diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3f066c7023..02f69d249f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,11 @@ version: 2 updates: - - package-ecosystem: "maven" + - package-ecosystem: "gradle" directory: "/" schedule: interval: "weekly" groups: - maven-deps: + deps: patterns: - "*" - package-ecosystem: "github-actions" @@ -13,6 +13,6 @@ updates: schedule: interval: "weekly" groups: - gh-actions: + deps: patterns: - "*" diff --git a/.github/workflows/formatting_check.yml b/.github/workflows/formatting_check.yml index 2d56e97171..e643467f96 100644 --- a/.github/workflows/formatting_check.yml +++ b/.github/workflows/formatting_check.yml @@ -39,9 +39,9 @@ jobs: with: java-version: '21' distribution: 'zulu' - cache: 'maven' + cache: 'gradle' - name: Validate Project Checkstyle - run: ./mvnw -B checkstyle:check + run: ./gradlew checkstyleMain spotless_check: name: Spotless check @@ -56,10 +56,10 @@ jobs: with: java-version: '21' distribution: 'zulu' - cache: 'maven' + cache: 'gradle' - name: Generate code and format run: | - ./run_core_metamodel_generator.sh - # ./run_core_generators.sh automatically runs ./mvnw spotless:apply - ./run_core_generators.sh + ./gradlew :jmlparser-metamodel-generators:run + ./gradlew :jmlparser-core-generators:run + ./gradlew spotlessCheck git diff --exit-code diff --git a/.github/workflows/maven_tests.yml b/.github/workflows/gradle_tests.yml similarity index 88% rename from .github/workflows/maven_tests.yml rename to .github/workflows/gradle_tests.yml index 9a4ef95525..75f0b859b9 100644 --- a/.github/workflows/maven_tests.yml +++ b/.github/workflows/gradle_tests.yml @@ -35,7 +35,7 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] ## Different JDK versions have different implementations etc. -- test on all combinations (ideally 8 to latest). ### exclude pre-8 (min development version jdk8) - jdk: [ 21 ] + jdk: [ 21, 25 ] env: @@ -58,7 +58,7 @@ jobs: distribution: 'zulu' # v2 requires explicitly stating the distribution - `zulu` and `adopt` supported at time of writing java-version: ${{ matrix.jdk }} # Use matrix to select which JDK level to use java-package: jdk # optional (jdk or jre) - defaults to jdk - cache: 'maven' + cache: 'gradle' ## Given that the build matrix only specifies the major version (configurable), output the precise version used. - name: Echo exact java version being used @@ -79,16 +79,17 @@ jobs: ### test : run the maven lifecycle stage `test` ### -P,--activate-profiles : Comma-delimited list of profiles to activate ### AlsoSlowTests : by default, only quick tests are run - the profile `AlsoSlowTests` runs the full test suite - - name: Test with Maven (incl. slow tests) + - name: Test with Gradle (incl. slow tests) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: "./mvnw --fail-at-end -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --activate-profiles AlsoSlowTests -B --errors clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=wadoon_jmlparser" + run: | + ./gradlew --continue --parallel test - name: Test reporting uses: dorny/test-reporter@v2 if: success() || failure() with: name: Test Report - path: "**/target/surefire-reports/*.xml" + path: "**/build/reports/tests/test/**/*.xml" reporter: java-junit diff --git a/.github/workflows/publish_pkg_github.yml b/.github/workflows/publish_pkg_github.yml deleted file mode 100644 index 673e92dbf4..0000000000 --- a/.github/workflows/publish_pkg_github.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Publish package to GitHub Packages -on: - workflow_dispatch: -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-java@v5 - with: - java-version: '17' - distribution: 'adopt' - - name: Publish package - run: mvn --batch-mode -DskipTests deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml deleted file mode 100644 index 80666d3392..0000000000 --- a/.github/workflows/qodana.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Qodana -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - - 'releases/*' - -jobs: - qodana: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6.0.2 - with: - fetch-depth: 0 - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2025.3.1 diff --git a/.gitignore b/.gitignore index 94c98df27e..d312e75f4a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ hs_err_pid* *.ipr *.iws build-* +!build-logic *.asc build out diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index d83ee439c6..0000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,40 +0,0 @@ -image: maven:latest - -variables: - MAVEN_CLI_OPTS: "--batch-mode" # -s .m2/settings.xml - MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" - -cache: - paths: - - .m2/repository/ - - target/ - -build: - stage: build - script: - - mvn $MAVEN_CLI_OPTS compile - -test: - stage: test - script: - - mvn $MAVEN_CLI_OPTS --fail-at-end verify - artifacts: - when: always - reports: - junit: - - "*/target/surefire-reports/TEST-*.xml" - - "*/target/failsafe-reports/TEST-*.xml" - - -deploy: - stage: deploy - script: - - mvn $MAVEN_CLI_OPTS -s dev-files/settings.deploy.xml deploy - only: - - master - -force-deploy: - when: manual - stage: build - script: - - mvn $MAVEN_CLI_OPTS -P run-snapshot -Dmaven.test.skip=true -s dev-files/settings.deploy.xml deploy diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 60ab49acc2..0000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,46 +0,0 @@ -pipeline { - agent { - docker { - image 'maven:latest' - } - } - - environment { - // This will suppress any download for dependencies and plugins or upload messages which would clutter the console log. - //`showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work. - MAVEN_OPTS = "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" - // As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used - // when running from the command line. - // `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins. - MAVEN_CLI_OPTS = "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" - } - - - stages { - stage('Clean') { - steps { - sh 'javac -version' - sh 'mvn $MAVEN_CLI_OPTS -version' - sh 'mvn $MAVEN_CLI_OPTS dependency:go-offline' - sh 'mvn clean' - } - } - - stage('Compile') { - steps { - sh 'mvn --offline $MAVEN_CLI_OPTS compile' - } - } - - stage('Tests: JUnit') { - steps { - sh 'mvn --offline $MAVEN_CLI_OPTS -Dmaven.test.failure.ignore=true install' - } - post { - success { - junit '*/target/surefire-reports/**/*.xml' - } - } - } - } -} diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 9008921efe..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: '{build}' -os: Windows Server 2012 - -environment: - appveyor_build_worker_cloud: gce - -init: - # Setup autocrlf -- by default, appveyor uses autocrlf input - # ... This affects tests which expect resource files to have the systems's line separator. - - git config --global core.autocrlf true - -install: - # Download maven - - ps: | - Add-Type -AssemblyName System.IO.Compression.FileSystem - if (!(Test-Path -Path "C:\maven" )) { - (new-object System.Net.WebClient).DownloadFile( - 'http://www.us.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip', - 'C:\maven-bin.zip' - ) - [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven") - } - # Setup environment variables for Maven and Java - - cmd: SET JAVA_HOME=C:\Program Files\Java\jdk10 - - cmd: SET M2_HOME=C:\maven\apache-maven-3.6.3 - - cmd: SET MAVEN_OPTS=-Xmx1g - - cmd: SET JAVA_OPTS=-Xmx1g - - cmd: SET PATH=C:\maven\apache-maven-3.6.3\bin;%JAVA_HOME%\bin;%PATH% - # Output the git config re: autocrlf to verify the "current" setting - - cmd: git config core.autocrlf - -# Appveyor is used for testing only -- the build script is not required. -build_script: - - echo ignore this - -test_script: - - mvn -B clean install --batch-mode - -# Use of the cache speeds up future tests, meaning that dependencies do not need to be re-downloaded on every run. -cache: - - C:\maven\ - - C:\Users\appveyor\.m2 diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts new file mode 100644 index 0000000000..26324f5ce4 --- /dev/null +++ b/build-logic/build.gradle.kts @@ -0,0 +1,28 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion + +val libs: VersionCatalog = extensions.getByType().named("libs") + +plugins { + `kotlin-dsl` + `kotlin-dsl-precompiled-script-plugins` +} + +repositories { + gradlePluginPortal() + mavenCentral() +} + +dependencies { + implementation("com.diffplug.gradle.spotless:com.diffplug.gradle.spotless.gradle.plugin:8.3.0") + + add("implementation", libs.findLibrary("kotlin-gradle").get()) + + // https://github.com/Kotlin/dokka + // Dokka is a documentation engine for Kotlin like JavaDoc for Java + //add("implementation", libs.findLibrary("dokka-gradle").get()) + + // https://detekt.dev/docs/gettingstarted/gradle/ + // A static code analyzer for Kotlin + //add("implementation", libs.findLibrary("detekt-gradle").get()) +} \ No newline at end of file diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 0000000000..e963597518 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,12 @@ +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } + @Suppress("UnstableApiUsage") + repositories { + mavenCentral() + gradlePluginPortal() + } +} diff --git a/build-logic/src/main/kotlin/buildlogic.java-conventions.gradle.kts b/build-logic/src/main/kotlin/buildlogic.java-conventions.gradle.kts new file mode 100644 index 0000000000..775a5b1741 --- /dev/null +++ b/build-logic/src/main/kotlin/buildlogic.java-conventions.gradle.kts @@ -0,0 +1,66 @@ +plugins { + `java-library` + `maven-publish` + id("test-report-aggregation") + id("com.diffplug.spotless") + checkstyle +} + +group = "io.github.jmltoolkit" +version = "3.28.0-J8.0-K13.5" + +repositories { + maven { + url = uri("https://repo.maven.apache.org/maven2/") + } +} + +dependencies { +} + +// Apply a specific Java toolchain to ease working on different environments. + +java { + // Auto JDK setup + toolchain { + languageVersion.set(JavaLanguageVersion.of("21")) + } + withSourcesJar() + withJavadocJar() +} + +publishing { + publications.create("maven") { + from(components["java"]) + } +} + +tasks.withType { + options.encoding = "UTF-8" +} + +tasks.withType { + options.encoding = "UTF-8" +} + +tasks.withType { + workingDir = projectDir + useJUnitPlatform() +} + +configure { + java { + removeUnusedImports() + palantirJavaFormat("2.86.0").formatJavadoc(false).style("PALANTIR") + } +} + +configure { + toolVersion = "13.1.0" + configFile = file("$rootDir/dev-files/JavaParser-CheckStyle.xml") + isShowViolations = true +} + +tasks.checkstyleMain { + source("src/main/java") +} diff --git a/build-logic/src/main/kotlin/standard-kotlin.gradle.kts b/build-logic/src/main/kotlin/standard-kotlin.gradle.kts new file mode 100644 index 0000000000..d883b3dc75 --- /dev/null +++ b/build-logic/src/main/kotlin/standard-kotlin.gradle.kts @@ -0,0 +1,76 @@ +plugins { + kotlin("jvm") + id("buildlogic.java-conventions") +} + +val libs = extensions.getByType().named("libs") + +dependencies {} + +testing { + suites { + val test by getting(JvmTestSuite::class) { + useKotlinTest() + } + } +} + + +repositories { + mavenLocal() + mavenCentral() + //maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/") +} + +dependencies { + //truth = { module = "com.google.truth:truth", version = "1.10.1" } + + api(project(":jmlparser-core")) + + + testImplementation(libs.findBundle("testing").get()) + testRuntimeOnly(libs.findBundle("testing-runtime").get()) +} + +tasks.named("test") { + useJUnitPlatform() + + maxHeapSize = "1G" + + testLogging { + events("passed") + } +} + +testing { + suites { + val test by getting(JvmTestSuite::class) { + //useKotlinTest("1.9.20") + useJUnitJupiter() + } + } +} + +tasks.compileJava { + // See: https://docs.oracle.com/en/java/javase/12/tools/javac.html + @Suppress("SpellCheckingInspection") + options.compilerArgs.addAll( + listOf( + "-Xlint:all", // Enables all recommended warnings. + "-Werror" // Terminates compilation when warnings occur. + ) + ) + options.encoding = "UTF-8" +} + +tasks.jar { + manifest { + attributes( + mapOf( + "Implementation-Title" to project.name, + "Implementation-Version" to project.version + ) + ) + } +} + diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..4f298e665d --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,2 @@ +plugins { +} diff --git a/dev-files/JavaParser-CheckStyle.xml b/dev-files/JavaParser-CheckStyle.xml index f9cc0b9dab..ffa14ab4ec 100644 --- a/dev-files/JavaParser-CheckStyle.xml +++ b/dev-files/JavaParser-CheckStyle.xml @@ -3,6 +3,11 @@ "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> + + + + + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000000..515400887d --- /dev/null +++ b/gradle.properties @@ -0,0 +1,7 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties + +org.gradle.configuration-cache=true +org.gradle.parallel=true +org.gradle.caching=true + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000000..c4e0bd0e7b --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,77 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/version_catalogs.html#sec::toml-dependencies-format + +[versions] +com-google-guava-guava = "33.5.0-jre" +com-google-truth-truth = "1.4.5" +com-squareup-okhttp3-okhttp = "5.3.2" +com-squareup-okhttp3-okhttp-jvm = "5.3.2" +com-squareup-okhttp3-okhttp-x1 = "4.9.2" +jakarta-json-jakarta-json-api = "2.1.3" +net-bytebuddy-byte-buddy-agent = "1.18.4" +org-assertj-assertj-core = "3.27.7" +org-checkerframework-checker-qual = "3.53.1" +org-eclipse-parsson-parsson = "1.1.7" +org-hamcrest-hamcrest = "3.0" +org-hamcrest-hamcrest-library = "3.0" +org-javassist-javassist = "3.30.2-GA" +org-jbehave-jbehave-core = "5.2.0" +org-jspecify-jspecify = "1.0.0" +org-junit = "6.0.3" +org-mockito-mockito-inline = "5.2.0" + +gson = "2.13.2" +logback = "1.5.32" +clickt = "5.1.0" +kotlin = "2.2.21" +ktor = "3.4.1" + +jdk = "21" + +[libraries] +com-google-guava-guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } +com-squareup-okhttp3-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "com-squareup-okhttp3-okhttp" } +com-squareup-okhttp3-okhttp-jvm = { module = "com.squareup.okhttp3:okhttp-jvm", version.ref = "com-squareup-okhttp3-okhttp-jvm" } +jakarta-json-jakarta-json-api = { module = "jakarta.json:jakarta.json-api", version.ref = "jakarta-json-jakarta-json-api" } +net-bytebuddy-byte-buddy-agent = { module = "net.bytebuddy:byte-buddy-agent", version.ref = "net-bytebuddy-byte-buddy-agent" } +org-checkerframework-checker-qual = { module = "org.checkerframework:checker-qual", version.ref = "org-checkerframework-checker-qual" } +org-eclipse-parsson-parsson = { module = "org.eclipse.parsson:parsson", version.ref = "org-eclipse-parsson-parsson" } +org-javassist-javassist = { module = "org.javassist:javassist", version.ref = "org-javassist-javassist" } +org-jspecify-jspecify = { module = "org.jspecify:jspecify", version.ref = "org-jspecify-jspecify" } + +# JUnit +org-junit-jupiter-junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "org-junit" } +org-junit-jupiter-junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "org-junit" } +org-junit-jupiter-junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "org-junit" } +#Testing +org-assertj-assertj-core = { module = "org.assertj:assertj-core", version.ref = "org-assertj-assertj-core" } +org-jbehave-jbehave-core = { module = "org.jbehave:jbehave-core", version.ref = "org-jbehave-jbehave-core" } +org-mockito-mockito-inline = { module = "org.mockito:mockito-inline", version.ref = "org-mockito-mockito-inline" } +com-google-truth-truth = { module = "com.google.truth:truth", version.ref = "com-google-truth-truth" } +org-hamcrest-hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "org-hamcrest-hamcrest" } +org-hamcrest-hamcrest-library = { module = "org.hamcrest:hamcrest-library", version.ref = "org-hamcrest-hamcrest-library" } + +clickt = { module = "com.github.ajalt.clikt:clikt", version.ref = "clickt" } +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } +lombok = { module = "org.projectlombok:lombok", version = "1.18.42" } +snakeyaml = { module = "org.yaml:snakeyaml", version = "2.6" } +kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } + +ktor-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor" } +ktor-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" } +ktor-html = { module = "io.ktor:ktor-html-builder", version = "1.6.8" } +ktor-statuspages = { module = "io.ktor:ktor-server-status-pages", version.ref = "ktor" } +ktor-severhtml = { module = "io.ktor:ktor-server-html-builder", version.ref = "ktor" } + + +[bundles] + +testing = ["org-junit-jupiter-junit-jupiter-params", "org-junit-jupiter-junit-jupiter-api", "org-assertj-assertj-core", + "org-mockito-mockito-inline", "org-hamcrest-hamcrest", "org-hamcrest-hamcrest-library", "com-google-truth-truth", + "org-jbehave-jbehave-core"] + +testing-runtime = ["org-junit-jupiter-junit-jupiter-engine"] + +[plugins] +jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..61285a659d Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..37f78a6af8 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000000..adff685a03 --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# 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 +# +# https://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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..c4bdd3ab8e --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,93 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/javaparser-core-generators/build.gradle.kts b/javaparser-core-generators/build.gradle.kts new file mode 100644 index 0000000000..dadcd88737 --- /dev/null +++ b/javaparser-core-generators/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + api(project(":jmlparser-core")) + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testing.runtime) +} + +description = "io.github.jmltoolkit:jmlparser-core-generators" + +val run by tasks.registering(JavaExec::class) { + mainClass = "com.github.javaparser.generator.core.CoreGenerator" + args = listOf("$projectDir") +} diff --git a/javaparser-core-generators/pom.xml b/javaparser-core-generators/pom.xml index c272032cb4..7422cffc6e 100644 --- a/javaparser-core-generators/pom.xml +++ b/javaparser-core-generators/pom.xml @@ -3,7 +3,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-core-metamodel-generator/build.gradle.kts b/javaparser-core-metamodel-generator/build.gradle.kts new file mode 100644 index 0000000000..59f9aef064 --- /dev/null +++ b/javaparser-core-metamodel-generator/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + api(project(":jmlparser-core")) +} + +description = "io.github.jmltoolkit:jmlparser-core-metamodel-generator" + +val run by tasks.registering(JavaExec::class) { + mainClass = "com.github.javaparser.generator.metamodel.MetaModelGenerator" + args = listOf("$projectDir") +} diff --git a/javaparser-core-metamodel-generator/pom.xml b/javaparser-core-metamodel-generator/pom.xml index 0185c838c3..4b2ee527a9 100644 --- a/javaparser-core-metamodel-generator/pom.xml +++ b/javaparser-core-metamodel-generator/pom.xml @@ -3,7 +3,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-core-metamodel-generator/src/main/java/com/github/javaparser/generator/metamodel/MetaModelGenerator.java b/javaparser-core-metamodel-generator/src/main/java/com/github/javaparser/generator/metamodel/MetaModelGenerator.java index 255cc6ca3c..8f4ebb4c63 100644 --- a/javaparser-core-metamodel-generator/src/main/java/com/github/javaparser/generator/metamodel/MetaModelGenerator.java +++ b/javaparser-core-metamodel-generator/src/main/java/com/github/javaparser/generator/metamodel/MetaModelGenerator.java @@ -34,6 +34,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -161,19 +162,6 @@ public class MetaModelGenerator extends AbstractGenerator { add(com.github.javaparser.ast.expr.MatchAllPatternExpr.class); add(com.github.javaparser.ast.expr.VariableDeclarationExpr.class); - add(JmlDoc.class); - add(JmlDocDeclaration.class); - add(JmlDocStmt.class); - add(JmlDocType.class); - - add(JmlQuantifiedExpr.class); - add(JmlTypeExpr.class); - add(JmlBinaryInfixExpr.class); - add(JmlLetExpr.class); - add(JmlMultiCompareExpr.class); - add(JmlLabelExpr.class); - add(JmlSetComprehensionExpr.class); - add(com.github.javaparser.ast.stmt.AssertStmt.class); add(com.github.javaparser.ast.stmt.BlockStmt.class); add(com.github.javaparser.ast.stmt.BreakStmt.class); @@ -199,6 +187,36 @@ public class MetaModelGenerator extends AbstractGenerator { add(com.github.javaparser.ast.stmt.WhileStmt.class); add(com.github.javaparser.ast.stmt.YieldStmt.class); + add(com.github.javaparser.ast.type.ArrayType.class); + add(com.github.javaparser.ast.type.ClassOrInterfaceType.class); + add(com.github.javaparser.ast.type.IntersectionType.class); + add(com.github.javaparser.ast.type.PrimitiveType.class); + add(com.github.javaparser.ast.type.TypeParameter.class); + add(com.github.javaparser.ast.type.UnionType.class); + add(com.github.javaparser.ast.type.UnknownType.class); + add(com.github.javaparser.ast.type.VarType.class); + add(com.github.javaparser.ast.type.VoidType.class); + add(com.github.javaparser.ast.type.WildcardType.class); + + add(com.github.javaparser.ast.modules.ModuleExportsDirective.class); + add(com.github.javaparser.ast.modules.ModuleOpensDirective.class); + add(com.github.javaparser.ast.modules.ModuleProvidesDirective.class); + add(com.github.javaparser.ast.modules.ModuleRequiresDirective.class); + add(com.github.javaparser.ast.modules.ModuleUsesDirective.class); + + add(JmlDoc.class); + add(JmlDocDeclaration.class); + add(JmlDocStmt.class); + add(JmlDocType.class); + + add(JmlQuantifiedExpr.class); + add(JmlTypeExpr.class); + add(JmlBinaryInfixExpr.class); + add(JmlLetExpr.class); + add(JmlMultiCompareExpr.class); + add(JmlLabelExpr.class); + add(JmlSetComprehensionExpr.class); + add(JmlStatement.class); add(JmlGhostStmt.class); add(JmlExpressionStmt.class); @@ -230,41 +248,29 @@ public class MetaModelGenerator extends AbstractGenerator { add(JmlRepresentsDeclaration.class); add(JmlClassAccessibleDeclaration.class); - add(com.github.javaparser.ast.type.ArrayType.class); - add(com.github.javaparser.ast.type.ClassOrInterfaceType.class); - add(com.github.javaparser.ast.type.IntersectionType.class); - add(com.github.javaparser.ast.type.PrimitiveType.class); - add(com.github.javaparser.ast.type.TypeParameter.class); - add(com.github.javaparser.ast.type.UnionType.class); - add(com.github.javaparser.ast.type.UnknownType.class); - add(com.github.javaparser.ast.type.VarType.class); - add(com.github.javaparser.ast.type.VoidType.class); - add(com.github.javaparser.ast.type.WildcardType.class); - - add(com.github.javaparser.ast.modules.ModuleExportsDirective.class); - add(com.github.javaparser.ast.modules.ModuleOpensDirective.class); - add(com.github.javaparser.ast.modules.ModuleProvidesDirective.class); - add(com.github.javaparser.ast.modules.ModuleRequiresDirective.class); - add(com.github.javaparser.ast.modules.ModuleUsesDirective.class); - // KEY add(KeyAbstractExecutionContext.class); - add(KeyCatchAllStatement.class); + add(KeyCatchAllStmt.class); add(KeyCcatchBranch.class); add(KeyCcatchBreak.class); add(KeyCcatchContinue.class); add(KeyCcatchParameter.class); add(KeyCcatchReturn.class); add(KeyEscapeExpression.class); - add(KeyExecStatement.class); + add(KeyExecStmt.class); add(KeyExecutionContext.class); - add(KeyLoopScopeBlock.class); - add(KeyMergePointStatement.class); + add(KeyLoopScopeBlockStmt.class); + add(KeyMergePointStmt.class); add(KeyMethodBodyStatement.class); - add(KeyMethodCallStatement.class); + add(KeyMethodCallStmt.class); add(KeyMethodSignature.class); - add(KeyRangeExpression.class); - add(KeyTransactionStatement.class); + // add(KeyRangeExpression.class); + add(KeyTransactionStmt.class); + // add(JmlDoc.class); + // add(JmlDocsBodyDeclaration.class); + // add(JmlDocsTypeDeclaration.class); + // add(JmlDocsStatements.class); + add(KeYMarkerStatement.class); // add(KeyActiveCommentStatement.class); // KeY-Schema diff --git a/javaparser-core-serialization/build.gradle.kts b/javaparser-core-serialization/build.gradle.kts new file mode 100644 index 0000000000..9eb771dc11 --- /dev/null +++ b/javaparser-core-serialization/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + api(project(":jmlparser-core")) + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testing) + + api(libs.jakarta.json.jakarta.json.api) + testImplementation(libs.org.eclipse.parsson.parsson) +} + +description = "io.github.jmltoolkit:jmlparser-core-serialization" diff --git a/javaparser-core-serialization/pom.xml b/javaparser-core-serialization/pom.xml index 3147f939c4..55fcb2a29b 100644 --- a/javaparser-core-serialization/pom.xml +++ b/javaparser-core-serialization/pom.xml @@ -2,7 +2,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-core-serialization/src/main/java/com/github/javaparser/serialization/JavaParserJsonDeserializer.java b/javaparser-core-serialization/src/main/java/com/github/javaparser/serialization/JavaParserJsonDeserializer.java index 79505691b1..05d7fafcf7 100644 --- a/javaparser-core-serialization/src/main/java/com/github/javaparser/serialization/JavaParserJsonDeserializer.java +++ b/javaparser-core-serialization/src/main/java/com/github/javaparser/serialization/JavaParserJsonDeserializer.java @@ -30,6 +30,8 @@ import com.github.javaparser.ast.Node; import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.comments.Comment; +import com.github.javaparser.ast.jml.doc.JmlDoc; +import com.github.javaparser.ast.jml.doc.JmlDocModifier; import com.github.javaparser.metamodel.BaseNodeMetaModel; import com.github.javaparser.metamodel.PropertyMetaModel; import com.github.javaparser.utils.Log; @@ -107,9 +109,15 @@ private Node deserializeObject(JsonObject nodeJson) { parameters.put(name, Boolean.parseBoolean(nodeJson.getString(name))); } else if (Enum.class.isAssignableFrom(type)) { parameters.put(name, Enum.valueOf((Class) type, nodeJson.getString(name))); - } else if (type == Modifier.DefaultKeyword.class) { - // TODO weigl handle JmlDocModifier? - parameters.put(name, Enum.valueOf(Modifier.DefaultKeyword.class, nodeJson.getString(name))); + } else if (type == Modifier.Keyword.class) { + Modifier.Keyword value; + final var string = nodeJson.getString(name); + try { + value = Enum.valueOf(Modifier.DefaultKeyword.class, string); + } catch (IllegalArgumentException e) { + value = new JmlDocModifier(new NodeList<>(new JmlDoc(string))); + } + parameters.put(name, value); } else { throw new IllegalStateException("Don't know how to convert: " + type); } diff --git a/javaparser-core-testing-bdd/build.gradle.kts b/javaparser-core-testing-bdd/build.gradle.kts new file mode 100644 index 0000000000..ab8d3838c0 --- /dev/null +++ b/javaparser-core-testing-bdd/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + api(project(":jmlparser-core")) + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testing.runtime) +} + +description = "io.github.jmltoolkit:jmlparser-core-testing-bdd" diff --git a/javaparser-core-testing-bdd/pom.xml b/javaparser-core-testing-bdd/pom.xml index e76caff15f..936230d266 100644 --- a/javaparser-core-testing-bdd/pom.xml +++ b/javaparser-core-testing-bdd/pom.xml @@ -3,7 +3,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-core-testing/build.gradle.kts b/javaparser-core-testing/build.gradle.kts new file mode 100644 index 0000000000..a306a1d224 --- /dev/null +++ b/javaparser-core-testing/build.gradle.kts @@ -0,0 +1,19 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * This project uses @Incubating APIs which are subject to change. + */ + +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + api(project(":jmlparser-core")) + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testing.runtime) + testImplementation(libs.com.squareup.okhttp3.okhttp) + testImplementation(libs.com.squareup.okhttp3.okhttp.jvm) +} + +description = "io.github.jmltoolkit:jmlparser-core-testing" diff --git a/javaparser-core-testing/pom.xml b/javaparser-core-testing/pom.xml index 0ca0e7007f..c72fd88093 100644 --- a/javaparser-core-testing/pom.xml +++ b/javaparser-core-testing/pom.xml @@ -3,7 +3,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/JavaTokenTest.java b/javaparser-core-testing/src/test/java/com/github/javaparser/JavaTokenTest.java index 4e2ed25a8a..edd00e8aaa 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/JavaTokenTest.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/JavaTokenTest.java @@ -79,7 +79,7 @@ void testKindEnum() { @Test void testKindEnum2() { - final int tokenCount = GeneratedJavaParserConstants.tokenImage.length; + final int tokenCount = GeneratedJavaParserConstants.tokenImage.length - 1; for (int i = 0; i < tokenCount; i++) { System.out.println(i); JavaToken.Kind kind = JavaToken.Kind.valueOf(i); @@ -98,7 +98,7 @@ void testKindEnum2() { @Test void test() throws NoSuchFieldException, IllegalAccessException { - final int tokenCount = GeneratedJavaParserConstants.tokenImage.length - 1; + final int tokenCount = GeneratedJavaParserConstants.tokenImage.length; assertEquals(tokenCount, JavaToken.Kind.values().length, "Error - mismatch between number of tokens."); // Iterate through the JP Tokens, and ensure that it matches the JavaCC tokens. diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/TokenTypesTest.java b/javaparser-core-testing/src/test/java/com/github/javaparser/TokenTypesTest.java index 93ff835803..c649ba792b 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/TokenTypesTest.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/TokenTypesTest.java @@ -49,13 +49,13 @@ void everyTokenHasACategory() throws IOException { int switchEntries = tokenTypesCu.findAll(SwitchEntry.class).size() - 1; // The amount of "case XXX:" in TokenTypes.java should be equal to the amount of tokens JavaCC knows about: - assertEquals(tokenCount, switchEntries); + assertEquals(tokenCount + 1, switchEntries); } @TestFactory Stream everyTokenHasACategory0() { final int tokenCount = GeneratedJavaParserConstants.tokenImage.length; - return IntStream.range(0, tokenCount - 1) + return IntStream.range(0, tokenCount) .mapToObj(it -> DynamicTest.dynamicTest("TokenType: " + it, () -> { try { TokenTypes.getCategory(it); diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapterTest.java b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapterTest.java index 786075784b..a921fe9298 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapterTest.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapterTest.java @@ -636,7 +636,7 @@ void visit_GivenConstructorDeclaration() { // Verify InOrder order = Mockito.inOrder(node); - order.verify(node).getBody(); + order.verify(node, times(2)).getBody(); order.verify(node).getModifiers(); order.verify(node).getName(); order.verify(node).getParameters(); diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericVisitorAdapterTest.java b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericVisitorAdapterTest.java index 3de04bd487..35b1475a72 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericVisitorAdapterTest.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericVisitorAdapterTest.java @@ -634,7 +634,7 @@ void visit_GivenConstructorDeclaration() { // Verify InOrder order = Mockito.inOrder(node); - order.verify(node).getBody(); + order.verify(node, times(2)).getBody(); order.verify(node).getModifiers(); order.verify(node).getName(); order.verify(node).getParameters(); @@ -1832,7 +1832,6 @@ void visit_GivenThisExpr() { Mockito.when(node.getTypeName()).thenReturn(Optional.of(mock(Name.class))); Mockito.when(node.getComment()).thenReturn(Optional.of(mock(Comment.class))); - // Then Object result = visitor.visit(node, argument); diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/HashCodeVisitorTest.java b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/HashCodeVisitorTest.java index 4242729294..d46bdfdcbe 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/HashCodeVisitorTest.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/HashCodeVisitorTest.java @@ -272,7 +272,7 @@ void testVisitConditionalExpr() { void testVisitConstructorDeclaration() { ConstructorDeclaration node = spy(new ConstructorDeclaration()); HashCodeVisitor.hashCode(node); - verify(node, times(1)).getBody(); + verify(node, times(2)).getBody(); verify(node, times(1)).getModifiers(); verify(node, times(1)).getName(); verify(node, times(1)).getParameters(); @@ -281,7 +281,8 @@ void testVisitConstructorDeclaration() { verify(node, times(1)).getTypeParameters(); verify(node, times(1)).getAnnotations(); verify(node, times(1)).getComment(); - //JML + + // JML verify(node, times(1)).getContracts(); } @@ -300,7 +301,7 @@ void testVisitDoStmt() { verify(node, times(1)).getBody(); verify(node, times(1)).getCondition(); verify(node, times(1)).getComment(); - //JML + // JML verify(node, times(1)).getContracts(); } @@ -398,7 +399,7 @@ void testVisitForEachStmt() { verify(node, times(1)).getIterable(); verify(node, times(1)).getVariable(); verify(node, times(1)).getComment(); - //JML + // JML verify(node, times(1)).getContracts(); } @@ -497,7 +498,7 @@ void testVisitLambdaExpr() { verify(node, times(1)).isEnclosingParameters(); verify(node, times(1)).getParameters(); verify(node, times(1)).getComment(); - //JML + // JML verify(node, times(1)).getContracts(); } @@ -575,7 +576,7 @@ void testVisitMethodDeclaration() { verify(node, times(1)).getTypeParameters(); verify(node, times(1)).getAnnotations(); verify(node, times(1)).getComment(); - //JML + // JML verify(node, times(1)).getContracts(); } diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitorTest.java b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitorTest.java index 47f0e2ca9f..883bb7edf8 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitorTest.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitorTest.java @@ -316,7 +316,7 @@ void testVisitConstructorDeclaration() { ConstructorDeclaration node = spy(new ConstructorDeclaration()); NoCommentHashCodeVisitor.hashCode(node); - verify(node, times(1)).getBody(); + verify(node, times(2)).getBody(); verify(node, times(1)).getModifiers(); verify(node, times(1)).getName(); verify(node, times(1)).getParameters(); diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/issues/Issue2627Test.java b/javaparser-core-testing/src/test/java/com/github/javaparser/issues/Issue2627Test.java index 227739acdd..b088259147 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/issues/Issue2627Test.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/issues/Issue2627Test.java @@ -82,40 +82,6 @@ private MethodDeclaration getFirstMethodDeclarationByName(CompilationUnit cu, St .get(); } - // @Test - // public void cuLength_minimal() throws IOException { - // CompilationUnit cu = StaticJavaParser.parseResource(RESOURCE_PATH_STRING_MINIMAL); - // - // final Range cuRange = cu.getRange().get(); - // - // int lineCount = cuRange.end.line - cuRange.begin.line; - // - // } - - // @Test - // public void commentPositions_minimal() throws IOException { - // CompilationUnit cu = StaticJavaParser.parseResource(RESOURCE_PATH_STRING_MINIMAL); - // - // List allComments = cu.getAllComments(); - // for (int i = 0; i < allComments.size(); i++) { - // Comment comment = allComments.get(i); - // Optional optionalRange = comment.getRange(); - // if (optionalRange.isPresent()) { - // Range range = optionalRange.get(); - // final TokenRange tokens = comment.getTokenRange().get(); - // int tokenIndex = 0; - // for (JavaToken token : tokens) { - // System.out.println("token " + tokenIndex + " = " + token); - // tokenIndex++; - // } - // System.out.println(tokens); - // } - // } - // - // - //// assertNodeInExpectedLines(cu, 1, 288); - // } - @ParameterizedTest @MethodSource("arguments_minimal") public void method_minimal(String name, int expectedStart, int expectedEnd) throws IOException { diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/Issue3761Test.java b/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/Issue3761Test.java index eff2eb7869..d69616be60 100755 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/Issue3761Test.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/Issue3761Test.java @@ -43,7 +43,7 @@ class C {\s List kws = field.getModifiers().stream().map(Modifier::getKeyword).collect(Collectors.toList()); kws.add(0, Modifier.DefaultKeyword.PROTECTED); - field.setModifiers(); + field.setModifiers(kws); String expected = "class C { \r\n protected static String S = \"s\";\r\n" + "}"; diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/transformations/ast/body/MethodDeclarationTransformationsTest.java b/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/transformations/ast/body/MethodDeclarationTransformationsTest.java index 82e5f71cf3..d33806c4f4 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/transformations/ast/body/MethodDeclarationTransformationsTest.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/printer/lexicalpreservation/transformations/ast/body/MethodDeclarationTransformationsTest.java @@ -163,8 +163,8 @@ void replacingDuplicateMarkdownComment() { + LineSeparator.SYSTEM + " ///" + LineSeparator.SYSTEM + " public void oneMethod() {" + LineSeparator.SYSTEM + " }" - + LineSeparator.SYSTEM + LineSeparator.SYSTEM - + " ///" + + LineSeparator.SYSTEM + + LineSeparator.SYSTEM + " ///" + LineSeparator.SYSTEM + " /// Comment A" + LineSeparator.SYSTEM + " ///" + LineSeparator.SYSTEM + " public void anotherMethod() {" diff --git a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_generators_src_main_java.txt b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_generators_src_main_java.txt index 1ca4992f69..8a9fcbee58 100644 --- a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_generators_src_main_java.txt +++ b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_generators_src_main_java.txt @@ -1,97 +1 @@ -com/github/javaparser/generator/CompilationUnitGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/AcceptGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/CloneGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/GetMetaModelGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/MainConstructorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/NodeModifierGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/PropertyGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/RemoveMethodGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/ReplaceMethodGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/node/TypeCastingGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/other/BndGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/other/TokenKindGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/quality/NotNullGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/utils/CodeUtils.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/CloneVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/EqualsVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/GenericListVisitorAdapterGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/GenericVisitorAdapterGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/GenericVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/GenericVisitorWithDefaultsGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/HashCodeVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/ModifierVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/NoCommentEqualsVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/NoCommentHashCodeVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/ObjectIdentityEqualsVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/ObjectIdentityHashCodeVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/VoidVisitorAdapterGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/VoidVisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/core/visitor/VoidVisitorWithDefaultsGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/Generator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/NodeGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/VisitorGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -32 problems in 32 files \ No newline at end of file +0 problems in 0 files \ No newline at end of file diff --git a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_metamodel_generator_src_main_java.txt b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_metamodel_generator_src_main_java.txt index 7ab454c7b4..8a9fcbee58 100644 --- a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_metamodel_generator_src_main_java.txt +++ b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_metamodel_generator_src_main_java.txt @@ -1,13 +1 @@ -com/github/javaparser/generator/AbstractGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/metamodel/AstTypeAnalysis.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/metamodel/MetaModelGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/generator/metamodel/NodeMetaModelGenerator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -4 problems in 4 files \ No newline at end of file +0 problems in 0 files \ No newline at end of file diff --git a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_src_main_java.txt b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_src_main_java.txt index 060e6fa7d0..8a9fcbee58 100644 --- a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_src_main_java.txt +++ b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_src_main_java.txt @@ -1,1702 +1 @@ -com/github/javaparser/ast/AbstractModifier.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/AccessSpecifier.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/ArrayCreationLevel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/AnnotationDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/AnnotationMemberDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/BodyDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/CallableDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/CompactConstructorDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/ConstructorDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/EnumConstantDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/EnumDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/FieldDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/InitializerDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/MethodDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/Parameter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/ReceiverParameter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/RecordDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/TypeDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/body/VariableDeclarator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/comments/BlockComment.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/comments/Comment.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/comments/CommentsCollection.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/comments/JavadocComment.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/comments/LineComment.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/comments/MarkdownComment.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/comments/TraditionalJavadocComment.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/CompilationUnit.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/AnnotationExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ArrayAccessExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ArrayCreationExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ArrayInitializerExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/AssignExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/BinaryExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/BooleanLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/CastExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/CharLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ClassExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ComponentPatternExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ConditionalExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/DoubleLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/EnclosedExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/Expression.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/FieldAccessExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/InstanceOfExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/IntegerLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/LambdaExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/LiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/LiteralStringValueExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/LongLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/MarkerAnnotationExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/MatchAllPatternExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/MemberValuePair.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/MethodCallExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/MethodReferenceExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/Name.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/NameExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/NormalAnnotationExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/NullLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ObjectCreationExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/PatternExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/RecordPatternExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/SimpleName.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/StringLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/SuperExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/SwitchExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/TextBlockLiteralExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/ThisExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/TypeExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/TypePatternExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/UnaryExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/expr/VariableDeclarationExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/ImportDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/ArbitraryNodeContainer.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/body/JmlClassLevelDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/body/JmlFieldDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/body/JmlMethodDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/ContractType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlCallableClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlClauseIf.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlClauseKind.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlContract.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlForallClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlMethodSignature.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlMultiExprClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlOldClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/doc/JmlDoc.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/doc/JmlDocDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/doc/JmlDocModifier.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/doc/JmlDocStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/doc/JmlDocType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/expr/JmlBinaryInfixExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/expr/JmlLabelExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/expr/JmlLetExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/expr/JmlMultiCompareExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/expr/JmlQuantifiedExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/expr/JmlTypeExpr.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/JmlModelProgram.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlBeginStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlEndStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlGhostStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlLabelStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlRefiningStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlStatement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/stmt/JmlUnreachableStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/jml/type/JmlLogicType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyAbstractExecutionContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyCatchAllStatement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyCcatchBranch.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyCcatchBreak.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyCcatchContinue.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyCcatchParameter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyCcatchReturn.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyEscapeExpression.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyExecStatement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyExecutionContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyLoopScopeBlock.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyMergePointStatement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyMethodBodyStatement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyMethodCallStatement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyMethodSignature.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyPassiveExpression.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyRangeExpression.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/KeyTransactionStatement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyCatchClauseSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyCcatchSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyContextStatementBlock.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyExecCtxtSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyExecutionContextSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyExpressionSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyJumpLabelSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyMetaConstruct.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyMetaConstructExpression.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyMetaConstructType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyMethodSignatureSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyProgramVariableSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyStatementSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/key/sv/KeyTypeSV.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/Modifier.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/modules/ModuleDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/modules/ModuleDirective.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/modules/ModuleExportsDirective.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/modules/ModuleOpensDirective.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/modules/ModuleProvidesDirective.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/modules/ModuleRequiresDirective.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/modules/ModuleUsesDirective.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/Node.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/NodeList.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/observer/ObservableProperty.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/PackageDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/AssertStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/Behavior.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/BlockStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/BreakStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/CatchClause.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/ContinueStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/DoStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/EmptyStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/ExpressionStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/ForEachStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/ForStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/IfStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/LabeledStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/LocalClassDeclarationStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/LocalRecordDeclarationStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/ReturnStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/Statement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/SwitchEntry.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/SwitchStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/SynchronizedStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/ThrowStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/TryStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/UnparsableStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/WhileStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/stmt/YieldStmt.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/ArrayType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/ClassOrInterfaceType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/IntersectionType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/LogicalType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/PrimitiveType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/ReferenceType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/Type.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/TypeParameter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/UnionType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/UnknownType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/VarType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/VoidType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/type/WildcardType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/chunks/CommonValidators.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/chunks/VarValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java10PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java10Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java11PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java11Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java12PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java12Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java13PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java13Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java14PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java14Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java15PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java15Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java16PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java16Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java17PreviewValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java17Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java18Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java19Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java1_0Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java1_1Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java1_2Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java1_3Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java1_4Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java20Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java21Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java22Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java23Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java24Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java25Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java5Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java6Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java7Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java8Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/Java9Validator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/language_level_validations/UpgradeJavaMessage.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/postprocessors/Java10PostProcessor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/postprocessors/PostProcessors.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/ProblemReporter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/RecordAsTypeIdentifierNotAllowed.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/ReservedKeywordValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/SimpleValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/SingleNodeTypeValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/TreeVisitorValidator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/validator/Validators.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/visitor/EqualsVisitor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/visitor/HashCodeVisitor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ast/visitor/NodeFinderVisitor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/CommentsInserter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/javadoc/description/JavadocDescription.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/javadoc/description/JavadocInlineTag.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/javadoc/description/JavadocSnippet.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/javadoc/Javadoc.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/javadoc/JavadocBlockTag.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/JavaParser.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/JavaParserAdapter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/JavaToken.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/jml/impl/JmlAnnotationSupport.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/jml/JmlProcessor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/jml/JmlUtility.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/jml/JmlWarnRemaingJmlDoc.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/LineEndingProcessingProvider.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/AnnotationDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/AnnotationExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/AnnotationMemberDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ArrayAccessExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ArrayCreationExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ArrayCreationLevelMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ArrayInitializerExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ArrayTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/AssertStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/AssignExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BaseNodeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BinaryExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BlockCommentMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BlockStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BodyDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BooleanLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BreaksClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/BreakStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CallableClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CallableDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CallableMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CastExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CatchClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CharLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ClassExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ClassOrInterfaceDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ClassOrInterfaceTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CommentMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CompactConstructorDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/CompilationUnitMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ComponentPatternExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ConditionalExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ConstructorDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ContinueStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/DoStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/DoubleLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/EmptyStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/EnclosedExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/EnumConstantDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/EnumDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ExplicitConstructorInvocationStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ExpressionMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ExpressionStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/FieldAccessExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/FieldDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ForallClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ForEachStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ForStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/IfStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ImportDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/InitializerDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/InstanceOfExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/IntegerLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/IntersectionTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JavadocCommentMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JavaParserMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlAssertStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlBeginStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlBinaryInfixExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlBindingExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlCallableClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClassAccessibleDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClassExprDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClassInvariantDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClassLevelDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClassLevelMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClauseIfMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClauseLEMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlContractMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlDefaultClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlDocDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlDocMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlDocModifierMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlDocStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlDocTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlEndStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlExpressionStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlFieldDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlForallClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlGhostStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlGhostStatementsMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlGhostStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlLabelExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlLabelMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlLabelStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlLetExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlMethodDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlMethodSignatureMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlMultiCompareExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlMultiExprClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlOldClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlQuantifiedExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlRefiningStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlRepresentsDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlSetComprehensionExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlSetComprehensionMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlSignalsClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlSignalsOnlyClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlSimpleExprClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlStmtWithExpressionMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlTypeExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/JmlUnreachableStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyAbstractExecutionContextMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyCatchAllStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeYCcatchBranchMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeYCcatchBreakMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeYCcatchContinueMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeYCcatchParameterMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeYCcatchReturnMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyCcatchSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyContextStatementBlockMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyEscapeExpressionMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyExecCtxtSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyExecStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyExecutionContextMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyExecutionContextSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyExpressionSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyJumpLabelSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyLoopScopeBlockMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMergePointStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMetaConstructExpressionMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMetaConstructMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMetaConstructTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMethodBodyStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMethodCallStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMethodSignatureMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyMethodSignatureSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyPassiveExpressionMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyProgramVariableSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyRangeExpressionMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyStatementSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyTransactionStatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/KeyTypeSVMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LabeledStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LambdaExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LineCommentMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LiteralStringValueExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LocalClassDeclarationStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LocalRecordDeclarationStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/LongLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/MarkdownCommentMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/MarkerAnnotationExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/MatchAllPatternExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/MemberValuePairMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/MethodCallExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/MethodDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/MethodReferenceExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModifierMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModuleDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModuleDirectiveMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModuleExportsDirectiveMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModuleOpensDirectiveMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModuleProvidesDirectiveMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModuleRequiresDirectiveMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ModuleUsesDirectiveMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/NameExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/NameMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/NodeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/NormalAnnotationExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/NullLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ObjectCreationExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/PackageDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ParameterMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/PatternExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/PrimitiveTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/PropertyMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ReceiverParameterMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/RecordDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/RecordPatternExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ReferenceTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ReturnStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SignalsClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SignalsMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SignalsOnlyClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SignalsOnlyMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SimpleNameMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SingleMemberAnnotationExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/StatementMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/StringLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SuperExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SwitchEntryMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SwitchExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SwitchStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/SynchronizedStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TextBlockLiteralExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ThisExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/ThrowStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TraditionalJavadocCommentMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TryStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TypeDeclarationMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TypeExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TypeParameterMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/TypePatternExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/UnaryExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/UnionTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/UnknownTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/UnparsableStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/UnreachableStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/VariableDeclarationExprMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/VariableDeclaratorMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/VarTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/VoidTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/WhileStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/WildcardTypeMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/WorkingSpaceClauseMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/metamodel/YieldStmtMetaModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ParseProblemException.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ParserConfiguration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/ParseResult.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/Position.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/ConcreteSyntaxModel.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmAttribute.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmChar.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmConditional.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmList.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmMix.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmSequence.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmSingleReference.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmString.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmTextBlock.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/concretesyntaxmodel/CsmToken.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/configuration/DefaultConfigurationOption.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/configuration/DefaultPrinterConfiguration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/configuration/Indentation.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/configuration/PrettyPrinterConfiguration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/DefaultPrettyPrinter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/DotPrinter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/Added.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/Difference.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/Kept.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/NodeText.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/Removed.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/Reshuffled.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/PrettyPrinter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/PrettyPrintVisitor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/SourcePrinter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/XmlPrinter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/YamlPrinter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/Problem.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/Providers.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/quality/Preconditions.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/Range.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/logic/ConflictingGenericTypesException.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/logic/FunctionalInterfaceLogic.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/logic/InferenceContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/logic/InferenceVariableType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/MethodAmbiguityException.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/MethodUsage.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/model/LambdaArgumentTypePlaceholder.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/model/SymbolReference.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/model/typesystem/LazyType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/model/typesystem/NullType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/model/Value.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/Navigator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/parametrization/ResolvedTypeParametersMap.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedArrayType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedIntersectionType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedLambdaConstraintType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedPrimitiveType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedReferenceType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedTypeVariable.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedUnionType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedVoidType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/types/ResolvedWildcard.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/resolution/UnsolvedSymbolException.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/StaticJavaParser.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/TokenRange.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/UnicodeEscapeProcessingProvider.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/CodeGenerationUtils.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/LineSeparator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/Pair.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/ParserCollectionStrategy.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/PositionUtils.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/ProjectRoot.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/SeparatedItemStringBuilder.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/SourceRoot.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/SourceZip.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/StringEscapeUtils.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/VisitorList.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/VisitorMap.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/utils/VisitorSet.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -567 problems in 567 files \ No newline at end of file +0 problems in 0 files \ No newline at end of file diff --git a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_testing_src_test_java.txt b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_testing_src_test_java.txt index 7c43ade3b0..8a9fcbee58 100644 --- a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_testing_src_test_java.txt +++ b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_core_testing_src_test_java.txt @@ -1,7 +1 @@ -com/github/javaparser/metamodel/BaseNodeMetaModelTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/printer/TestVisitor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -2 problems in 2 files \ No newline at end of file +0 problems in 0 files \ No newline at end of file diff --git a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_symbol_solver_core_src_main_java.txt b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_symbol_solver_core_src_main_java.txt index 4b8b207340..8a9fcbee58 100644 --- a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_symbol_solver_core_src_main_java.txt +++ b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_symbol_solver_core_src_main_java.txt @@ -1,418 +1 @@ -com/github/javaparser/symbolsolver/cache/DefaultCacheStats.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/cache/GuavaCache.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/cache/InMemoryCache.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/declarations/common/MethodDeclarationCommonLogic.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnnotationDeclarationContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ArrayAccessExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/BinaryExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/BlockStmtContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/CatchClauseContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationExtendsContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConditionalExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConstructorContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ContextHelper.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/DoStatementContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnclosedExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnumDeclarationContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ExpressionContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/FieldAccessContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForEachStatementContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForStatementContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/InstanceOfExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/jml/JmlContractContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/jml/JmlLetExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/jml/JmlQuantifiedExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/jml/JmlSignalsClauseContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodReferenceExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/ObjectCreationContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/RecordDeclarationContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/StatementContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchEntryContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/TryWithResourceContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/UnaryExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclarationExprContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclaratorContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/contexts/WhileStatementContext.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/DefaultConstructorDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationMemberDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumConstantDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarators/AbstractSymbolDeclarator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarators/FieldSymbolDeclarator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarators/NoSymbolDeclarator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarators/ParameterSymbolDeclarator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarators/TypePatternSymbolDeclarator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/declarators/VariableSymbolDeclarator.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableResult.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/JavaRefersToJmlException.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodLikeDeclarationAdapter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/JavaSymbolSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationMemberDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionConstructorDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumConstantDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionPatternDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclaration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/naming/NameCategory.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/promotion/BooleanConditionalExprHandler.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/promotion/NumericConditionalExprHandler.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/promotion/ReferenceConditionalExprHandler.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/SymbolSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/bounds/CapturesBound.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/bounds/FalseBound.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SameAsBound.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SubtypeOfBound.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/bounds/ThrowsBound.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/BoundSet.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/ConstraintFormula.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/ExpressionCompatibleWithType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/TypeCompatibleWithType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/TypeSameAsType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/TypeSubtypeOfType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/ConstraintFormulaSet.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/ControlFlowLogic.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/InferenceVariable.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/InferenceVariableSubstitution.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/Instantiation.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/InstantiationSet.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/LeastUpperBoundLogic.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/MethodType.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/ProperLowerBound.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/ProperUpperBound.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/Substitution.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typeinference/TypeInference.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/AarTypeSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/ClassLoaderTypeSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolver.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/SourceFileInfoExtractor.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategy.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -139 problems in 139 files \ No newline at end of file +0 problems in 0 files \ No newline at end of file diff --git a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_symbol_solver_testing_src_test_java.txt b/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_symbol_solver_testing_src_test_java.txt deleted file mode 100644 index cc64860931..0000000000 --- a/javaparser-core-testing/src/test/resources/com/github/javaparser/bulk_test_results/javaparser_test_results_javaparser_symbol_solver_testing_src_test_java.txt +++ /dev/null @@ -1,43 +0,0 @@ -com/github/javaparser/key/LogicalTypes.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/AbstractSymbolResolutionTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclarationTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/DefaultPackageTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/AarTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/AbstractTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/ClassLoaderTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/MemoryTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolverTest.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -com/github/javaparser/symbolsolver/utils/LeanParserConfiguration.java -Cannot invoke "com.github.javaparser.ast.NodeList.forEach(java.util.function.Consumer)" because the return value of "com.github.javaparser.ast.body.ConstructorDeclaration.getContracts()" is null - -14 problems in 14 files \ No newline at end of file diff --git a/javaparser-core/build.gradle.kts b/javaparser-core/build.gradle.kts new file mode 100644 index 0000000000..c0cb3a7e22 --- /dev/null +++ b/javaparser-core/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("buildlogic.java-conventions") + //id("org.javacc.javacc") version "4.0.3" +} + +description = "io.github.jmltoolkit:jmlparser-core" + +val javacc by configurations.creating + +dependencies { + api(libs.org.jspecify.jspecify) + api(libs.net.bytebuddy.byte.buddy.agent) + javacc("com.helger:parser-generator-cc:2.0.1") +} + +val javaBuildFile by tasks.registering(Copy::class) { + from("src/main/java-templates/") + includeEmptyDirs = false + + into(layout.buildDirectory.dir("generated-src/main/javacc/")) + expand( + "name" to project.name, + "version" to project.version + ) +} +tasks.compileJava { dependsOn(javaBuildFile) } + +val javaccOutput = layout.buildDirectory.dir("generated-src/main/javacc").get().asFile.absolutePath +val javaccInput = "src/main/javacc/java.jj" +val compileJavacc by tasks.registering(JavaExec::class) { + inputs.file(javaccInput).withPathSensitivity(PathSensitivity.RELATIVE) + outputs.dir(javaccOutput) + mainClass.set("com.helger.pgcc.parser.Main") + classpath(javacc) + args = listOf( + "-OUTPUT_DIRECTORY=$javaccOutput/com/github/javaparser", + "src/main/javacc/java.jj" + ) +} +tasks.compileJava { dependsOn(compileJavacc) } +sourceSets.main { + java { + srcDirs(javaccOutput, "src/main/javacc-support") + } +} \ No newline at end of file diff --git a/javaparser-core/pom.xml b/javaparser-core/pom.xml index 690072a4dd..0cc4f6a3b4 100644 --- a/javaparser-core/pom.xml +++ b/javaparser-core/pom.xml @@ -3,7 +3,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-core/src/main/java-templates/com/github/javaparser/JavaParserBuild.java b/javaparser-core/src/main/java-templates/com/github/javaparser/JavaParserBuild.java index b6cbe6b6ae..689ceceb9c 100644 --- a/javaparser-core/src/main/java-templates/com/github/javaparser/JavaParserBuild.java +++ b/javaparser-core/src/main/java-templates/com/github/javaparser/JavaParserBuild.java @@ -24,7 +24,6 @@ * Core information about this library. */ public class JavaParserBuild { - public static final String PROJECT_VERSION = "${project.version}"; - public static final String PROJECT_NAME = "${project.name}"; - public static final String PROJECT_BUILD_FINAL_NAME = "${project.build.finalName}"; + public static final String PROJECT_VERSION = "${version}"; + public static final String PROJECT_NAME = "${name}"; } \ No newline at end of file diff --git a/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java b/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java index 6649f4fc44..04ddc6f58e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java +++ b/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java @@ -451,213 +451,212 @@ public enum Kind { WORKING_SPACE(185), WORKING_SPACE_REDUNDANTLY(186), WRITABLE(187), - DOTDOT(188), - JML_LINE_COMMENT(189), - SINGLE_LINE_COMMENT(190), - JML_ENTER_MULTILINE_COMMENT(191), - ENTER_JAVADOC_COMMENT(192), - ENTER_JML_BLOCK_COMMENT(193), - ENTER_MULTILINE_COMMENT(194), - JML_BLOCK_COMMENT(195), - JAVADOC_COMMENT(196), - MULTI_LINE_COMMENT(197), - JML_MULTI_LINE_COMMENT(198), - COMMENT_CONTENT(199), - ABSTRACT(200), - ASSERT(201), - BOOLEAN(202), - BREAK(203), - BYTE(204), - CASE(205), - CATCH(206), - CHAR(207), - CLASS(208), - CONST(209), - CONTINUE(210), - _DEFAULT(211), - DO(212), - DOUBLE(213), - ELSE(214), - ENUM(215), - EXTENDS(216), - FALSE(217), - FINAL(218), - FINALLY(219), - FLOAT(220), - FOR(221), - GOTO(222), - IF(223), - IMPLEMENTS(224), - IMPORT(225), - INSTANCEOF(226), - INT(227), - INTERFACE(228), - LONG(229), - NATIVE(230), - NEW(231), - NON_SEALED(232), - NULL(233), - PACKAGE(234), - PERMITS(235), - PRIVATE(236), - PROTECTED(237), - PUBLIC(238), - RECORD(239), - RETURN(240), - SEALED(241), - SHORT(242), - STATIC(243), - STRICTFP(244), - SUPER(245), - SWITCH(246), - SYNCHRONIZED(247), - THIS(248), - THROW(249), - THROWS(250), - TRANSIENT(251), - TRUE(252), - TRY(253), - VOID(254), - VOLATILE(255), - WHILE(256), - YIELD(257), - REQUIRES(258), - TO(259), - WITH(260), - OPEN(261), - OPENS(262), - USES(263), - MODULE(264), - EXPORTS(265), - PROVIDES(266), - TRANSITIVE(267), - WHEN(268), - SOURCE(269), - TRANSACTIONBEGIN(270), - TRANSACTIONCOMMIT(271), - TRANSACTIONFINISH(272), - TRANSACTIONABORT(273), - RETURNTYPE(274), - LOOPSCOPE(275), - MERGE_POINT(276), - METHODFRAME(277), - EXEC(278), - CONTINUETYPE(279), - CCATCH(280), - CCAT(281), - BREAKTYPE(282), - TYPEOF(283), - SWITCHTOIF(284), - UNPACK(285), - REATTACHLOOPINVARIANT(286), - FORINITUNFOLDTRANSFORMER(287), - LOOPSCOPEINVARIANTTRANSFORMER(288), - SETSV(289), - ISSTATIC(290), - EVALARGS(291), - REPLACEARGS(292), - UNWINDLOOP(293), - CATCHALL(294), - COMMIT(295), - FINISH(296), - ABORT(297), - UNWIND_LOOP_BOUNDED(298), - FORTOWHILE(299), - DOBREAK(300), - METHODCALL(301), - EXPANDMETHODBODY(302), - CONSTRUCTORCALL(303), - SPECIALCONSTRUCTORECALL(304), - POSTWORK(305), - STATICINITIALIZATION(306), - RESOLVE_MULTIPLE_VAR_DECL(307), - ARRAY_POST_DECL(308), - ARRAY_INIT_CREATION(309), - ARRAY_INIT_CREATION_TRANSIENT(310), - ARRAY_INIT_CREATION_ASSIGNMENTS(311), - ENHANCEDFOR_ELIM(312), - STATIC_EVALUATE(313), - CREATE_OBJECT(314), - LENGTHREF(315), - RESULTARROW(316), - LONG_LITERAL(317), - INTEGER_LITERAL(318), - DECIMAL_LITERAL(319), - HEX_LITERAL(320), - OCTAL_LITERAL(321), - BINARY_LITERAL(322), - FLOATING_POINT_LITERAL(323), - DECIMAL_FLOATING_POINT_LITERAL(324), - DECIMAL_EXPONENT(325), - HEXADECIMAL_FLOATING_POINT_LITERAL(326), - HEXADECIMAL_EXPONENT(327), - HEX_DIGITS(328), - UNICODE_ESCAPE(329), - CHARACTER_LITERAL(330), - STRING_LITERAL(331), - ENTER_TEXT_BLOCK(332), - TEXT_BLOCK_LITERAL(333), - TEXT_BLOCK_CONTENT(334), + JML_LINE_COMMENT(188), + SINGLE_LINE_COMMENT(189), + JML_ENTER_MULTILINE_COMMENT(190), + ENTER_JAVADOC_COMMENT(191), + ENTER_JML_BLOCK_COMMENT(192), + ENTER_MULTILINE_COMMENT(193), + JML_BLOCK_COMMENT(194), + JAVADOC_COMMENT(195), + MULTI_LINE_COMMENT(196), + JML_MULTI_LINE_COMMENT(197), + COMMENT_CONTENT(198), + ABSTRACT(199), + ASSERT(200), + BOOLEAN(201), + BREAK(202), + BYTE(203), + CASE(204), + CATCH(205), + CHAR(206), + CLASS(207), + CONST(208), + CONTINUE(209), + _DEFAULT(210), + DO(211), + DOUBLE(212), + ELSE(213), + ENUM(214), + EXTENDS(215), + FALSE(216), + FINAL(217), + FINALLY(218), + FLOAT(219), + FOR(220), + GOTO(221), + IF(222), + IMPLEMENTS(223), + IMPORT(224), + INSTANCEOF(225), + INT(226), + INTERFACE(227), + LONG(228), + NATIVE(229), + NEW(230), + NON_SEALED(231), + NULL(232), + PACKAGE(233), + PERMITS(234), + PRIVATE(235), + PROTECTED(236), + PUBLIC(237), + RECORD(238), + RETURN(239), + SEALED(240), + SHORT(241), + STATIC(242), + STRICTFP(243), + SUPER(244), + SWITCH(245), + SYNCHRONIZED(246), + THIS(247), + THROW(248), + THROWS(249), + TRANSIENT(250), + TRUE(251), + TRY(252), + VOID(253), + VOLATILE(254), + WHILE(255), + YIELD(256), + REQUIRES(257), + TO(258), + WITH(259), + OPEN(260), + OPENS(261), + USES(262), + MODULE(263), + EXPORTS(264), + PROVIDES(265), + TRANSITIVE(266), + WHEN(267), + SOURCE(268), + TRANSACTIONBEGIN(269), + TRANSACTIONCOMMIT(270), + TRANSACTIONFINISH(271), + TRANSACTIONABORT(272), + RETURNTYPE(273), + LOOPSCOPE(274), + MERGE_POINT(275), + METHODFRAME(276), + EXEC(277), + CONTINUETYPE(278), + CCATCH(279), + CCAT(280), + BREAKTYPE(281), + TYPEOF(282), + SWITCHTOIF(283), + UNPACK(284), + REATTACHLOOPINVARIANT(285), + FORINITUNFOLDTRANSFORMER(286), + LOOPSCOPEINVARIANTTRANSFORMER(287), + SETSV(288), + ISSTATIC(289), + EVALARGS(290), + REPLACEARGS(291), + UNWINDLOOP(292), + CATCHALL(293), + COMMIT(294), + FINISH(295), + ABORT(296), + UNWIND_LOOP_BOUNDED(297), + FORTOWHILE(298), + DOBREAK(299), + METHODCALL(300), + EXPANDMETHODBODY(301), + CONSTRUCTORCALL(302), + SPECIALCONSTRUCTORECALL(303), + POSTWORK(304), + STATICINITIALIZATION(305), + RESOLVE_MULTIPLE_VAR_DECL(306), + ARRAY_POST_DECL(307), + ARRAY_INIT_CREATION(308), + ARRAY_INIT_CREATION_TRANSIENT(309), + ARRAY_INIT_CREATION_ASSIGNMENTS(310), + ENHANCEDFOR_ELIM(311), + STATIC_EVALUATE(312), + CREATE_OBJECT(313), + LENGTHREF(314), + RESULTARROW(315), + LONG_LITERAL(316), + INTEGER_LITERAL(317), + DECIMAL_LITERAL(318), + HEX_LITERAL(319), + OCTAL_LITERAL(320), + BINARY_LITERAL(321), + FLOATING_POINT_LITERAL(322), + DECIMAL_FLOATING_POINT_LITERAL(323), + DECIMAL_EXPONENT(324), + HEXADECIMAL_FLOATING_POINT_LITERAL(325), + HEXADECIMAL_EXPONENT(326), + HEX_DIGITS(327), + UNICODE_ESCAPE(328), + CHARACTER_LITERAL(329), + STRING_LITERAL(330), + ENTER_TEXT_BLOCK(331), + TEXT_BLOCK_LITERAL(332), + TEXT_BLOCK_CONTENT(333), + IDENTIFIER(334), JML_IDENTIFIER(335), - IDENTIFIER(336), - JMLIDENTIFIER(337), - SVIDENTIFIER(338), - KEYIDENTIFIER(339), - NON_UNDERSCORE_LETTER(340), - PART_LETTER(341), - LPAREN(342), - RPAREN(343), - LBRACE(344), - RBRACE(345), - LBRACKET(346), - RBRACKET(347), - SEMICOLON(348), - COMMA(349), + SVIDENTIFIER(336), + KEYIDENTIFIER(337), + NON_UNDERSCORE_LETTER(338), + PART_LETTER(339), + LPAREN(340), + RPAREN(341), + LBRACE(342), + RBRACE(343), + LBRACKET(344), + RBRACKET(345), + SEMICOLON(346), + COMMA(347), + DOTDOT(348), + ELLIPSIS(349), DOT(350), - ELLIPSIS(351), - AT(352), - DOUBLECOLON(353), - ASSIGN(354), - LT(355), - BANG(356), - TILDE(357), - HOOK(358), - COLON(359), - ARROW(360), - EQ(361), - GE(362), - LE(363), - NE(364), - SC_AND(365), - SC_OR(366), - INCR(367), - DECR(368), - PLUS(369), - MINUS(370), - STAR(371), - SLASH(372), - BIT_AND(373), - BIT_OR(374), - XOR(375), - REM(376), - LSHIFT(377), - SHARP(378), - PLUSASSIGN(379), - MINUSASSIGN(380), - STARASSIGN(381), - SLASHASSIGN(382), - ANDASSIGN(383), - ORASSIGN(384), - XORASSIGN(385), - REMASSIGN(386), - LSHIFTASSIGN(387), - RSIGNEDSHIFTASSIGN(388), - RUNSIGNEDSHIFTASSIGN(389), - RUNSIGNEDSHIFT(390), - RSIGNEDSHIFT(391), - GT(392), - CTRL_Z(393), - UNNAMED_PLACEHOLDER(394); + AT(351), + DOUBLECOLON(352), + ASSIGN(353), + LT(354), + BANG(355), + TILDE(356), + HOOK(357), + COLON(358), + ARROW(359), + EQ(360), + GE(361), + LE(362), + NE(363), + SC_AND(364), + SC_OR(365), + INCR(366), + DECR(367), + PLUS(368), + MINUS(369), + STAR(370), + SLASH(371), + BIT_AND(372), + BIT_OR(373), + XOR(374), + REM(375), + LSHIFT(376), + SHARP(377), + PLUSASSIGN(378), + MINUSASSIGN(379), + STARASSIGN(380), + SLASHASSIGN(381), + ANDASSIGN(382), + ORASSIGN(383), + XORASSIGN(384), + REMASSIGN(385), + LSHIFTASSIGN(386), + RSIGNEDSHIFTASSIGN(387), + RUNSIGNEDSHIFTASSIGN(388), + RUNSIGNEDSHIFT(389), + RSIGNEDSHIFT(390), + GT(391), + CTRL_Z(392), + UNNAMED_PLACEHOLDER(393); private final int kind; @@ -667,420 +666,418 @@ public enum Kind { public static Kind valueOf(int kind) { switch (kind) { - case 394: - return UNNAMED_PLACEHOLDER; case 393: - return CTRL_Z; + return UNNAMED_PLACEHOLDER; case 392: - return GT; + return CTRL_Z; case 391: - return RSIGNEDSHIFT; + return GT; case 390: - return RUNSIGNEDSHIFT; + return RSIGNEDSHIFT; case 389: - return RUNSIGNEDSHIFTASSIGN; + return RUNSIGNEDSHIFT; case 388: - return RSIGNEDSHIFTASSIGN; + return RUNSIGNEDSHIFTASSIGN; case 387: - return LSHIFTASSIGN; + return RSIGNEDSHIFTASSIGN; case 386: - return REMASSIGN; + return LSHIFTASSIGN; case 385: - return XORASSIGN; + return REMASSIGN; case 384: - return ORASSIGN; + return XORASSIGN; case 383: - return ANDASSIGN; + return ORASSIGN; case 382: - return SLASHASSIGN; + return ANDASSIGN; case 381: - return STARASSIGN; + return SLASHASSIGN; case 380: - return MINUSASSIGN; + return STARASSIGN; case 379: - return PLUSASSIGN; + return MINUSASSIGN; case 378: - return SHARP; + return PLUSASSIGN; case 377: - return LSHIFT; + return SHARP; case 376: - return REM; + return LSHIFT; case 375: - return XOR; + return REM; case 374: - return BIT_OR; + return XOR; case 373: - return BIT_AND; + return BIT_OR; case 372: - return SLASH; + return BIT_AND; case 371: - return STAR; + return SLASH; case 370: - return MINUS; + return STAR; case 369: - return PLUS; + return MINUS; case 368: - return DECR; + return PLUS; case 367: - return INCR; + return DECR; case 366: - return SC_OR; + return INCR; case 365: - return SC_AND; + return SC_OR; case 364: - return NE; + return SC_AND; case 363: - return LE; + return NE; case 362: - return GE; + return LE; case 361: - return EQ; + return GE; case 360: - return ARROW; + return EQ; case 359: - return COLON; + return ARROW; case 358: - return HOOK; + return COLON; case 357: - return TILDE; + return HOOK; case 356: - return BANG; + return TILDE; case 355: - return LT; + return BANG; case 354: - return ASSIGN; + return LT; case 353: - return DOUBLECOLON; + return ASSIGN; case 352: - return AT; + return DOUBLECOLON; case 351: - return ELLIPSIS; + return AT; case 350: return DOT; case 349: - return COMMA; + return ELLIPSIS; case 348: - return SEMICOLON; + return DOTDOT; case 347: - return RBRACKET; + return COMMA; case 346: - return LBRACKET; + return SEMICOLON; case 345: - return RBRACE; + return RBRACKET; case 344: - return LBRACE; + return LBRACKET; case 343: - return RPAREN; + return RBRACE; case 342: - return LPAREN; + return LBRACE; case 341: - return PART_LETTER; + return RPAREN; case 340: - return NON_UNDERSCORE_LETTER; + return LPAREN; case 339: - return KEYIDENTIFIER; + return PART_LETTER; case 338: - return SVIDENTIFIER; + return NON_UNDERSCORE_LETTER; case 337: - return JMLIDENTIFIER; + return KEYIDENTIFIER; case 336: - return IDENTIFIER; + return SVIDENTIFIER; case 335: return JML_IDENTIFIER; case 334: - return TEXT_BLOCK_CONTENT; + return IDENTIFIER; case 333: - return TEXT_BLOCK_LITERAL; + return TEXT_BLOCK_CONTENT; case 332: - return ENTER_TEXT_BLOCK; + return TEXT_BLOCK_LITERAL; case 331: - return STRING_LITERAL; + return ENTER_TEXT_BLOCK; case 330: - return CHARACTER_LITERAL; + return STRING_LITERAL; case 329: - return UNICODE_ESCAPE; + return CHARACTER_LITERAL; case 328: - return HEX_DIGITS; + return UNICODE_ESCAPE; case 327: - return HEXADECIMAL_EXPONENT; + return HEX_DIGITS; case 326: - return HEXADECIMAL_FLOATING_POINT_LITERAL; + return HEXADECIMAL_EXPONENT; case 325: - return DECIMAL_EXPONENT; + return HEXADECIMAL_FLOATING_POINT_LITERAL; case 324: - return DECIMAL_FLOATING_POINT_LITERAL; + return DECIMAL_EXPONENT; case 323: - return FLOATING_POINT_LITERAL; + return DECIMAL_FLOATING_POINT_LITERAL; case 322: - return BINARY_LITERAL; + return FLOATING_POINT_LITERAL; case 321: - return OCTAL_LITERAL; + return BINARY_LITERAL; case 320: - return HEX_LITERAL; + return OCTAL_LITERAL; case 319: - return DECIMAL_LITERAL; + return HEX_LITERAL; case 318: - return INTEGER_LITERAL; + return DECIMAL_LITERAL; case 317: - return LONG_LITERAL; + return INTEGER_LITERAL; case 316: - return RESULTARROW; + return LONG_LITERAL; case 315: - return LENGTHREF; + return RESULTARROW; case 314: - return CREATE_OBJECT; + return LENGTHREF; case 313: - return STATIC_EVALUATE; + return CREATE_OBJECT; case 312: - return ENHANCEDFOR_ELIM; + return STATIC_EVALUATE; case 311: - return ARRAY_INIT_CREATION_ASSIGNMENTS; + return ENHANCEDFOR_ELIM; case 310: - return ARRAY_INIT_CREATION_TRANSIENT; + return ARRAY_INIT_CREATION_ASSIGNMENTS; case 309: - return ARRAY_INIT_CREATION; + return ARRAY_INIT_CREATION_TRANSIENT; case 308: - return ARRAY_POST_DECL; + return ARRAY_INIT_CREATION; case 307: - return RESOLVE_MULTIPLE_VAR_DECL; + return ARRAY_POST_DECL; case 306: - return STATICINITIALIZATION; + return RESOLVE_MULTIPLE_VAR_DECL; case 305: - return POSTWORK; + return STATICINITIALIZATION; case 304: - return SPECIALCONSTRUCTORECALL; + return POSTWORK; case 303: - return CONSTRUCTORCALL; + return SPECIALCONSTRUCTORECALL; case 302: - return EXPANDMETHODBODY; + return CONSTRUCTORCALL; case 301: - return METHODCALL; + return EXPANDMETHODBODY; case 300: - return DOBREAK; + return METHODCALL; case 299: - return FORTOWHILE; + return DOBREAK; case 298: - return UNWIND_LOOP_BOUNDED; + return FORTOWHILE; case 297: - return ABORT; + return UNWIND_LOOP_BOUNDED; case 296: - return FINISH; + return ABORT; case 295: - return COMMIT; + return FINISH; case 294: - return CATCHALL; + return COMMIT; case 293: - return UNWINDLOOP; + return CATCHALL; case 292: - return REPLACEARGS; + return UNWINDLOOP; case 291: - return EVALARGS; + return REPLACEARGS; case 290: - return ISSTATIC; + return EVALARGS; case 289: - return SETSV; + return ISSTATIC; case 288: - return LOOPSCOPEINVARIANTTRANSFORMER; + return SETSV; case 287: - return FORINITUNFOLDTRANSFORMER; + return LOOPSCOPEINVARIANTTRANSFORMER; case 286: - return REATTACHLOOPINVARIANT; + return FORINITUNFOLDTRANSFORMER; case 285: - return UNPACK; + return REATTACHLOOPINVARIANT; case 284: - return SWITCHTOIF; + return UNPACK; case 283: - return TYPEOF; + return SWITCHTOIF; case 282: - return BREAKTYPE; + return TYPEOF; case 281: - return CCAT; + return BREAKTYPE; case 280: - return CCATCH; + return CCAT; case 279: - return CONTINUETYPE; + return CCATCH; case 278: - return EXEC; + return CONTINUETYPE; case 277: - return METHODFRAME; + return EXEC; case 276: - return MERGE_POINT; + return METHODFRAME; case 275: - return LOOPSCOPE; + return MERGE_POINT; case 274: - return RETURNTYPE; + return LOOPSCOPE; case 273: - return TRANSACTIONABORT; + return RETURNTYPE; case 272: - return TRANSACTIONFINISH; + return TRANSACTIONABORT; case 271: - return TRANSACTIONCOMMIT; + return TRANSACTIONFINISH; case 270: - return TRANSACTIONBEGIN; + return TRANSACTIONCOMMIT; case 269: - return SOURCE; + return TRANSACTIONBEGIN; case 268: - return WHEN; + return SOURCE; case 267: - return TRANSITIVE; + return WHEN; case 266: - return PROVIDES; + return TRANSITIVE; case 265: - return EXPORTS; + return PROVIDES; case 264: - return MODULE; + return EXPORTS; case 263: - return USES; + return MODULE; case 262: - return OPENS; + return USES; case 261: - return OPEN; + return OPENS; case 260: - return WITH; + return OPEN; case 259: - return TO; + return WITH; case 258: - return REQUIRES; + return TO; case 257: - return YIELD; + return REQUIRES; case 256: - return WHILE; + return YIELD; case 255: - return VOLATILE; + return WHILE; case 254: - return VOID; + return VOLATILE; case 253: - return TRY; + return VOID; case 252: - return TRUE; + return TRY; case 251: - return TRANSIENT; + return TRUE; case 250: - return THROWS; + return TRANSIENT; case 249: - return THROW; + return THROWS; case 248: - return THIS; + return THROW; case 247: - return SYNCHRONIZED; + return THIS; case 246: - return SWITCH; + return SYNCHRONIZED; case 245: - return SUPER; + return SWITCH; case 244: - return STRICTFP; + return SUPER; case 243: - return STATIC; + return STRICTFP; case 242: - return SHORT; + return STATIC; case 241: - return SEALED; + return SHORT; case 240: - return RETURN; + return SEALED; case 239: - return RECORD; + return RETURN; case 238: - return PUBLIC; + return RECORD; case 237: - return PROTECTED; + return PUBLIC; case 236: - return PRIVATE; + return PROTECTED; case 235: - return PERMITS; + return PRIVATE; case 234: - return PACKAGE; + return PERMITS; case 233: - return NULL; + return PACKAGE; case 232: - return NON_SEALED; + return NULL; case 231: - return NEW; + return NON_SEALED; case 230: - return NATIVE; + return NEW; case 229: - return LONG; + return NATIVE; case 228: - return INTERFACE; + return LONG; case 227: - return INT; + return INTERFACE; case 226: - return INSTANCEOF; + return INT; case 225: - return IMPORT; + return INSTANCEOF; case 224: - return IMPLEMENTS; + return IMPORT; case 223: - return IF; + return IMPLEMENTS; case 222: - return GOTO; + return IF; case 221: - return FOR; + return GOTO; case 220: - return FLOAT; + return FOR; case 219: - return FINALLY; + return FLOAT; case 218: - return FINAL; + return FINALLY; case 217: - return FALSE; + return FINAL; case 216: - return EXTENDS; + return FALSE; case 215: - return ENUM; + return EXTENDS; case 214: - return ELSE; + return ENUM; case 213: - return DOUBLE; + return ELSE; case 212: - return DO; + return DOUBLE; case 211: - return _DEFAULT; + return DO; case 210: - return CONTINUE; + return _DEFAULT; case 209: - return CONST; + return CONTINUE; case 208: - return CLASS; + return CONST; case 207: - return CHAR; + return CLASS; case 206: - return CATCH; + return CHAR; case 205: - return CASE; + return CATCH; case 204: - return BYTE; + return CASE; case 203: - return BREAK; + return BYTE; case 202: - return BOOLEAN; + return BREAK; case 201: - return ASSERT; + return BOOLEAN; case 200: - return ABSTRACT; + return ASSERT; case 199: - return COMMENT_CONTENT; + return ABSTRACT; case 198: - return JML_MULTI_LINE_COMMENT; + return COMMENT_CONTENT; case 197: - return MULTI_LINE_COMMENT; + return JML_MULTI_LINE_COMMENT; case 196: - return JAVADOC_COMMENT; + return MULTI_LINE_COMMENT; case 195: - return JML_BLOCK_COMMENT; + return JAVADOC_COMMENT; case 194: - return ENTER_MULTILINE_COMMENT; + return JML_BLOCK_COMMENT; case 193: - return ENTER_JML_BLOCK_COMMENT; + return ENTER_MULTILINE_COMMENT; case 192: - return ENTER_JAVADOC_COMMENT; + return ENTER_JML_BLOCK_COMMENT; case 191: - return JML_ENTER_MULTILINE_COMMENT; + return ENTER_JAVADOC_COMMENT; case 190: - return SINGLE_LINE_COMMENT; + return JML_ENTER_MULTILINE_COMMENT; case 189: - return JML_LINE_COMMENT; + return SINGLE_LINE_COMMENT; case 188: - return DOTDOT; + return JML_LINE_COMMENT; case 187: return WRITABLE; case 186: diff --git a/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java b/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java index 7b6a7704d6..baaa26d547 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java +++ b/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java @@ -108,8 +108,11 @@ public static JavaToken.Category getCategory(int kind) { case JAVADOC_COMMENT: case MULTI_LINE_COMMENT: return JavaToken.Category.COMMENT; + case JML_BLOCK_COMMENT: + case JML_LINE_COMMENT: case ABSTRACT: case ASSERT: + case GHOST: case BOOLEAN: case BREAK: case BYTE: @@ -184,6 +187,7 @@ public static JavaToken.Category getCategory(int kind) { case ALSO: case ANTIVALENCE: case ASSERT_REDUNDANTLY: + case JML_ASSERT: case ASSIGNABLE: case ASSIGNABLE_REDUNDANTLY: case ASSUME: @@ -249,7 +253,6 @@ public static JavaToken.Category getCategory(int kind) { case PEER: case REP: case READ_ONLY: - case GHOST: case END: case HELPER: case HENCE_BY: @@ -357,10 +360,6 @@ public static JavaToken.Category getCategory(int kind) { case WORKING_SPACE_REDUNDANTLY: case WRITABLE: case DOTDOT: - case JML_LINE_COMMENT: - case JML_ENTER_MULTILINE_COMMENT: - case ENTER_JML_BLOCK_COMMENT: - case JML_BLOCK_COMMENT: case JML_MULTI_LINE_COMMENT: case TRANSACTIONBEGIN: case TRANSACTIONCOMMIT: @@ -433,7 +432,6 @@ public static JavaToken.Category getCategory(int kind) { case NULL: case UNNAMED_PLACEHOLDER: return JavaToken.Category.LITERAL; - case JMLIDENTIFIER: case SVIDENTIFIER: case IDENTIFIER: case JML_IDENTIFIER: @@ -492,6 +490,8 @@ public static JavaToken.Category getCategory(int kind) { return JavaToken.Category.OPERATOR; // The following are tokens that are only used internally by the lexer case ENTER_JAVADOC_COMMENT: + case ENTER_JML_BLOCK_COMMENT: + case JML_ENTER_MULTILINE_COMMENT: case ENTER_MULTILINE_COMMENT: case COMMENT_CONTENT: case HEX_DIGITS: diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java index f4ae853244..2ba6901b7c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java @@ -37,6 +37,7 @@ /** * A modifier, like private, public, or volatile. */ +@SuppressWarnings("unused") public class Modifier extends Node { public static Modifier publicModifier() { @@ -123,13 +124,6 @@ public static Modifier jmlSpecPrivateModifier() { return new Modifier(DefaultKeyword.JML_SPEC_PRIVATE); } - public interface Keyword { - - String asString(); - - String name(); - } - public static Modifier sealedModifier() { return new Modifier(DefaultKeyword.SEALED); } @@ -138,6 +132,13 @@ public static Modifier nonSealedModifier() { return new Modifier(DefaultKeyword.NON_SEALED); } + public interface Keyword { + + String name(); + + String asString(); + } + /** * The Java modifier keywords. */ @@ -157,7 +158,7 @@ public enum DefaultKeyword implements Keyword { TRANSITIVE("transitive"), SEALED("sealed"), NON_SEALED("non-sealed"), - // JML + // KEY JML_PACKAGE("package"), JML_PURE("pure"), JML_STRICTLY_PURE("strictly_pure"), @@ -180,6 +181,9 @@ public enum DefaultKeyword implements Keyword { JML_CODE_BIGINT_MATH("code_bigint_math"), JML_CODE_JAVA_MATH("code_java_math"), JML_CODE_SAFE_MATH("code_safe_math"), + JML_SPEC_BIGINT_MATH("spec_bigint_math"), + JML_SPEC_JAVA_MATH("spec_java_math"), + JML_SPEC_SAFE_MATH("spec_safe_math"), JML_CODE("code"), JML_OT_PEER("peer"), JML_OT_REP("rep"), @@ -238,22 +242,11 @@ public Keyword getKeyword() { return keyword; } - @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Modifier setKeyword(final @NonNull() Keyword keyword) { - assertNotNull(keyword); - if (keyword == this.keyword) { - return this; - } - notifyPropertyChange(ObservableProperty.KEYWORD, this.keyword, keyword); - this.keyword = keyword; - return this; - } - /** * Utility method that instantiaties "Modifier"s for the keywords, * and puts them in a NodeList. */ - public static NodeList createModifierList(Modifier.Keyword... modifiers) { + public static NodeList createModifierList(Keyword... modifiers) { return Arrays.stream(modifiers).map(Modifier::new).collect(toNodeList()); } @@ -283,4 +276,15 @@ public Modifier(TokenRange tokenRange) { super(tokenRange); customInitialization(); } + + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public Modifier setKeyword(final @NonNull() Keyword keyword) { + assertNotNull(keyword); + if (keyword == this.keyword) { + return this; + } + notifyPropertyChange(ObservableProperty.KEYWORD, this.keyword, keyword); + this.keyword = keyword; + return this; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java index 720d709e10..2d3ac40514 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java @@ -132,7 +132,7 @@ public Optional toAnnotationDeclaration() { } @Override - public FieldDeclaration addField(Type type, String name, Modifier.DefaultKeyword... modifiers) { + public FieldDeclaration addField(Type type, String name, Modifier.Keyword... modifiers) { throw new IllegalStateException("Cannot add a field to an annotation declaration."); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java index f98046d34f..5de37304b1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java @@ -30,8 +30,12 @@ import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.expr.AnnotationExpr; import com.github.javaparser.ast.jml.body.*; -import com.github.javaparser.ast.jml.doc.JmlDocDeclaration; -import com.github.javaparser.ast.jml.doc.JmlDocType; +import com.github.javaparser.ast.jml.clauses.*; +import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.expr.*; +import com.github.javaparser.ast.jml.stmt.*; +import com.github.javaparser.ast.key.*; +import com.github.javaparser.ast.key.sv.*; import com.github.javaparser.ast.nodeTypes.NodeWithAnnotations; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.visitor.CloneVisitor; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java index 9ee8e4e8d8..87166aadce 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java @@ -20,7 +20,6 @@ */ package com.github.javaparser.ast.body; -import static com.github.javaparser.ast.Modifier.DefaultKeyword.FINAL; import static com.github.javaparser.utils.Utils.assertNotNull; import com.github.javaparser.TokenRange; @@ -193,7 +192,7 @@ private void processIsCompactChange(boolean newIsCompact) { NodeList modifiers = getModifiers(); if (modifiers != null) { getModifiers().forEach(modifier -> { - if (modifier.getKeyword().equals(FINAL)) { + if (modifier.getKeyword().equals(Modifier.DefaultKeyword.FINAL)) { modifier.setData(PHANTOM_KEY, newIsCompact); } }); @@ -229,7 +228,7 @@ public void propertyChange( @SuppressWarnings("unchecked") NodeList newModifiers = (NodeList) newValue; newModifiers.forEach(modifier -> { - if (modifier.getKeyword().equals(FINAL)) { + if (modifier.getKeyword().equals(Modifier.DefaultKeyword.FINAL)) { modifier.setData(PHANTOM_KEY, isCompact); } }); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassRepresentsClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassRepresentsClause.java deleted file mode 100644 index 13734ee789..0000000000 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassRepresentsClause.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.github.javaparser.ast.body; - -/** - * @author Alexander Weigl - * @version 1 (2/21/21) - */ -public class ClassRepresentsClause {} diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java index 93b635657f..1f20928684 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java @@ -267,7 +267,7 @@ public boolean isStatic() { */ @Override public boolean isFinal() { - return hasModifier(FINAL) || isDeclaredInInterface(); + return hasModifier(Modifier.DefaultKeyword.FINAL) || isDeclaredInInterface(); } /* @@ -275,7 +275,7 @@ public boolean isFinal() { */ @Override public boolean isPublic() { - return hasModifier(PUBLIC) || isDeclaredInInterface(); + return hasModifier(DefaultKeyword.PUBLIC) || isDeclaredInInterface(); } /* diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java index 061a65d4ed..1fc3e9a210 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java @@ -67,6 +67,10 @@ public TypeDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>()); } + public TypeDeclaration(TokenRange range) { + this(range, new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>()); + } + public TypeDeclaration(NodeList modifiers, String name) { this(null, modifiers, new NodeList<>(), new SimpleName(name), new NodeList<>()); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java index e01c75569d..a638d5f718 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java @@ -29,8 +29,7 @@ import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.key.KeyEscapeExpression; import com.github.javaparser.ast.key.KeyPassiveExpression; -import com.github.javaparser.ast.key.KeyRangeExpression; -import com.github.javaparser.ast.key.KeyTransactionStatement; +import com.github.javaparser.ast.key.KeyTransactionStmt; import com.github.javaparser.ast.key.sv.KeyExpressionSV; import com.github.javaparser.ast.key.sv.KeyMetaConstructExpression; import com.github.javaparser.ast.key.sv.KeyProgramVariableSV; @@ -988,37 +987,23 @@ public boolean isKeyRangeExpression() { return false; } - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyRangeExpression asKeyRangeExpression() { - throw new IllegalStateException(f( - "%s is not KeyRangeExpression, it is %s", this, this.getClass().getSimpleName())); - } - - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyRangeExpression() { - return Optional.empty(); - } - - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyRangeExpression(Consumer action) {} - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isKeyTransactionStatement() { return true; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyTransactionStatement asKeyTransactionStatement() { + public KeyTransactionStmt asKeyTransactionStatement() { return null; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyTransactionStatement() { + public Optional toKeyTransactionStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyTransactionStatement(Consumer action) {} + public void ifKeyTransactionStatement(Consumer action) {} @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isKeyExpressionSV() { diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java index c506caa32d..00ec4d2330 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java @@ -9,11 +9,11 @@ * @author Alexander Weigl * @version 1 (12/9/21) */ -public interface NodeWithContracts { +public interface NodeWithContracts { NodeList getContracts(); - T setContracts(NodeList contracts); + N setContracts(NodeList contracts); default void addContracts(JmlContract contracts) { final var jmlContracts = getContracts(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java index 055e40f50b..8f24adecff 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java @@ -7,6 +7,7 @@ import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.ast.expr.SimpleName; import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; +import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.visitor.CloneVisitor; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -25,7 +26,8 @@ * @version 1 (3/11/21) */ public class JmlClassAccessibleDeclaration extends JmlClassLevelDeclaration - implements NodeWithModifiers { + implements NodeWithModifiers, + NodeWithAccessModifiers { private NodeList modifiers; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java index 51f022823e..ea9cf8f3e4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java @@ -8,6 +8,7 @@ import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.ast.expr.SimpleName; import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; +import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.visitor.CloneVisitor; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -26,7 +27,7 @@ * @version 1 (2/21/21) */ public class JmlClassExprDeclaration extends JmlClassLevelDeclaration - implements NodeWithModifiers { + implements NodeWithModifiers, NodeWithAccessModifiers { private SimpleName kind; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java index 259c93656f..40fa5ad716 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java @@ -9,6 +9,7 @@ import com.github.javaparser.ast.expr.SimpleName; import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; import com.github.javaparser.ast.nodeTypes.NodeWithName; +import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.visitor.CloneVisitor; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -30,7 +31,9 @@ * @version 1 (3/11/21) */ public class JmlRepresentsDeclaration extends JmlClassLevelDeclaration - implements NodeWithModifiers, NodeWithName { + implements NodeWithName, + NodeWithModifiers, + NodeWithAccessModifiers { private NodeList modifiers; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlSpecification.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlSpecification.java deleted file mode 100644 index 1aeb947618..0000000000 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlSpecification.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.github.javaparser.ast.jml.body; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.NodeList; -import java.util.Set; - -/** - * @author Alexander Weigl - * @version 1 (3/17/21) - */ -public class JmlSpecification { - - /**/ - private boolean singleLine; - - private Set jmlTags; - - private NodeList elements; -} diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/BlockContractable.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/BlockContractable.java deleted file mode 100644 index 4dffbf556c..0000000000 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/BlockContractable.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.github.javaparser.ast.jml.clauses; - -/** - * @author Alexander Weigl - * @version 1 (3/16/21) - */ -public interface BlockContractable {} diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java index 93e056126f..4ddb4c337c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java @@ -8,6 +8,7 @@ import com.github.javaparser.ast.Jmlish; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.expr.SimpleName; +import com.github.javaparser.ast.nodeTypes.NodeWithOptionalSimpleName; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.visitor.CloneVisitor; import com.github.javaparser.metamodel.JavaParserMetaModel; @@ -15,15 +16,18 @@ import com.github.javaparser.metamodel.OptionalProperty; import java.util.Optional; import java.util.function.Consumer; +import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable; /** * @author Alexander Weigl * @version 1 (2/21/21) */ -public abstract class JmlClause extends Node implements Jmlish { +@NullMarked +public abstract class JmlClause extends Node implements Jmlish, NodeWithOptionalSimpleName { @OptionalProperty + @Nullable private SimpleName name; public JmlClause() { @@ -31,7 +35,7 @@ public JmlClause() { } @AllFieldsConstructor - public JmlClause(final SimpleName name) { + public JmlClause(@Nullable final SimpleName name) { this(null, name); } @@ -39,7 +43,7 @@ public JmlClause(final SimpleName name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClause(TokenRange tokenRange, SimpleName name) { + public JmlClause(@Nullable TokenRange tokenRange, @Nullable SimpleName name) { super(tokenRange); setName(name); customInitialization(); @@ -69,6 +73,7 @@ public JmlClauseMetaModel getMetaModel() { public abstract JmlClauseKind getKind(); @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + @Override public Optional getName() { return Optional.ofNullable(name); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java index 4f63265e0d..96f5d6d882 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java @@ -8,6 +8,8 @@ import com.github.javaparser.ast.Node; import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.ast.expr.SimpleName; +import com.github.javaparser.ast.nodeTypes.NodeWithCondition; +import com.github.javaparser.ast.nodeTypes.NodeWithExpression; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.visitor.CloneVisitor; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -23,17 +25,17 @@ * @author Alexander Weigl * @version 1 (2/22/21) */ -public class JmlClauseIf extends JmlClause implements MethodContractable { +public class JmlClauseIf extends JmlClause implements NodeWithExpression, NodeWithCondition { private JmlClauseKind kind; - private Expression then; + private Expression expression; private Expression condition; @AllFieldsConstructor - public JmlClauseIf(SimpleName name, Expression condition, JmlClauseKind kind, Expression then) { - this(null, name, condition, kind, then); + public JmlClauseIf(SimpleName name, Expression condition, JmlClauseKind kind, Expression expression) { + this(null, name, condition, kind, expression); } /** @@ -55,8 +57,8 @@ public boolean replace(Node node, Node replacementNode) { setCondition((Expression) replacementNode); return true; } - if (node == then) { - setThen((Expression) replacementNode); + if (node == expression) { + setExpression((Expression) replacementNode); return true; } return super.replace(node, replacementNode); @@ -117,19 +119,19 @@ public JmlClauseIf setKind(final @NonNull() JmlClauseKind kind) { @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public Expression getThen() { - return then; + return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseIf setThen(final @NonNull() Expression then) { - assertNotNull(then); - if (then == this.then) { + public JmlClauseIf setThen(@NonNull() final Expression expression) { + assertNotNull(expression); + if (expression == this.expression) { return this; } - notifyPropertyChange(ObservableProperty.THEN, this.then, then); - if (this.then != null) this.then.setParentNode(null); - this.then = then; - setAsParentNodeOf(then); + notifyPropertyChange(ObservableProperty.CONDITION, this.expression, expression); + if (this.expression != null) this.expression.setParentNode(null); + this.expression = expression; + setAsParentNodeOf(expression); return this; } @@ -168,11 +170,11 @@ public JmlClauseIfMetaModel getMetaModel() { */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") public JmlClauseIf( - TokenRange tokenRange, SimpleName name, Expression condition, JmlClauseKind kind, Expression then) { + TokenRange tokenRange, SimpleName name, Expression condition, JmlClauseKind kind, Expression expression) { super(tokenRange, name); setCondition(condition); setKind(kind); - setThen(then); + setExpression(expression); customInitialization(); } @@ -190,7 +192,32 @@ public JmlClauseIf( @com.github.javaparser.ast.key.IgnoreLexPrinting() @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public @NonNull() Expression then() { - return Objects.requireNonNull(then); + @NonNull() + public Expression then() { + return Objects.requireNonNull(expression); + } + + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public Expression getExpression() { + return expression; + } + + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public JmlClauseIf setExpression(final @NonNull() Expression expression) { + assertNotNull(expression); + if (expression == this.expression) { + return this; + } + notifyPropertyChange(ObservableProperty.EXPRESSION, this.expression, expression); + if (this.expression != null) this.expression.setParentNode(null); + this.expression = expression; + setAsParentNodeOf(expression); + return this; + } + + @com.github.javaparser.ast.key.IgnoreLexPrinting() + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public @NonNull() Expression expression() { + return Objects.requireNonNull(expression); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java index 68278bc01a..db25328801 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java @@ -10,6 +10,7 @@ import com.github.javaparser.ast.expr.BooleanLiteralExpr; import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.ast.expr.SimpleName; +import com.github.javaparser.ast.nodeTypes.NodeWithExpression; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.visitor.CloneVisitor; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -27,42 +28,42 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlClauseLabel extends JmlClause { +public class JmlClauseLabel extends JmlClause implements NodeWithExpression { private JmlClauseKind kind; @OptionalProperty private SimpleName label; - private Expression expr; + private Expression expression; public JmlClauseLabel() { this(JmlClauseKind.NONE, null, new BooleanLiteralExpr(true)); } - public JmlClauseLabel(SimpleName label, Expression expr) { - this(JmlClauseKind.NONE, label, expr); + public JmlClauseLabel(SimpleName label, Expression expression) { + this(JmlClauseKind.NONE, label, expression); } @AllFieldsConstructor - public JmlClauseLabel(JmlClauseKind kind, SimpleName label, Expression expr) { - this(null, kind, label, expr); + public JmlClauseLabel(JmlClauseKind kind, SimpleName label, Expression expression) { + this(null, kind, label, expression); } /** * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClauseLabel(TokenRange tokenRange, JmlClauseKind kind, SimpleName label, Expression expr) { + public JmlClauseLabel(TokenRange tokenRange, JmlClauseKind kind, SimpleName label, Expression expression) { super(tokenRange); setKind(kind); setLabel(label); - setExpr(expr); + setExpression(expression); customInitialization(); } - public JmlClauseLabel(TokenRange range, JavaToken kind, SimpleName label, Expression expr) { - this(range, JmlClauseKind.getKindByToken(kind), label, expr); + public JmlClauseLabel(TokenRange range, JavaToken kind, SimpleName label, Expression expression) { + this(range, JmlClauseKind.getKindByToken(kind), label, expression); } @Override @@ -98,8 +99,8 @@ public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } - if (node == expr) { - setExpr((Expression) replacementNode); + if (node == expression) { + setExpression((Expression) replacementNode); return true; } if (label != null) { @@ -128,19 +129,19 @@ public JmlClauseLabel(TokenRange tokenRange) { @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public Expression getExpr() { - return expr; + return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseLabel setExpr(final @NonNull() Expression expr) { - assertNotNull(expr); - if (expr == this.expr) { + public JmlClauseLabel setExpr(@NonNull() final Expression expression) { + assertNotNull(expression); + if (expression == this.expression) { return this; } - notifyPropertyChange(ObservableProperty.EXPR, this.expr, expr); - if (this.expr != null) this.expr.setParentNode(null); - this.expr = expr; - setAsParentNodeOf(expr); + notifyPropertyChange(ObservableProperty.EXPR, this.expression, expression); + if (this.expression != null) this.expression.setParentNode(null); + this.expression = expression; + setAsParentNodeOf(expression); return this; } @@ -215,8 +216,9 @@ public void ifJmlClauseLabel(Consumer action) { @com.github.javaparser.ast.key.IgnoreLexPrinting() @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public @NonNull() Expression expr() { - return Objects.requireNonNull(expr); + @NonNull() + public Expression expr() { + return Objects.requireNonNull(expression); } @com.github.javaparser.ast.key.IgnoreLexPrinting() @@ -230,4 +232,28 @@ public void ifJmlClauseLabel(Consumer action) { public @Nullable() SimpleName label() { return label; } + + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public Expression getExpression() { + return expression; + } + + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public JmlClauseLabel setExpression(final @NonNull() Expression expression) { + assertNotNull(expression); + if (expression == this.expression) { + return this; + } + notifyPropertyChange(ObservableProperty.EXPRESSION, this.expression, expression); + if (this.expression != null) this.expression.setParentNode(null); + this.expression = expression; + setAsParentNodeOf(expression); + return this; + } + + @com.github.javaparser.ast.key.IgnoreLexPrinting() + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public @NonNull() Expression expression() { + return Objects.requireNonNull(expression); + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java index 2b02b37694..b963b4b9d1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java @@ -7,6 +7,7 @@ import com.github.javaparser.ast.expr.SimpleName; import com.github.javaparser.ast.jml.NodeWithJmlTags; import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; +import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.stmt.Behavior; import com.github.javaparser.ast.visitor.CloneVisitor; @@ -24,7 +25,11 @@ * @author Alexander Weigl * @version 1 (3/14/21) */ -public class JmlContract extends Node implements Jmlish, NodeWithModifiers, NodeWithJmlTags { +public class JmlContract extends Node + implements Jmlish, + NodeWithModifiers, + NodeWithJmlTags, + NodeWithAccessModifiers { private NodeList jmlTags = new NodeList<>(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java index 35b6baa53b..a18df72f26 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java @@ -23,7 +23,7 @@ * @author Alexander Weigl * @version 1 (2/22/21) */ -public class JmlForallClause extends JmlClause implements MethodContractable { +public class JmlForallClause extends JmlClause { private NodeList boundedVariables; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java index 817918bd60..8a4af6ec72 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java @@ -24,7 +24,7 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlSignalsClause extends JmlClause implements MethodContractable, BlockContractable { +public class JmlSignalsClause extends JmlClause { private Parameter parameter; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java index c40a866646..946629ac8d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java @@ -23,7 +23,7 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlSignalsOnlyClause extends JmlClause implements MethodContractable, BlockContractable { +public class JmlSignalsOnlyClause extends JmlClause { private NodeList types; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java index af176afeb9..f86d499bdf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java @@ -27,7 +27,7 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlSimpleExprClause extends JmlClause implements MethodContractable, BlockContractable { +public class JmlSimpleExprClause extends JmlClause { private JmlClauseKind kind; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/MethodContractable.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/MethodContractable.java deleted file mode 100644 index 2c77cde4de..0000000000 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/MethodContractable.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.github.javaparser.ast.jml.clauses; - -/** - * @author Alexander Weigl - * @version 1 (3/16/21) - */ -public interface MethodContractable {} diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java index 9d464147c0..068eac0c02 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java @@ -2,6 +2,7 @@ import static com.github.javaparser.utils.Utils.assertNotNull; +import com.github.javaparser.GeneratedJavaParserConstants; import com.github.javaparser.JavaToken; import com.github.javaparser.TokenRange; import com.github.javaparser.ast.AllFieldsConstructor; @@ -22,11 +23,19 @@ */ public class JmlDoc extends Node { - private JavaToken content; + private String content; - @AllFieldsConstructor public JmlDoc(JavaToken content) { - this(new TokenRange(content, content), content); + this(new TokenRange(content, content), content.getText()); + } + + private static JavaToken getContent(JavaToken content) { + return content; + } + + @AllFieldsConstructor + public JmlDoc(String content) { + this(null, content); } @Override @@ -42,14 +51,14 @@ public void accept(final VoidVisitor v, final A arg) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JavaToken getContent() { + public String getContent() { return content; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlDoc setContent(final @NonNull() JavaToken content) { + public JmlDoc setContent(final @NonNull() String content) { assertNotNull(content); - if (content == this.content) { + if (content.equals(this.content)) { return this; } notifyPropertyChange(ObservableProperty.CONTENT, this.content, content); @@ -63,25 +72,38 @@ public JmlDoc clone() { return (JmlDoc) accept(new CloneVisitor(), null); } - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlDocMetaModel getMetaModel() { - return JavaParserMetaModel.jmlDocMetaModel; - } - /** * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlDoc(TokenRange tokenRange, JavaToken content) { + public JmlDoc(TokenRange tokenRange, String content) { super(tokenRange); setContent(content); customInitialization(); } + public JmlDoc(TokenRange tokenRange, JavaToken content) { + this(tokenRange, content.getText()); + } + @com.github.javaparser.ast.key.IgnoreLexPrinting() @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public @NonNull() JavaToken content() { + public @NonNull() String content() { return Objects.requireNonNull(content); } + + public JavaToken constructToken() { + final var tokenRange = getTokenRange(); + if (tokenRange.isPresent()) { + assert (tokenRange.get().getBegin() == tokenRange.get().getEnd()); + return tokenRange.get().getBegin(); + } + return new JavaToken(GeneratedJavaParserConstants.JML_BLOCK_COMMENT, getContent()); + } + + @Override + @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") + public JmlDocMetaModel getMetaModel() { + return JavaParserMetaModel.jmlDocMetaModel; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java index 9eb3949bff..a020295dd1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java @@ -20,16 +20,14 @@ import java.util.function.Consumer; import org.jspecify.annotations.NonNull; -/** - * 12.5 Set Comprehensions - * https://www.cs.ucf.edu/~leavens/JML/jmlrefman/jmlrefman_12.html#SEC160 - *

- * new JMLObjectSet {Integer i | myIntSet.has(i) && - * i != null && 0 <= i.intValue() && i.intValue() <= 10 } - * - * @author Alexander Weigl - * @version 1 (3/20/21) - */ +/// [12.5 Set Comprehensions](https://www.cs.ucf.edu/~leavens/JML/jmlrefman/jmlrefman_12.html#SEC160) +/// +/// ```java +/// new JMLObjectSet {Integer i | myIntSet.has(i) && +/// i != null && 0 <= i.intValue() && i.intValue() <= 10 } +/// ``` +/// @author Alexander Weigl +/// @version 1 (3/20/21) public class JmlSetComprehensionExpr extends Expression implements Jmlish { private VariableDeclarator binding; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java index 7ce418bd65..a1e29117c4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java @@ -31,7 +31,7 @@ public class JmlExpressionStmt extends JmlStatement implements NodeWithJmlTags { public enum JmlStmtKind implements JmlKeyword { - ASSERT(GeneratedJavaParserConstants.ASSERT), + ASSERT(GeneratedJavaParserConstants.JML_ASSERT), ASSERT_REDUNDANTLY(GeneratedJavaParserConstants.ASSERT_REDUNDANTLY), ASSUME(GeneratedJavaParserConstants.ASSUME), ASSUME_REDUNDANTLY(GeneratedJavaParserConstants.ASSUME_REDUNDANTLY), diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeYMarkerStatement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeYMarkerStatement.java new file mode 100644 index 0000000000..0ebc93cbd0 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeYMarkerStatement.java @@ -0,0 +1,112 @@ +package com.github.javaparser.ast.key; + +import com.github.javaparser.TokenRange; +import com.github.javaparser.ast.AllFieldsConstructor; +import com.github.javaparser.ast.DataKey; +import com.github.javaparser.ast.Generated; +import com.github.javaparser.ast.observer.ObservableProperty; +import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.ast.visitor.CloneVisitor; +import com.github.javaparser.ast.visitor.GenericVisitor; +import com.github.javaparser.ast.visitor.VoidVisitor; +import com.github.javaparser.metamodel.JavaParserMetaModel; +import com.github.javaparser.metamodel.KeYMarkerStatementMetaModel; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Consumer; + +/** + * This class is statement, that can be plugged everywhere. Its meaning is defined by {@link #kind} with semantics + * left to the user. For additional value, use {@link #setData(DataKey, Object)} and {@link #getData(DataKey)}. + * + * @author Alexander Weigl + * @version 1 (3/4/26) + */ +public class KeYMarkerStatement extends Statement { + + private int kind = 0; + + @AllFieldsConstructor + public KeYMarkerStatement(int kind) { + this.kind = kind; + } + + @Override + @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override + @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + @Override + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public boolean isKeYMarkerStatement() { + return true; + } + + @Override + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public KeYMarkerStatement asKeYMarkerStatement() { + return this; + } + + @Override + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public Optional toKeYMarkerStatement() { + return Optional.of(this); + } + + @Override + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public void ifKeYMarkerStatement(Consumer action) { + action.accept(this); + } + + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public int getKind() { + return kind; + } + + @com.github.javaparser.ast.key.IgnoreLexPrinting() + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public int kind() { + return Objects.requireNonNull(kind); + } + + @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") + public KeYMarkerStatement setKind(final int kind) { + if (kind == this.kind) { + return this; + } + notifyPropertyChange(ObservableProperty.KIND, this.kind, kind); + this.kind = kind; + return this; + } + + @Override + @Generated("com.github.javaparser.generator.core.node.CloneGenerator") + public KeYMarkerStatement clone() { + return (KeYMarkerStatement) accept(new CloneVisitor(), null); + } + + @Override + @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") + public KeYMarkerStatementMetaModel getMetaModel() { + return JavaParserMetaModel.keYMarkerStatementMetaModel; + } + + /** + * This constructor is used by the parser and is considered private. + */ + @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") + public KeYMarkerStatement(TokenRange tokenRange, int kind) { + super(tokenRange); + setKind(kind); + customInitialization(); + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyCatchAllStatement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyCatchAllStmt.java similarity index 78% rename from javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyCatchAllStatement.java rename to javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyCatchAllStmt.java index eeedb4d130..f40acd0ff7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyCatchAllStatement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyCatchAllStmt.java @@ -7,7 +7,6 @@ import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.expr.Name; -import com.github.javaparser.ast.key.sv.*; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.ast.stmt.BlockStmt; import com.github.javaparser.ast.stmt.Statement; @@ -15,20 +14,20 @@ import com.github.javaparser.ast.visitor.GenericVisitor; import com.github.javaparser.ast.visitor.VoidVisitor; import com.github.javaparser.metamodel.JavaParserMetaModel; -import com.github.javaparser.metamodel.KeyCatchAllStatementMetaModel; +import com.github.javaparser.metamodel.KeyCatchAllStmtMetaModel; import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; import org.jspecify.annotations.NonNull; -public class KeyCatchAllStatement extends Statement { +public class KeyCatchAllStmt extends Statement { private Name label; private BlockStmt block; @AllFieldsConstructor - public KeyCatchAllStatement(Name label, BlockStmt block) { + public KeyCatchAllStmt(Name label, BlockStmt block) { this(null, label, block); } @@ -36,7 +35,7 @@ public KeyCatchAllStatement(Name label, BlockStmt block) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public KeyCatchAllStatement(TokenRange tokenRange, Name label, BlockStmt block) { + public KeyCatchAllStmt(TokenRange tokenRange, Name label, BlockStmt block) { super(tokenRange); setLabel(label); setBlock(block); @@ -63,19 +62,19 @@ public boolean isKeyCatchAllStatement() { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyCatchAllStatement asKeyCatchAllStatement() { + public KeyCatchAllStmt asKeyCatchAllStatement() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyCatchAllStatement() { + public Optional toKeyCatchAllStatement() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyCatchAllStatement(Consumer action) { + public void ifKeyCatchAllStatement(Consumer action) { action.accept(this); } @@ -85,7 +84,7 @@ public BlockStmt getBlock() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyCatchAllStatement setBlock(final @NonNull() BlockStmt block) { + public KeyCatchAllStmt setBlock(final @NonNull() BlockStmt block) { assertNotNull(block); if (block == this.block) { return this; @@ -103,7 +102,7 @@ public Name getLabel() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyCatchAllStatement setLabel(final @NonNull() Name label) { + public KeyCatchAllStmt setLabel(final @NonNull() Name label) { assertNotNull(label); if (label == this.label) { return this; @@ -134,14 +133,8 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public KeyCatchAllStatement clone() { - return (KeyCatchAllStatement) accept(new CloneVisitor(), null); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public KeyCatchAllStatementMetaModel getMetaModel() { - return JavaParserMetaModel.keyCatchAllStatementMetaModel; + public KeyCatchAllStmt clone() { + return (KeyCatchAllStmt) accept(new CloneVisitor(), null); } @com.github.javaparser.ast.key.IgnoreLexPrinting() @@ -155,4 +148,28 @@ public KeyCatchAllStatementMetaModel getMetaModel() { public @NonNull() Name label() { return Objects.requireNonNull(label); } + + @Override + public boolean isKeyCatchAllStmt() { + return true; + } + + @Override + public KeyCatchAllStmt asKeyCatchAllStmt() { + return this; + } + + @Override + public Optional toKeyCatchAllStmt() { + return Optional.of(this); + } + + public void ifKeyCatchAllStmt(Consumer action) { + action.accept(this); + } + + @Override + public KeyCatchAllStmtMetaModel getMetaModel() { + return JavaParserMetaModel.keyCatchAllStmtMetaModel; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyExecStatement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyExecStmt.java similarity index 81% rename from javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyExecStatement.java rename to javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyExecStmt.java index ce8b4d5593..8fb9bd0a2f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyExecStatement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyExecStmt.java @@ -14,20 +14,20 @@ import com.github.javaparser.ast.visitor.GenericVisitor; import com.github.javaparser.ast.visitor.VoidVisitor; import com.github.javaparser.metamodel.JavaParserMetaModel; -import com.github.javaparser.metamodel.KeyExecStatementMetaModel; +import com.github.javaparser.metamodel.KeyExecStmtMetaModel; import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; import org.jspecify.annotations.NonNull; -public class KeyExecStatement extends Statement { +public class KeyExecStmt extends Statement { private BlockStmt execBlock; private NodeList branches; @AllFieldsConstructor - public KeyExecStatement(BlockStmt execBlock, NodeList branches) { + public KeyExecStmt(BlockStmt execBlock, NodeList branches) { this(null, execBlock, branches); } @@ -35,7 +35,7 @@ public KeyExecStatement(BlockStmt execBlock, NodeList branches) * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public KeyExecStatement(TokenRange tokenRange, BlockStmt execBlock, NodeList branches) { + public KeyExecStmt(TokenRange tokenRange, BlockStmt execBlock, NodeList branches) { super(tokenRange); setExecBlock(execBlock); setBranches(branches); @@ -60,7 +60,7 @@ public NodeList getBranches() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyExecStatement setBranches(final @NonNull() NodeList branches) { + public KeyExecStmt setBranches(final @NonNull() NodeList branches) { assertNotNull(branches); if (branches == this.branches) { return this; @@ -78,7 +78,7 @@ public BlockStmt getExecBlock() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyExecStatement setExecBlock(final @NonNull() BlockStmt execBlock) { + public KeyExecStmt setExecBlock(final @NonNull() BlockStmt execBlock) { assertNotNull(execBlock); if (execBlock == this.execBlock) { return this; @@ -126,14 +126,8 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public KeyExecStatement clone() { - return (KeyExecStatement) accept(new CloneVisitor(), null); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public KeyExecStatementMetaModel getMetaModel() { - return JavaParserMetaModel.keyExecStatementMetaModel; + public KeyExecStmt clone() { + return (KeyExecStmt) accept(new CloneVisitor(), null); } @Override @@ -144,19 +138,19 @@ public boolean isKeyExecStatement() { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyExecStatement asKeyExecStatement() { + public KeyExecStmt asKeyExecStatement() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyExecStatement() { + public Optional toKeyExecStatement() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyExecStatement(Consumer action) { + public void ifKeyExecStatement(Consumer action) { action.accept(this); } @@ -171,4 +165,28 @@ public void ifKeyExecStatement(Consumer action) { public @NonNull() BlockStmt execBlock() { return Objects.requireNonNull(execBlock); } + + @Override + public boolean isKeyExecStmt() { + return true; + } + + @Override + public KeyExecStmt asKeyExecStmt() { + return this; + } + + @Override + public Optional toKeyExecStmt() { + return Optional.of(this); + } + + public void ifKeyExecStmt(Consumer action) { + action.accept(this); + } + + @Override + public KeyExecStmtMetaModel getMetaModel() { + return JavaParserMetaModel.keyExecStmtMetaModel; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyLoopScopeBlock.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyLoopScopeBlockStmt.java similarity index 77% rename from javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyLoopScopeBlock.java rename to javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyLoopScopeBlockStmt.java index b127364e81..2286768045 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyLoopScopeBlock.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyLoopScopeBlockStmt.java @@ -14,20 +14,20 @@ import com.github.javaparser.ast.visitor.GenericVisitor; import com.github.javaparser.ast.visitor.VoidVisitor; import com.github.javaparser.metamodel.JavaParserMetaModel; -import com.github.javaparser.metamodel.KeyLoopScopeBlockMetaModel; +import com.github.javaparser.metamodel.KeyLoopScopeBlockStmtMetaModel; import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; import org.jspecify.annotations.NonNull; -public class KeyLoopScopeBlock extends Statement { +public class KeyLoopScopeBlockStmt extends Statement { private Expression indexPV; private BlockStmt block; @AllFieldsConstructor - public KeyLoopScopeBlock(Expression indexPV, BlockStmt block) { + public KeyLoopScopeBlockStmt(Expression indexPV, BlockStmt block) { this.indexPV = indexPV; this.block = block; } @@ -36,7 +36,7 @@ public KeyLoopScopeBlock(Expression indexPV, BlockStmt block) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public KeyLoopScopeBlock(TokenRange tokenRange, Expression indexPV, BlockStmt block) { + public KeyLoopScopeBlockStmt(TokenRange tokenRange, Expression indexPV, BlockStmt block) { super(tokenRange); setIndexPV(indexPV); setBlock(block); @@ -61,7 +61,7 @@ public BlockStmt getBlock() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyLoopScopeBlock setBlock(final @NonNull() BlockStmt block) { + public KeyLoopScopeBlockStmt setBlock(final @NonNull() BlockStmt block) { assertNotNull(block); if (block == this.block) { return this; @@ -79,7 +79,7 @@ public Expression getIndexPV() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyLoopScopeBlock setIndexPV(final @NonNull() Expression indexPV) { + public KeyLoopScopeBlockStmt setIndexPV(final @NonNull() Expression indexPV) { assertNotNull(indexPV); if (indexPV == this.indexPV) { return this; @@ -110,14 +110,8 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public KeyLoopScopeBlock clone() { - return (KeyLoopScopeBlock) accept(new CloneVisitor(), null); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public KeyLoopScopeBlockMetaModel getMetaModel() { - return JavaParserMetaModel.keyLoopScopeBlockMetaModel; + public KeyLoopScopeBlockStmt clone() { + return (KeyLoopScopeBlockStmt) accept(new CloneVisitor(), null); } @Override @@ -128,19 +122,19 @@ public boolean isKeyLoopScopeBlock() { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyLoopScopeBlock asKeyLoopScopeBlock() { + public KeyLoopScopeBlockStmt asKeyLoopScopeBlock() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyLoopScopeBlock() { + public Optional toKeyLoopScopeBlock() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyLoopScopeBlock(Consumer action) { + public void ifKeyLoopScopeBlock(Consumer action) { action.accept(this); } @@ -155,4 +149,28 @@ public void ifKeyLoopScopeBlock(Consumer action) { public @NonNull() Expression indexPV() { return Objects.requireNonNull(indexPV); } + + @Override + public boolean isKeyLoopScopeBlockStmt() { + return true; + } + + @Override + public KeyLoopScopeBlockStmt asKeyLoopScopeBlockStmt() { + return this; + } + + @Override + public Optional toKeyLoopScopeBlockStmt() { + return Optional.of(this); + } + + public void ifKeyLoopScopeBlockStmt(Consumer action) { + action.accept(this); + } + + @Override + public KeyLoopScopeBlockStmtMetaModel getMetaModel() { + return JavaParserMetaModel.keyLoopScopeBlockStmtMetaModel; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMergePointStatement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMergePointStmt.java similarity index 76% rename from javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMergePointStatement.java rename to javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMergePointStmt.java index 6c90f9cb95..fdcd1c24af 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMergePointStatement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMergePointStmt.java @@ -13,7 +13,7 @@ import com.github.javaparser.ast.visitor.GenericVisitor; import com.github.javaparser.ast.visitor.VoidVisitor; import com.github.javaparser.metamodel.JavaParserMetaModel; -import com.github.javaparser.metamodel.KeyMergePointStatementMetaModel; +import com.github.javaparser.metamodel.KeyMergePointStmtMetaModel; import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; @@ -21,12 +21,12 @@ /// A statement marking a merge point for the theorem prover, carries an `expr`; /// @author weigl -public class KeyMergePointStatement extends Statement { +public class KeyMergePointStmt extends Statement { private Expression expr; @AllFieldsConstructor - public KeyMergePointStatement(Expression expr) { + public KeyMergePointStmt(Expression expr) { this(null, expr); } @@ -34,7 +34,7 @@ public KeyMergePointStatement(Expression expr) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public KeyMergePointStatement(TokenRange tokenRange, Expression expr) { + public KeyMergePointStmt(TokenRange tokenRange, Expression expr) { super(tokenRange); setExpr(expr); customInitialization(); @@ -67,14 +67,8 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public KeyMergePointStatement clone() { - return (KeyMergePointStatement) accept(new CloneVisitor(), null); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public KeyMergePointStatementMetaModel getMetaModel() { - return JavaParserMetaModel.keyMergePointStatementMetaModel; + public KeyMergePointStmt clone() { + return (KeyMergePointStmt) accept(new CloneVisitor(), null); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @@ -83,7 +77,7 @@ public Expression getExpr() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyMergePointStatement setExpr(final @NonNull() Expression expr) { + public KeyMergePointStmt setExpr(final @NonNull() Expression expr) { assertNotNull(expr); if (expr == this.expr) { return this; @@ -103,19 +97,19 @@ public boolean isKeyMergePointStatement() { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyMergePointStatement asKeyMergePointStatement() { + public KeyMergePointStmt asKeyMergePointStatement() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyMergePointStatement() { + public Optional toKeyMergePointStatement() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyMergePointStatement(Consumer action) { + public void ifKeyMergePointStatement(Consumer action) { action.accept(this); } @@ -124,4 +118,28 @@ public void ifKeyMergePointStatement(Consumer action) { public @NonNull() Expression expr() { return Objects.requireNonNull(expr); } + + @Override + public boolean isKeyMergePointStmt() { + return true; + } + + @Override + public KeyMergePointStmt asKeyMergePointStmt() { + return this; + } + + @Override + public Optional toKeyMergePointStmt() { + return Optional.of(this); + } + + public void ifKeyMergePointStmt(Consumer action) { + action.accept(this); + } + + @Override + public KeyMergePointStmtMetaModel getMetaModel() { + return JavaParserMetaModel.keyMergePointStmtMetaModel; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMethodCallStatement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMethodCallStmt.java similarity index 81% rename from javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMethodCallStatement.java rename to javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMethodCallStmt.java index 611d9a1a23..c6719c6cb5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMethodCallStatement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMethodCallStmt.java @@ -14,7 +14,7 @@ import com.github.javaparser.ast.visitor.GenericVisitor; import com.github.javaparser.ast.visitor.VoidVisitor; import com.github.javaparser.metamodel.JavaParserMetaModel; -import com.github.javaparser.metamodel.KeyMethodCallStatementMetaModel; +import com.github.javaparser.metamodel.KeyMethodCallStmtMetaModel; import com.github.javaparser.metamodel.OptionalProperty; import java.util.Objects; import java.util.Optional; @@ -28,7 +28,7 @@ /// } /// ``` /// @author weigl -public class KeyMethodCallStatement extends Statement { +public class KeyMethodCallStmt extends Statement { @OptionalProperty private Name name; @@ -38,7 +38,7 @@ public class KeyMethodCallStatement extends Statement { private BlockStmt block; @AllFieldsConstructor - public KeyMethodCallStatement(Name name, KeyExecutionContext context, BlockStmt block) { + public KeyMethodCallStmt(Name name, KeyExecutionContext context, BlockStmt block) { this(null, name, context, block); } @@ -46,8 +46,7 @@ public KeyMethodCallStatement(Name name, KeyExecutionContext context, BlockStmt * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public KeyMethodCallStatement( - TokenRange tokenRange, Name name, KeyAbstractExecutionContext context, BlockStmt block) { + public KeyMethodCallStmt(TokenRange tokenRange, Name name, KeyAbstractExecutionContext context, BlockStmt block) { super(tokenRange); setName(name); setContext(context); @@ -75,19 +74,19 @@ public boolean isKeyMethodCallStatement() { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyMethodCallStatement asKeyMethodCallStatement() { + public KeyMethodCallStmt asKeyMethodCallStatement() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyMethodCallStatement() { + public Optional toKeyMethodCallStatement() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyMethodCallStatement(Consumer action) { + public void ifKeyMethodCallStatement(Consumer action) { action.accept(this); } @@ -97,7 +96,7 @@ public BlockStmt getBlock() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyMethodCallStatement setBlock(final @NonNull() BlockStmt block) { + public KeyMethodCallStmt setBlock(final @NonNull() BlockStmt block) { assertNotNull(block); if (block == this.block) { return this; @@ -115,7 +114,7 @@ public KeyAbstractExecutionContext getContext() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyMethodCallStatement setContext(final @NonNull() KeyAbstractExecutionContext context) { + public KeyMethodCallStmt setContext(final @NonNull() KeyAbstractExecutionContext context) { assertNotNull(context); if (context == this.context) { return this; @@ -133,7 +132,7 @@ public Optional getName() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyMethodCallStatement setName(final @Nullable() Name name) { + public KeyMethodCallStmt setName(final @Nullable() Name name) { if (name == this.name) { return this; } @@ -184,18 +183,12 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public KeyMethodCallStatement clone() { - return (KeyMethodCallStatement) accept(new CloneVisitor(), null); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public KeyMethodCallStatementMetaModel getMetaModel() { - return JavaParserMetaModel.keyMethodCallStatementMetaModel; + public KeyMethodCallStmt clone() { + return (KeyMethodCallStmt) accept(new CloneVisitor(), null); } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public KeyMethodCallStatement removeName() { + public KeyMethodCallStmt removeName() { return setName((Name) null); } @@ -216,4 +209,28 @@ public KeyMethodCallStatement removeName() { public @Nullable() Name name() { return name; } + + @Override + public boolean isKeyMethodCallStmt() { + return true; + } + + @Override + public KeyMethodCallStmt asKeyMethodCallStmt() { + return this; + } + + @Override + public Optional toKeyMethodCallStmt() { + return Optional.of(this); + } + + public void ifKeyMethodCallStmt(Consumer action) { + action.accept(this); + } + + @Override + public KeyMethodCallStmtMetaModel getMetaModel() { + return JavaParserMetaModel.keyMethodCallStmtMetaModel; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyRangeExpression.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyRangeExpression.java deleted file mode 100644 index 03bdc442b9..0000000000 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyRangeExpression.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.github.javaparser.ast.key; - -import static com.github.javaparser.utils.Utils.assertNotNull; - -import com.github.javaparser.TokenRange; -import com.github.javaparser.ast.AllFieldsConstructor; -import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.expr.Expression; -import com.github.javaparser.ast.observer.ObservableProperty; -import com.github.javaparser.ast.visitor.CloneVisitor; -import com.github.javaparser.ast.visitor.GenericVisitor; -import com.github.javaparser.ast.visitor.VoidVisitor; -import com.github.javaparser.metamodel.JavaParserMetaModel; -import com.github.javaparser.metamodel.KeyRangeExpressionMetaModel; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Consumer; -import org.jspecify.annotations.NonNull; - -/// @deprecated currently unused -@Deprecated() -public class KeyRangeExpression extends Expression { - - private Expression lower; - - private Expression upper; - - @AllFieldsConstructor - public KeyRangeExpression(Expression lower, Expression upper) { - this(null, lower, upper); - } - - /** - * This constructor is used by the parser and is considered private. - */ - @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public KeyRangeExpression(TokenRange tokenRange, Expression lower, Expression upper) { - super(tokenRange); - setLower(lower); - setUpper(upper); - customInitialization(); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isKeyRangeExpression() { - return true; - } - - @Override - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyRangeExpression asKeyRangeExpression() { - return this; - } - - @Override - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyRangeExpression() { - return Optional.of(this); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyRangeExpression(Consumer action) { - action.accept(this); - } - - @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getUpper() { - return upper; - } - - @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyRangeExpression setUpper(final @NonNull() Expression upper) { - assertNotNull(upper); - if (upper == this.upper) { - return this; - } - notifyPropertyChange(ObservableProperty.UPPER, this.upper, upper); - if (this.upper != null) this.upper.setParentNode(null); - this.upper = upper; - setAsParentNodeOf(upper); - return this; - } - - @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getLower() { - return lower; - } - - @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyRangeExpression setLower(final @NonNull() Expression lower) { - assertNotNull(lower); - if (lower == this.lower) { - return this; - } - notifyPropertyChange(ObservableProperty.LOWER, this.lower, lower); - if (this.lower != null) this.lower.setParentNode(null); - this.lower = lower; - setAsParentNodeOf(lower); - return this; - } - - @Override - @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { - if (node == null) { - return false; - } - if (node == lower) { - setLower((Expression) replacementNode); - return true; - } - if (node == upper) { - setUpper((Expression) replacementNode); - return true; - } - return super.replace(node, replacementNode); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public KeyRangeExpression clone() { - return (KeyRangeExpression) accept(new CloneVisitor(), null); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public KeyRangeExpressionMetaModel getMetaModel() { - return JavaParserMetaModel.keyRangeExpressionMetaModel; - } - - @com.github.javaparser.ast.key.IgnoreLexPrinting() - @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public @NonNull() Expression lower() { - return Objects.requireNonNull(lower); - } - - @com.github.javaparser.ast.key.IgnoreLexPrinting() - @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public @NonNull() Expression upper() { - return Objects.requireNonNull(upper); - } -} diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyTransactionStatement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyTransactionStmt.java similarity index 76% rename from javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyTransactionStatement.java rename to javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyTransactionStmt.java index 1ffdb88e0b..decac850ee 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyTransactionStatement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyTransactionStmt.java @@ -12,7 +12,7 @@ import com.github.javaparser.ast.visitor.GenericVisitor; import com.github.javaparser.ast.visitor.VoidVisitor; import com.github.javaparser.metamodel.JavaParserMetaModel; -import com.github.javaparser.metamodel.KeyTransactionStatementMetaModel; +import com.github.javaparser.metamodel.KeyTransactionStmtMetaModel; import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; @@ -30,16 +30,16 @@ /// } /// ``` /// @author weigl -public class KeyTransactionStatement extends Statement { +public class KeyTransactionStmt extends Statement { private TransactionType type; @AllFieldsConstructor - public KeyTransactionStatement(TransactionType type) { + public KeyTransactionStmt(TransactionType type) { this.type = type; } - public KeyTransactionStatement(TokenRange range, JavaToken begin) { + public KeyTransactionStmt(TokenRange range, JavaToken begin) { super(range); setType(TransactionType.byName(begin.getText())); } @@ -84,7 +84,7 @@ public TransactionType getType() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public KeyTransactionStatement setType(final @NonNull() TransactionType type) { + public KeyTransactionStmt setType(final @NonNull() TransactionType type) { assertNotNull(type); if (type == this.type) { return this; @@ -96,21 +96,15 @@ public KeyTransactionStatement setType(final @NonNull() TransactionType type) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public KeyTransactionStatement clone() { - return (KeyTransactionStatement) accept(new CloneVisitor(), null); - } - - @Override - @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public KeyTransactionStatementMetaModel getMetaModel() { - return JavaParserMetaModel.keyTransactionStatementMetaModel; + public KeyTransactionStmt clone() { + return (KeyTransactionStmt) accept(new CloneVisitor(), null); } /** * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public KeyTransactionStatement(TokenRange tokenRange, TransactionType type) { + public KeyTransactionStmt(TokenRange tokenRange, TransactionType type) { super(tokenRange); setType(type); customInitialization(); @@ -124,19 +118,19 @@ public boolean isKeyTransactionStatement() { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyTransactionStatement asKeyTransactionStatement() { + public KeyTransactionStmt asKeyTransactionStatement() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyTransactionStatement() { + public Optional toKeyTransactionStatement() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyTransactionStatement(Consumer action) { + public void ifKeyTransactionStatement(Consumer action) { action.accept(this); } @@ -145,4 +139,28 @@ public void ifKeyTransactionStatement(Consumer action) public @NonNull() TransactionType type() { return Objects.requireNonNull(type); } + + @Override + public boolean isKeyTransactionStmt() { + return true; + } + + @Override + public KeyTransactionStmt asKeyTransactionStmt() { + return this; + } + + @Override + public Optional toKeyTransactionStmt() { + return Optional.of(this); + } + + public void ifKeyTransactionStmt(Consumer action) { + action.accept(this); + } + + @Override + public KeyTransactionStmtMetaModel getMetaModel() { + return JavaParserMetaModel.keyTransactionStmtMetaModel; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java index 53a57f9c9f..44b2107ad8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java @@ -23,6 +23,7 @@ import static com.github.javaparser.StaticJavaParser.parseType; import static com.github.javaparser.ast.Modifier.DefaultKeyword.*; import static com.github.javaparser.ast.Modifier.Keyword; +import static com.github.javaparser.ast.Modifier.Keyword.*; import static com.github.javaparser.ast.Modifier.createModifierList; import static java.util.Collections.unmodifiableList; import static java.util.stream.Collectors.toList; @@ -80,7 +81,7 @@ default N addMember(BodyDeclaration member) { * @param modifiers the modifiers like {@link Modifier.DefaultKeyword#PUBLIC} * @return the {@link FieldDeclaration} created */ - default FieldDeclaration addField(Class typeClass, String name, Modifier.DefaultKeyword... modifiers) { + default FieldDeclaration addField(Class typeClass, String name, Modifier.Keyword... modifiers) { tryAddImportToParentCompilationUnit(typeClass); return addField(typeClass.getSimpleName(), name, modifiers); } @@ -93,7 +94,7 @@ default FieldDeclaration addField(Class typeClass, String name, Modifier.Defa * @param modifiers the modifiers like {@link Modifier.DefaultKeyword#PUBLIC} * @return the {@link FieldDeclaration} created */ - default FieldDeclaration addField(String type, String name, Modifier.DefaultKeyword... modifiers) { + default FieldDeclaration addField(String type, String name, Modifier.Keyword... modifiers) { return addField(parseType(type), name, modifiers); } @@ -105,7 +106,7 @@ default FieldDeclaration addField(String type, String name, Modifier.DefaultKeyw * @param modifiers the modifiers like {@link Modifier.DefaultKeyword#PUBLIC} * @return the {@link FieldDeclaration} created */ - default FieldDeclaration addField(Type type, String name, Modifier.DefaultKeyword... modifiers) { + default FieldDeclaration addField(Type type, String name, Modifier.Keyword... modifiers) { FieldDeclaration fieldDeclaration = new FieldDeclaration(); VariableDeclarator variable = new VariableDeclarator(type, name); fieldDeclaration.getVariables().add(variable); @@ -153,7 +154,7 @@ default FieldDeclaration addFieldWithInitializer( * @return the {@link FieldDeclaration} created */ default FieldDeclaration addFieldWithInitializer( - Type type, String name, Expression initializer, Modifier.DefaultKeyword... modifiers) { + Type type, String name, Expression initializer, Keyword... modifiers) { FieldDeclaration declaration = addField(type, name, modifiers); declaration.getVariables().iterator().next().setInitializer(initializer); return declaration; @@ -283,7 +284,7 @@ default MethodDeclaration addMethod(String methodName, Keyword... modifiers) { * @param modifiers the modifiers like {@link Modifier.DefaultKeyword#PUBLIC} * @return the created constructor */ - default ConstructorDeclaration addConstructor(Modifier.DefaultKeyword... modifiers) { + default ConstructorDeclaration addConstructor(Keyword... modifiers) { ConstructorDeclaration constructorDeclaration = new ConstructorDeclaration(); constructorDeclaration.setModifiers(createModifierList(modifiers)); constructorDeclaration.setName(getName()); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java index be3f319d56..b8cbd1973d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java @@ -20,11 +20,11 @@ */ package com.github.javaparser.ast.nodeTypes; -import static com.github.javaparser.ast.Modifier.DefaultKeyword.*; import static com.github.javaparser.ast.NodeList.toNodeList; import com.github.javaparser.ast.AccessSpecifier; import com.github.javaparser.ast.Modifier; +import com.github.javaparser.ast.Modifier.Keyword; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.NodeList; import java.util.Arrays; @@ -49,9 +49,9 @@ public interface NodeWithModifiers { N setModifiers(NodeList modifiers); @SuppressWarnings("unchecked") - default N addModifier(Modifier.Keyword... newModifiers) { + default N addModifier(Keyword... newModifiers) { NodeList existingModifiers = new NodeList<>(getModifiers()); - for (Modifier.Keyword newModifier : newModifiers) { + for (Keyword newModifier : newModifiers) { boolean alreadyPresent = existingModifiers.stream().anyMatch(m -> m.getKeyword() == newModifier); if (!alreadyPresent) { existingModifiers.add(new Modifier(newModifier)); @@ -62,8 +62,8 @@ default N addModifier(Modifier.Keyword... newModifiers) { } @SuppressWarnings("unchecked") - default N removeModifier(Modifier.Keyword... modifiersToRemove) { - List modifiersToRemoveAsList = Arrays.asList(modifiersToRemove); + default N removeModifier(Keyword... modifiersToRemove) { + List modifiersToRemoveAsList = Arrays.asList(modifiersToRemove); NodeList remaining = getModifiers().stream() .filter(existingModifier -> !modifiersToRemoveAsList.contains(existingModifier.getKeyword())) .collect(toNodeList()); @@ -71,7 +71,7 @@ default N removeModifier(Modifier.Keyword... modifiersToRemove) { return (N) this; } - default N setModifier(Modifier.Keyword m, boolean set) { + default N setModifier(Keyword m, boolean set) { if (set) { return addModifier(m); } @@ -79,10 +79,10 @@ default N setModifier(Modifier.Keyword m, boolean set) { } /** - * @param modifier the modifer being searched for + * @param modifier the modifier being searched for * @return true if the modifier has been explicitly added to this node, else false */ - default boolean hasModifier(Modifier.Keyword modifier) { + default boolean hasModifier(Keyword modifier) { for (Modifier m : getModifiers()) { if (m.getKeyword() == modifier) { return true; @@ -94,10 +94,17 @@ default boolean hasModifier(Modifier.Keyword modifier) { /** * Creates a list of modifier nodes corresponding to the keywords passed, and set it. */ - default N setModifiers(final Modifier.DefaultKeyword... modifiers) { + default N setModifiers(final Modifier.Keyword... modifiers) { return setModifiers(Arrays.stream(modifiers).map(Modifier::new).collect(toNodeList())); } + /** + * Creates a list of modifier nodes corresponding to the keywords passed, and set it. + */ + default N setModifiers(List modifiers) { + return setModifiers(modifiers.stream().map(Modifier::new).collect(toNodeList())); + } + /** * @return the access specifier as far as it can be derived from the modifiers. * Does not take anything else into account (like "interface methods are implicitly public") diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalSimpleName.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalSimpleName.java new file mode 100644 index 0000000000..91df8ccad8 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalSimpleName.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.ast.nodeTypes; + +import static com.github.javaparser.utils.Utils.assertNonEmpty; + +import com.github.javaparser.ast.Node; +import com.github.javaparser.ast.expr.NameExpr; +import com.github.javaparser.ast.expr.SimpleName; +import java.util.Optional; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +/** + * A node with a name. + *

+ * The main reason for this interface is to permit users to manipulate homogeneously all nodes with a getName method. + */ +@NullMarked +public interface NodeWithOptionalSimpleName { + + Optional getName(); + + N setName(@Nullable SimpleName name); + + @SuppressWarnings("unchecked") + default N setName(@Nullable String name) { + assertNonEmpty(name); + return setName(new SimpleName(name)); + } + + default Optional getNameAsString() { + return getName().map(SimpleName::getIdentifier); + } + + default Optional getNameAsExpression() { + return getName().map(NameExpr::new); + } + + @Nullable + SimpleName name(); + + default @Nullable String nameAsString() { + return name() != null ? name().getIdentifier() : null; + } + + default @Nullable NameExpr nameAsExpression() { + return name() != null ? new NameExpr(name()) : null; + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java index 09c1054621..ebd4d49ac4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java @@ -105,7 +105,6 @@ public enum ObservableProperty { LABELS(Type.MULTIPLE_REFERENCE), LEFT(Type.SINGLE_REFERENCE), LEVELS(Type.MULTIPLE_REFERENCE), - LOWER(Type.SINGLE_REFERENCE), MEASURED_BY(Type.SINGLE_REFERENCE), MEMBERS(Type.MULTIPLE_REFERENCE), MEMBER_VALUE(Type.SINGLE_REFERENCE), @@ -147,7 +146,6 @@ public enum ObservableProperty { SUPER_TYPE(Type.SINGLE_REFERENCE), TARGET(Type.SINGLE_REFERENCE), TEXT(Type.SINGLE_ATTRIBUTE), - THEN(Type.SINGLE_REFERENCE), THEN_EXPR(Type.SINGLE_REFERENCE), THEN_STMT(Type.SINGLE_REFERENCE), THIS(Type.SINGLE_ATTRIBUTE), @@ -161,7 +159,6 @@ public enum ObservableProperty { TYPE_NAME(Type.SINGLE_REFERENCE), TYPE_PARAMETERS(Type.MULTIPLE_REFERENCE), UPDATE(Type.MULTIPLE_REFERENCE), - UPPER(Type.SINGLE_REFERENCE), VALUE(Type.SINGLE_REFERENCE), VALUES(Type.MULTIPLE_REFERENCE), VARIABLE(Type.SINGLE_REFERENCE), diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java index 95fc88a9d0..8e87c8b0d0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java @@ -26,7 +26,7 @@ import com.github.javaparser.ast.AllFieldsConstructor; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.jml.doc.JmlDocStmt; +import com.github.javaparser.ast.jml.doc.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; import com.github.javaparser.ast.key.sv.KeyContextStatementBlock; @@ -499,19 +499,19 @@ public boolean isKeyCatchAllStatement() { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyCatchAllStatement asKeyCatchAllStatement() { + public KeyCatchAllStmt asKeyCatchAllStatement() { throw new IllegalStateException(f( "%s is not KeyCatchAllStatement, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyCatchAllStatement() { + public Optional toKeyCatchAllStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyCatchAllStatement(Consumer action) {} + public void ifKeyCatchAllStatement(Consumer action) {} @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isKeyContextStatementBlock() { @@ -536,19 +536,19 @@ public boolean isKeyMethodCallStatement() { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyMethodCallStatement asKeyMethodCallStatement() { + public KeyMethodCallStmt asKeyMethodCallStatement() { throw new IllegalStateException(f( "%s is not KeyMethodCallStatement, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyMethodCallStatement() { + public Optional toKeyMethodCallStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyMethodCallStatement(Consumer action) {} + public void ifKeyMethodCallStatement(Consumer action) {} @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public void ifKeyContextStatementBlock(Consumer action) {} @@ -596,18 +596,18 @@ public boolean isKeyExecStatement() { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyExecStatement asKeyExecStatement() { + public KeyExecStmt asKeyExecStatement() { throw new IllegalStateException( f("%s is not KeyExecStatement, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyExecStatement() { + public Optional toKeyExecStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyExecStatement(Consumer action) {} + public void ifKeyExecStatement(Consumer action) {} @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isKeyLoopScopeBlock() { @@ -615,18 +615,18 @@ public boolean isKeyLoopScopeBlock() { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyLoopScopeBlock asKeyLoopScopeBlock() { + public KeyLoopScopeBlockStmt asKeyLoopScopeBlock() { throw new IllegalStateException( f("%s is not KeyLoopScopeBlock, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyLoopScopeBlock() { + public Optional toKeyLoopScopeBlock() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyLoopScopeBlock(Consumer action) {} + public void ifKeyLoopScopeBlock(Consumer action) {} @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isKeyMergePointStatement() { @@ -634,19 +634,19 @@ public boolean isKeyMergePointStatement() { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyMergePointStatement asKeyMergePointStatement() { + public KeyMergePointStmt asKeyMergePointStatement() { throw new IllegalStateException(f( "%s is not KeyMergePointStatement, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyMergePointStatement() { + public Optional toKeyMergePointStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyMergePointStatement(Consumer action) {} + public void ifKeyMergePointStatement(Consumer action) {} @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isKeyMetaConstruct() { @@ -712,19 +712,38 @@ public boolean isKeyTransactionStatement() { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public KeyTransactionStatement asKeyTransactionStatement() { + public KeyTransactionStmt asKeyTransactionStatement() { throw new IllegalStateException(f( "%s is not KeyTransactionStatement, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toKeyTransactionStatement() { + public Optional toKeyTransactionStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifKeyTransactionStatement(Consumer action) {} + public void ifKeyTransactionStatement(Consumer action) {} + + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public boolean isKeYMarkerStatement() { + return false; + } + + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public KeYMarkerStatement asKeYMarkerStatement() { + throw new IllegalStateException(f( + "%s is not KeYMarkerStatement, it is %s", this, this.getClass().getSimpleName())); + } + + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public Optional toKeYMarkerStatement() { + return Optional.empty(); + } + + @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") + public void ifKeYMarkerStatement(Consumer action) {} @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isJmlDocStmt() { @@ -896,4 +915,95 @@ public Optional toJmlUnreachableStmt() { @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") public void ifJmlUnreachableStmt(Consumer action) {} + + public boolean isKeyCatchAllStmt() { + return false; + } + + public KeyCatchAllStmt asKeyCatchAllStmt() { + throw new IllegalStateException( + f("%s is not KeyCatchAllStmt, it is %s", this, this.getClass().getSimpleName())); + } + + public Optional toKeyCatchAllStmt() { + return Optional.empty(); + } + + public void ifKeyCatchAllStmt(Consumer action) {} + + public boolean isKeyExecStmt() { + return false; + } + + public KeyExecStmt asKeyExecStmt() { + throw new IllegalStateException( + f("%s is not KeyExecStmt, it is %s", this, this.getClass().getSimpleName())); + } + + public Optional toKeyExecStmt() { + return Optional.empty(); + } + + public void ifKeyExecStmt(Consumer action) {} + + public boolean isKeyLoopScopeBlockStmt() { + return false; + } + + public KeyLoopScopeBlockStmt asKeyLoopScopeBlockStmt() { + throw new IllegalStateException(f( + "%s is not KeyLoopScopeBlockStmt, it is %s", + this, this.getClass().getSimpleName())); + } + + public Optional toKeyLoopScopeBlockStmt() { + return Optional.empty(); + } + + public void ifKeyLoopScopeBlockStmt(Consumer action) {} + + public boolean isKeyMergePointStmt() { + return false; + } + + public KeyMergePointStmt asKeyMergePointStmt() { + throw new IllegalStateException( + f("%s is not KeyMergePointStmt, it is %s", this, this.getClass().getSimpleName())); + } + + public Optional toKeyMergePointStmt() { + return Optional.empty(); + } + + public void ifKeyMergePointStmt(Consumer action) {} + + public boolean isKeyMethodCallStmt() { + return false; + } + + public KeyMethodCallStmt asKeyMethodCallStmt() { + throw new IllegalStateException( + f("%s is not KeyMethodCallStmt, it is %s", this, this.getClass().getSimpleName())); + } + + public Optional toKeyMethodCallStmt() { + return Optional.empty(); + } + + public void ifKeyMethodCallStmt(Consumer action) {} + + public boolean isKeyTransactionStmt() { + return false; + } + + public KeyTransactionStmt asKeyTransactionStmt() { + throw new IllegalStateException(f( + "%s is not KeyTransactionStmt, it is %s", this, this.getClass().getSimpleName())); + } + + public Optional toKeyTransactionStmt() { + return Optional.empty(); + } + + public void ifKeyTransactionStmt(Consumer action) {} } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java index feb168c46e..e27b9ac0a4 100644 Binary files a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java and b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java differ diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java index 50f473a36e..246fae6bb8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java @@ -43,39 +43,15 @@ */ public class ModifierValidator extends VisitorValidator { - private final Modifier.Keyword[] interfaceWithNothingSpecial = new Modifier.Keyword[] { - PUBLIC, - PROTECTED, + private final Modifier.DefaultKeyword[] interfaceWithNothingSpecial = new Modifier.DefaultKeyword[] { // JML + // JML + PUBLIC, // JML + PROTECTED, // JML ABSTRACT, FINAL, SYNCHRONIZED, NATIVE, - STRICTFP, // JML - JML_PURE, - JML_STRICTLY_PURE, - JML_NULLABLE, - JML_NULLABLE_BY_DEFAULT, - JML_NON_NULL, - JML_NON_NULL_ELEMENTS, - JML_HELPER, - JML_TWO_STATE, - JML_NO_STATE, - JML_SPEC_PACKAGE, - JML_SPEC_PRIVATE, - JML_SPEC_PUBLIC, - JML_SPEC_PRIVATE - }; - - private final Modifier.Keyword[] interfaceWithStaticAndDefault = new Modifier.Keyword[] { - PUBLIC, - PROTECTED, - ABSTRACT, - STATIC, - FINAL, - SYNCHRONIZED, - NATIVE, STRICTFP, - DEFAULT, // JML JML_PURE, JML_STRICTLY_PURE, JML_NULLABLE, @@ -91,17 +67,17 @@ public class ModifierValidator extends VisitorValidator { JML_SPEC_PRIVATE }; - private final Modifier.Keyword[] interfaceWithStaticAndDefaultAndPrivate = new Modifier.Keyword[] { - PUBLIC, - PROTECTED, - PRIVATE, - ABSTRACT, - STATIC, + private final Modifier.DefaultKeyword[] interfaceWithStaticAndDefault = new Modifier.DefaultKeyword[] { // JML + // JML + PUBLIC, // JML + PROTECTED, // JML + ABSTRACT, // JML + STATIC, // JML FINAL, SYNCHRONIZED, NATIVE, STRICTFP, - DEFAULT, // JML + DEFAULT, JML_PURE, JML_STRICTLY_PURE, JML_NULLABLE, @@ -117,6 +93,34 @@ public class ModifierValidator extends VisitorValidator { JML_SPEC_PRIVATE }; + private final Modifier.DefaultKeyword[] interfaceWithStaticAndDefaultAndPrivate = + new Modifier.DefaultKeyword[] { // JML + // JML + PUBLIC, // JML + PROTECTED, // JML + PRIVATE, // JML + ABSTRACT, // JML + STATIC, // JML + FINAL, + SYNCHRONIZED, + NATIVE, + STRICTFP, + DEFAULT, + JML_PURE, + JML_STRICTLY_PURE, + JML_NULLABLE, + JML_NULLABLE_BY_DEFAULT, + JML_NON_NULL, + JML_NON_NULL_ELEMENTS, + JML_HELPER, + JML_TWO_STATE, + JML_NO_STATE, + JML_SPEC_PACKAGE, + JML_SPEC_PRIVATE, + JML_SPEC_PUBLIC, + JML_SPEC_PRIVATE + }; + private final boolean hasStrictfp; private final boolean hasDefaultAndStaticInterfaceMethods; @@ -142,15 +146,17 @@ public void visit(ClassOrInterfaceDeclaration n, ProblemReporter reporter) { private void validateClassModifiers(ClassOrInterfaceDeclaration n, ProblemReporter reporter) { if (n.isTopLevelType()) { - validateModifiers( - n, - reporter, - PUBLIC, + // JML + // JML + validateModifiers( // JML + n, // JML + reporter, // JML + PUBLIC, // JML ABSTRACT, FINAL, STRICTFP, SEALED, - NON_SEALED, // JML + NON_SEALED, JML_PURE, JML_STRICTLY_PURE, JML_NULLABLE, @@ -165,18 +171,20 @@ private void validateClassModifiers(ClassOrInterfaceDeclaration n, ProblemReport JML_SPEC_PUBLIC, JML_SPEC_PRIVATE); } else if (n.isNestedType()) { - validateModifiers( - n, - reporter, - PUBLIC, - PROTECTED, - PRIVATE, - ABSTRACT, + // JML + // JML + validateModifiers( // JML + n, // JML + reporter, // JML + PUBLIC, // JML + PROTECTED, // JML + PRIVATE, // JML + ABSTRACT, // JML STATIC, FINAL, STRICTFP, SEALED, - NON_SEALED, // JML + NON_SEALED, JML_PURE, JML_STRICTLY_PURE, JML_NULLABLE, @@ -191,14 +199,16 @@ private void validateClassModifiers(ClassOrInterfaceDeclaration n, ProblemReport JML_SPEC_PUBLIC, JML_SPEC_PRIVATE); } else if (n.isLocalClassDeclaration()) { - validateModifiers( - n, - reporter, + // JML + // JML + validateModifiers( // JML + n, // JML + reporter, // JML ABSTRACT, FINAL, STRICTFP, SEALED, - NON_SEALED, // JML + NON_SEALED, JML_PURE, JML_STRICTLY_PURE, JML_NULLABLE, @@ -247,12 +257,14 @@ public void visit(AnnotationMemberDeclaration n, ProblemReporter reporter) { @Override public void visit(ConstructorDeclaration n, ProblemReporter reporter) { - validateModifiers( + // JML + // JML + validateModifiers( // JML n, reporter, PUBLIC, PROTECTED, - PRIVATE, // JML + PRIVATE, JML_PURE, JML_STRICTLY_PURE, JML_NULLABLE, @@ -329,7 +341,7 @@ public void visit(MethodDeclaration n, ProblemReporter reporter) { if (n.isAbstract()) { final SeparatedItemStringBuilder builder = new SeparatedItemStringBuilder("Cannot be 'abstract' and also '", "', '", "'."); - for (Modifier.Keyword m : asList(PRIVATE, STATIC, FINAL, NATIVE, STRICTFP, SYNCHRONIZED)) { + for (Modifier.DefaultKeyword m : asList(PRIVATE, STATIC, FINAL, NATIVE, STRICTFP, SYNCHRONIZED)) { if (n.hasModifier(m)) { builder.append(m.asString()); } @@ -351,18 +363,20 @@ public void visit(MethodDeclaration n, ProblemReporter reporter) { validateModifiers(n, reporter, interfaceWithNothingSpecial); } } else { - validateModifiers( - n, - reporter, - PUBLIC, - PROTECTED, - PRIVATE, - ABSTRACT, + // JML + // JML + validateModifiers( // JML + n, // JML + reporter, // JML + PUBLIC, // JML + PROTECTED, // JML + PRIVATE, // JML + ABSTRACT, // JML STATIC, FINAL, SYNCHRONIZED, NATIVE, - STRICTFP, // JML + STRICTFP, JML_PURE, JML_STRICTLY_PURE, JML_NULLABLE, @@ -419,7 +433,7 @@ public void visit(ModuleRequiresDirective n, ProblemReporter reporter) { } private & NodeWithTokenRange> void validateModifiers( - T n, ProblemReporter reporter, Modifier.Keyword... allowedModifiers) { + T n, ProblemReporter reporter, Modifier.DefaultKeyword... allowedModifiers) { validateAtMostOneOf(n, reporter, PUBLIC, PROTECTED, PRIVATE); validateAtMostOneOf(n, reporter, FINAL, ABSTRACT); validateAtMostOneOf(n, reporter, JML_INSTANCE, STATIC); @@ -436,10 +450,11 @@ private & NodeWithTokenRange> void validateMo } } - private Modifier.Keyword[] removeModifierFromArray(Modifier.Keyword m, Modifier.Keyword[] allowedModifiers) { - final List newModifiers = new ArrayList<>(asList(allowedModifiers)); + private Modifier.DefaultKeyword[] removeModifierFromArray( + Modifier.DefaultKeyword m, Modifier.DefaultKeyword[] allowedModifiers) { + final List newModifiers = new ArrayList<>(asList(allowedModifiers)); newModifiers.remove(m); - allowedModifiers = newModifiers.toArray(new Modifier.Keyword[0]); + allowedModifiers = newModifiers.toArray(new Modifier.DefaultKeyword[0]); return allowedModifiers; } @@ -454,15 +469,15 @@ private boolean arrayContains(Object[] items, Object searchItem) { private & NodeWithTokenRange> void validateAtMostOneOf( T t, ProblemReporter reporter, Modifier.DefaultKeyword... modifiers) { - List foundModifiers = new ArrayList<>(); - for (Modifier.Keyword m : modifiers) { + List foundModifiers = new ArrayList<>(); + for (Modifier.DefaultKeyword m : modifiers) { if (t.hasModifier(m)) { foundModifiers.add(m); } } if (foundModifiers.size() > 1) { SeparatedItemStringBuilder builder = new SeparatedItemStringBuilder("Can have only one of '", "', '", "'."); - for (Modifier.Keyword m : foundModifiers) { + for (Modifier.DefaultKeyword m : foundModifiers) { builder.append(m.asString()); } reporter.report(t, builder.toString()); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java index 40d21fa01e..c334ae6c35 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java @@ -35,6 +35,7 @@ import com.github.javaparser.ast.jml.clauses.JmlSignalsOnlyClause; import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -1543,13 +1544,13 @@ public Visitable visit(final JmlQuantifiedExpr n, final Object arg) { @Override public Visitable visit(final JmlClauseLabel n, final Object arg) { - Expression expr = cloneNode(n.getExpr(), arg); + Expression expression = cloneNode(n.getExpression(), arg); SimpleName label = cloneNode(n.getLabel(), arg); SimpleName name = cloneNode(n.getName(), arg); NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - JmlClauseLabel r = new JmlClauseLabel(n.getTokenRange().orElse(null), n.getKind(), label, expr); + JmlClauseLabel r = new JmlClauseLabel(n.getTokenRange().orElse(null), n.getKind(), label, expression); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -1713,12 +1714,12 @@ public Visitable visit(final JmlRefiningStmt n, final Object arg) { @Override public Visitable visit(final JmlClauseIf n, final Object arg) { Expression condition = cloneNode(n.getCondition(), arg); - Expression then = cloneNode(n.getThen(), arg); + Expression expression = cloneNode(n.getExpression(), arg); SimpleName name = cloneNode(n.getName(), arg); NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - JmlClauseIf r = new JmlClauseIf(n.getTokenRange().orElse(null), name, condition, n.getKind(), then); + JmlClauseIf r = new JmlClauseIf(n.getTokenRange().orElse(null), name, condition, n.getKind(), expression); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -1980,13 +1981,13 @@ public Visitable visit(final KeyCcatchReturn n, final Object arg) { } @Override - public Visitable visit(final KeyCatchAllStatement n, final Object arg) { + public Visitable visit(final KeyCatchAllStmt n, final Object arg) { BlockStmt block = cloneNode(n.getBlock(), arg); Name label = cloneNode(n.getLabel(), arg); NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - KeyCatchAllStatement r = new KeyCatchAllStatement(n.getTokenRange().orElse(null), label, block); + KeyCatchAllStmt r = new KeyCatchAllStmt(n.getTokenRange().orElse(null), label, block); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -2008,13 +2009,13 @@ public Visitable visit(final KeyEscapeExpression n, final Object arg) { } @Override - public Visitable visit(final KeyExecStatement n, final Object arg) { + public Visitable visit(final KeyExecStmt n, final Object arg) { NodeList branches = cloneList(n.getBranches(), arg); BlockStmt execBlock = cloneNode(n.getExecBlock(), arg); NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - KeyExecStatement r = new KeyExecStatement(n.getTokenRange().orElse(null), execBlock, branches); + KeyExecStmt r = new KeyExecStmt(n.getTokenRange().orElse(null), execBlock, branches); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -2037,13 +2038,13 @@ public Visitable visit(final KeyExecutionContext n, final Object arg) { } @Override - public Visitable visit(final KeyLoopScopeBlock n, final Object arg) { + public Visitable visit(final KeyLoopScopeBlockStmt n, final Object arg) { BlockStmt block = cloneNode(n.getBlock(), arg); Expression indexPV = cloneNode(n.getIndexPV(), arg); NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - KeyLoopScopeBlock r = new KeyLoopScopeBlock(n.getTokenRange().orElse(null), indexPV, block); + KeyLoopScopeBlockStmt r = new KeyLoopScopeBlockStmt(n.getTokenRange().orElse(null), indexPV, block); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -2051,12 +2052,12 @@ public Visitable visit(final KeyLoopScopeBlock n, final Object arg) { } @Override - public Visitable visit(final KeyMergePointStatement n, final Object arg) { + public Visitable visit(final KeyMergePointStmt n, final Object arg) { Expression expr = cloneNode(n.getExpr(), arg); NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - KeyMergePointStatement r = new KeyMergePointStatement(n.getTokenRange().orElse(null), expr); + KeyMergePointStmt r = new KeyMergePointStmt(n.getTokenRange().orElse(null), expr); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -2079,14 +2080,14 @@ public Visitable visit(final KeyMethodBodyStatement n, final Object arg) { } @Override - public Visitable visit(final KeyMethodCallStatement n, final Object arg) { + public Visitable visit(final KeyMethodCallStmt n, final Object arg) { BlockStmt block = cloneNode(n.getBlock(), arg); KeyAbstractExecutionContext context = cloneNode(n.getContext(), arg); Name name = cloneNode(n.getName(), arg); NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - KeyMethodCallStatement r = new KeyMethodCallStatement(n.getTokenRange().orElse(null), name, context, block); + KeyMethodCallStmt r = new KeyMethodCallStmt(n.getTokenRange().orElse(null), name, context, block); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -2108,26 +2109,11 @@ public Visitable visit(final KeyMethodSignature n, final Object arg) { } @Override - public Visitable visit(final KeyRangeExpression n, final Object arg) { - Expression lower = cloneNode(n.getLower(), arg); - Expression upper = cloneNode(n.getUpper(), arg); - NodeList associatedSpecificationComments = - cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); - Comment comment = cloneNode(n.getComment(), arg); - KeyRangeExpression r = new KeyRangeExpression(n.getTokenRange().orElse(null), lower, upper); - r.setComment(comment); - n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); - copyData(n, r); - return r; - } - - @Override - public Visitable visit(final KeyTransactionStatement n, final Object arg) { + public Visitable visit(final KeyTransactionStmt n, final Object arg) { NodeList associatedSpecificationComments = cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); - KeyTransactionStatement r = - new KeyTransactionStatement(n.getTokenRange().orElse(null), n.getType()); + KeyTransactionStmt r = new KeyTransactionStmt(n.getTokenRange().orElse(null), n.getType()); r.setComment(comment); n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); copyData(n, r); @@ -2376,18 +2362,6 @@ public Visitable visit(final JmlDocStmt n, final Object arg) { return r; } - @Override - public Visitable visit(final JmlDoc n, final Object arg) { - NodeList associatedSpecificationComments = - cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); - Comment comment = cloneNode(n.getComment(), arg); - JmlDoc r = new JmlDoc(n.getTokenRange().orElse(null), n.getContent()); - r.setComment(comment); - n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); - copyData(n, r); - return r; - } - @Override public Visitable visit(final JmlDocType n, final Object arg) { NodeList jmlComments = cloneList(n.getJmlComments(), arg); @@ -2518,4 +2492,28 @@ public Visitable visit(final JmlMethodSignature n, final Object arg) { copyData(n, r); return r; } + + @Override + public Visitable visit(final JmlDoc n, final Object arg) { + NodeList associatedSpecificationComments = + cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); + Comment comment = cloneNode(n.getComment(), arg); + JmlDoc r = new JmlDoc(n.getTokenRange().orElse(null), n.getContent()); + r.setComment(comment); + n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); + copyData(n, r); + return r; + } + + @Override + public Visitable visit(final KeYMarkerStatement n, final Object arg) { + NodeList associatedSpecificationComments = + cloneList(n.getAssociatedSpecificationComments().orElse(null), arg); + Comment comment = cloneNode(n.getComment(), arg); + KeYMarkerStatement r = new KeYMarkerStatement(n.getTokenRange().orElse(null), n.getKind()); + r.setComment(comment); + n.getOrphanComments().stream().map(Comment::clone).forEach(r::addOrphanComment); + copyData(n, r); + return r; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java index 607a3f9ecb..4b156d1768 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java @@ -30,6 +30,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -1163,7 +1164,7 @@ public Boolean visit(final TypePatternExpr n, final Visitable arg) { @Override public Boolean visit(final JmlClauseLabel n, final Visitable arg) { final JmlClauseLabel n2 = (JmlClauseLabel) arg; - if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; + if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; if (!objEquals(n.getKind(), n2.getKind())) return false; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1300,8 +1301,8 @@ public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { public Boolean visit(final JmlClauseIf n, final Visitable arg) { final JmlClauseIf n2 = (JmlClauseIf) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; + if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; if (!objEquals(n.getKind(), n2.getKind())) return false; - if (!nodeEquals(n.getThen(), n2.getThen())) return false; if (!nodeEquals(n.getName(), n2.getName())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; if (!nodeEquals(n.getComment(), n2.getComment())) return false; @@ -1455,8 +1456,8 @@ public Boolean visit(final KeyCcatchReturn n, final Visitable arg) { } @Override - public Boolean visit(final KeyCatchAllStatement n, final Visitable arg) { - final KeyCatchAllStatement n2 = (KeyCatchAllStatement) arg; + public Boolean visit(final KeyCatchAllStmt n, final Visitable arg) { + final KeyCatchAllStmt n2 = (KeyCatchAllStmt) arg; if (!nodeEquals(n.getBlock(), n2.getBlock())) return false; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; @@ -1475,8 +1476,8 @@ public Boolean visit(final KeyEscapeExpression n, final Visitable arg) { } @Override - public Boolean visit(final KeyExecStatement n, final Visitable arg) { - final KeyExecStatement n2 = (KeyExecStatement) arg; + public Boolean visit(final KeyExecStmt n, final Visitable arg) { + final KeyExecStmt n2 = (KeyExecStmt) arg; if (!nodesEquals(n.getBranches(), n2.getBranches())) return false; if (!nodeEquals(n.getExecBlock(), n2.getExecBlock())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; @@ -1496,8 +1497,8 @@ public Boolean visit(final KeyExecutionContext n, final Visitable arg) { } @Override - public Boolean visit(final KeyLoopScopeBlock n, final Visitable arg) { - final KeyLoopScopeBlock n2 = (KeyLoopScopeBlock) arg; + public Boolean visit(final KeyLoopScopeBlockStmt n, final Visitable arg) { + final KeyLoopScopeBlockStmt n2 = (KeyLoopScopeBlockStmt) arg; if (!nodeEquals(n.getBlock(), n2.getBlock())) return false; if (!nodeEquals(n.getIndexPV(), n2.getIndexPV())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; @@ -1506,8 +1507,8 @@ public Boolean visit(final KeyLoopScopeBlock n, final Visitable arg) { } @Override - public Boolean visit(final KeyMergePointStatement n, final Visitable arg) { - final KeyMergePointStatement n2 = (KeyMergePointStatement) arg; + public Boolean visit(final KeyMergePointStmt n, final Visitable arg) { + final KeyMergePointStmt n2 = (KeyMergePointStmt) arg; if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; if (!nodeEquals(n.getComment(), n2.getComment())) return false; @@ -1526,8 +1527,8 @@ public Boolean visit(final KeyMethodBodyStatement n, final Visitable arg) { } @Override - public Boolean visit(final KeyMethodCallStatement n, final Visitable arg) { - final KeyMethodCallStatement n2 = (KeyMethodCallStatement) arg; + public Boolean visit(final KeyMethodCallStmt n, final Visitable arg) { + final KeyMethodCallStmt n2 = (KeyMethodCallStmt) arg; if (!nodeEquals(n.getBlock(), n2.getBlock())) return false; if (!nodeEquals(n.getContext(), n2.getContext())) return false; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1547,18 +1548,8 @@ public Boolean visit(final KeyMethodSignature n, final Visitable arg) { } @Override - public Boolean visit(final KeyRangeExpression n, final Visitable arg) { - final KeyRangeExpression n2 = (KeyRangeExpression) arg; - if (!nodeEquals(n.getLower(), n2.getLower())) return false; - if (!nodeEquals(n.getUpper(), n2.getUpper())) return false; - if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; - if (!nodeEquals(n.getComment(), n2.getComment())) return false; - return true; - } - - @Override - public Boolean visit(final KeyTransactionStatement n, final Visitable arg) { - final KeyTransactionStatement n2 = (KeyTransactionStatement) arg; + public Boolean visit(final KeyTransactionStmt n, final Visitable arg) { + final KeyTransactionStmt n2 = (KeyTransactionStmt) arg; if (!objEquals(n.getType(), n2.getType())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; if (!nodeEquals(n.getComment(), n2.getComment())) return false; @@ -1772,15 +1763,6 @@ public Boolean visit(final JmlDocStmt n, final Visitable arg) { return true; } - @Override - public Boolean visit(final JmlDoc n, final Visitable arg) { - final JmlDoc n2 = (JmlDoc) arg; - if (!objEquals(n.getContent(), n2.getContent())) return false; - if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; - if (!nodeEquals(n.getComment(), n2.getComment())) return false; - return true; - } - @Override public Boolean visit(final JmlDocType n, final Visitable arg) { final JmlDocType n2 = (JmlDocType) arg; @@ -1874,4 +1856,22 @@ public Boolean visit(final JmlMethodSignature n, final Visitable arg) { if (!nodeEquals(n.getComment(), n2.getComment())) return false; return true; } + + @Override + public Boolean visit(final JmlDoc n, final Visitable arg) { + final JmlDoc n2 = (JmlDoc) arg; + if (!objEquals(n.getContent(), n2.getContent())) return false; + if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; + if (!nodeEquals(n.getComment(), n2.getComment())) return false; + return true; + } + + @Override + public Boolean visit(final KeYMarkerStatement n, final Visitable arg) { + final KeYMarkerStatement n2 = (KeYMarkerStatement) arg; + if (!objEquals(n.getKind(), n2.getKind())) return false; + if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; + if (!nodeEquals(n.getComment(), n2.getComment())) return false; + return true; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java index 222ddf14cc..d2e63b0ff0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java @@ -2048,7 +2048,7 @@ public List visit(final WildcardType n, final A arg) { } @Override - public List visit(NodeList n, A arg) { + public List visit(NodeList n, A arg) { return ((NodeList) n) .stream() .filter(Objects::nonNull) @@ -2382,7 +2382,7 @@ public List visit(final JmlClauseLabel n, final A arg) { List result = new ArrayList<>(); List tmp; { - tmp = n.getExpr().accept(this, arg); + tmp = n.getExpression().accept(this, arg); if (tmp != null) result.addAll(tmp); } if (n.getLabel().isPresent()) { @@ -2662,7 +2662,7 @@ public List visit(final JmlClauseIf n, final A arg) { if (tmp != null) result.addAll(tmp); } { - tmp = n.getThen().accept(this, arg); + tmp = n.getExpression().accept(this, arg); if (tmp != null) result.addAll(tmp); } if (n.getName().isPresent()) { @@ -3053,7 +3053,7 @@ public List visit(final KeyCcatchReturn n, final A arg) { } @Override - public List visit(final KeyCatchAllStatement n, final A arg) { + public List visit(final KeyCatchAllStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3099,7 +3099,7 @@ public List visit(final KeyEscapeExpression n, final A arg) { } @Override - public List visit(final KeyExecStatement n, final A arg) { + public List visit(final KeyExecStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3149,7 +3149,7 @@ public List visit(final KeyExecutionContext n, final A arg) { } @Override - public List visit(final KeyLoopScopeBlock n, final A arg) { + public List visit(final KeyLoopScopeBlockStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3172,7 +3172,7 @@ public List visit(final KeyLoopScopeBlock n, final A arg) { } @Override - public List visit(final KeyMergePointStatement n, final A arg) { + public List visit(final KeyMergePointStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3218,7 +3218,7 @@ public List visit(final KeyMethodBodyStatement n, final A arg) { } @Override - public List visit(final KeyMethodCallStatement n, final A arg) { + public List visit(final KeyMethodCallStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3268,30 +3268,7 @@ public List visit(final KeyMethodSignature n, final A arg) { } @Override - public List visit(final KeyRangeExpression n, final A arg) { - List result = new ArrayList<>(); - List tmp; - { - tmp = n.getLower().accept(this, arg); - if (tmp != null) result.addAll(tmp); - } - { - tmp = n.getUpper().accept(this, arg); - if (tmp != null) result.addAll(tmp); - } - if (n.getAssociatedSpecificationComments().isPresent()) { - tmp = n.getAssociatedSpecificationComments().get().accept(this, arg); - if (tmp != null) result.addAll(tmp); - } - if (n.getComment().isPresent()) { - tmp = n.getComment().get().accept(this, arg); - if (tmp != null) result.addAll(tmp); - } - return result; - } - - @Override - public List visit(final KeyTransactionStatement n, final A arg) { + public List visit(final KeyTransactionStmt n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getAssociatedSpecificationComments().isPresent()) { @@ -3957,4 +3934,19 @@ public List visit(final JmlMethodSignature n, final A arg) { } return result; } + + @Override + public List visit(final KeYMarkerStatement n, final A arg) { + List result = new ArrayList<>(); + List tmp; + if (n.getAssociatedSpecificationComments().isPresent()) { + tmp = n.getAssociatedSpecificationComments().get().accept(this, arg); + if (tmp != null) result.addAll(tmp); + } + if (n.getComment().isPresent()) { + tmp = n.getComment().get().accept(this, arg); + if (tmp != null) result.addAll(tmp); + } + return result; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java index fe57ecd673..305ecdae76 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java @@ -28,10 +28,8 @@ import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; +import com.github.javaparser.ast.jml.doc.*; import com.github.javaparser.ast.jml.doc.JmlDoc; -import com.github.javaparser.ast.jml.doc.JmlDocDeclaration; -import com.github.javaparser.ast.jml.doc.JmlDocStmt; -import com.github.javaparser.ast.jml.doc.JmlDocType; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -216,7 +214,7 @@ public interface GenericVisitor { R visit(TypeExpr n, A arg); - R visit(NodeList n, A arg); + R visit(NodeList n, A arg); R visit(Name n, A arg); @@ -266,27 +264,25 @@ public interface GenericVisitor { R visit(KeyCcatchReturn n, A arg); - R visit(KeyCatchAllStatement n, A arg); + R visit(KeyCatchAllStmt n, A arg); R visit(KeyEscapeExpression n, A arg); - R visit(KeyExecStatement n, A arg); + R visit(KeyExecStmt n, A arg); R visit(KeyExecutionContext n, A arg); - R visit(KeyLoopScopeBlock n, A arg); + R visit(KeyLoopScopeBlockStmt n, A arg); - R visit(KeyMergePointStatement n, A arg); + R visit(KeyMergePointStmt n, A arg); R visit(KeyMethodBodyStatement n, A arg); - R visit(KeyMethodCallStatement n, A arg); + R visit(KeyMethodCallStmt n, A arg); R visit(KeyMethodSignature n, A arg); - R visit(KeyRangeExpression n, A arg); - - R visit(KeyTransactionStatement n, A arg); + R visit(KeyTransactionStmt n, A arg); R visit(KeyContextStatementBlock n, A arg); @@ -383,4 +379,6 @@ public interface GenericVisitor { R visit(JmlLabelStmt n, A arg); R visit(JmlMethodSignature n, A arg); + + R visit(KeYMarkerStatement n, A arg); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java index 8c71a81a3c..306b809feb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java @@ -1961,7 +1961,7 @@ public R visit(final LineComment n, final A arg) { } @Override - public R visit(NodeList n, A arg) { + public R visit(NodeList n, A arg) { for (final Object v : n) { R result = ((Node) v).accept(this, arg); if (result != null) { @@ -2281,7 +2281,7 @@ public R visit(final JmlQuantifiedExpr n, final A arg) { public R visit(final JmlClauseLabel n, final A arg) { R result; { - result = n.getExpr().accept(this, arg); + result = n.getExpression().accept(this, arg); if (result != null) return result; } if (n.getLabel().isPresent()) { @@ -2549,7 +2549,7 @@ public R visit(final JmlClauseIf n, final A arg) { if (result != null) return result; } { - result = n.getThen().accept(this, arg); + result = n.getExpression().accept(this, arg); if (result != null) return result; } if (n.getName().isPresent()) { @@ -2928,7 +2928,7 @@ public R visit(final KeyCcatchReturn n, final A arg) { } @Override - public R visit(final KeyCatchAllStatement n, final A arg) { + public R visit(final KeyCatchAllStmt n, final A arg) { R result; { result = n.getBlock().accept(this, arg); @@ -2972,7 +2972,7 @@ public R visit(final KeyEscapeExpression n, final A arg) { } @Override - public R visit(final KeyExecStatement n, final A arg) { + public R visit(final KeyExecStmt n, final A arg) { R result; { result = n.getBranches().accept(this, arg); @@ -3020,7 +3020,7 @@ public R visit(final KeyExecutionContext n, final A arg) { } @Override - public R visit(final KeyLoopScopeBlock n, final A arg) { + public R visit(final KeyLoopScopeBlockStmt n, final A arg) { R result; { result = n.getBlock().accept(this, arg); @@ -3042,7 +3042,7 @@ public R visit(final KeyLoopScopeBlock n, final A arg) { } @Override - public R visit(final KeyMergePointStatement n, final A arg) { + public R visit(final KeyMergePointStmt n, final A arg) { R result; { result = n.getExpr().accept(this, arg); @@ -3086,7 +3086,7 @@ public R visit(final KeyMethodBodyStatement n, final A arg) { } @Override - public R visit(final KeyMethodCallStatement n, final A arg) { + public R visit(final KeyMethodCallStmt n, final A arg) { R result; { result = n.getBlock().accept(this, arg); @@ -3134,29 +3134,7 @@ public R visit(final KeyMethodSignature n, final A arg) { } @Override - public R visit(final KeyRangeExpression n, final A arg) { - R result; - { - result = n.getLower().accept(this, arg); - if (result != null) return result; - } - { - result = n.getUpper().accept(this, arg); - if (result != null) return result; - } - if (n.getAssociatedSpecificationComments().isPresent()) { - result = n.getAssociatedSpecificationComments().get().accept(this, arg); - if (result != null) return result; - } - if (n.getComment().isPresent()) { - result = n.getComment().get().accept(this, arg); - if (result != null) return result; - } - return null; - } - - @Override - public R visit(final KeyTransactionStatement n, final A arg) { + public R visit(final KeyTransactionStmt n, final A arg) { R result; if (n.getAssociatedSpecificationComments().isPresent()) { result = n.getAssociatedSpecificationComments().get().accept(this, arg); @@ -3790,4 +3768,18 @@ public R visit(final JmlMethodSignature n, final A arg) { } return null; } + + @Override + public R visit(final KeYMarkerStatement n, final A arg) { + R result; + if (n.getAssociatedSpecificationComments().isPresent()) { + result = n.getAssociatedSpecificationComments().get().accept(this, arg); + if (result != null) return result; + } + if (n.getComment().isPresent()) { + result = n.getComment().get().accept(this, arg); + if (result != null) return result; + } + return null; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java index cc7156cb3b..399bd5e1ee 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java @@ -22,11 +22,17 @@ import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; -import com.github.javaparser.ast.comments.*; +import com.github.javaparser.ast.comments.BlockComment; +import com.github.javaparser.ast.comments.LineComment; +import com.github.javaparser.ast.comments.MarkdownComment; +import com.github.javaparser.ast.comments.TraditionalJavadocComment; import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; -import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; +import com.github.javaparser.ast.jml.doc.JmlDocDeclaration; +import com.github.javaparser.ast.jml.doc.JmlDocStmt; +import com.github.javaparser.ast.jml.doc.JmlDocType; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -471,7 +477,7 @@ public R visit(final LineComment n, final A arg) { } @Override - public R visit(NodeList n, A arg) { + public R visit(NodeList n, A arg) { return defaultAction(n, arg); } @@ -691,7 +697,7 @@ public R visit(final KeyCcatchReturn n, final A arg) { } @Override - public R visit(final KeyCatchAllStatement n, final A arg) { + public R visit(final KeyCatchAllStmt n, final A arg) { return defaultAction(n, arg); } @@ -701,7 +707,7 @@ public R visit(final KeyEscapeExpression n, final A arg) { } @Override - public R visit(final KeyExecStatement n, final A arg) { + public R visit(final KeyExecStmt n, final A arg) { return defaultAction(n, arg); } @@ -711,12 +717,12 @@ public R visit(final KeyExecutionContext n, final A arg) { } @Override - public R visit(final KeyLoopScopeBlock n, final A arg) { + public R visit(final KeyLoopScopeBlockStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final KeyMergePointStatement n, final A arg) { + public R visit(final KeyMergePointStmt n, final A arg) { return defaultAction(n, arg); } @@ -726,7 +732,7 @@ public R visit(final KeyMethodBodyStatement n, final A arg) { } @Override - public R visit(final KeyMethodCallStatement n, final A arg) { + public R visit(final KeyMethodCallStmt n, final A arg) { return defaultAction(n, arg); } @@ -736,12 +742,7 @@ public R visit(final KeyMethodSignature n, final A arg) { } @Override - public R visit(final KeyRangeExpression n, final A arg) { - return defaultAction(n, arg); - } - - @Override - public R visit(final KeyTransactionStatement n, final A arg) { + public R visit(final KeyTransactionStmt n, final A arg) { return defaultAction(n, arg); } @@ -884,4 +885,9 @@ public R visit(final JmlLabelStmt n, final A arg) { public R visit(final JmlMethodSignature n, final A arg) { return defaultAction(n, arg); } + + @Override + public R visit(final KeYMarkerStatement n, final A arg) { + return defaultAction(n, arg); + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java index 2fb9fef203..c2d6463d07 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java @@ -30,6 +30,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -667,7 +668,7 @@ public Integer visit(final Name n, final Void arg) { + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(NodeList n, Void arg) { + public Integer visit(NodeList n, Void arg) { int result = 0; for (Object node : n) { result += 31 * ((Visitable) node).accept(this, arg); @@ -1117,7 +1118,7 @@ public Integer visit(final JmlQuantifiedExpr n, final Void arg) { @Override public Integer visit(final JmlClauseLabel n, final Void arg) { - return (n.getExpr().accept(this, arg)) * 31 + return (n.getExpression().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 @@ -1255,8 +1256,8 @@ public Integer visit(final JmlRefiningStmt n, final Void arg) { @Override public Integer visit(final JmlClauseIf n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + + (n.getExpression().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 - + (n.getThen().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getAssociatedSpecificationComments().isPresent() ? n.getAssociatedSpecificationComments().get().accept(this, arg) @@ -1438,7 +1439,7 @@ public Integer visit(final KeyCcatchReturn n, final Void arg) { } @Override - public Integer visit(final KeyCatchAllStatement n, final Void arg) { + public Integer visit(final KeyCatchAllStmt n, final Void arg) { return (n.getBlock().accept(this, arg)) * 31 + (n.getLabel().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() @@ -1460,7 +1461,7 @@ public Integer visit(final KeyEscapeExpression n, final Void arg) { } @Override - public Integer visit(final KeyExecStatement n, final Void arg) { + public Integer visit(final KeyExecStmt n, final Void arg) { return (n.getBranches().accept(this, arg)) * 31 + (n.getExecBlock().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() @@ -1483,7 +1484,7 @@ public Integer visit(final KeyExecutionContext n, final Void arg) { } @Override - public Integer visit(final KeyLoopScopeBlock n, final Void arg) { + public Integer visit(final KeyLoopScopeBlockStmt n, final Void arg) { return (n.getBlock().accept(this, arg)) * 31 + (n.getIndexPV().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() @@ -1494,7 +1495,7 @@ public Integer visit(final KeyLoopScopeBlock n, final Void arg) { } @Override - public Integer visit(final KeyMergePointStatement n, final Void arg) { + public Integer visit(final KeyMergePointStmt n, final Void arg) { return (n.getExpr().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() ? n.getAssociatedSpecificationComments().get().accept(this, arg) @@ -1516,7 +1517,7 @@ public Integer visit(final KeyMethodBodyStatement n, final Void arg) { } @Override - public Integer visit(final KeyMethodCallStatement n, final Void arg) { + public Integer visit(final KeyMethodCallStmt n, final Void arg) { return (n.getBlock().accept(this, arg)) * 31 + (n.getContext().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 @@ -1539,18 +1540,7 @@ public Integer visit(final KeyMethodSignature n, final Void arg) { } @Override - public Integer visit(final KeyRangeExpression n, final Void arg) { - return (n.getLower().accept(this, arg)) * 31 - + (n.getUpper().accept(this, arg)) * 31 - + (n.getAssociatedSpecificationComments().isPresent() - ? n.getAssociatedSpecificationComments().get().accept(this, arg) - : 0) - * 31 - + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); - } - - @Override - public Integer visit(final KeyTransactionStatement n, final Void arg) { + public Integer visit(final KeyTransactionStmt n, final Void arg) { return (n.getType().hashCode()) * 31 + (n.getAssociatedSpecificationComments().isPresent() ? n.getAssociatedSpecificationComments().get().accept(this, arg) @@ -1887,4 +1877,14 @@ public Integer visit(final JmlMethodSignature n, final Void arg) { * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } + + @Override + public Integer visit(final KeYMarkerStatement n, final Void arg) { + return n.getKind() * 31 + + (n.getAssociatedSpecificationComments().isPresent() + ? n.getAssociatedSpecificationComments().get().accept(this, arg) + : 0) + * 31 + + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java index 3ea04cbd3e..03254b1122 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java @@ -34,6 +34,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -1289,7 +1290,7 @@ public Visitable visit(final TypeExpr n, final A arg) { } @Override - public Visitable visit(NodeList n, A arg) { + public Visitable visit(NodeList n, A arg) { if (n.isEmpty()) { return n; } @@ -1301,9 +1302,9 @@ public Visitable visit(NodeList n, A arg) { } for (Pair change : changeList) { if (change.b == null) { - removeElementByObjectIdentity(n, change.a); + removeElementByObjectIdentity((NodeList) n, change.a); } else { - replaceElementByObjectIdentity(n, change.a, change.b); + replaceElementByObjectIdentity((NodeList) n, change.a, change.b); } } return n; @@ -1580,7 +1581,7 @@ public Visitable visit(final KeyCcatchReturn n, final A arg) { } @Override - public Visitable visit(final KeyCatchAllStatement n, final A arg) { + public Visitable visit(final KeyCatchAllStmt n, final A arg) { BlockStmt block = (BlockStmt) n.getBlock().accept(this, arg); Name label = (Name) n.getLabel().accept(this, arg); NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); @@ -1608,7 +1609,7 @@ public Visitable visit(final KeyEscapeExpression n, final A arg) { } @Override - public Visitable visit(final KeyExecStatement n, final A arg) { + public Visitable visit(final KeyExecStmt n, final A arg) { NodeList branches = modifyList(n.getBranches(), arg); BlockStmt execBlock = (BlockStmt) n.getExecBlock().accept(this, arg); NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); @@ -1639,7 +1640,7 @@ public Visitable visit(final KeyExecutionContext n, final A arg) { } @Override - public Visitable visit(final KeyLoopScopeBlock n, final A arg) { + public Visitable visit(final KeyLoopScopeBlockStmt n, final A arg) { BlockStmt block = (BlockStmt) n.getBlock().accept(this, arg); Expression indexPV = (Expression) n.getIndexPV().accept(this, arg); NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); @@ -1653,7 +1654,7 @@ public Visitable visit(final KeyLoopScopeBlock n, final A arg) { } @Override - public Visitable visit(final KeyMergePointStatement n, final A arg) { + public Visitable visit(final KeyMergePointStmt n, final A arg) { Expression expr = (Expression) n.getExpr().accept(this, arg); NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1681,7 +1682,7 @@ public Visitable visit(final KeyMethodBodyStatement n, final A arg) { } @Override - public Visitable visit(final KeyMethodCallStatement n, final A arg) { + public Visitable visit(final KeyMethodCallStmt n, final A arg) { BlockStmt block = (BlockStmt) n.getBlock().accept(this, arg); KeyAbstractExecutionContext context = (KeyAbstractExecutionContext) n.getContext().accept(this, arg); @@ -1712,21 +1713,7 @@ public Visitable visit(final KeyMethodSignature n, final A arg) { } @Override - public Visitable visit(final KeyRangeExpression n, final A arg) { - Expression lower = (Expression) n.getLower().accept(this, arg); - Expression upper = (Expression) n.getUpper().accept(this, arg); - NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); - Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); - if (lower == null || upper == null) return null; - n.setLower(lower); - n.setUpper(upper); - n.setAssociatedSpecificationComments(associatedSpecificationComments); - n.setComment(comment); - return n; - } - - @Override - public Visitable visit(final KeyTransactionStatement n, final A arg) { + public Visitable visit(final KeyTransactionStmt n, final A arg) { NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setAssociatedSpecificationComments(associatedSpecificationComments); @@ -1931,14 +1918,14 @@ public Visitable visit(final MarkdownComment n, final A arg) { @Override public Visitable visit(final JmlClauseLabel n, final A arg) { - Expression expr = (Expression) n.getExpr().accept(this, arg); + Expression expression = (Expression) n.getExpression().accept(this, arg); SimpleName label = n.getLabel().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); - if (expr == null) return null; - n.setExpr(expr); + if (expression == null) return null; + n.setExpression(expression); n.setLabel(label); n.setName(name); n.setAssociatedSpecificationComments(associatedSpecificationComments); @@ -2111,13 +2098,13 @@ public Visitable visit(final JmlRefiningStmt n, final A arg) { @Override public Visitable visit(final JmlClauseIf n, final A arg) { Expression condition = (Expression) n.getCondition().accept(this, arg); - Expression then = (Expression) n.getThen().accept(this, arg); + Expression expression = (Expression) n.getExpression().accept(this, arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); - if (condition == null || then == null) return null; + if (condition == null || expression == null) return null; n.setCondition(condition); - n.setThen(then); + n.setExpression(expression); n.setName(name); n.setAssociatedSpecificationComments(associatedSpecificationComments); n.setComment(comment); @@ -2434,4 +2421,13 @@ public Visitable visit(final JmlMethodSignature n, final A arg) { n.setComment(comment); return n; } + + @Override + public Visitable visit(final KeYMarkerStatement n, final A arg) { + NodeList associatedSpecificationComments = modifyList(n.getAssociatedSpecificationComments(), arg); + Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); + n.setAssociatedSpecificationComments(associatedSpecificationComments); + n.setComment(comment); + return n; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java index de89919636..a70afb56e6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java @@ -30,6 +30,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -1015,7 +1016,7 @@ public Boolean visit(final TypePatternExpr n, final Visitable arg) { @Override public Boolean visit(final JmlClauseLabel n, final Visitable arg) { final JmlClauseLabel n2 = (JmlClauseLabel) arg; - if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; + if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; if (!objEquals(n.getKind(), n2.getKind())) return false; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1139,8 +1140,8 @@ public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { public Boolean visit(final JmlClauseIf n, final Visitable arg) { final JmlClauseIf n2 = (JmlClauseIf) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; + if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; if (!objEquals(n.getKind(), n2.getKind())) return false; - if (!nodeEquals(n.getThen(), n2.getThen())) return false; if (!nodeEquals(n.getName(), n2.getName())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; return true; @@ -1291,8 +1292,8 @@ public Boolean visit(final KeyCcatchReturn n, final Visitable arg) { } @Override - public Boolean visit(final KeyCatchAllStatement n, final Visitable arg) { - final KeyCatchAllStatement n2 = (KeyCatchAllStatement) arg; + public Boolean visit(final KeyCatchAllStmt n, final Visitable arg) { + final KeyCatchAllStmt n2 = (KeyCatchAllStmt) arg; if (!nodeEquals(n.getBlock(), n2.getBlock())) return false; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; @@ -1309,8 +1310,8 @@ public Boolean visit(final KeyEscapeExpression n, final Visitable arg) { } @Override - public Boolean visit(final KeyExecStatement n, final Visitable arg) { - final KeyExecStatement n2 = (KeyExecStatement) arg; + public Boolean visit(final KeyExecStmt n, final Visitable arg) { + final KeyExecStmt n2 = (KeyExecStmt) arg; if (!nodesEquals(n.getBranches(), n2.getBranches())) return false; if (!nodeEquals(n.getExecBlock(), n2.getExecBlock())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; @@ -1328,8 +1329,8 @@ public Boolean visit(final KeyExecutionContext n, final Visitable arg) { } @Override - public Boolean visit(final KeyLoopScopeBlock n, final Visitable arg) { - final KeyLoopScopeBlock n2 = (KeyLoopScopeBlock) arg; + public Boolean visit(final KeyLoopScopeBlockStmt n, final Visitable arg) { + final KeyLoopScopeBlockStmt n2 = (KeyLoopScopeBlockStmt) arg; if (!nodeEquals(n.getBlock(), n2.getBlock())) return false; if (!nodeEquals(n.getIndexPV(), n2.getIndexPV())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; @@ -1337,8 +1338,8 @@ public Boolean visit(final KeyLoopScopeBlock n, final Visitable arg) { } @Override - public Boolean visit(final KeyMergePointStatement n, final Visitable arg) { - final KeyMergePointStatement n2 = (KeyMergePointStatement) arg; + public Boolean visit(final KeyMergePointStmt n, final Visitable arg) { + final KeyMergePointStmt n2 = (KeyMergePointStmt) arg; if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; return true; @@ -1355,8 +1356,8 @@ public Boolean visit(final KeyMethodBodyStatement n, final Visitable arg) { } @Override - public Boolean visit(final KeyMethodCallStatement n, final Visitable arg) { - final KeyMethodCallStatement n2 = (KeyMethodCallStatement) arg; + public Boolean visit(final KeyMethodCallStmt n, final Visitable arg) { + final KeyMethodCallStmt n2 = (KeyMethodCallStmt) arg; if (!nodeEquals(n.getBlock(), n2.getBlock())) return false; if (!nodeEquals(n.getContext(), n2.getContext())) return false; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1374,17 +1375,8 @@ public Boolean visit(final KeyMethodSignature n, final Visitable arg) { } @Override - public Boolean visit(final KeyRangeExpression n, final Visitable arg) { - final KeyRangeExpression n2 = (KeyRangeExpression) arg; - if (!nodeEquals(n.getLower(), n2.getLower())) return false; - if (!nodeEquals(n.getUpper(), n2.getUpper())) return false; - if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; - return true; - } - - @Override - public Boolean visit(final KeyTransactionStatement n, final Visitable arg) { - final KeyTransactionStatement n2 = (KeyTransactionStatement) arg; + public Boolean visit(final KeyTransactionStmt n, final Visitable arg) { + final KeyTransactionStmt n2 = (KeyTransactionStmt) arg; if (!objEquals(n.getType(), n2.getType())) return false; if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; return true; @@ -1566,14 +1558,6 @@ public Boolean visit(final JmlDocStmt n, final Visitable arg) { return true; } - @Override - public Boolean visit(final JmlDoc n, final Visitable arg) { - final JmlDoc n2 = (JmlDoc) arg; - if (!objEquals(n.getContent(), n2.getContent())) return false; - if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; - return true; - } - @Override public Boolean visit(final JmlDocType n, final Visitable arg) { final JmlDocType n2 = (JmlDocType) arg; @@ -1658,4 +1642,20 @@ public Boolean visit(final JmlMethodSignature n, final Visitable arg) { if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; return true; } + + @Override + public Boolean visit(final JmlDoc n, final Visitable arg) { + final JmlDoc n2 = (JmlDoc) arg; + if (!objEquals(n.getContent(), n2.getContent())) return false; + if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; + return true; + } + + @Override + public Boolean visit(final KeYMarkerStatement n, final Visitable arg) { + final KeYMarkerStatement n2 = (KeYMarkerStatement) arg; + if (!objEquals(n.getKind(), n2.getKind())) return false; + if (!nodesEquals(n.getAssociatedSpecificationComments(), n2.getAssociatedSpecificationComments())) return false; + return true; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java index 4e5dd58d7f..34e460e615 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java @@ -30,6 +30,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -539,7 +540,7 @@ public Integer visit(final Name n, final Void arg) { : 0); } - public Integer visit(NodeList n, Void arg) { + public Integer visit(NodeList n, Void arg) { int result = 0; for (Object node : n) { result += 31 * ((Visitable) node).accept(this, arg); @@ -905,7 +906,7 @@ public Integer visit(final JmlQuantifiedExpr n, final Void arg) { @Override public Integer visit(final JmlClauseLabel n, final Void arg) { - return (n.getExpr().accept(this, arg)) * 31 + return (n.getExpression().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 @@ -1019,8 +1020,8 @@ public Integer visit(final JmlRefiningStmt n, final Void arg) { @Override public Integer visit(final JmlClauseIf n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + + (n.getExpression().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 - + (n.getThen().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getAssociatedSpecificationComments().isPresent() ? n.getAssociatedSpecificationComments().get().accept(this, arg) @@ -1164,7 +1165,7 @@ public Integer visit(final KeyCcatchReturn n, final Void arg) { } @Override - public Integer visit(final KeyCatchAllStatement n, final Void arg) { + public Integer visit(final KeyCatchAllStmt n, final Void arg) { return (n.getBlock().accept(this, arg)) * 31 + (n.getLabel().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() @@ -1182,7 +1183,7 @@ public Integer visit(final KeyEscapeExpression n, final Void arg) { } @Override - public Integer visit(final KeyExecStatement n, final Void arg) { + public Integer visit(final KeyExecStmt n, final Void arg) { return (n.getBranches().accept(this, arg)) * 31 + (n.getExecBlock().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() @@ -1201,7 +1202,7 @@ public Integer visit(final KeyExecutionContext n, final Void arg) { } @Override - public Integer visit(final KeyLoopScopeBlock n, final Void arg) { + public Integer visit(final KeyLoopScopeBlockStmt n, final Void arg) { return (n.getBlock().accept(this, arg)) * 31 + (n.getIndexPV().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() @@ -1210,7 +1211,7 @@ public Integer visit(final KeyLoopScopeBlock n, final Void arg) { } @Override - public Integer visit(final KeyMergePointStatement n, final Void arg) { + public Integer visit(final KeyMergePointStmt n, final Void arg) { return (n.getExpr().accept(this, arg)) * 31 + (n.getAssociatedSpecificationComments().isPresent() ? n.getAssociatedSpecificationComments().get().accept(this, arg) @@ -1228,7 +1229,7 @@ public Integer visit(final KeyMethodBodyStatement n, final Void arg) { } @Override - public Integer visit(final KeyMethodCallStatement n, final Void arg) { + public Integer visit(final KeyMethodCallStmt n, final Void arg) { return (n.getBlock().accept(this, arg)) * 31 + (n.getContext().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 @@ -1247,16 +1248,7 @@ public Integer visit(final KeyMethodSignature n, final Void arg) { } @Override - public Integer visit(final KeyRangeExpression n, final Void arg) { - return (n.getLower().accept(this, arg)) * 31 - + (n.getUpper().accept(this, arg)) * 31 - + (n.getAssociatedSpecificationComments().isPresent() - ? n.getAssociatedSpecificationComments().get().accept(this, arg) - : 0); - } - - @Override - public Integer visit(final KeyTransactionStatement n, final Void arg) { + public Integer visit(final KeyTransactionStmt n, final Void arg) { return (n.getType().hashCode()) * 31 + (n.getAssociatedSpecificationComments().isPresent() ? n.getAssociatedSpecificationComments().get().accept(this, arg) @@ -1449,14 +1441,6 @@ public Integer visit(final JmlDocStmt n, final Void arg) { : 0); } - @Override - public Integer visit(final JmlDoc n, final Void arg) { - return (n.getContent().hashCode()) * 31 - + (n.getAssociatedSpecificationComments().isPresent() - ? n.getAssociatedSpecificationComments().get().accept(this, arg) - : 0); - } - @Override public Integer visit(final JmlDocType n, final Void arg) { return (n.getJmlComments().accept(this, arg)) * 31 @@ -1541,4 +1525,20 @@ public Integer visit(final JmlMethodSignature n, final Void arg) { ? n.getAssociatedSpecificationComments().get().accept(this, arg) : 0); } + + @Override + public Integer visit(final JmlDoc n, final Void arg) { + return (n.getContent().hashCode()) * 31 + + (n.getAssociatedSpecificationComments().isPresent() + ? n.getAssociatedSpecificationComments().get().accept(this, arg) + : 0); + } + + @Override + public Integer visit(final KeYMarkerStatement n, final Void arg) { + return n.getKind() * 31 + + (n.getAssociatedSpecificationComments().isPresent() + ? n.getAssociatedSpecificationComments().get().accept(this, arg) + : 0); + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java index 1d7831b9b1..657c538333 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java @@ -30,6 +30,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -467,7 +468,7 @@ public Boolean visit(final ImportDeclaration n, final Visitable arg) { } @Override - public Boolean visit(NodeList n, Visitable arg) { + public Boolean visit(NodeList n, Visitable arg) { return n == arg; } @@ -687,7 +688,7 @@ public Boolean visit(final KeyCcatchReturn n, final Visitable arg) { } @Override - public Boolean visit(final KeyCatchAllStatement n, final Visitable arg) { + public Boolean visit(final KeyCatchAllStmt n, final Visitable arg) { return n == arg; } @@ -697,7 +698,7 @@ public Boolean visit(final KeyEscapeExpression n, final Visitable arg) { } @Override - public Boolean visit(final KeyExecStatement n, final Visitable arg) { + public Boolean visit(final KeyExecStmt n, final Visitable arg) { return n == arg; } @@ -707,12 +708,12 @@ public Boolean visit(final KeyExecutionContext n, final Visitable arg) { } @Override - public Boolean visit(final KeyLoopScopeBlock n, final Visitable arg) { + public Boolean visit(final KeyLoopScopeBlockStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final KeyMergePointStatement n, final Visitable arg) { + public Boolean visit(final KeyMergePointStmt n, final Visitable arg) { return n == arg; } @@ -722,7 +723,7 @@ public Boolean visit(final KeyMethodBodyStatement n, final Visitable arg) { } @Override - public Boolean visit(final KeyMethodCallStatement n, final Visitable arg) { + public Boolean visit(final KeyMethodCallStmt n, final Visitable arg) { return n == arg; } @@ -732,12 +733,7 @@ public Boolean visit(final KeyMethodSignature n, final Visitable arg) { } @Override - public Boolean visit(final KeyRangeExpression n, final Visitable arg) { - return n == arg; - } - - @Override - public Boolean visit(final KeyTransactionStatement n, final Visitable arg) { + public Boolean visit(final KeyTransactionStmt n, final Visitable arg) { return n == arg; } @@ -880,4 +876,9 @@ public Boolean visit(final JmlLabelStmt n, final Visitable arg) { public Boolean visit(final JmlMethodSignature n, final Visitable arg) { return n == arg; } + + @Override + public Boolean visit(final KeYMarkerStatement n, final Visitable arg) { + return n == arg; + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java index 9cf78254f7..c2302b9e12 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java @@ -29,6 +29,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -274,7 +275,7 @@ public Integer visit(final Name n, final Void arg) { return n.hashCode(); } - public Integer visit(NodeList n, Void arg) { + public Integer visit(NodeList n, Void arg) { return n.hashCode(); } @@ -599,7 +600,7 @@ public Integer visit(final KeyCcatchReturn n, final Void arg) { } @Override - public Integer visit(final KeyCatchAllStatement n, final Void arg) { + public Integer visit(final KeyCatchAllStmt n, final Void arg) { return n.hashCode(); } @@ -609,7 +610,7 @@ public Integer visit(final KeyEscapeExpression n, final Void arg) { } @Override - public Integer visit(final KeyExecStatement n, final Void arg) { + public Integer visit(final KeyExecStmt n, final Void arg) { return n.hashCode(); } @@ -619,12 +620,12 @@ public Integer visit(final KeyExecutionContext n, final Void arg) { } @Override - public Integer visit(final KeyLoopScopeBlock n, final Void arg) { + public Integer visit(final KeyLoopScopeBlockStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final KeyMergePointStatement n, final Void arg) { + public Integer visit(final KeyMergePointStmt n, final Void arg) { return n.hashCode(); } @@ -634,7 +635,7 @@ public Integer visit(final KeyMethodBodyStatement n, final Void arg) { } @Override - public Integer visit(final KeyMethodCallStatement n, final Void arg) { + public Integer visit(final KeyMethodCallStmt n, final Void arg) { return n.hashCode(); } @@ -644,12 +645,7 @@ public Integer visit(final KeyMethodSignature n, final Void arg) { } @Override - public Integer visit(final KeyRangeExpression n, final Void arg) { - return n.hashCode(); - } - - @Override - public Integer visit(final KeyTransactionStatement n, final Void arg) { + public Integer visit(final KeyTransactionStmt n, final Void arg) { return n.hashCode(); } @@ -792,4 +788,9 @@ public Integer visit(final JmlLabelStmt n, final Void arg) { public Integer visit(final JmlMethodSignature n, final Void arg) { return n.hashCode(); } + + @Override + public Integer visit(final KeYMarkerStatement n, final Void arg) { + return n.hashCode(); + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java index cd4de4a6b5..38fe9faf2a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java @@ -22,14 +22,15 @@ import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; -import com.github.javaparser.ast.comments.*; +import com.github.javaparser.ast.comments.BlockComment; +import com.github.javaparser.ast.comments.LineComment; +import com.github.javaparser.ast.comments.MarkdownComment; +import com.github.javaparser.ast.comments.TraditionalJavadocComment; import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; +import com.github.javaparser.ast.jml.doc.*; import com.github.javaparser.ast.jml.doc.JmlDoc; -import com.github.javaparser.ast.jml.doc.JmlDocDeclaration; -import com.github.javaparser.ast.jml.doc.JmlDocStmt; -import com.github.javaparser.ast.jml.doc.JmlDocType; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -45,7 +46,7 @@ */ public interface VoidVisitor { - void visit(NodeList n, A arg); + void visit(NodeList n, A arg); void visit(AnnotationDeclaration n, A arg); @@ -259,27 +260,25 @@ public interface VoidVisitor { void visit(KeyCcatchReturn n, A arg); - void visit(KeyCatchAllStatement n, A arg); + void visit(KeyCatchAllStmt n, A arg); void visit(KeyEscapeExpression n, A arg); - void visit(KeyExecStatement n, A arg); + void visit(KeyExecStmt n, A arg); void visit(KeyExecutionContext n, A arg); - void visit(KeyLoopScopeBlock n, A arg); + void visit(KeyLoopScopeBlockStmt n, A arg); - void visit(KeyMergePointStatement n, A arg); + void visit(KeyMergePointStmt n, A arg); void visit(KeyMethodBodyStatement n, A arg); - void visit(KeyMethodCallStatement n, A arg); + void visit(KeyMethodCallStmt n, A arg); void visit(KeyMethodSignature n, A arg); - void visit(KeyRangeExpression n, A arg); - - void visit(KeyTransactionStatement n, A arg); + void visit(KeyTransactionStmt n, A arg); void visit(KeyContextStatementBlock n, A arg); @@ -376,4 +375,6 @@ public interface VoidVisitor { void visit(JmlLabelStmt n, A arg); void visit(JmlMethodSignature n, A arg); + + void visit(KeYMarkerStatement n, A arg); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java index 6329fd91f6..193d50edde 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java @@ -30,6 +30,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -725,7 +726,7 @@ public void visit(final TypeExpr n, final A arg) { } @Override - public void visit(NodeList n, A arg) { + public void visit(NodeList n, A arg) { for (Object node : n) { ((Node) node).accept(this, arg); } @@ -844,7 +845,7 @@ public void visit(final TypePatternExpr n, final A arg) { @Override public void visit(final JmlClauseLabel n, final A arg) { - n.getExpr().accept(this, arg); + n.getExpression().accept(this, arg); n.getLabel().ifPresent(l -> l.accept(this, arg)); n.getName().ifPresent(l -> l.accept(this, arg)); n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); @@ -949,7 +950,7 @@ public void visit(final JmlRefiningStmt n, final A arg) { @Override public void visit(final JmlClauseIf n, final A arg) { n.getCondition().accept(this, arg); - n.getThen().accept(this, arg); + n.getExpression().accept(this, arg); n.getName().ifPresent(l -> l.accept(this, arg)); n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getComment().ifPresent(l -> l.accept(this, arg)); @@ -1076,7 +1077,7 @@ public void visit(final KeyCcatchReturn n, final A arg) { } @Override - public void visit(final KeyCatchAllStatement n, final A arg) { + public void visit(final KeyCatchAllStmt n, final A arg) { n.getBlock().accept(this, arg); n.getLabel().accept(this, arg); n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); @@ -1092,7 +1093,7 @@ public void visit(final KeyEscapeExpression n, final A arg) { } @Override - public void visit(final KeyExecStatement n, final A arg) { + public void visit(final KeyExecStmt n, final A arg) { n.getBranches().forEach(p -> p.accept(this, arg)); n.getExecBlock().accept(this, arg); n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); @@ -1109,7 +1110,7 @@ public void visit(final KeyExecutionContext n, final A arg) { } @Override - public void visit(final KeyLoopScopeBlock n, final A arg) { + public void visit(final KeyLoopScopeBlockStmt n, final A arg) { n.getBlock().accept(this, arg); n.getIndexPV().accept(this, arg); n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); @@ -1117,7 +1118,7 @@ public void visit(final KeyLoopScopeBlock n, final A arg) { } @Override - public void visit(final KeyMergePointStatement n, final A arg) { + public void visit(final KeyMergePointStmt n, final A arg) { n.getExpr().accept(this, arg); n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getComment().ifPresent(l -> l.accept(this, arg)); @@ -1133,7 +1134,7 @@ public void visit(final KeyMethodBodyStatement n, final A arg) { } @Override - public void visit(final KeyMethodCallStatement n, final A arg) { + public void visit(final KeyMethodCallStmt n, final A arg) { n.getBlock().accept(this, arg); n.getContext().accept(this, arg); n.getName().ifPresent(l -> l.accept(this, arg)); @@ -1150,15 +1151,7 @@ public void visit(final KeyMethodSignature n, final A arg) { } @Override - public void visit(final KeyRangeExpression n, final A arg) { - n.getLower().accept(this, arg); - n.getUpper().accept(this, arg); - n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); - n.getComment().ifPresent(l -> l.accept(this, arg)); - } - - @Override - public void visit(final KeyTransactionStatement n, final A arg) { + public void visit(final KeyTransactionStmt n, final A arg) { n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getComment().ifPresent(l -> l.accept(this, arg)); } @@ -1395,4 +1388,10 @@ public void visit(final JmlMethodSignature n, final A arg) { n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getComment().ifPresent(l -> l.accept(this, arg)); } + + @Override + public void visit(final KeYMarkerStatement n, final A arg) { + n.getAssociatedSpecificationComments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); + n.getComment().ifPresent(l -> l.accept(this, arg)); + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java index b0ad1ce508..5a425405a9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java @@ -27,6 +27,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -462,7 +463,7 @@ public void visit(final TypeExpr n, final A arg) { } @Override - public void visit(NodeList n, A arg) { + public void visit(NodeList n, A arg) { defaultAction(n, arg); } @@ -685,7 +686,7 @@ public void visit(final KeyCcatchReturn n, final A arg) { } @Override - public void visit(final KeyCatchAllStatement n, final A arg) { + public void visit(final KeyCatchAllStmt n, final A arg) { defaultAction(n, arg); } @@ -695,7 +696,7 @@ public void visit(final KeyEscapeExpression n, final A arg) { } @Override - public void visit(final KeyExecStatement n, final A arg) { + public void visit(final KeyExecStmt n, final A arg) { defaultAction(n, arg); } @@ -705,12 +706,12 @@ public void visit(final KeyExecutionContext n, final A arg) { } @Override - public void visit(final KeyLoopScopeBlock n, final A arg) { + public void visit(final KeyLoopScopeBlockStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final KeyMergePointStatement n, final A arg) { + public void visit(final KeyMergePointStmt n, final A arg) { defaultAction(n, arg); } @@ -720,7 +721,7 @@ public void visit(final KeyMethodBodyStatement n, final A arg) { } @Override - public void visit(final KeyMethodCallStatement n, final A arg) { + public void visit(final KeyMethodCallStmt n, final A arg) { defaultAction(n, arg); } @@ -730,12 +731,7 @@ public void visit(final KeyMethodSignature n, final A arg) { } @Override - public void visit(final KeyRangeExpression n, final A arg) { - defaultAction(n, arg); - } - - @Override - public void visit(final KeyTransactionStatement n, final A arg) { + public void visit(final KeyTransactionStmt n, final A arg) { defaultAction(n, arg); } @@ -829,11 +825,6 @@ public void visit(final JmlDocStmt n, final A arg) { defaultAction(n, arg); } - @Override - public void visit(final JmlDoc n, final A arg) { - defaultAction(n, arg); - } - @Override public void visit(final JmlDocType n, final A arg) { defaultAction(n, arg); @@ -878,4 +869,14 @@ public void visit(final JmlLabelStmt n, final A arg) { public void visit(final JmlMethodSignature n, final A arg) { defaultAction(n, arg); } + + @Override + public void visit(final JmlDoc n, final A arg) { + defaultAction(n, arg); + } + + @Override + public void visit(final KeYMarkerStatement n, final A arg) { + defaultAction(n, arg); + } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java index 6dce907689..6270496ef3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java @@ -54,7 +54,7 @@ public String asString(Collection jmlDocs, boolean emulateGlobalPosition) } public String asString(NodeList jmlDocs, boolean emulateGlobalPosition) { - return asStringJT(jmlDocs.stream().map(JmlDoc::getContent).toList(), emulateGlobalPosition); + return asStringJT(jmlDocs.stream().map(JmlDoc::constructToken).toList(), emulateGlobalPosition); } public String toSanitizedString(StringBuilder s) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavaParserMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavaParserMetaModel.java index 55bc7e1471..582a9a02f9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavaParserMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavaParserMetaModel.java @@ -415,46 +415,6 @@ private static void initializeConstructorParameters() { variableDeclarationExprMetaModel .getConstructorParameters() .add(variableDeclarationExprMetaModel.variablesPropertyMetaModel); - jmlDocMetaModel.getConstructorParameters().add(jmlDocMetaModel.contentPropertyMetaModel); - jmlDocDeclarationMetaModel - .getConstructorParameters() - .add(jmlDocDeclarationMetaModel.jmlCommentsPropertyMetaModel); - jmlDocStmtMetaModel.getConstructorParameters().add(jmlDocStmtMetaModel.jmlCommentsPropertyMetaModel); - jmlDocTypeMetaModel.getConstructorParameters().add(typeDeclarationMetaModel.modifiersPropertyMetaModel); - jmlDocTypeMetaModel.getConstructorParameters().add(bodyDeclarationMetaModel.annotationsPropertyMetaModel); - jmlDocTypeMetaModel.getConstructorParameters().add(typeDeclarationMetaModel.namePropertyMetaModel); - jmlDocTypeMetaModel.getConstructorParameters().add(typeDeclarationMetaModel.membersPropertyMetaModel); - jmlDocTypeMetaModel.getConstructorParameters().add(jmlDocTypeMetaModel.jmlCommentsPropertyMetaModel); - jmlQuantifiedExprMetaModel.getConstructorParameters().add(jmlQuantifiedExprMetaModel.binderPropertyMetaModel); - jmlQuantifiedExprMetaModel - .getConstructorParameters() - .add(jmlQuantifiedExprMetaModel.variablesPropertyMetaModel); - jmlQuantifiedExprMetaModel - .getConstructorParameters() - .add(jmlQuantifiedExprMetaModel.expressionsPropertyMetaModel); - jmlTypeExprMetaModel.getConstructorParameters().add(jmlTypeExprMetaModel.typePropertyMetaModel); - jmlBinaryInfixExprMetaModel.getConstructorParameters().add(jmlBinaryInfixExprMetaModel.leftPropertyMetaModel); - jmlBinaryInfixExprMetaModel.getConstructorParameters().add(jmlBinaryInfixExprMetaModel.rightPropertyMetaModel); - jmlBinaryInfixExprMetaModel - .getConstructorParameters() - .add(jmlBinaryInfixExprMetaModel.operatorPropertyMetaModel); - jmlLetExprMetaModel.getConstructorParameters().add(jmlLetExprMetaModel.variablesPropertyMetaModel); - jmlLetExprMetaModel.getConstructorParameters().add(jmlLetExprMetaModel.bodyPropertyMetaModel); - jmlMultiCompareExprMetaModel - .getConstructorParameters() - .add(jmlMultiCompareExprMetaModel.expressionsPropertyMetaModel); - jmlMultiCompareExprMetaModel - .getConstructorParameters() - .add(jmlMultiCompareExprMetaModel.operatorsPropertyMetaModel); - jmlLabelExprMetaModel.getConstructorParameters().add(jmlLabelExprMetaModel.kindPropertyMetaModel); - jmlLabelExprMetaModel.getConstructorParameters().add(jmlLabelExprMetaModel.labelPropertyMetaModel); - jmlLabelExprMetaModel.getConstructorParameters().add(jmlLabelExprMetaModel.expressionPropertyMetaModel); - jmlSetComprehensionExprMetaModel - .getConstructorParameters() - .add(jmlSetComprehensionExprMetaModel.bindingPropertyMetaModel); - jmlSetComprehensionExprMetaModel - .getConstructorParameters() - .add(jmlSetComprehensionExprMetaModel.predicatePropertyMetaModel); assertStmtMetaModel.getConstructorParameters().add(assertStmtMetaModel.checkPropertyMetaModel); assertStmtMetaModel.getConstructorParameters().add(assertStmtMetaModel.messagePropertyMetaModel); blockStmtMetaModel.getConstructorParameters().add(blockStmtMetaModel.statementsPropertyMetaModel); @@ -518,6 +478,94 @@ private static void initializeConstructorParameters() { whileStmtMetaModel.getConstructorParameters().add(whileStmtMetaModel.bodyPropertyMetaModel); whileStmtMetaModel.getConstructorParameters().add(whileStmtMetaModel.contractsPropertyMetaModel); yieldStmtMetaModel.getConstructorParameters().add(yieldStmtMetaModel.expressionPropertyMetaModel); + arrayTypeMetaModel.getConstructorParameters().add(arrayTypeMetaModel.componentTypePropertyMetaModel); + arrayTypeMetaModel.getConstructorParameters().add(arrayTypeMetaModel.originPropertyMetaModel); + arrayTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); + classOrInterfaceTypeMetaModel + .getConstructorParameters() + .add(classOrInterfaceTypeMetaModel.scopePropertyMetaModel); + classOrInterfaceTypeMetaModel + .getConstructorParameters() + .add(classOrInterfaceTypeMetaModel.namePropertyMetaModel); + classOrInterfaceTypeMetaModel + .getConstructorParameters() + .add(classOrInterfaceTypeMetaModel.typeArgumentsPropertyMetaModel); + classOrInterfaceTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); + intersectionTypeMetaModel.getConstructorParameters().add(intersectionTypeMetaModel.elementsPropertyMetaModel); + primitiveTypeMetaModel.getConstructorParameters().add(primitiveTypeMetaModel.typePropertyMetaModel); + primitiveTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); + typeParameterMetaModel.getConstructorParameters().add(typeParameterMetaModel.namePropertyMetaModel); + typeParameterMetaModel.getConstructorParameters().add(typeParameterMetaModel.typeBoundPropertyMetaModel); + typeParameterMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); + unionTypeMetaModel.getConstructorParameters().add(unionTypeMetaModel.elementsPropertyMetaModel); + wildcardTypeMetaModel.getConstructorParameters().add(wildcardTypeMetaModel.extendedTypePropertyMetaModel); + wildcardTypeMetaModel.getConstructorParameters().add(wildcardTypeMetaModel.superTypePropertyMetaModel); + wildcardTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); + moduleExportsDirectiveMetaModel + .getConstructorParameters() + .add(moduleExportsDirectiveMetaModel.namePropertyMetaModel); + moduleExportsDirectiveMetaModel + .getConstructorParameters() + .add(moduleExportsDirectiveMetaModel.moduleNamesPropertyMetaModel); + moduleOpensDirectiveMetaModel + .getConstructorParameters() + .add(moduleOpensDirectiveMetaModel.namePropertyMetaModel); + moduleOpensDirectiveMetaModel + .getConstructorParameters() + .add(moduleOpensDirectiveMetaModel.moduleNamesPropertyMetaModel); + moduleProvidesDirectiveMetaModel + .getConstructorParameters() + .add(moduleProvidesDirectiveMetaModel.namePropertyMetaModel); + moduleProvidesDirectiveMetaModel + .getConstructorParameters() + .add(moduleProvidesDirectiveMetaModel.withPropertyMetaModel); + moduleRequiresDirectiveMetaModel + .getConstructorParameters() + .add(moduleRequiresDirectiveMetaModel.modifiersPropertyMetaModel); + moduleRequiresDirectiveMetaModel + .getConstructorParameters() + .add(moduleRequiresDirectiveMetaModel.namePropertyMetaModel); + moduleUsesDirectiveMetaModel.getConstructorParameters().add(moduleUsesDirectiveMetaModel.namePropertyMetaModel); + jmlDocMetaModel.getConstructorParameters().add(jmlDocMetaModel.contentPropertyMetaModel); + jmlDocDeclarationMetaModel + .getConstructorParameters() + .add(jmlDocDeclarationMetaModel.jmlCommentsPropertyMetaModel); + jmlDocStmtMetaModel.getConstructorParameters().add(jmlDocStmtMetaModel.jmlCommentsPropertyMetaModel); + jmlDocTypeMetaModel.getConstructorParameters().add(typeDeclarationMetaModel.modifiersPropertyMetaModel); + jmlDocTypeMetaModel.getConstructorParameters().add(bodyDeclarationMetaModel.annotationsPropertyMetaModel); + jmlDocTypeMetaModel.getConstructorParameters().add(typeDeclarationMetaModel.namePropertyMetaModel); + jmlDocTypeMetaModel.getConstructorParameters().add(typeDeclarationMetaModel.membersPropertyMetaModel); + jmlDocTypeMetaModel.getConstructorParameters().add(jmlDocTypeMetaModel.jmlCommentsPropertyMetaModel); + jmlQuantifiedExprMetaModel.getConstructorParameters().add(jmlQuantifiedExprMetaModel.binderPropertyMetaModel); + jmlQuantifiedExprMetaModel + .getConstructorParameters() + .add(jmlQuantifiedExprMetaModel.variablesPropertyMetaModel); + jmlQuantifiedExprMetaModel + .getConstructorParameters() + .add(jmlQuantifiedExprMetaModel.expressionsPropertyMetaModel); + jmlTypeExprMetaModel.getConstructorParameters().add(jmlTypeExprMetaModel.typePropertyMetaModel); + jmlBinaryInfixExprMetaModel.getConstructorParameters().add(jmlBinaryInfixExprMetaModel.leftPropertyMetaModel); + jmlBinaryInfixExprMetaModel.getConstructorParameters().add(jmlBinaryInfixExprMetaModel.rightPropertyMetaModel); + jmlBinaryInfixExprMetaModel + .getConstructorParameters() + .add(jmlBinaryInfixExprMetaModel.operatorPropertyMetaModel); + jmlLetExprMetaModel.getConstructorParameters().add(jmlLetExprMetaModel.variablesPropertyMetaModel); + jmlLetExprMetaModel.getConstructorParameters().add(jmlLetExprMetaModel.bodyPropertyMetaModel); + jmlMultiCompareExprMetaModel + .getConstructorParameters() + .add(jmlMultiCompareExprMetaModel.expressionsPropertyMetaModel); + jmlMultiCompareExprMetaModel + .getConstructorParameters() + .add(jmlMultiCompareExprMetaModel.operatorsPropertyMetaModel); + jmlLabelExprMetaModel.getConstructorParameters().add(jmlLabelExprMetaModel.kindPropertyMetaModel); + jmlLabelExprMetaModel.getConstructorParameters().add(jmlLabelExprMetaModel.labelPropertyMetaModel); + jmlLabelExprMetaModel.getConstructorParameters().add(jmlLabelExprMetaModel.expressionPropertyMetaModel); + jmlSetComprehensionExprMetaModel + .getConstructorParameters() + .add(jmlSetComprehensionExprMetaModel.bindingPropertyMetaModel); + jmlSetComprehensionExprMetaModel + .getConstructorParameters() + .add(jmlSetComprehensionExprMetaModel.predicatePropertyMetaModel); jmlGhostStmtMetaModel.getConstructorParameters().add(jmlGhostStmtMetaModel.jmlTagsPropertyMetaModel); jmlGhostStmtMetaModel.getConstructorParameters().add(jmlGhostStmtMetaModel.statementPropertyMetaModel); jmlExpressionStmtMetaModel.getConstructorParameters().add(jmlExpressionStmtMetaModel.jmlTagsPropertyMetaModel); @@ -569,7 +617,7 @@ private static void initializeConstructorParameters() { .add(jmlSignalsOnlyClauseMetaModel.typesPropertyMetaModel); jmlClauseLabelMetaModel.getConstructorParameters().add(jmlClauseLabelMetaModel.kindPropertyMetaModel); jmlClauseLabelMetaModel.getConstructorParameters().add(jmlClauseLabelMetaModel.labelPropertyMetaModel); - jmlClauseLabelMetaModel.getConstructorParameters().add(jmlClauseLabelMetaModel.exprPropertyMetaModel); + jmlClauseLabelMetaModel.getConstructorParameters().add(jmlClauseLabelMetaModel.expressionPropertyMetaModel); jmlForallClauseMetaModel .getConstructorParameters() .add(jmlForallClauseMetaModel.boundedVariablesPropertyMetaModel); @@ -581,7 +629,7 @@ private static void initializeConstructorParameters() { jmlClauseIfMetaModel.getConstructorParameters().add(jmlClauseMetaModel.namePropertyMetaModel); jmlClauseIfMetaModel.getConstructorParameters().add(jmlClauseIfMetaModel.conditionPropertyMetaModel); jmlClauseIfMetaModel.getConstructorParameters().add(jmlClauseIfMetaModel.kindPropertyMetaModel); - jmlClauseIfMetaModel.getConstructorParameters().add(jmlClauseIfMetaModel.thenPropertyMetaModel); + jmlClauseIfMetaModel.getConstructorParameters().add(jmlClauseIfMetaModel.expressionPropertyMetaModel); jmlMethodSignatureMetaModel .getConstructorParameters() .add(jmlMethodSignatureMetaModel.receiverPropertyMetaModel); @@ -638,60 +686,8 @@ private static void initializeConstructorParameters() { jmlClassAccessibleDeclarationMetaModel .getConstructorParameters() .add(jmlClassAccessibleDeclarationMetaModel.measuredByPropertyMetaModel); - arrayTypeMetaModel.getConstructorParameters().add(arrayTypeMetaModel.componentTypePropertyMetaModel); - arrayTypeMetaModel.getConstructorParameters().add(arrayTypeMetaModel.originPropertyMetaModel); - arrayTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); - classOrInterfaceTypeMetaModel - .getConstructorParameters() - .add(classOrInterfaceTypeMetaModel.scopePropertyMetaModel); - classOrInterfaceTypeMetaModel - .getConstructorParameters() - .add(classOrInterfaceTypeMetaModel.namePropertyMetaModel); - classOrInterfaceTypeMetaModel - .getConstructorParameters() - .add(classOrInterfaceTypeMetaModel.typeArgumentsPropertyMetaModel); - classOrInterfaceTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); - intersectionTypeMetaModel.getConstructorParameters().add(intersectionTypeMetaModel.elementsPropertyMetaModel); - primitiveTypeMetaModel.getConstructorParameters().add(primitiveTypeMetaModel.typePropertyMetaModel); - primitiveTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); - typeParameterMetaModel.getConstructorParameters().add(typeParameterMetaModel.namePropertyMetaModel); - typeParameterMetaModel.getConstructorParameters().add(typeParameterMetaModel.typeBoundPropertyMetaModel); - typeParameterMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); - unionTypeMetaModel.getConstructorParameters().add(unionTypeMetaModel.elementsPropertyMetaModel); - wildcardTypeMetaModel.getConstructorParameters().add(wildcardTypeMetaModel.extendedTypePropertyMetaModel); - wildcardTypeMetaModel.getConstructorParameters().add(wildcardTypeMetaModel.superTypePropertyMetaModel); - wildcardTypeMetaModel.getConstructorParameters().add(typeMetaModel.annotationsPropertyMetaModel); - moduleExportsDirectiveMetaModel - .getConstructorParameters() - .add(moduleExportsDirectiveMetaModel.namePropertyMetaModel); - moduleExportsDirectiveMetaModel - .getConstructorParameters() - .add(moduleExportsDirectiveMetaModel.moduleNamesPropertyMetaModel); - moduleOpensDirectiveMetaModel - .getConstructorParameters() - .add(moduleOpensDirectiveMetaModel.namePropertyMetaModel); - moduleOpensDirectiveMetaModel - .getConstructorParameters() - .add(moduleOpensDirectiveMetaModel.moduleNamesPropertyMetaModel); - moduleProvidesDirectiveMetaModel - .getConstructorParameters() - .add(moduleProvidesDirectiveMetaModel.namePropertyMetaModel); - moduleProvidesDirectiveMetaModel - .getConstructorParameters() - .add(moduleProvidesDirectiveMetaModel.withPropertyMetaModel); - moduleRequiresDirectiveMetaModel - .getConstructorParameters() - .add(moduleRequiresDirectiveMetaModel.modifiersPropertyMetaModel); - moduleRequiresDirectiveMetaModel - .getConstructorParameters() - .add(moduleRequiresDirectiveMetaModel.namePropertyMetaModel); - moduleUsesDirectiveMetaModel.getConstructorParameters().add(moduleUsesDirectiveMetaModel.namePropertyMetaModel); - keyCatchAllStatementMetaModel - .getConstructorParameters() - .add(keyCatchAllStatementMetaModel.labelPropertyMetaModel); - keyCatchAllStatementMetaModel - .getConstructorParameters() - .add(keyCatchAllStatementMetaModel.blockPropertyMetaModel); + keyCatchAllStmtMetaModel.getConstructorParameters().add(keyCatchAllStmtMetaModel.labelPropertyMetaModel); + keyCatchAllStmtMetaModel.getConstructorParameters().add(keyCatchAllStmtMetaModel.blockPropertyMetaModel); keyCcatchBreakMetaModel.getConstructorParameters().add(keyCcatchBreakMetaModel.labelPropertyMetaModel); keyCcatchBreakMetaModel.getConstructorParameters().add(keyCcatchBreakMetaModel.blockPropertyMetaModel); keyCcatchContinueMetaModel.getConstructorParameters().add(keyCcatchContinueMetaModel.labelPropertyMetaModel); @@ -708,8 +704,8 @@ private static void initializeConstructorParameters() { keyEscapeExpressionMetaModel .getConstructorParameters() .add(keyEscapeExpressionMetaModel.argumentsPropertyMetaModel); - keyExecStatementMetaModel.getConstructorParameters().add(keyExecStatementMetaModel.execBlockPropertyMetaModel); - keyExecStatementMetaModel.getConstructorParameters().add(keyExecStatementMetaModel.branchesPropertyMetaModel); + keyExecStmtMetaModel.getConstructorParameters().add(keyExecStmtMetaModel.execBlockPropertyMetaModel); + keyExecStmtMetaModel.getConstructorParameters().add(keyExecStmtMetaModel.branchesPropertyMetaModel); keyExecutionContextMetaModel .getConstructorParameters() .add(keyExecutionContextMetaModel.contextPropertyMetaModel); @@ -719,11 +715,13 @@ private static void initializeConstructorParameters() { keyExecutionContextMetaModel .getConstructorParameters() .add(keyExecutionContextMetaModel.instancePropertyMetaModel); - keyLoopScopeBlockMetaModel.getConstructorParameters().add(keyLoopScopeBlockMetaModel.indexPVPropertyMetaModel); - keyLoopScopeBlockMetaModel.getConstructorParameters().add(keyLoopScopeBlockMetaModel.blockPropertyMetaModel); - keyMergePointStatementMetaModel + keyLoopScopeBlockStmtMetaModel .getConstructorParameters() - .add(keyMergePointStatementMetaModel.exprPropertyMetaModel); + .add(keyLoopScopeBlockStmtMetaModel.indexPVPropertyMetaModel); + keyLoopScopeBlockStmtMetaModel + .getConstructorParameters() + .add(keyLoopScopeBlockStmtMetaModel.blockPropertyMetaModel); + keyMergePointStmtMetaModel.getConstructorParameters().add(keyMergePointStmtMetaModel.exprPropertyMetaModel); keyMethodBodyStatementMetaModel .getConstructorParameters() .add(keyMethodBodyStatementMetaModel.namePropertyMetaModel); @@ -733,24 +731,15 @@ private static void initializeConstructorParameters() { keyMethodBodyStatementMetaModel .getConstructorParameters() .add(keyMethodBodyStatementMetaModel.sourcePropertyMetaModel); - keyMethodCallStatementMetaModel - .getConstructorParameters() - .add(keyMethodCallStatementMetaModel.namePropertyMetaModel); - keyMethodCallStatementMetaModel - .getConstructorParameters() - .add(keyMethodCallStatementMetaModel.contextPropertyMetaModel); - keyMethodCallStatementMetaModel - .getConstructorParameters() - .add(keyMethodCallStatementMetaModel.blockPropertyMetaModel); + keyMethodCallStmtMetaModel.getConstructorParameters().add(keyMethodCallStmtMetaModel.namePropertyMetaModel); + keyMethodCallStmtMetaModel.getConstructorParameters().add(keyMethodCallStmtMetaModel.contextPropertyMetaModel); + keyMethodCallStmtMetaModel.getConstructorParameters().add(keyMethodCallStmtMetaModel.blockPropertyMetaModel); keyMethodSignatureMetaModel.getConstructorParameters().add(keyMethodSignatureMetaModel.namePropertyMetaModel); keyMethodSignatureMetaModel .getConstructorParameters() .add(keyMethodSignatureMetaModel.paramTypesPropertyMetaModel); - keyRangeExpressionMetaModel.getConstructorParameters().add(keyRangeExpressionMetaModel.lowerPropertyMetaModel); - keyRangeExpressionMetaModel.getConstructorParameters().add(keyRangeExpressionMetaModel.upperPropertyMetaModel); - keyTransactionStatementMetaModel - .getConstructorParameters() - .add(keyTransactionStatementMetaModel.typePropertyMetaModel); + keyTransactionStmtMetaModel.getConstructorParameters().add(keyTransactionStmtMetaModel.typePropertyMetaModel); + keYMarkerStatementMetaModel.getConstructorParameters().add(keYMarkerStatementMetaModel.kindPropertyMetaModel); keyContextStatementBlockMetaModel .getConstructorParameters() .add(keyContextStatementBlockMetaModel.statementsPropertyMetaModel); @@ -895,8 +884,9 @@ private static void initializeNodeMetaModels() { nodeMetaModels.add(jmlStatementMetaModel); nodeMetaModels.add(jmlTypeExprMetaModel); nodeMetaModels.add(jmlUnreachableStmtMetaModel); + nodeMetaModels.add(keYMarkerStatementMetaModel); nodeMetaModels.add(keyAbstractExecutionContextMetaModel); - nodeMetaModels.add(keyCatchAllStatementMetaModel); + nodeMetaModels.add(keyCatchAllStmtMetaModel); nodeMetaModels.add(keyCcatchBranchMetaModel); nodeMetaModels.add(keyCcatchBreakMetaModel); nodeMetaModels.add(keyCcatchContinueMetaModel); @@ -906,25 +896,24 @@ private static void initializeNodeMetaModels() { nodeMetaModels.add(keyContextStatementBlockMetaModel); nodeMetaModels.add(keyEscapeExpressionMetaModel); nodeMetaModels.add(keyExecCtxtSVMetaModel); - nodeMetaModels.add(keyExecStatementMetaModel); + nodeMetaModels.add(keyExecStmtMetaModel); nodeMetaModels.add(keyExecutionContextMetaModel); nodeMetaModels.add(keyExecutionContextSVMetaModel); nodeMetaModels.add(keyExpressionSVMetaModel); nodeMetaModels.add(keyJumpLabelSVMetaModel); - nodeMetaModels.add(keyLoopScopeBlockMetaModel); - nodeMetaModels.add(keyMergePointStatementMetaModel); + nodeMetaModels.add(keyLoopScopeBlockStmtMetaModel); + nodeMetaModels.add(keyMergePointStmtMetaModel); nodeMetaModels.add(keyMetaConstructExpressionMetaModel); nodeMetaModels.add(keyMetaConstructMetaModel); nodeMetaModels.add(keyMetaConstructTypeMetaModel); nodeMetaModels.add(keyMethodBodyStatementMetaModel); - nodeMetaModels.add(keyMethodCallStatementMetaModel); + nodeMetaModels.add(keyMethodCallStmtMetaModel); nodeMetaModels.add(keyMethodSignatureMetaModel); nodeMetaModels.add(keyMethodSignatureSVMetaModel); nodeMetaModels.add(keyPassiveExpressionMetaModel); nodeMetaModels.add(keyProgramVariableSVMetaModel); - nodeMetaModels.add(keyRangeExpressionMetaModel); nodeMetaModels.add(keyStatementSVMetaModel); - nodeMetaModels.add(keyTransactionStatementMetaModel); + nodeMetaModels.add(keyTransactionStmtMetaModel); nodeMetaModels.add(keyTypeSVMetaModel); nodeMetaModels.add(labeledStmtMetaModel); nodeMetaModels.add(lambdaExprMetaModel); @@ -2636,283 +2625,61 @@ private static void initializePropertyMetaModels() { variableDeclarationExprMetaModel .getDerivedPropertyMetaModels() .add(variableDeclarationExprMetaModel.maximumCommonTypePropertyMetaModel); - jmlDocMetaModel.contentPropertyMetaModel = new PropertyMetaModel( - jmlDocMetaModel, - "content", - com.github.javaparser.JavaToken.class, - Optional.empty(), + assertStmtMetaModel.checkPropertyMetaModel = new PropertyMetaModel( + assertStmtMetaModel, + "check", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), false, false, false, false); - jmlDocMetaModel.getDeclaredPropertyMetaModels().add(jmlDocMetaModel.contentPropertyMetaModel); - jmlDocDeclarationMetaModel.jmlCommentsPropertyMetaModel = new PropertyMetaModel( - jmlDocDeclarationMetaModel, - "jmlComments", - com.github.javaparser.ast.jml.doc.JmlDoc.class, - Optional.of(jmlDocMetaModel), + assertStmtMetaModel.getDeclaredPropertyMetaModels().add(assertStmtMetaModel.checkPropertyMetaModel); + assertStmtMetaModel.messagePropertyMetaModel = new PropertyMetaModel( + assertStmtMetaModel, + "message", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + true, false, false, - true, false); - jmlDocDeclarationMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlDocDeclarationMetaModel.jmlCommentsPropertyMetaModel); - jmlDocStmtMetaModel.jmlCommentsPropertyMetaModel = new PropertyMetaModel( - jmlDocStmtMetaModel, - "jmlComments", - com.github.javaparser.ast.jml.doc.JmlDoc.class, - Optional.of(jmlDocMetaModel), + assertStmtMetaModel.getDeclaredPropertyMetaModels().add(assertStmtMetaModel.messagePropertyMetaModel); + blockStmtMetaModel.contractsPropertyMetaModel = new PropertyMetaModel( + blockStmtMetaModel, + "contracts", + com.github.javaparser.ast.jml.clauses.JmlContract.class, + Optional.of(jmlContractMetaModel), false, false, true, false); - jmlDocStmtMetaModel.getDeclaredPropertyMetaModels().add(jmlDocStmtMetaModel.jmlCommentsPropertyMetaModel); - jmlDocTypeMetaModel.jmlCommentsPropertyMetaModel = new PropertyMetaModel( - jmlDocTypeMetaModel, - "jmlComments", - com.github.javaparser.ast.jml.doc.JmlDoc.class, - Optional.of(jmlDocMetaModel), + blockStmtMetaModel.getDeclaredPropertyMetaModels().add(blockStmtMetaModel.contractsPropertyMetaModel); + blockStmtMetaModel.statementsPropertyMetaModel = new PropertyMetaModel( + blockStmtMetaModel, + "statements", + com.github.javaparser.ast.stmt.Statement.class, + Optional.of(statementMetaModel), false, false, true, false); - jmlDocTypeMetaModel.getDeclaredPropertyMetaModels().add(jmlDocTypeMetaModel.jmlCommentsPropertyMetaModel); - jmlQuantifiedExprMetaModel.binderPropertyMetaModel = new PropertyMetaModel( - jmlQuantifiedExprMetaModel, - "binder", - com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr.JmlBinder.class, - Optional.empty(), - false, - false, - false, - false); - jmlQuantifiedExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlQuantifiedExprMetaModel.binderPropertyMetaModel); - jmlQuantifiedExprMetaModel.expressionsPropertyMetaModel = new PropertyMetaModel( - jmlQuantifiedExprMetaModel, - "expressions", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - true, - true, - false); - jmlQuantifiedExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlQuantifiedExprMetaModel.expressionsPropertyMetaModel); - jmlQuantifiedExprMetaModel.variablesPropertyMetaModel = new PropertyMetaModel( - jmlQuantifiedExprMetaModel, - "variables", - com.github.javaparser.ast.body.Parameter.class, - Optional.of(parameterMetaModel), - false, - true, - true, - false); - jmlQuantifiedExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlQuantifiedExprMetaModel.variablesPropertyMetaModel); - jmlTypeExprMetaModel.typePropertyMetaModel = new PropertyMetaModel( - jmlTypeExprMetaModel, - "type", - com.github.javaparser.ast.type.Type.class, - Optional.of(typeMetaModel), - false, - false, - false, - false); - jmlTypeExprMetaModel.getDeclaredPropertyMetaModels().add(jmlTypeExprMetaModel.typePropertyMetaModel); - jmlBinaryInfixExprMetaModel.leftPropertyMetaModel = new PropertyMetaModel( - jmlBinaryInfixExprMetaModel, - "left", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - jmlBinaryInfixExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlBinaryInfixExprMetaModel.leftPropertyMetaModel); - jmlBinaryInfixExprMetaModel.operatorPropertyMetaModel = new PropertyMetaModel( - jmlBinaryInfixExprMetaModel, - "operator", - com.github.javaparser.ast.expr.SimpleName.class, - Optional.of(simpleNameMetaModel), - false, - false, - false, - false); - jmlBinaryInfixExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlBinaryInfixExprMetaModel.operatorPropertyMetaModel); - jmlBinaryInfixExprMetaModel.rightPropertyMetaModel = new PropertyMetaModel( - jmlBinaryInfixExprMetaModel, - "right", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - jmlBinaryInfixExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlBinaryInfixExprMetaModel.rightPropertyMetaModel); - jmlLetExprMetaModel.bodyPropertyMetaModel = new PropertyMetaModel( - jmlLetExprMetaModel, - "body", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - jmlLetExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLetExprMetaModel.bodyPropertyMetaModel); - jmlLetExprMetaModel.variablesPropertyMetaModel = new PropertyMetaModel( - jmlLetExprMetaModel, - "variables", - com.github.javaparser.ast.expr.VariableDeclarationExpr.class, - Optional.of(variableDeclarationExprMetaModel), - false, - false, - false, - false); - jmlLetExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLetExprMetaModel.variablesPropertyMetaModel); - jmlMultiCompareExprMetaModel.expressionsPropertyMetaModel = new PropertyMetaModel( - jmlMultiCompareExprMetaModel, - "expressions", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - true, - true, - false); - jmlMultiCompareExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlMultiCompareExprMetaModel.expressionsPropertyMetaModel); - jmlMultiCompareExprMetaModel.operatorsPropertyMetaModel = new PropertyMetaModel( - jmlMultiCompareExprMetaModel, - "operators", - com.github.javaparser.ast.jml.expr.JmlMultiCompareExpr.Operators.class, - Optional.empty(), - false, - false, - false, - false); - jmlMultiCompareExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlMultiCompareExprMetaModel.operatorsPropertyMetaModel); - jmlLabelExprMetaModel.expressionPropertyMetaModel = new PropertyMetaModel( - jmlLabelExprMetaModel, - "expression", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - jmlLabelExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLabelExprMetaModel.expressionPropertyMetaModel); - jmlLabelExprMetaModel.kindPropertyMetaModel = new PropertyMetaModel( - jmlLabelExprMetaModel, - "kind", - com.github.javaparser.ast.jml.expr.JmlLabelExpr.Kind.class, - Optional.empty(), - false, - false, - false, - false); - jmlLabelExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLabelExprMetaModel.kindPropertyMetaModel); - jmlLabelExprMetaModel.labelPropertyMetaModel = new PropertyMetaModel( - jmlLabelExprMetaModel, - "label", - com.github.javaparser.ast.expr.SimpleName.class, - Optional.of(simpleNameMetaModel), - false, - false, - false, - false); - jmlLabelExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLabelExprMetaModel.labelPropertyMetaModel); - jmlSetComprehensionExprMetaModel.bindingPropertyMetaModel = new PropertyMetaModel( - jmlSetComprehensionExprMetaModel, - "binding", - com.github.javaparser.ast.body.VariableDeclarator.class, - Optional.of(variableDeclaratorMetaModel), - false, - false, - false, - false); - jmlSetComprehensionExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlSetComprehensionExprMetaModel.bindingPropertyMetaModel); - jmlSetComprehensionExprMetaModel.predicatePropertyMetaModel = new PropertyMetaModel( - jmlSetComprehensionExprMetaModel, - "predicate", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - jmlSetComprehensionExprMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlSetComprehensionExprMetaModel.predicatePropertyMetaModel); - assertStmtMetaModel.checkPropertyMetaModel = new PropertyMetaModel( - assertStmtMetaModel, - "check", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - assertStmtMetaModel.getDeclaredPropertyMetaModels().add(assertStmtMetaModel.checkPropertyMetaModel); - assertStmtMetaModel.messagePropertyMetaModel = new PropertyMetaModel( - assertStmtMetaModel, - "message", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - true, - false, - false, - false); - assertStmtMetaModel.getDeclaredPropertyMetaModels().add(assertStmtMetaModel.messagePropertyMetaModel); - blockStmtMetaModel.contractsPropertyMetaModel = new PropertyMetaModel( - blockStmtMetaModel, - "contracts", - com.github.javaparser.ast.jml.clauses.JmlContract.class, - Optional.of(jmlContractMetaModel), - false, - false, - true, - false); - blockStmtMetaModel.getDeclaredPropertyMetaModels().add(blockStmtMetaModel.contractsPropertyMetaModel); - blockStmtMetaModel.statementsPropertyMetaModel = new PropertyMetaModel( - blockStmtMetaModel, - "statements", - com.github.javaparser.ast.stmt.Statement.class, - Optional.of(statementMetaModel), - false, - false, - true, - false); - blockStmtMetaModel.getDeclaredPropertyMetaModels().add(blockStmtMetaModel.statementsPropertyMetaModel); - breakStmtMetaModel.labelPropertyMetaModel = new PropertyMetaModel( - breakStmtMetaModel, - "label", - com.github.javaparser.ast.expr.SimpleName.class, - Optional.of(simpleNameMetaModel), - true, - false, - false, - false); - breakStmtMetaModel.getDeclaredPropertyMetaModels().add(breakStmtMetaModel.labelPropertyMetaModel); - catchClauseMetaModel.bodyPropertyMetaModel = new PropertyMetaModel( - catchClauseMetaModel, - "body", - com.github.javaparser.ast.stmt.BlockStmt.class, - Optional.of(blockStmtMetaModel), + blockStmtMetaModel.getDeclaredPropertyMetaModels().add(blockStmtMetaModel.statementsPropertyMetaModel); + breakStmtMetaModel.labelPropertyMetaModel = new PropertyMetaModel( + breakStmtMetaModel, + "label", + com.github.javaparser.ast.expr.SimpleName.class, + Optional.of(simpleNameMetaModel), + true, + false, + false, + false); + breakStmtMetaModel.getDeclaredPropertyMetaModels().add(breakStmtMetaModel.labelPropertyMetaModel); + catchClauseMetaModel.bodyPropertyMetaModel = new PropertyMetaModel( + catchClauseMetaModel, + "body", + com.github.javaparser.ast.stmt.BlockStmt.class, + Optional.of(blockStmtMetaModel), false, false, false, @@ -3413,6 +3180,469 @@ private static void initializePropertyMetaModels() { false, false); yieldStmtMetaModel.getDeclaredPropertyMetaModels().add(yieldStmtMetaModel.expressionPropertyMetaModel); + arrayTypeMetaModel.componentTypePropertyMetaModel = new PropertyMetaModel( + arrayTypeMetaModel, + "componentType", + com.github.javaparser.ast.type.Type.class, + Optional.of(typeMetaModel), + false, + false, + false, + false); + arrayTypeMetaModel.getDeclaredPropertyMetaModels().add(arrayTypeMetaModel.componentTypePropertyMetaModel); + arrayTypeMetaModel.originPropertyMetaModel = new PropertyMetaModel( + arrayTypeMetaModel, + "origin", + com.github.javaparser.ast.type.ArrayType.Origin.class, + Optional.empty(), + false, + false, + false, + false); + arrayTypeMetaModel.getDeclaredPropertyMetaModels().add(arrayTypeMetaModel.originPropertyMetaModel); + classOrInterfaceTypeMetaModel.namePropertyMetaModel = new PropertyMetaModel( + classOrInterfaceTypeMetaModel, + "name", + com.github.javaparser.ast.expr.SimpleName.class, + Optional.of(simpleNameMetaModel), + false, + false, + false, + false); + classOrInterfaceTypeMetaModel + .getDeclaredPropertyMetaModels() + .add(classOrInterfaceTypeMetaModel.namePropertyMetaModel); + classOrInterfaceTypeMetaModel.scopePropertyMetaModel = new PropertyMetaModel( + classOrInterfaceTypeMetaModel, + "scope", + com.github.javaparser.ast.type.ClassOrInterfaceType.class, + Optional.of(classOrInterfaceTypeMetaModel), + true, + false, + false, + false); + classOrInterfaceTypeMetaModel + .getDeclaredPropertyMetaModels() + .add(classOrInterfaceTypeMetaModel.scopePropertyMetaModel); + classOrInterfaceTypeMetaModel.typeArgumentsPropertyMetaModel = new PropertyMetaModel( + classOrInterfaceTypeMetaModel, + "typeArguments", + com.github.javaparser.ast.type.Type.class, + Optional.of(typeMetaModel), + true, + false, + true, + false); + classOrInterfaceTypeMetaModel + .getDeclaredPropertyMetaModels() + .add(classOrInterfaceTypeMetaModel.typeArgumentsPropertyMetaModel); + classOrInterfaceTypeMetaModel.usingDiamondOperatorPropertyMetaModel = new PropertyMetaModel( + classOrInterfaceTypeMetaModel, + "usingDiamondOperator", + boolean.class, + Optional.empty(), + false, + false, + false, + false); + classOrInterfaceTypeMetaModel + .getDerivedPropertyMetaModels() + .add(classOrInterfaceTypeMetaModel.usingDiamondOperatorPropertyMetaModel); + intersectionTypeMetaModel.elementsPropertyMetaModel = new PropertyMetaModel( + intersectionTypeMetaModel, + "elements", + com.github.javaparser.ast.type.ReferenceType.class, + Optional.of(referenceTypeMetaModel), + false, + true, + true, + false); + intersectionTypeMetaModel + .getDeclaredPropertyMetaModels() + .add(intersectionTypeMetaModel.elementsPropertyMetaModel); + primitiveTypeMetaModel.typePropertyMetaModel = new PropertyMetaModel( + primitiveTypeMetaModel, + "type", + com.github.javaparser.ast.type.PrimitiveType.Primitive.class, + Optional.empty(), + false, + false, + false, + false); + primitiveTypeMetaModel.getDeclaredPropertyMetaModels().add(primitiveTypeMetaModel.typePropertyMetaModel); + typeParameterMetaModel.namePropertyMetaModel = new PropertyMetaModel( + typeParameterMetaModel, + "name", + com.github.javaparser.ast.expr.SimpleName.class, + Optional.of(simpleNameMetaModel), + false, + false, + false, + false); + typeParameterMetaModel.getDeclaredPropertyMetaModels().add(typeParameterMetaModel.namePropertyMetaModel); + typeParameterMetaModel.typeBoundPropertyMetaModel = new PropertyMetaModel( + typeParameterMetaModel, + "typeBound", + com.github.javaparser.ast.type.ClassOrInterfaceType.class, + Optional.of(classOrInterfaceTypeMetaModel), + false, + false, + true, + false); + typeParameterMetaModel.getDeclaredPropertyMetaModels().add(typeParameterMetaModel.typeBoundPropertyMetaModel); + unionTypeMetaModel.elementsPropertyMetaModel = new PropertyMetaModel( + unionTypeMetaModel, + "elements", + com.github.javaparser.ast.type.ReferenceType.class, + Optional.of(referenceTypeMetaModel), + false, + true, + true, + false); + unionTypeMetaModel.getDeclaredPropertyMetaModels().add(unionTypeMetaModel.elementsPropertyMetaModel); + wildcardTypeMetaModel.extendedTypePropertyMetaModel = new PropertyMetaModel( + wildcardTypeMetaModel, + "extendedType", + com.github.javaparser.ast.type.ReferenceType.class, + Optional.of(referenceTypeMetaModel), + true, + false, + false, + false); + wildcardTypeMetaModel.getDeclaredPropertyMetaModels().add(wildcardTypeMetaModel.extendedTypePropertyMetaModel); + wildcardTypeMetaModel.superTypePropertyMetaModel = new PropertyMetaModel( + wildcardTypeMetaModel, + "superType", + com.github.javaparser.ast.type.ReferenceType.class, + Optional.of(referenceTypeMetaModel), + true, + false, + false, + false); + wildcardTypeMetaModel.getDeclaredPropertyMetaModels().add(wildcardTypeMetaModel.superTypePropertyMetaModel); + moduleExportsDirectiveMetaModel.moduleNamesPropertyMetaModel = new PropertyMetaModel( + moduleExportsDirectiveMetaModel, + "moduleNames", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + true, + false); + moduleExportsDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleExportsDirectiveMetaModel.moduleNamesPropertyMetaModel); + moduleExportsDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( + moduleExportsDirectiveMetaModel, + "name", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + false, + false); + moduleExportsDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleExportsDirectiveMetaModel.namePropertyMetaModel); + moduleOpensDirectiveMetaModel.moduleNamesPropertyMetaModel = new PropertyMetaModel( + moduleOpensDirectiveMetaModel, + "moduleNames", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + true, + false); + moduleOpensDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleOpensDirectiveMetaModel.moduleNamesPropertyMetaModel); + moduleOpensDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( + moduleOpensDirectiveMetaModel, + "name", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + false, + false); + moduleOpensDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleOpensDirectiveMetaModel.namePropertyMetaModel); + moduleProvidesDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( + moduleProvidesDirectiveMetaModel, + "name", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + false, + false); + moduleProvidesDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleProvidesDirectiveMetaModel.namePropertyMetaModel); + moduleProvidesDirectiveMetaModel.withPropertyMetaModel = new PropertyMetaModel( + moduleProvidesDirectiveMetaModel, + "with", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + true, + false); + moduleProvidesDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleProvidesDirectiveMetaModel.withPropertyMetaModel); + moduleRequiresDirectiveMetaModel.modifiersPropertyMetaModel = new PropertyMetaModel( + moduleRequiresDirectiveMetaModel, + "modifiers", + com.github.javaparser.ast.Modifier.class, + Optional.of(modifierMetaModel), + false, + false, + true, + false); + moduleRequiresDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleRequiresDirectiveMetaModel.modifiersPropertyMetaModel); + moduleRequiresDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( + moduleRequiresDirectiveMetaModel, + "name", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + false, + false); + moduleRequiresDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleRequiresDirectiveMetaModel.namePropertyMetaModel); + moduleUsesDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( + moduleUsesDirectiveMetaModel, + "name", + com.github.javaparser.ast.expr.Name.class, + Optional.of(nameMetaModel), + false, + false, + false, + false); + moduleUsesDirectiveMetaModel + .getDeclaredPropertyMetaModels() + .add(moduleUsesDirectiveMetaModel.namePropertyMetaModel); + jmlDocMetaModel.contentPropertyMetaModel = new PropertyMetaModel( + jmlDocMetaModel, "content", java.lang.String.class, Optional.empty(), false, false, false, false); + jmlDocMetaModel.getDeclaredPropertyMetaModels().add(jmlDocMetaModel.contentPropertyMetaModel); + jmlDocDeclarationMetaModel.jmlCommentsPropertyMetaModel = new PropertyMetaModel( + jmlDocDeclarationMetaModel, + "jmlComments", + com.github.javaparser.ast.jml.doc.JmlDoc.class, + Optional.of(jmlDocMetaModel), + false, + false, + true, + false); + jmlDocDeclarationMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlDocDeclarationMetaModel.jmlCommentsPropertyMetaModel); + jmlDocStmtMetaModel.jmlCommentsPropertyMetaModel = new PropertyMetaModel( + jmlDocStmtMetaModel, + "jmlComments", + com.github.javaparser.ast.jml.doc.JmlDoc.class, + Optional.of(jmlDocMetaModel), + false, + false, + true, + false); + jmlDocStmtMetaModel.getDeclaredPropertyMetaModels().add(jmlDocStmtMetaModel.jmlCommentsPropertyMetaModel); + jmlDocTypeMetaModel.jmlCommentsPropertyMetaModel = new PropertyMetaModel( + jmlDocTypeMetaModel, + "jmlComments", + com.github.javaparser.ast.jml.doc.JmlDoc.class, + Optional.of(jmlDocMetaModel), + false, + false, + true, + false); + jmlDocTypeMetaModel.getDeclaredPropertyMetaModels().add(jmlDocTypeMetaModel.jmlCommentsPropertyMetaModel); + jmlQuantifiedExprMetaModel.binderPropertyMetaModel = new PropertyMetaModel( + jmlQuantifiedExprMetaModel, + "binder", + com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr.JmlBinder.class, + Optional.empty(), + false, + false, + false, + false); + jmlQuantifiedExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlQuantifiedExprMetaModel.binderPropertyMetaModel); + jmlQuantifiedExprMetaModel.expressionsPropertyMetaModel = new PropertyMetaModel( + jmlQuantifiedExprMetaModel, + "expressions", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + false, + true, + true, + false); + jmlQuantifiedExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlQuantifiedExprMetaModel.expressionsPropertyMetaModel); + jmlQuantifiedExprMetaModel.variablesPropertyMetaModel = new PropertyMetaModel( + jmlQuantifiedExprMetaModel, + "variables", + com.github.javaparser.ast.body.Parameter.class, + Optional.of(parameterMetaModel), + false, + true, + true, + false); + jmlQuantifiedExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlQuantifiedExprMetaModel.variablesPropertyMetaModel); + jmlTypeExprMetaModel.typePropertyMetaModel = new PropertyMetaModel( + jmlTypeExprMetaModel, + "type", + com.github.javaparser.ast.type.Type.class, + Optional.of(typeMetaModel), + false, + false, + false, + false); + jmlTypeExprMetaModel.getDeclaredPropertyMetaModels().add(jmlTypeExprMetaModel.typePropertyMetaModel); + jmlBinaryInfixExprMetaModel.leftPropertyMetaModel = new PropertyMetaModel( + jmlBinaryInfixExprMetaModel, + "left", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + false, + false, + false, + false); + jmlBinaryInfixExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlBinaryInfixExprMetaModel.leftPropertyMetaModel); + jmlBinaryInfixExprMetaModel.operatorPropertyMetaModel = new PropertyMetaModel( + jmlBinaryInfixExprMetaModel, + "operator", + com.github.javaparser.ast.expr.SimpleName.class, + Optional.of(simpleNameMetaModel), + false, + false, + false, + false); + jmlBinaryInfixExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlBinaryInfixExprMetaModel.operatorPropertyMetaModel); + jmlBinaryInfixExprMetaModel.rightPropertyMetaModel = new PropertyMetaModel( + jmlBinaryInfixExprMetaModel, + "right", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + false, + false, + false, + false); + jmlBinaryInfixExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlBinaryInfixExprMetaModel.rightPropertyMetaModel); + jmlLetExprMetaModel.bodyPropertyMetaModel = new PropertyMetaModel( + jmlLetExprMetaModel, + "body", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + false, + false, + false, + false); + jmlLetExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLetExprMetaModel.bodyPropertyMetaModel); + jmlLetExprMetaModel.variablesPropertyMetaModel = new PropertyMetaModel( + jmlLetExprMetaModel, + "variables", + com.github.javaparser.ast.expr.VariableDeclarationExpr.class, + Optional.of(variableDeclarationExprMetaModel), + false, + false, + false, + false); + jmlLetExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLetExprMetaModel.variablesPropertyMetaModel); + jmlMultiCompareExprMetaModel.expressionsPropertyMetaModel = new PropertyMetaModel( + jmlMultiCompareExprMetaModel, + "expressions", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + false, + true, + true, + false); + jmlMultiCompareExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlMultiCompareExprMetaModel.expressionsPropertyMetaModel); + jmlMultiCompareExprMetaModel.operatorsPropertyMetaModel = new PropertyMetaModel( + jmlMultiCompareExprMetaModel, + "operators", + com.github.javaparser.ast.jml.expr.JmlMultiCompareExpr.Operators.class, + Optional.empty(), + false, + false, + false, + false); + jmlMultiCompareExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlMultiCompareExprMetaModel.operatorsPropertyMetaModel); + jmlLabelExprMetaModel.expressionPropertyMetaModel = new PropertyMetaModel( + jmlLabelExprMetaModel, + "expression", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + false, + false, + false, + false); + jmlLabelExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLabelExprMetaModel.expressionPropertyMetaModel); + jmlLabelExprMetaModel.kindPropertyMetaModel = new PropertyMetaModel( + jmlLabelExprMetaModel, + "kind", + com.github.javaparser.ast.jml.expr.JmlLabelExpr.Kind.class, + Optional.empty(), + false, + false, + false, + false); + jmlLabelExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLabelExprMetaModel.kindPropertyMetaModel); + jmlLabelExprMetaModel.labelPropertyMetaModel = new PropertyMetaModel( + jmlLabelExprMetaModel, + "label", + com.github.javaparser.ast.expr.SimpleName.class, + Optional.of(simpleNameMetaModel), + false, + false, + false, + false); + jmlLabelExprMetaModel.getDeclaredPropertyMetaModels().add(jmlLabelExprMetaModel.labelPropertyMetaModel); + jmlSetComprehensionExprMetaModel.bindingPropertyMetaModel = new PropertyMetaModel( + jmlSetComprehensionExprMetaModel, + "binding", + com.github.javaparser.ast.body.VariableDeclarator.class, + Optional.of(variableDeclaratorMetaModel), + false, + false, + false, + false); + jmlSetComprehensionExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlSetComprehensionExprMetaModel.bindingPropertyMetaModel); + jmlSetComprehensionExprMetaModel.predicatePropertyMetaModel = new PropertyMetaModel( + jmlSetComprehensionExprMetaModel, + "predicate", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), + false, + false, + false, + false); + jmlSetComprehensionExprMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlSetComprehensionExprMetaModel.predicatePropertyMetaModel); jmlGhostStmtMetaModel.jmlTagsPropertyMetaModel = new PropertyMetaModel( jmlGhostStmtMetaModel, "jmlTags", @@ -3709,16 +3939,18 @@ private static void initializePropertyMetaModels() { jmlSignalsOnlyClauseMetaModel .getDeclaredPropertyMetaModels() .add(jmlSignalsOnlyClauseMetaModel.typesPropertyMetaModel); - jmlClauseLabelMetaModel.exprPropertyMetaModel = new PropertyMetaModel( + jmlClauseLabelMetaModel.expressionPropertyMetaModel = new PropertyMetaModel( jmlClauseLabelMetaModel, - "expr", + "expression", com.github.javaparser.ast.expr.Expression.class, Optional.of(expressionMetaModel), false, false, false, false); - jmlClauseLabelMetaModel.getDeclaredPropertyMetaModels().add(jmlClauseLabelMetaModel.exprPropertyMetaModel); + jmlClauseLabelMetaModel + .getDeclaredPropertyMetaModels() + .add(jmlClauseLabelMetaModel.expressionPropertyMetaModel); jmlClauseLabelMetaModel.kindPropertyMetaModel = new PropertyMetaModel( jmlClauseLabelMetaModel, "kind", @@ -3783,26 +4015,26 @@ private static void initializePropertyMetaModels() { false, false); jmlClauseIfMetaModel.getDeclaredPropertyMetaModels().add(jmlClauseIfMetaModel.conditionPropertyMetaModel); - jmlClauseIfMetaModel.kindPropertyMetaModel = new PropertyMetaModel( + jmlClauseIfMetaModel.expressionPropertyMetaModel = new PropertyMetaModel( jmlClauseIfMetaModel, - "kind", - com.github.javaparser.ast.jml.clauses.JmlClauseKind.class, - Optional.empty(), + "expression", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), false, false, false, false); - jmlClauseIfMetaModel.getDeclaredPropertyMetaModels().add(jmlClauseIfMetaModel.kindPropertyMetaModel); - jmlClauseIfMetaModel.thenPropertyMetaModel = new PropertyMetaModel( + jmlClauseIfMetaModel.getDeclaredPropertyMetaModels().add(jmlClauseIfMetaModel.expressionPropertyMetaModel); + jmlClauseIfMetaModel.kindPropertyMetaModel = new PropertyMetaModel( jmlClauseIfMetaModel, - "then", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), + "kind", + com.github.javaparser.ast.jml.clauses.JmlClauseKind.class, + Optional.empty(), false, false, false, false); - jmlClauseIfMetaModel.getDeclaredPropertyMetaModels().add(jmlClauseIfMetaModel.thenPropertyMetaModel); + jmlClauseIfMetaModel.getDeclaredPropertyMetaModels().add(jmlClauseIfMetaModel.kindPropertyMetaModel); jmlMethodSignatureMetaModel.argumentTypesPropertyMetaModel = new PropertyMetaModel( jmlMethodSignatureMetaModel, "argumentTypes", @@ -4050,247 +4282,11 @@ private static void initializePropertyMetaModels() { false, false, false); - jmlClassAccessibleDeclarationMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlClassAccessibleDeclarationMetaModel.measuredByPropertyMetaModel); - jmlClassAccessibleDeclarationMetaModel.modifiersPropertyMetaModel = new PropertyMetaModel( - jmlClassAccessibleDeclarationMetaModel, - "modifiers", - com.github.javaparser.ast.Modifier.class, - Optional.of(modifierMetaModel), - false, - false, - true, - false); - jmlClassAccessibleDeclarationMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlClassAccessibleDeclarationMetaModel.modifiersPropertyMetaModel); - jmlClassAccessibleDeclarationMetaModel.variablePropertyMetaModel = new PropertyMetaModel( - jmlClassAccessibleDeclarationMetaModel, - "variable", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - jmlClassAccessibleDeclarationMetaModel - .getDeclaredPropertyMetaModels() - .add(jmlClassAccessibleDeclarationMetaModel.variablePropertyMetaModel); - arrayTypeMetaModel.componentTypePropertyMetaModel = new PropertyMetaModel( - arrayTypeMetaModel, - "componentType", - com.github.javaparser.ast.type.Type.class, - Optional.of(typeMetaModel), - false, - false, - false, - false); - arrayTypeMetaModel.getDeclaredPropertyMetaModels().add(arrayTypeMetaModel.componentTypePropertyMetaModel); - arrayTypeMetaModel.originPropertyMetaModel = new PropertyMetaModel( - arrayTypeMetaModel, - "origin", - com.github.javaparser.ast.type.ArrayType.Origin.class, - Optional.empty(), - false, - false, - false, - false); - arrayTypeMetaModel.getDeclaredPropertyMetaModels().add(arrayTypeMetaModel.originPropertyMetaModel); - classOrInterfaceTypeMetaModel.namePropertyMetaModel = new PropertyMetaModel( - classOrInterfaceTypeMetaModel, - "name", - com.github.javaparser.ast.expr.SimpleName.class, - Optional.of(simpleNameMetaModel), - false, - false, - false, - false); - classOrInterfaceTypeMetaModel - .getDeclaredPropertyMetaModels() - .add(classOrInterfaceTypeMetaModel.namePropertyMetaModel); - classOrInterfaceTypeMetaModel.scopePropertyMetaModel = new PropertyMetaModel( - classOrInterfaceTypeMetaModel, - "scope", - com.github.javaparser.ast.type.ClassOrInterfaceType.class, - Optional.of(classOrInterfaceTypeMetaModel), - true, - false, - false, - false); - classOrInterfaceTypeMetaModel - .getDeclaredPropertyMetaModels() - .add(classOrInterfaceTypeMetaModel.scopePropertyMetaModel); - classOrInterfaceTypeMetaModel.typeArgumentsPropertyMetaModel = new PropertyMetaModel( - classOrInterfaceTypeMetaModel, - "typeArguments", - com.github.javaparser.ast.type.Type.class, - Optional.of(typeMetaModel), - true, - false, - true, - false); - classOrInterfaceTypeMetaModel - .getDeclaredPropertyMetaModels() - .add(classOrInterfaceTypeMetaModel.typeArgumentsPropertyMetaModel); - classOrInterfaceTypeMetaModel.usingDiamondOperatorPropertyMetaModel = new PropertyMetaModel( - classOrInterfaceTypeMetaModel, - "usingDiamondOperator", - boolean.class, - Optional.empty(), - false, - false, - false, - false); - classOrInterfaceTypeMetaModel - .getDerivedPropertyMetaModels() - .add(classOrInterfaceTypeMetaModel.usingDiamondOperatorPropertyMetaModel); - intersectionTypeMetaModel.elementsPropertyMetaModel = new PropertyMetaModel( - intersectionTypeMetaModel, - "elements", - com.github.javaparser.ast.type.ReferenceType.class, - Optional.of(referenceTypeMetaModel), - false, - true, - true, - false); - intersectionTypeMetaModel - .getDeclaredPropertyMetaModels() - .add(intersectionTypeMetaModel.elementsPropertyMetaModel); - primitiveTypeMetaModel.typePropertyMetaModel = new PropertyMetaModel( - primitiveTypeMetaModel, - "type", - com.github.javaparser.ast.type.PrimitiveType.Primitive.class, - Optional.empty(), - false, - false, - false, - false); - primitiveTypeMetaModel.getDeclaredPropertyMetaModels().add(primitiveTypeMetaModel.typePropertyMetaModel); - typeParameterMetaModel.namePropertyMetaModel = new PropertyMetaModel( - typeParameterMetaModel, - "name", - com.github.javaparser.ast.expr.SimpleName.class, - Optional.of(simpleNameMetaModel), - false, - false, - false, - false); - typeParameterMetaModel.getDeclaredPropertyMetaModels().add(typeParameterMetaModel.namePropertyMetaModel); - typeParameterMetaModel.typeBoundPropertyMetaModel = new PropertyMetaModel( - typeParameterMetaModel, - "typeBound", - com.github.javaparser.ast.type.ClassOrInterfaceType.class, - Optional.of(classOrInterfaceTypeMetaModel), - false, - false, - true, - false); - typeParameterMetaModel.getDeclaredPropertyMetaModels().add(typeParameterMetaModel.typeBoundPropertyMetaModel); - unionTypeMetaModel.elementsPropertyMetaModel = new PropertyMetaModel( - unionTypeMetaModel, - "elements", - com.github.javaparser.ast.type.ReferenceType.class, - Optional.of(referenceTypeMetaModel), - false, - true, - true, - false); - unionTypeMetaModel.getDeclaredPropertyMetaModels().add(unionTypeMetaModel.elementsPropertyMetaModel); - wildcardTypeMetaModel.extendedTypePropertyMetaModel = new PropertyMetaModel( - wildcardTypeMetaModel, - "extendedType", - com.github.javaparser.ast.type.ReferenceType.class, - Optional.of(referenceTypeMetaModel), - true, - false, - false, - false); - wildcardTypeMetaModel.getDeclaredPropertyMetaModels().add(wildcardTypeMetaModel.extendedTypePropertyMetaModel); - wildcardTypeMetaModel.superTypePropertyMetaModel = new PropertyMetaModel( - wildcardTypeMetaModel, - "superType", - com.github.javaparser.ast.type.ReferenceType.class, - Optional.of(referenceTypeMetaModel), - true, - false, - false, - false); - wildcardTypeMetaModel.getDeclaredPropertyMetaModels().add(wildcardTypeMetaModel.superTypePropertyMetaModel); - moduleExportsDirectiveMetaModel.moduleNamesPropertyMetaModel = new PropertyMetaModel( - moduleExportsDirectiveMetaModel, - "moduleNames", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), - false, - false, - true, - false); - moduleExportsDirectiveMetaModel - .getDeclaredPropertyMetaModels() - .add(moduleExportsDirectiveMetaModel.moduleNamesPropertyMetaModel); - moduleExportsDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( - moduleExportsDirectiveMetaModel, - "name", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), - false, - false, - false, - false); - moduleExportsDirectiveMetaModel - .getDeclaredPropertyMetaModels() - .add(moduleExportsDirectiveMetaModel.namePropertyMetaModel); - moduleOpensDirectiveMetaModel.moduleNamesPropertyMetaModel = new PropertyMetaModel( - moduleOpensDirectiveMetaModel, - "moduleNames", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), - false, - false, - true, - false); - moduleOpensDirectiveMetaModel - .getDeclaredPropertyMetaModels() - .add(moduleOpensDirectiveMetaModel.moduleNamesPropertyMetaModel); - moduleOpensDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( - moduleOpensDirectiveMetaModel, - "name", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), - false, - false, - false, - false); - moduleOpensDirectiveMetaModel - .getDeclaredPropertyMetaModels() - .add(moduleOpensDirectiveMetaModel.namePropertyMetaModel); - moduleProvidesDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( - moduleProvidesDirectiveMetaModel, - "name", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), - false, - false, - false, - false); - moduleProvidesDirectiveMetaModel - .getDeclaredPropertyMetaModels() - .add(moduleProvidesDirectiveMetaModel.namePropertyMetaModel); - moduleProvidesDirectiveMetaModel.withPropertyMetaModel = new PropertyMetaModel( - moduleProvidesDirectiveMetaModel, - "with", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), - false, - false, - true, - false); - moduleProvidesDirectiveMetaModel + jmlClassAccessibleDeclarationMetaModel .getDeclaredPropertyMetaModels() - .add(moduleProvidesDirectiveMetaModel.withPropertyMetaModel); - moduleRequiresDirectiveMetaModel.modifiersPropertyMetaModel = new PropertyMetaModel( - moduleRequiresDirectiveMetaModel, + .add(jmlClassAccessibleDeclarationMetaModel.measuredByPropertyMetaModel); + jmlClassAccessibleDeclarationMetaModel.modifiersPropertyMetaModel = new PropertyMetaModel( + jmlClassAccessibleDeclarationMetaModel, "modifiers", com.github.javaparser.ast.Modifier.class, Optional.of(modifierMetaModel), @@ -4298,35 +4294,23 @@ private static void initializePropertyMetaModels() { false, true, false); - moduleRequiresDirectiveMetaModel - .getDeclaredPropertyMetaModels() - .add(moduleRequiresDirectiveMetaModel.modifiersPropertyMetaModel); - moduleRequiresDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( - moduleRequiresDirectiveMetaModel, - "name", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), - false, - false, - false, - false); - moduleRequiresDirectiveMetaModel + jmlClassAccessibleDeclarationMetaModel .getDeclaredPropertyMetaModels() - .add(moduleRequiresDirectiveMetaModel.namePropertyMetaModel); - moduleUsesDirectiveMetaModel.namePropertyMetaModel = new PropertyMetaModel( - moduleUsesDirectiveMetaModel, - "name", - com.github.javaparser.ast.expr.Name.class, - Optional.of(nameMetaModel), + .add(jmlClassAccessibleDeclarationMetaModel.modifiersPropertyMetaModel); + jmlClassAccessibleDeclarationMetaModel.variablePropertyMetaModel = new PropertyMetaModel( + jmlClassAccessibleDeclarationMetaModel, + "variable", + com.github.javaparser.ast.expr.Expression.class, + Optional.of(expressionMetaModel), false, false, false, false); - moduleUsesDirectiveMetaModel + jmlClassAccessibleDeclarationMetaModel .getDeclaredPropertyMetaModels() - .add(moduleUsesDirectiveMetaModel.namePropertyMetaModel); - keyCatchAllStatementMetaModel.blockPropertyMetaModel = new PropertyMetaModel( - keyCatchAllStatementMetaModel, + .add(jmlClassAccessibleDeclarationMetaModel.variablePropertyMetaModel); + keyCatchAllStmtMetaModel.blockPropertyMetaModel = new PropertyMetaModel( + keyCatchAllStmtMetaModel, "block", com.github.javaparser.ast.stmt.BlockStmt.class, Optional.of(blockStmtMetaModel), @@ -4334,11 +4318,9 @@ private static void initializePropertyMetaModels() { false, false, false); - keyCatchAllStatementMetaModel - .getDeclaredPropertyMetaModels() - .add(keyCatchAllStatementMetaModel.blockPropertyMetaModel); - keyCatchAllStatementMetaModel.labelPropertyMetaModel = new PropertyMetaModel( - keyCatchAllStatementMetaModel, + keyCatchAllStmtMetaModel.getDeclaredPropertyMetaModels().add(keyCatchAllStmtMetaModel.blockPropertyMetaModel); + keyCatchAllStmtMetaModel.labelPropertyMetaModel = new PropertyMetaModel( + keyCatchAllStmtMetaModel, "label", com.github.javaparser.ast.expr.Name.class, Optional.of(nameMetaModel), @@ -4346,9 +4328,7 @@ private static void initializePropertyMetaModels() { false, false, false); - keyCatchAllStatementMetaModel - .getDeclaredPropertyMetaModels() - .add(keyCatchAllStatementMetaModel.labelPropertyMetaModel); + keyCatchAllStmtMetaModel.getDeclaredPropertyMetaModels().add(keyCatchAllStmtMetaModel.labelPropertyMetaModel); keyCcatchBreakMetaModel.blockPropertyMetaModel = new PropertyMetaModel( keyCcatchBreakMetaModel, "block", @@ -4463,8 +4443,8 @@ private static void initializePropertyMetaModels() { keyEscapeExpressionMetaModel .getDeclaredPropertyMetaModels() .add(keyEscapeExpressionMetaModel.calleePropertyMetaModel); - keyExecStatementMetaModel.branchesPropertyMetaModel = new PropertyMetaModel( - keyExecStatementMetaModel, + keyExecStmtMetaModel.branchesPropertyMetaModel = new PropertyMetaModel( + keyExecStmtMetaModel, "branches", com.github.javaparser.ast.key.KeyCcatchBranch.class, Optional.of(keyCcatchBranchMetaModel), @@ -4472,11 +4452,9 @@ private static void initializePropertyMetaModels() { false, true, false); - keyExecStatementMetaModel - .getDeclaredPropertyMetaModels() - .add(keyExecStatementMetaModel.branchesPropertyMetaModel); - keyExecStatementMetaModel.execBlockPropertyMetaModel = new PropertyMetaModel( - keyExecStatementMetaModel, + keyExecStmtMetaModel.getDeclaredPropertyMetaModels().add(keyExecStmtMetaModel.branchesPropertyMetaModel); + keyExecStmtMetaModel.execBlockPropertyMetaModel = new PropertyMetaModel( + keyExecStmtMetaModel, "execBlock", com.github.javaparser.ast.stmt.BlockStmt.class, Optional.of(blockStmtMetaModel), @@ -4484,9 +4462,7 @@ private static void initializePropertyMetaModels() { false, false, false); - keyExecStatementMetaModel - .getDeclaredPropertyMetaModels() - .add(keyExecStatementMetaModel.execBlockPropertyMetaModel); + keyExecStmtMetaModel.getDeclaredPropertyMetaModels().add(keyExecStmtMetaModel.execBlockPropertyMetaModel); keyExecutionContextMetaModel.contextPropertyMetaModel = new PropertyMetaModel( keyExecutionContextMetaModel, "context", @@ -4523,8 +4499,8 @@ private static void initializePropertyMetaModels() { keyExecutionContextMetaModel .getDeclaredPropertyMetaModels() .add(keyExecutionContextMetaModel.signaturePropertyMetaModel); - keyLoopScopeBlockMetaModel.blockPropertyMetaModel = new PropertyMetaModel( - keyLoopScopeBlockMetaModel, + keyLoopScopeBlockStmtMetaModel.blockPropertyMetaModel = new PropertyMetaModel( + keyLoopScopeBlockStmtMetaModel, "block", com.github.javaparser.ast.stmt.BlockStmt.class, Optional.of(blockStmtMetaModel), @@ -4532,11 +4508,11 @@ private static void initializePropertyMetaModels() { false, false, false); - keyLoopScopeBlockMetaModel + keyLoopScopeBlockStmtMetaModel .getDeclaredPropertyMetaModels() - .add(keyLoopScopeBlockMetaModel.blockPropertyMetaModel); - keyLoopScopeBlockMetaModel.indexPVPropertyMetaModel = new PropertyMetaModel( - keyLoopScopeBlockMetaModel, + .add(keyLoopScopeBlockStmtMetaModel.blockPropertyMetaModel); + keyLoopScopeBlockStmtMetaModel.indexPVPropertyMetaModel = new PropertyMetaModel( + keyLoopScopeBlockStmtMetaModel, "indexPV", com.github.javaparser.ast.expr.Expression.class, Optional.of(expressionMetaModel), @@ -4544,11 +4520,11 @@ private static void initializePropertyMetaModels() { false, false, false); - keyLoopScopeBlockMetaModel + keyLoopScopeBlockStmtMetaModel .getDeclaredPropertyMetaModels() - .add(keyLoopScopeBlockMetaModel.indexPVPropertyMetaModel); - keyMergePointStatementMetaModel.exprPropertyMetaModel = new PropertyMetaModel( - keyMergePointStatementMetaModel, + .add(keyLoopScopeBlockStmtMetaModel.indexPVPropertyMetaModel); + keyMergePointStmtMetaModel.exprPropertyMetaModel = new PropertyMetaModel( + keyMergePointStmtMetaModel, "expr", com.github.javaparser.ast.expr.Expression.class, Optional.of(expressionMetaModel), @@ -4556,9 +4532,9 @@ private static void initializePropertyMetaModels() { false, false, false); - keyMergePointStatementMetaModel + keyMergePointStmtMetaModel .getDeclaredPropertyMetaModels() - .add(keyMergePointStatementMetaModel.exprPropertyMetaModel); + .add(keyMergePointStmtMetaModel.exprPropertyMetaModel); keyMethodBodyStatementMetaModel.exprPropertyMetaModel = new PropertyMetaModel( keyMethodBodyStatementMetaModel, "expr", @@ -4595,8 +4571,8 @@ private static void initializePropertyMetaModels() { keyMethodBodyStatementMetaModel .getDeclaredPropertyMetaModels() .add(keyMethodBodyStatementMetaModel.sourcePropertyMetaModel); - keyMethodCallStatementMetaModel.blockPropertyMetaModel = new PropertyMetaModel( - keyMethodCallStatementMetaModel, + keyMethodCallStmtMetaModel.blockPropertyMetaModel = new PropertyMetaModel( + keyMethodCallStmtMetaModel, "block", com.github.javaparser.ast.stmt.BlockStmt.class, Optional.of(blockStmtMetaModel), @@ -4604,11 +4580,11 @@ private static void initializePropertyMetaModels() { false, false, false); - keyMethodCallStatementMetaModel + keyMethodCallStmtMetaModel .getDeclaredPropertyMetaModels() - .add(keyMethodCallStatementMetaModel.blockPropertyMetaModel); - keyMethodCallStatementMetaModel.contextPropertyMetaModel = new PropertyMetaModel( - keyMethodCallStatementMetaModel, + .add(keyMethodCallStmtMetaModel.blockPropertyMetaModel); + keyMethodCallStmtMetaModel.contextPropertyMetaModel = new PropertyMetaModel( + keyMethodCallStmtMetaModel, "context", com.github.javaparser.ast.key.KeyAbstractExecutionContext.class, Optional.of(keyAbstractExecutionContextMetaModel), @@ -4616,11 +4592,11 @@ private static void initializePropertyMetaModels() { false, false, false); - keyMethodCallStatementMetaModel + keyMethodCallStmtMetaModel .getDeclaredPropertyMetaModels() - .add(keyMethodCallStatementMetaModel.contextPropertyMetaModel); - keyMethodCallStatementMetaModel.namePropertyMetaModel = new PropertyMetaModel( - keyMethodCallStatementMetaModel, + .add(keyMethodCallStmtMetaModel.contextPropertyMetaModel); + keyMethodCallStmtMetaModel.namePropertyMetaModel = new PropertyMetaModel( + keyMethodCallStmtMetaModel, "name", com.github.javaparser.ast.expr.Name.class, Optional.of(nameMetaModel), @@ -4628,9 +4604,9 @@ private static void initializePropertyMetaModels() { false, false, false); - keyMethodCallStatementMetaModel + keyMethodCallStmtMetaModel .getDeclaredPropertyMetaModels() - .add(keyMethodCallStatementMetaModel.namePropertyMetaModel); + .add(keyMethodCallStmtMetaModel.namePropertyMetaModel); keyMethodSignatureMetaModel.namePropertyMetaModel = new PropertyMetaModel( keyMethodSignatureMetaModel, "name", @@ -4655,42 +4631,23 @@ private static void initializePropertyMetaModels() { keyMethodSignatureMetaModel .getDeclaredPropertyMetaModels() .add(keyMethodSignatureMetaModel.paramTypesPropertyMetaModel); - keyRangeExpressionMetaModel.lowerPropertyMetaModel = new PropertyMetaModel( - keyRangeExpressionMetaModel, - "lower", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - keyRangeExpressionMetaModel - .getDeclaredPropertyMetaModels() - .add(keyRangeExpressionMetaModel.lowerPropertyMetaModel); - keyRangeExpressionMetaModel.upperPropertyMetaModel = new PropertyMetaModel( - keyRangeExpressionMetaModel, - "upper", - com.github.javaparser.ast.expr.Expression.class, - Optional.of(expressionMetaModel), - false, - false, - false, - false); - keyRangeExpressionMetaModel - .getDeclaredPropertyMetaModels() - .add(keyRangeExpressionMetaModel.upperPropertyMetaModel); - keyTransactionStatementMetaModel.typePropertyMetaModel = new PropertyMetaModel( - keyTransactionStatementMetaModel, + keyTransactionStmtMetaModel.typePropertyMetaModel = new PropertyMetaModel( + keyTransactionStmtMetaModel, "type", - com.github.javaparser.ast.key.KeyTransactionStatement.TransactionType.class, + com.github.javaparser.ast.key.KeyTransactionStmt.TransactionType.class, Optional.empty(), false, false, false, false); - keyTransactionStatementMetaModel + keyTransactionStmtMetaModel + .getDeclaredPropertyMetaModels() + .add(keyTransactionStmtMetaModel.typePropertyMetaModel); + keYMarkerStatementMetaModel.kindPropertyMetaModel = new PropertyMetaModel( + keYMarkerStatementMetaModel, "kind", int.class, Optional.empty(), false, false, false, false); + keYMarkerStatementMetaModel .getDeclaredPropertyMetaModels() - .add(keyTransactionStatementMetaModel.typePropertyMetaModel); + .add(keYMarkerStatementMetaModel.kindPropertyMetaModel); keyContextStatementBlockMetaModel.contextPropertyMetaModel = new PropertyMetaModel( keyContextStatementBlockMetaModel, "context", @@ -5211,49 +5168,6 @@ public static Optional getNodeMetaModel(Class c) { public static final VariableDeclarationExprMetaModel variableDeclarationExprMetaModel = new VariableDeclarationExprMetaModel(Optional.of(expressionMetaModel)); - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlDocMetaModel jmlDocMetaModel = new JmlDocMetaModel(Optional.of(nodeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlDocDeclarationMetaModel jmlDocDeclarationMetaModel = - new JmlDocDeclarationMetaModel(Optional.of(bodyDeclarationMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlDocStmtMetaModel jmlDocStmtMetaModel = - new JmlDocStmtMetaModel(Optional.of(statementMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlDocTypeMetaModel jmlDocTypeMetaModel = - new JmlDocTypeMetaModel(Optional.of(typeDeclarationMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlQuantifiedExprMetaModel jmlQuantifiedExprMetaModel = - new JmlQuantifiedExprMetaModel(Optional.of(expressionMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlTypeExprMetaModel jmlTypeExprMetaModel = - new JmlTypeExprMetaModel(Optional.of(expressionMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlBinaryInfixExprMetaModel jmlBinaryInfixExprMetaModel = - new JmlBinaryInfixExprMetaModel(Optional.of(expressionMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlLetExprMetaModel jmlLetExprMetaModel = - new JmlLetExprMetaModel(Optional.of(expressionMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlMultiCompareExprMetaModel jmlMultiCompareExprMetaModel = - new JmlMultiCompareExprMetaModel(Optional.of(expressionMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlLabelExprMetaModel jmlLabelExprMetaModel = - new JmlLabelExprMetaModel(Optional.of(expressionMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final JmlSetComprehensionExprMetaModel jmlSetComprehensionExprMetaModel = - new JmlSetComprehensionExprMetaModel(Optional.of(expressionMetaModel)); - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final AssertStmtMetaModel assertStmtMetaModel = new AssertStmtMetaModel(Optional.of(statementMetaModel)); @@ -5340,6 +5254,106 @@ public static Optional getNodeMetaModel(Class c) { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final YieldStmtMetaModel yieldStmtMetaModel = new YieldStmtMetaModel(Optional.of(statementMetaModel)); + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final ArrayTypeMetaModel arrayTypeMetaModel = + new ArrayTypeMetaModel(Optional.of(referenceTypeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final ClassOrInterfaceTypeMetaModel classOrInterfaceTypeMetaModel = + new ClassOrInterfaceTypeMetaModel(Optional.of(referenceTypeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final IntersectionTypeMetaModel intersectionTypeMetaModel = + new IntersectionTypeMetaModel(Optional.of(typeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final PrimitiveTypeMetaModel primitiveTypeMetaModel = + new PrimitiveTypeMetaModel(Optional.of(typeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final TypeParameterMetaModel typeParameterMetaModel = + new TypeParameterMetaModel(Optional.of(referenceTypeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final UnionTypeMetaModel unionTypeMetaModel = new UnionTypeMetaModel(Optional.of(typeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final UnknownTypeMetaModel unknownTypeMetaModel = + new UnknownTypeMetaModel(Optional.of(typeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final VarTypeMetaModel varTypeMetaModel = new VarTypeMetaModel(Optional.of(typeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final VoidTypeMetaModel voidTypeMetaModel = new VoidTypeMetaModel(Optional.of(typeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final WildcardTypeMetaModel wildcardTypeMetaModel = + new WildcardTypeMetaModel(Optional.of(typeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final ModuleExportsDirectiveMetaModel moduleExportsDirectiveMetaModel = + new ModuleExportsDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final ModuleOpensDirectiveMetaModel moduleOpensDirectiveMetaModel = + new ModuleOpensDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final ModuleProvidesDirectiveMetaModel moduleProvidesDirectiveMetaModel = + new ModuleProvidesDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final ModuleRequiresDirectiveMetaModel moduleRequiresDirectiveMetaModel = + new ModuleRequiresDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final ModuleUsesDirectiveMetaModel moduleUsesDirectiveMetaModel = + new ModuleUsesDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlDocMetaModel jmlDocMetaModel = new JmlDocMetaModel(Optional.of(nodeMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlDocDeclarationMetaModel jmlDocDeclarationMetaModel = + new JmlDocDeclarationMetaModel(Optional.of(bodyDeclarationMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlDocStmtMetaModel jmlDocStmtMetaModel = + new JmlDocStmtMetaModel(Optional.of(statementMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlDocTypeMetaModel jmlDocTypeMetaModel = + new JmlDocTypeMetaModel(Optional.of(typeDeclarationMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlQuantifiedExprMetaModel jmlQuantifiedExprMetaModel = + new JmlQuantifiedExprMetaModel(Optional.of(expressionMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlTypeExprMetaModel jmlTypeExprMetaModel = + new JmlTypeExprMetaModel(Optional.of(expressionMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlBinaryInfixExprMetaModel jmlBinaryInfixExprMetaModel = + new JmlBinaryInfixExprMetaModel(Optional.of(expressionMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlLetExprMetaModel jmlLetExprMetaModel = + new JmlLetExprMetaModel(Optional.of(expressionMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlMultiCompareExprMetaModel jmlMultiCompareExprMetaModel = + new JmlMultiCompareExprMetaModel(Optional.of(expressionMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlLabelExprMetaModel jmlLabelExprMetaModel = + new JmlLabelExprMetaModel(Optional.of(expressionMetaModel)); + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + public static final JmlSetComprehensionExprMetaModel jmlSetComprehensionExprMetaModel = + new JmlSetComprehensionExprMetaModel(Optional.of(expressionMetaModel)); + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final JmlStatementMetaModel jmlStatementMetaModel = new JmlStatementMetaModel(Optional.of(statementMetaModel)); @@ -5443,70 +5457,13 @@ public static Optional getNodeMetaModel(Class c) { public static final JmlClassAccessibleDeclarationMetaModel jmlClassAccessibleDeclarationMetaModel = new JmlClassAccessibleDeclarationMetaModel(Optional.of(jmlClassLevelDeclarationMetaModel)); - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final ArrayTypeMetaModel arrayTypeMetaModel = - new ArrayTypeMetaModel(Optional.of(referenceTypeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final ClassOrInterfaceTypeMetaModel classOrInterfaceTypeMetaModel = - new ClassOrInterfaceTypeMetaModel(Optional.of(referenceTypeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final IntersectionTypeMetaModel intersectionTypeMetaModel = - new IntersectionTypeMetaModel(Optional.of(typeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final PrimitiveTypeMetaModel primitiveTypeMetaModel = - new PrimitiveTypeMetaModel(Optional.of(typeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final TypeParameterMetaModel typeParameterMetaModel = - new TypeParameterMetaModel(Optional.of(referenceTypeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final UnionTypeMetaModel unionTypeMetaModel = new UnionTypeMetaModel(Optional.of(typeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final UnknownTypeMetaModel unknownTypeMetaModel = - new UnknownTypeMetaModel(Optional.of(typeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final VarTypeMetaModel varTypeMetaModel = new VarTypeMetaModel(Optional.of(typeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final VoidTypeMetaModel voidTypeMetaModel = new VoidTypeMetaModel(Optional.of(typeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final WildcardTypeMetaModel wildcardTypeMetaModel = - new WildcardTypeMetaModel(Optional.of(typeMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final ModuleExportsDirectiveMetaModel moduleExportsDirectiveMetaModel = - new ModuleExportsDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final ModuleOpensDirectiveMetaModel moduleOpensDirectiveMetaModel = - new ModuleOpensDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final ModuleProvidesDirectiveMetaModel moduleProvidesDirectiveMetaModel = - new ModuleProvidesDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final ModuleRequiresDirectiveMetaModel moduleRequiresDirectiveMetaModel = - new ModuleRequiresDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); - - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final ModuleUsesDirectiveMetaModel moduleUsesDirectiveMetaModel = - new ModuleUsesDirectiveMetaModel(Optional.of(moduleDirectiveMetaModel)); - @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final KeyAbstractExecutionContextMetaModel keyAbstractExecutionContextMetaModel = new KeyAbstractExecutionContextMetaModel(Optional.of(nodeMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final KeyCatchAllStatementMetaModel keyCatchAllStatementMetaModel = - new KeyCatchAllStatementMetaModel(Optional.of(statementMetaModel)); + public static final KeyCatchAllStmtMetaModel keyCatchAllStmtMetaModel = + new KeyCatchAllStmtMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final KeyCcatchBranchMetaModel keyCcatchBranchMetaModel = @@ -5533,40 +5490,40 @@ public static Optional getNodeMetaModel(Class c) { new KeyEscapeExpressionMetaModel(Optional.of(expressionMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final KeyExecStatementMetaModel keyExecStatementMetaModel = - new KeyExecStatementMetaModel(Optional.of(statementMetaModel)); + public static final KeyExecStmtMetaModel keyExecStmtMetaModel = + new KeyExecStmtMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final KeyExecutionContextMetaModel keyExecutionContextMetaModel = new KeyExecutionContextMetaModel(Optional.of(keyAbstractExecutionContextMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final KeyLoopScopeBlockMetaModel keyLoopScopeBlockMetaModel = - new KeyLoopScopeBlockMetaModel(Optional.of(statementMetaModel)); + public static final KeyLoopScopeBlockStmtMetaModel keyLoopScopeBlockStmtMetaModel = + new KeyLoopScopeBlockStmtMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final KeyMergePointStatementMetaModel keyMergePointStatementMetaModel = - new KeyMergePointStatementMetaModel(Optional.of(statementMetaModel)); + public static final KeyMergePointStmtMetaModel keyMergePointStmtMetaModel = + new KeyMergePointStmtMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final KeyMethodBodyStatementMetaModel keyMethodBodyStatementMetaModel = new KeyMethodBodyStatementMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final KeyMethodCallStatementMetaModel keyMethodCallStatementMetaModel = - new KeyMethodCallStatementMetaModel(Optional.of(statementMetaModel)); + public static final KeyMethodCallStmtMetaModel keyMethodCallStmtMetaModel = + new KeyMethodCallStmtMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final KeyMethodSignatureMetaModel keyMethodSignatureMetaModel = new KeyMethodSignatureMetaModel(Optional.of(nodeMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final KeyRangeExpressionMetaModel keyRangeExpressionMetaModel = - new KeyRangeExpressionMetaModel(Optional.of(expressionMetaModel)); + public static final KeyTransactionStmtMetaModel keyTransactionStmtMetaModel = + new KeyTransactionStmtMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - public static final KeyTransactionStatementMetaModel keyTransactionStatementMetaModel = - new KeyTransactionStatementMetaModel(Optional.of(statementMetaModel)); + public static final KeYMarkerStatementMetaModel keYMarkerStatementMetaModel = + new KeYMarkerStatementMetaModel(Optional.of(statementMetaModel)); @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") public static final KeyContextStatementBlockMetaModel keyContextStatementBlockMetaModel = diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java index b5e0ecfdca..e6b5707007 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java @@ -49,7 +49,7 @@ public class JmlClauseIfMetaModel extends JmlClauseMetaModel { public PropertyMetaModel conditionPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel thenPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java index e62d0d03f3..d866bd4971 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java @@ -47,7 +47,7 @@ public class JmlClauseLabelMetaModel extends JmlClauseMetaModel { false); } - public PropertyMetaModel exprPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; public PropertyMetaModel kindPropertyMetaModel; diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyRangeExpressionMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeYMarkerStatementMetaModel.java similarity index 81% rename from javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyRangeExpressionMetaModel.java rename to javaparser-core/src/main/java/com/github/javaparser/metamodel/KeYMarkerStatementMetaModel.java index 6b70da323c..603c9f0c9b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyRangeExpressionMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeYMarkerStatementMetaModel.java @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.key.KeyRangeExpression; +import com.github.javaparser.ast.key.KeYMarkerStatement; import java.util.Optional; /** @@ -34,20 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class KeyRangeExpressionMetaModel extends ExpressionMetaModel { +public class KeYMarkerStatementMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - KeyRangeExpressionMetaModel(Optional superBaseNodeMetaModel) { + KeYMarkerStatementMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - KeyRangeExpression.class, - "KeyRangeExpression", + KeYMarkerStatement.class, + "KeYMarkerStatement", "com.github.javaparser.ast.key", false, false); } - public PropertyMetaModel lowerPropertyMetaModel; - - public PropertyMetaModel upperPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyCatchAllStatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyCatchAllStatementMetaModel.java index c5f5d1749c..f4e59963c8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyCatchAllStatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyCatchAllStatementMetaModel.java @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.key.KeyCatchAllStatement; +import com.github.javaparser.ast.key.KeyCatchAllStmt; import java.util.Optional; /** @@ -40,7 +40,7 @@ public class KeyCatchAllStatementMetaModel extends StatementMetaModel { KeyCatchAllStatementMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - KeyCatchAllStatement.class, + KeyCatchAllStmt.class, "KeyCatchAllStatement", "com.github.javaparser.ast.key", false, diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyCatchAllStmtMetaModel.java similarity index 74% rename from javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java rename to javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyCatchAllStmtMetaModel.java index 8b7228dcf1..5faa6fd8fc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyCatchAllStmtMetaModel.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2021 The JavaParser Team. + * Copyright (C) 2011, 2013-2024 The JavaParser Team. * * This file is part of JavaParser. * @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration; +import com.github.javaparser.ast.key.KeyCatchAllStmt; import java.util.Optional; /** @@ -30,24 +30,24 @@ *

  • The contents and annotations within the package `com.github.javaparser.ast`, and
  • *
  • `ALL_NODE_CLASSES` within the class `com.github.javaparser.generator.metamodel.MetaModelGenerator`.
  • * - *

    + * * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ClassInvariantClauseMetaModel extends JmlClassLevelMetaModel { +public class KeyCatchAllStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") - ClassInvariantClauseMetaModel(Optional superBaseNodeMetaModel) { + KeyCatchAllStmtMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - JmlClassExprDeclaration.class, - "ClassInvariantClause", - "com.github.javaparser.ast.jml.body", + KeyCatchAllStmt.class, + "KeyCatchAllStmt", + "com.github.javaparser.ast.key", false, false); } - public PropertyMetaModel invariantPropertyMetaModel; + public PropertyMetaModel blockPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyExecStatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyExecStatementMetaModel.java index 1df8ff7eac..8be99a7161 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyExecStatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyExecStatementMetaModel.java @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.key.KeyExecStatement; +import com.github.javaparser.ast.key.KeyExecStmt; import java.util.Optional; /** @@ -40,7 +40,7 @@ public class KeyExecStatementMetaModel extends StatementMetaModel { KeyExecStatementMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - KeyExecStatement.class, + KeyExecStmt.class, "KeyExecStatement", "com.github.javaparser.ast.key", false, diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyExecStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyExecStmtMetaModel.java new file mode 100644 index 0000000000..b6ee18051e --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyExecStmtMetaModel.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.metamodel; + +import com.github.javaparser.ast.Generated; +import com.github.javaparser.ast.key.KeyExecStmt; +import java.util.Optional; + +/** + * This file, class, and its contents are completely generated based on: + *

      + *
    • The contents and annotations within the package `com.github.javaparser.ast`, and
    • + *
    • `ALL_NODE_CLASSES` within the class `com.github.javaparser.generator.metamodel.MetaModelGenerator`.
    • + *
    + * + * For this reason, any changes made directly to this file will be overwritten the next time generators are run. + */ +@Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") +public class KeyExecStmtMetaModel extends StatementMetaModel { + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + KeyExecStmtMetaModel(Optional superBaseNodeMetaModel) { + super(superBaseNodeMetaModel, KeyExecStmt.class, "KeyExecStmt", "com.github.javaparser.ast.key", false, false); + } + + public PropertyMetaModel branchesPropertyMetaModel; + + public PropertyMetaModel execBlockPropertyMetaModel; +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyLoopScopeBlockMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyLoopScopeBlockMetaModel.java index f485b1fef8..cf07563db3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyLoopScopeBlockMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyLoopScopeBlockMetaModel.java @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.key.KeyLoopScopeBlock; +import com.github.javaparser.ast.key.KeyLoopScopeBlockStmt; import java.util.Optional; /** @@ -40,7 +40,7 @@ public class KeyLoopScopeBlockMetaModel extends StatementMetaModel { KeyLoopScopeBlockMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - KeyLoopScopeBlock.class, + KeyLoopScopeBlockStmt.class, "KeyLoopScopeBlock", "com.github.javaparser.ast.key", false, diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyLoopScopeBlockStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyLoopScopeBlockStmtMetaModel.java new file mode 100644 index 0000000000..7cc3164ab2 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyLoopScopeBlockStmtMetaModel.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.metamodel; + +import com.github.javaparser.ast.Generated; +import com.github.javaparser.ast.key.KeyLoopScopeBlockStmt; +import java.util.Optional; + +/** + * This file, class, and its contents are completely generated based on: + *
      + *
    • The contents and annotations within the package `com.github.javaparser.ast`, and
    • + *
    • `ALL_NODE_CLASSES` within the class `com.github.javaparser.generator.metamodel.MetaModelGenerator`.
    • + *
    + * + * For this reason, any changes made directly to this file will be overwritten the next time generators are run. + */ +@Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") +public class KeyLoopScopeBlockStmtMetaModel extends StatementMetaModel { + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + KeyLoopScopeBlockStmtMetaModel(Optional superBaseNodeMetaModel) { + super( + superBaseNodeMetaModel, + KeyLoopScopeBlockStmt.class, + "KeyLoopScopeBlockStmt", + "com.github.javaparser.ast.key", + false, + false); + } + + public PropertyMetaModel blockPropertyMetaModel; + + public PropertyMetaModel indexPVPropertyMetaModel; +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMergePointStatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMergePointStatementMetaModel.java index 63ec413ae2..72921bcfbb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMergePointStatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMergePointStatementMetaModel.java @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.key.KeyMergePointStatement; +import com.github.javaparser.ast.key.KeyMergePointStmt; import java.util.Optional; /** @@ -40,7 +40,7 @@ public class KeyMergePointStatementMetaModel extends StatementMetaModel { KeyMergePointStatementMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - KeyMergePointStatement.class, + KeyMergePointStmt.class, "KeyMergePointStatement", "com.github.javaparser.ast.key", false, diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMergePointStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMergePointStmtMetaModel.java new file mode 100644 index 0000000000..cad126d599 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMergePointStmtMetaModel.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.metamodel; + +import com.github.javaparser.ast.Generated; +import com.github.javaparser.ast.key.KeyMergePointStmt; +import java.util.Optional; + +/** + * This file, class, and its contents are completely generated based on: + *
      + *
    • The contents and annotations within the package `com.github.javaparser.ast`, and
    • + *
    • `ALL_NODE_CLASSES` within the class `com.github.javaparser.generator.metamodel.MetaModelGenerator`.
    • + *
    + * + * For this reason, any changes made directly to this file will be overwritten the next time generators are run. + */ +@Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") +public class KeyMergePointStmtMetaModel extends StatementMetaModel { + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + KeyMergePointStmtMetaModel(Optional superBaseNodeMetaModel) { + super( + superBaseNodeMetaModel, + KeyMergePointStmt.class, + "KeyMergePointStmt", + "com.github.javaparser.ast.key", + false, + false); + } + + public PropertyMetaModel exprPropertyMetaModel; +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMethodCallStatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMethodCallStatementMetaModel.java index 3e7360acf8..1f166f51fc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMethodCallStatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMethodCallStatementMetaModel.java @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.key.KeyMethodCallStatement; +import com.github.javaparser.ast.key.KeyMethodCallStmt; import java.util.Optional; /** @@ -40,7 +40,7 @@ public class KeyMethodCallStatementMetaModel extends StatementMetaModel { KeyMethodCallStatementMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - KeyMethodCallStatement.class, + KeyMethodCallStmt.class, "KeyMethodCallStatement", "com.github.javaparser.ast.key", false, diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMethodCallStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMethodCallStmtMetaModel.java new file mode 100644 index 0000000000..d34749faba --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyMethodCallStmtMetaModel.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.metamodel; + +import com.github.javaparser.ast.Generated; +import com.github.javaparser.ast.key.KeyMethodCallStmt; +import java.util.Optional; + +/** + * This file, class, and its contents are completely generated based on: + *
      + *
    • The contents and annotations within the package `com.github.javaparser.ast`, and
    • + *
    • `ALL_NODE_CLASSES` within the class `com.github.javaparser.generator.metamodel.MetaModelGenerator`.
    • + *
    + * + * For this reason, any changes made directly to this file will be overwritten the next time generators are run. + */ +@Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") +public class KeyMethodCallStmtMetaModel extends StatementMetaModel { + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + KeyMethodCallStmtMetaModel(Optional superBaseNodeMetaModel) { + super( + superBaseNodeMetaModel, + KeyMethodCallStmt.class, + "KeyMethodCallStmt", + "com.github.javaparser.ast.key", + false, + false); + } + + public PropertyMetaModel blockPropertyMetaModel; + + public PropertyMetaModel contextPropertyMetaModel; + + public PropertyMetaModel namePropertyMetaModel; +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyTransactionStatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyTransactionStatementMetaModel.java index 1b3f5fd5be..19d3d5ff3f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyTransactionStatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyTransactionStatementMetaModel.java @@ -21,7 +21,7 @@ package com.github.javaparser.metamodel; import com.github.javaparser.ast.Generated; -import com.github.javaparser.ast.key.KeyTransactionStatement; +import com.github.javaparser.ast.key.KeyTransactionStmt; import java.util.Optional; /** @@ -40,7 +40,7 @@ public class KeyTransactionStatementMetaModel extends StatementMetaModel { KeyTransactionStatementMetaModel(Optional superBaseNodeMetaModel) { super( superBaseNodeMetaModel, - KeyTransactionStatement.class, + KeyTransactionStmt.class, "KeyTransactionStatement", "com.github.javaparser.ast.key", false, diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyTransactionStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyTransactionStmtMetaModel.java new file mode 100644 index 0000000000..d47036d011 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/KeyTransactionStmtMetaModel.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.metamodel; + +import com.github.javaparser.ast.Generated; +import com.github.javaparser.ast.key.KeyTransactionStmt; +import java.util.Optional; + +/** + * This file, class, and its contents are completely generated based on: + *
      + *
    • The contents and annotations within the package `com.github.javaparser.ast`, and
    • + *
    • `ALL_NODE_CLASSES` within the class `com.github.javaparser.generator.metamodel.MetaModelGenerator`.
    • + *
    + * + * For this reason, any changes made directly to this file will be overwritten the next time generators are run. + */ +@Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") +public class KeyTransactionStmtMetaModel extends StatementMetaModel { + + @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") + KeyTransactionStmtMetaModel(Optional superBaseNodeMetaModel) { + super( + superBaseNodeMetaModel, + KeyTransactionStmt.class, + "KeyTransactionStmt", + "com.github.javaparser.ast.key", + false, + false); + } + + public PropertyMetaModel typePropertyMetaModel; +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java b/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java index c0c050e1f1..d700dbcaa8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java @@ -35,9 +35,10 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; +import com.github.javaparser.ast.jml.doc.JmlDocModifier; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; -import com.github.javaparser.ast.jml.type.*; import com.github.javaparser.ast.key.*; import com.github.javaparser.ast.key.sv.*; import com.github.javaparser.ast.modules.*; @@ -1229,10 +1230,24 @@ SCOPE, IS_PRESENT, sequence(child(SCOPE), string(GeneratedJavaParserConstants.DO semicolon(), newline())); // region JML - concreteSyntaxModelByClass.put(JmlClauseIf.class, sequence()); - concreteSyntaxModelByClass.put(JmlLabelStmt.class, sequence()); - concreteSyntaxModelByClass.put(JmlMethodSignature.class, sequence()); - concreteSyntaxModelByClass.put(JmlSetComprehensionExpr.class, sequence()); + concreteSyntaxModelByClass.put( + JmlClauseIf.class, sequence(attribute(KIND), attribute(CONDITION), token(WHEN), attribute(CONDITION))); + concreteSyntaxModelByClass.put(JmlLabelStmt.class, sequence(list(JML_TAGS), attribute(LABEL), token(COLON))); + concreteSyntaxModelByClass.put( + JmlMethodSignature.class, + sequence(attribute(NAME), token(LPAREN), list(ARGUMENT_TYPES, token(COMMA)), token(RPAREN))); + concreteSyntaxModelByClass.put( + JmlSetComprehensionExpr.class, + sequence( + token(LBRACE), + space(), + attribute(BINDING), + space(), + token(OR), + space(), + attribute(PREDICATE), + space(), + token(RBRACE))); concreteSyntaxModelByClass.put( JmlForallClause.class, sequence( @@ -1271,18 +1286,14 @@ SCOPE, IS_PRESENT, sequence(child(SCOPE), string(GeneratedJavaParserConstants.DO semicolon(), newline())); concreteSyntaxModelByClass.put( - JmlCallableClause.class, - sequence( - child(MODIFIERS), - token(CALLABLE), // space(), - // child(EXPRESSION), - semicolon())); + JmlCallableClause.class, sequence(child(MODIFIERS), token(CALLABLE), semicolon())); concreteSyntaxModelByClass.put( JmlClassExprDeclaration.class, - sequence(child(MODIFIERS), token(INVARIANT), space(), child(EXPRESSION), semicolon())); + sequence(child(MODIFIERS), space(), token(INVARIANT), space(), child(EXPRESSION), semicolon())); concreteSyntaxModelByClass.put(JmlClassAccessibleDeclaration.class, sequence()); concreteSyntaxModelByClass.put(JmlContract.class, sequence()); - concreteSyntaxModelByClass.put(JmlGhostStmt.class, sequence()); + concreteSyntaxModelByClass.put( + JmlGhostStmt.class, sequence(list(JML_TAGS), token(GHOST), attribute(STATEMENT))); concreteSyntaxModelByClass.put( JmlLabelExpr.class, sequence( @@ -1339,37 +1350,51 @@ SCOPE, IS_PRESENT, sequence(child(SCOPE), string(GeneratedJavaParserConstants.DO concreteSyntaxModelByClass.put( JmlSignalsOnlyClause.class, sequence(token(SIGNALS_ONLY), child(TYPES), semicolon(), newline())); // endregion + // region KEY // TODO weigl maybe one day someone will complete this, but currently we do not need // the support of concrete syntax model. concreteSyntaxModelByClass.put(KeyCcatchBreak.class, sequence()); concreteSyntaxModelByClass.put(KeyCcatchContinue.class, sequence()); concreteSyntaxModelByClass.put(KeyCcatchParameter.class, sequence()); concreteSyntaxModelByClass.put(KeyCcatchReturn.class, sequence()); - concreteSyntaxModelByClass.put(KeyCatchAllStatement.class, sequence()); + concreteSyntaxModelByClass.put(KeyCatchAllStmt.class, sequence()); concreteSyntaxModelByClass.put(KeyCcatchSV.class, attribute(TEXT)); concreteSyntaxModelByClass.put(KeyContextStatementBlock.class, sequence()); concreteSyntaxModelByClass.put(KeyEscapeExpression.class, sequence()); concreteSyntaxModelByClass.put(KeyExecCtxtSV.class, attribute(TEXT)); - concreteSyntaxModelByClass.put(KeyExecStatement.class, sequence()); + concreteSyntaxModelByClass.put(KeyExecStmt.class, sequence()); concreteSyntaxModelByClass.put(KeyExecutionContext.class, sequence()); concreteSyntaxModelByClass.put(KeyExecutionContextSV.class, attribute(TEXT)); - concreteSyntaxModelByClass.put(KeyExpressionSV.class, sequence()); + concreteSyntaxModelByClass.put(KeyExpressionSV.class, attribute(TEXT)); concreteSyntaxModelByClass.put(KeyJumpLabelSV.class, attribute(TEXT)); - concreteSyntaxModelByClass.put(KeyLoopScopeBlock.class, sequence()); - concreteSyntaxModelByClass.put(KeyMergePointStatement.class, sequence()); + concreteSyntaxModelByClass.put(KeYMarkerStatement.class, sequence()); + concreteSyntaxModelByClass.put( + KeyLoopScopeBlockStmt.class, + sequence( + token(LOOPSCOPE), + token(LPAREN), + attribute(INDEX_P_V), + token(RPAREN), + token(LBRACE), + newline(), + attribute(BLOCK), + newline(), + token(RBRACE))); + concreteSyntaxModelByClass.put(KeyMergePointStmt.class, sequence()); concreteSyntaxModelByClass.put(KeyMetaConstructExpression.class, sequence()); concreteSyntaxModelByClass.put(KeyMetaConstruct.class, sequence()); concreteSyntaxModelByClass.put(KeyMetaConstructType.class, sequence()); concreteSyntaxModelByClass.put(KeyMethodBodyStatement.class, sequence()); - concreteSyntaxModelByClass.put(KeyMethodCallStatement.class, sequence()); + concreteSyntaxModelByClass.put(KeyMethodCallStmt.class, sequence()); concreteSyntaxModelByClass.put(KeyMethodSignature.class, sequence()); concreteSyntaxModelByClass.put(KeyMethodSignatureSV.class, attribute(TEXT)); - concreteSyntaxModelByClass.put(KeyPassiveExpression.class, sequence()); + concreteSyntaxModelByClass.put( + KeyPassiveExpression.class, sequence(token(AT), token(LPAREN), attribute(EXPR), token(RPAREN))); concreteSyntaxModelByClass.put(KeyProgramVariableSV.class, attribute(TEXT)); - concreteSyntaxModelByClass.put(KeyRangeExpression.class, sequence()); concreteSyntaxModelByClass.put(KeyStatementSV.class, attribute(TEXT)); - concreteSyntaxModelByClass.put(KeyTransactionStatement.class, sequence()); + concreteSyntaxModelByClass.put(KeyTransactionStmt.class, sequence()); concreteSyntaxModelByClass.put(KeyTypeSV.class, attribute(TEXT)); + // endregion List unsupportedNodeClassNames = JavaParserMetaModel.getNodeMetaModels().stream() .filter(c -> !c.isAbstract() && !Comment.class.isAssignableFrom(c.getType()) diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java index f630063ac7..cdcd5e3bee 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java @@ -1233,7 +1233,7 @@ public void visit(JmlDocStmt n, Void arg) { @Override public void visit(JmlDoc n, Void arg) { - printer.print(n.getContent().asString()); + wrapInJmlIfNeeded(() -> printer.print(n.getContent())); } @Override @@ -1354,7 +1354,7 @@ public void visit(KeyCcatchReturn n, Void arg) { } @Override - public void visit(KeyCatchAllStatement n, Void arg) { + public void visit(KeyCatchAllStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("#catchAll("); @@ -1376,7 +1376,7 @@ public void visit(KeyEscapeExpression n, Void arg) { } @Override - public void visit(KeyExecStatement n, Void arg) { + public void visit(KeyExecStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("exec "); @@ -1404,7 +1404,7 @@ public void visit(KeyExecutionContext n, Void arg) { } @Override - public void visit(KeyLoopScopeBlock n, Void arg) { + public void visit(KeyLoopScopeBlockStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("$loopScope( "); @@ -1415,7 +1415,7 @@ public void visit(KeyLoopScopeBlock n, Void arg) { } @Override - public void visit(KeyMergePointStatement n, Void arg) { + public void visit(KeyMergePointStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("merge_point"); @@ -1435,7 +1435,7 @@ public void visit(KeyMethodBodyStatement n, Void arg) { } @Override - public void visit(KeyMethodCallStatement n, Void arg) { + public void visit(KeyMethodCallStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("method-frame("); @@ -1460,16 +1460,7 @@ public void visit(KeyMethodSignature n, Void arg) { } @Override - public void visit(KeyRangeExpression n, Void arg) { - printOrphanCommentsBeforeThisChildNode(n); - printComment(n.getComment(), arg); - n.getLower().accept(this, arg); - printer.print(".."); - n.getUpper().accept(this, arg); - } - - @Override - public void visit(KeyTransactionStatement n, Void arg) { + public void visit(KeyTransactionStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getType().symbol); @@ -1605,6 +1596,11 @@ public void visit(KeyExecutionContextSV n, Void arg) { printer.print(n.getText()); } + @Override + public void visit(KeYMarkerStatement n, Void arg) { + printer.println("//KEY MARKER STATEMENT: " + n.getKind()); + } + @Override public void visit(final RecordPatternExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java index 0a31dc4d96..f11faebec9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java @@ -33,6 +33,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.key.*; @@ -852,7 +853,7 @@ public void visit(KeyCcatchReturn n, Void arg) { } @Override - public void visit(KeyCatchAllStatement n, Void arg) { + public void visit(KeyCatchAllStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("#catchAll"); @@ -875,7 +876,7 @@ public void visit(KeyEscapeExpression n, Void arg) { } @Override - public void visit(KeyExecStatement n, Void arg) { + public void visit(KeyExecStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("exec"); @@ -903,7 +904,7 @@ public void visit(KeyExecutionContext n, Void arg) { } @Override - public void visit(KeyLoopScopeBlock n, Void arg) { + public void visit(KeyLoopScopeBlockStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("loop-scope"); @@ -914,7 +915,7 @@ public void visit(KeyLoopScopeBlock n, Void arg) { } @Override - public void visit(KeyMergePointStatement n, Void arg) { + public void visit(KeyMergePointStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("merge_point"); @@ -938,7 +939,7 @@ public void visit(KeyMethodBodyStatement n, Void arg) { } @Override - public void visit(KeyMethodCallStatement n, Void arg) { + public void visit(KeyMethodCallStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("method-frame"); @@ -968,16 +969,7 @@ public void visit(KeyMethodSignature n, Void arg) { } @Override - public void visit(KeyRangeExpression n, Void arg) { - printOrphanCommentsBeforeThisChildNode(n); - printComment(n.getComment(), arg); - n.getLower().accept(this, arg); - printer.print(".."); - n.getUpper().accept(this, arg); - } - - @Override - public void visit(KeyTransactionStatement n, Void arg) { + public void visit(KeyTransactionStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getType().symbol); @@ -1112,6 +1104,11 @@ public void visit(KeyExecutionContextSV n, Void arg) { printer.print(n.getText()); } + @Override + public void visit(KeYMarkerStatement n, Void arg) { + printer.println("//KEY MARKER STATEMENT: " + n.getKind()); + } + @Override public void visit(final RecordPatternExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); @@ -2303,7 +2300,7 @@ public void visit(JmlDocStmt n, Void arg) { @Override public void visit(JmlDoc n, Void arg) { - printer.print(n.getContent().asString()); + printer.print(n.getContent()); } @Override diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Added.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Added.java index 9110da75f4..14ccb8b7c3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Added.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Added.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java index b930daa1e3..8727fafaab 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DefaultLexicalPreservingPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DefaultLexicalPreservingPrinter.java index 233f9b5bac..de8e8f67ee 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DefaultLexicalPreservingPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DefaultLexicalPreservingPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java index 167735aaa2..c1b0f54257 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -22,7 +22,6 @@ import static com.github.javaparser.GeneratedJavaParserConstants.LBRACE; import static com.github.javaparser.GeneratedJavaParserConstants.RBRACE; -import static com.github.javaparser.GeneratedJavaParserConstants.SPACE; import com.github.javaparser.GeneratedJavaParserConstants; import com.github.javaparser.JavaToken; @@ -40,8 +39,6 @@ import com.github.javaparser.printer.concretesyntaxmodel.CsmUnindent; import com.github.javaparser.printer.lexicalpreservation.LexicalDifferenceCalculator.CsmChild; import java.util.*; -import java.util.function.Predicate; -import java.util.stream.IntStream; /** * A Difference should give me a sequence of elements I should find (to indicate the context) followed by a list of elements @@ -51,8 +48,6 @@ */ public class Difference { - public static final int STANDARD_INDENTATION_SIZE = 4; - private final NodeText nodeText; private final Node node; @@ -84,55 +79,31 @@ public class Difference { * Returns the indentation used after the last line break */ List processIndentation(List indentation, List prevElements) { - int eolIndex = lastIndexOfEol(prevElements); + TextElementList list = new TextElementList(prevElements); + int eolIndex = list.findLast(TextElement::isNewline); // Return "indentation" as is if no EOL element was found if (eolIndex < 0) return indentation; // Find consecutive space characters after the EOL element indentation = - takeWhile(prevElements.subList(eolIndex + 1, prevElements.size()), element -> element.isWhiteSpace()); + TextElementList.of(list.subList(eolIndex + 1, list.size())).takeWhile(TextElement::isWhiteSpace); return indentation; } - /* - * returns only the elements that match the given predicate. - * takeWhile takes elements from the initial stream while the predicate holds true. - * Meaning that when an element is encountered that does not match the predicate, the rest of the list is discarded. - */ - List takeWhile(List prevElements, Predicate predicate) { - List spaces = new ArrayList<>(); - for (TextElement element : prevElements) { - if (predicate.test(element)) { - spaces.add(element); - continue; - } - break; - } - return spaces; - } - - int lastIndexOfEol(List source) { - return IntStream.range(0, source.size()) - .map(i -> source.size() - i - 1) - .filter(i -> source.get(i).isNewline()) - .findFirst() - .orElse(-1); - } - /* * Returns the position of the next element in the list starting from @{code fromIndex} which is a comment (Ignoring spaces) * or -1 if it's not a comment. */ private int posOfNextComment(int fromIndex, List elements) { - if (!isValidIndex(fromIndex, elements)) return -1; - ArrayIterator iterator = new ArrayIterator<>(elements, fromIndex); - // search for the next consecutive space characters + TextElementList list = new TextElementList(elements); + if (!list.isValidIndex(fromIndex)) return -1; + TextElementIterator iterator = list.iterator(fromIndex); while (iterator.hasNext()) { TextElement element = iterator.next(); if (element.isSpaceOrTab()) { continue; } if (element.isComment()) { - return iterator.index(); + return iterator.currentIndex(); } break; } @@ -150,44 +121,16 @@ private boolean isFollowedByComment(int fromIndex, List elements) { * Removes all elements in the list starting from @{code fromIndex}) ending to @{code toIndex}) */ private void removeElements(int fromIndex, int toIndex, List elements) { - if (!(isValidIndex(fromIndex, elements) && isValidIndex(toIndex, elements) && fromIndex <= toIndex)) return; - ListIterator iterator = elements.listIterator(fromIndex); - // removing elements - int count = fromIndex; - while (iterator.hasNext() && count <= toIndex) { + TextElementList list = new TextElementList(elements); + TextElementIterator iterator = list.iterator(fromIndex); + for (int i = fromIndex; i <= toIndex && iterator.hasNext(); i++) { iterator.next(); iterator.remove(); - count++; - } - } - - private boolean isValidIndex(int index, List elements) { - return index >= 0 && index <= elements.size(); - } - - /* - * Returns the position of the last new line character or -1 if there is no eol in the specified list of TextElement - */ - int lastIndexOfEolWithoutGPT(List source) { - ListIterator listIterator = source.listIterator(source.size()); - int lastIndex = source.size() - 1; - while (listIterator.hasPrevious()) { - TextElement elem = listIterator.previous(); - if (elem.isNewline()) { - return lastIndex; - } - lastIndex--; } - return -1; } private List indentationBlock() { - List res = new LinkedList<>(); - res.add(new TokenTextElement(SPACE)); - res.add(new TokenTextElement(SPACE)); - res.add(new TokenTextElement(SPACE)); - res.add(new TokenTextElement(SPACE)); - return res; + return IndentationCalculator.createIndentationBlock(); } private boolean isAfterLBrace(NodeText nodeText, int nodeTextIndex) { @@ -308,36 +251,9 @@ private int removeExtraCharacters(NodeText nodeText, int nodeTextIndex, int extr * The number of consecutive whitespace (or tab) characters */ private EnforcingIndentationContext defineEnforcingIndentationContext(NodeText nodeText, int startIndex) { - EnforcingIndentationContext ctx = new EnforcingIndentationContext(startIndex); - // compute space before startIndex value - if (startIndex < nodeText.numberOfElements() && startIndex > 0) { - // at this stage startIndex points to the first element before the deleted one - for (int i = startIndex - 1; i >= 0 && i < nodeText.numberOfElements(); i--) { - if (nodeText.getTextElement(i).isNewline()) { - break; - } - if (!isSpaceOrTabElement(nodeText, i)) { - ctx = new EnforcingIndentationContext(startIndex); - break; - } - ctx.start = i; - ctx.extraCharacters++; - } - } - // compute space after the deleted element - if (startIndex < nodeText.numberOfElements() && isSpaceOrTabElement(nodeText, startIndex)) { - // int startingFromIndex = startIndex == 0 ? startIndex : startIndex + 1; - for (int i = startIndex; i >= 0 && i < nodeText.numberOfElements(); i++) { - if (nodeText.getTextElement(i).isNewline()) { - break; - } - if (!isSpaceOrTabElement(nodeText, i)) { - break; - } - ctx.extraCharacters++; - } - } - return ctx; + IndentationCalculator.EnforcingContext ctx = + IndentationCalculator.analyzeEnforcingContext(nodeText, startIndex); + return new EnforcingIndentationContext(ctx.getStartIndex(), ctx.getExtraCharacters()); } /* @@ -947,13 +863,13 @@ private boolean nextIsRightBrace(int index) { } private void addIndent() { - for (int i = 0; i < STANDARD_INDENTATION_SIZE; i++) { + for (int i = 0; i < IndentationConstants.STANDARD_INDENTATION_SIZE; i++) { indentation.add(new TokenTextElement(GeneratedJavaParserConstants.SPACE)); } } private void removeIndent() { - for (int i = 0; i < STANDARD_INDENTATION_SIZE && !indentation.isEmpty(); i++) { + for (int i = 0; i < IndentationConstants.STANDARD_INDENTATION_SIZE && !indentation.isEmpty(); i++) { indentation.remove(indentation.size() - 1); } } @@ -1090,76 +1006,6 @@ private void applyAddedDiffElement(Added added) { diffIndex++; } - /* - * A list iterator which provides a method to know the current positioning - */ - public static class ArrayIterator implements ListIterator { - - ListIterator iterator; - - public ArrayIterator(List elements) { - this(elements, 0); - } - - public ArrayIterator(List elements, int index) { - this.iterator = elements.listIterator(index); - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public T next() { - return iterator.next(); - } - - @Override - public boolean hasPrevious() { - return iterator.hasPrevious(); - } - - @Override - public T previous() { - return iterator.previous(); - } - - @Override - public int nextIndex() { - return iterator.nextIndex(); - } - - @Override - public int previousIndex() { - return iterator.previousIndex(); - } - - /* - * Returns the current index in the underlying list - */ - public int index() { - return iterator.nextIndex() - 1; - } - - @Override - public void remove() { - iterator.remove(); - ; - } - - @Override - public void set(T e) { - iterator.set(e); - } - - @Override - public void add(T e) { - iterator.add(e); - ; - } - } - /* * Returns true if the next element in the list is an added element of type CsmUnindent */ @@ -1177,9 +1023,12 @@ private int adjustIndentation( if (nodeTextIndex < nodeText.numberOfElements() && nodeText.getTextElement(nodeTextIndex).isToken(RBRACE)) { indentationAdj = indentationAdj.subList( - 0, indentationAdj.size() - Math.min(STANDARD_INDENTATION_SIZE, indentationAdj.size())); + 0, + indentationAdj.size() + - Math.min(IndentationConstants.STANDARD_INDENTATION_SIZE, indentationAdj.size())); } else if (followedByUnindent) { - indentationAdj = indentationAdj.subList(0, Math.max(0, indentationAdj.size() - STANDARD_INDENTATION_SIZE)); + indentationAdj = indentationAdj.subList( + 0, Math.max(0, indentationAdj.size() - IndentationConstants.STANDARD_INDENTATION_SIZE)); } for (TextElement e : indentationAdj) { if ((nodeTextIndex < nodeText.numberOfElements()) diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java index 33f28eae34..6241c4b556 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java index 0b803087f1..1c750170ac 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationCalculator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationCalculator.java new file mode 100755 index 0000000000..b929bf1841 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationCalculator.java @@ -0,0 +1,359 @@ +/* + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import static com.github.javaparser.printer.lexicalpreservation.IndentationConstants.STANDARD_INDENTATION_SIZE; + +import com.github.javaparser.GeneratedJavaParserConstants; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Provides stateless utility methods for indentation calculations and analysis. + * + * This class contains pure functions that compute indentation-related values + * without maintaining any state. All methods are static and can be used + * independently without creating an instance. + * + * Typical operations include: + * - Computing indentation from preceding elements + * - Analyzing indentation context for enforcement + * - Creating standard indentation blocks + * - Extracting indentation from token sequences + * + * @see IndentationContext for stateful indentation management + */ +public final class IndentationCalculator { + + /** + * Private constructor to prevent instantiation. + * This is a utility class with only static methods. + */ + private IndentationCalculator() { + throw new AssertionError("IndentationCalculator is a utility class and should not be instantiated"); + } + + /** + * Computes the indentation that should be used based on the elements preceding + * the current position. This analyzes the elements to find the last newline + * and extracts all whitespace characters that follow it. + * + * This method is used when we need to match existing indentation in the source code. + * + * @param precedingElements elements before the current position + * @return list of indentation elements (spaces/tabs) after the last newline, or empty list if no newline found + */ + public static List computeFromPrecedingElements(List precedingElements) { + int eolIndex = findLastNewlineIndex(precedingElements); + // No newline found, return empty indentation + if (eolIndex < 0) { + return Collections.emptyList(); + } + // Extract whitespace elements after the newline + List result = new ArrayList<>(); + for (int i = eolIndex + 1; i < precedingElements.size(); i++) { + TextElement element = precedingElements.get(i); + if (element.isSpaceOrTab()) { + result.add(element); + } else { + // Stop at first non-whitespace + break; + } + } + return result; + } + + /** + * Extracts the indentation portion from a list of elements. + * + * This method differs from computeFromPrecedingElements because it doesn't look for + * a newline first - it assumes the list represents tokens after a newline and simply + * extracts all leading whitespace. + * + * This is useful when we have already collected preceding tokens and want to + * extract just the indentation part. + * + * @param precedingTokens tokens that precede the position + * @return list of indentation elements (leading whitespace only) + */ + public static List extractIndentationFromTokens(List precedingTokens) { + List indentation = new ArrayList<>(); + for (TextElement element : precedingTokens) { + if (element.isSpaceOrTab()) { + indentation.add(element); + } else { + // Stop at first non-whitespace + break; + } + } + return indentation; + } + + /** + * Creates a single indentation block of STANDARD_INDENTATION_SIZE spaces. + * This is used when we need to add one level of indentation temporarily. + * + * @return list containing STANDARD_INDENTATION_SIZE space elements + */ + public static List createIndentationBlock() { + List block = new ArrayList<>(STANDARD_INDENTATION_SIZE); + for (int i = 0; i < STANDARD_INDENTATION_SIZE; i++) { + block.add(new TokenTextElement(GeneratedJavaParserConstants.SPACE, " ")); + } + return block; + } + + /** + * Analyzes the indentation enforcement context at a given position in the node text. + * + *

    Context and Purpose:

    + * This method is primarily used by the {@link Difference} class during AST modification + * to determine if excess whitespace should be removed after deleting elements. When a node + * is removed from the AST, surrounding whitespace may need to be adjusted to maintain + * proper formatting. + * + *

    Algorithm Overview:

    + * The algorithm performs a two-phase scan to identify excess whitespace: + *
      + *
    1. Backward Scan: Looks backward from the given index to find contiguous + * whitespace characters, stopping at either a newline or a non-whitespace element.
    2. + *
    3. Forward Scan: If the current position contains whitespace, scans forward + * to count additional contiguous whitespace characters.
    4. + *
    + * + *

    Examples:

    + *
    +     * Example 1 - Whitespace between elements after deletion:
    +     *   Before: "public class A { int foo; }"
    +     *   After deletion of "int foo;": "public class A { [space][space] }"
    +     *   analyzeEnforcingContext(nodeText, firstSpaceIndex) returns:
    +     *     - startIndex: index of first space
    +     *     - extraCharacters: 2 (both spaces should be considered for removal)
    +     *
    +     * Example 2 - Indentation after newline:
    +     *   Structure: "[newline][space][space][space][space]public"
    +     *   analyzeEnforcingContext(nodeText, middleSpaceIndex) returns:
    +     *     - startIndex: index of first space after newline
    +     *     - extraCharacters: 4 (all indentation spaces)
    +     *
    +     * Example 3 - Non-whitespace interrupts sequence:
    +     *   Structure: "public[space][space]"
    +     *   analyzeEnforcingContext(nodeText, firstSpaceIndex) returns:
    +     *     - startIndex: index of first space (reset due to "public")
    +     *     - extraCharacters: 2 (spaces after "public")
    +     * 
    + * + *

    Important Behavior:

    + * When a non-whitespace element is encountered during the backward scan, the context + * is reset (start becomes the current index, extraCharacters becomes 0), but the forward + * scan still executes if the current position is whitespace. This allows the method to + * identify and count trailing spaces after non-whitespace elements. + * + * @param nodeText the node text being modified + * @param index position to analyze (typically points to a position after a deletion) + * @return context containing the start index and count of excess whitespace characters + */ + public static EnforcingContext analyzeEnforcingContext(NodeText nodeText, int index) { + // Guard against invalid indices + if (index < 0 || index >= nodeText.numberOfElements()) { + return new EnforcingContext(index, 0); + } + // Starting position of whitespace sequence to potentially remove + int start = index; + // Total count of excess whitespace characters + int extraCharacters = 0; + // ========== PHASE 1: BACKWARD SCAN ========== + // Scan backward from the position to identify preceding whitespace. + // This determines if we're at the beginning of a line (after newline) or + // if there are spaces that should be counted as part of the enforcement context. + if (index < nodeText.numberOfElements() && index > 0) { + for (int i = index - 1; i >= 0; i--) { + // Stop at newline - we've found the line boundary + if (nodeText.getTextElement(i).isNewline()) { + break; + } + // If we encounter a non-whitespace element: + // Reset the context because we're not at the beginning of a line. + // However, we still need to scan forward to count any trailing spaces. + if (!nodeText.getTextElement(i).isSpaceOrTab()) { + // Reset: we'll only count forward from current position + start = index; + extraCharacters = 0; + break; + } + // Found whitespace - expand the sequence backward + // Update start to this earlier position + start = i; + // Count this whitespace character + extraCharacters++; + } + } + // ========== PHASE 2: FORWARD SCAN ========== + // Scan forward from the current position to count additional whitespace. + // This phase ALWAYS executes if the current position is whitespace, + // even if we reset the context during the backward scan. + // + // Example scenario where this matters: + // "public[space][space]" - backward scan finds "public" and resets, + // but we still need to count the 2 trailing spaces. + if (index < nodeText.numberOfElements() + && nodeText.getTextElement(index).isSpaceOrTab()) { + for (int i = index; i < nodeText.numberOfElements(); i++) { + // Stop at newline - end of current line + if (nodeText.getTextElement(i).isNewline()) { + break; + } + // Stop at non-whitespace - end of whitespace sequence + if (!nodeText.getTextElement(i).isSpaceOrTab()) { + break; + } + // Count this whitespace character + extraCharacters++; + } + } + return new EnforcingContext(start, extraCharacters); + } + + /** + * Removes excess indentation characters from the node text. + * + * This method modifies the provided NodeText by removing a specified number + * of elements starting from the given index. + * + * @param nodeText the node text to modify + * @param startIndex where to start removing + * @param count how many characters to remove + * @return the new index position after removal + */ + public static int removeExcessIndentation(NodeText nodeText, int startIndex, int count) { + int removed = 0; + while (startIndex >= 0 && startIndex < nodeText.numberOfElements() && removed < count) { + nodeText.removeElement(startIndex); + removed++; + } + return startIndex; + } + + /** + * Applies indentation enforcement at the specified position, preserving + * the specified number of characters. + * + * This is the main enforcement method that: + * 1. Analyzes the context to determine extra whitespace + * 2. Calculates how much to remove based on charactersToPreserve + * 3. Removes the excess + * 4. Returns the adjusted index + * + * @param nodeText the node text to modify + * @param index current position + * @param charactersToPreserve how many indentation characters to keep + * @return the new index position after enforcement + */ + public static int enforceIndentation(NodeText nodeText, int index, int charactersToPreserve) { + EnforcingContext ctx = analyzeEnforcingContext(nodeText, index); + if (!ctx.hasExtraCharacters()) { + return index; + } + int toRemove = + ctx.getExtraCharacters() > charactersToPreserve ? ctx.getExtraCharacters() - charactersToPreserve : 0; + int newIndex = removeExcessIndentation(nodeText, ctx.getStartIndex(), toRemove); + // Adjust for preserved characters + return toRemove > 0 ? newIndex + charactersToPreserve : newIndex; + } + + /** + * Finds the index of the last newline element in the list. + * + * @param elements list to search + * @return index of last newline, or -1 if not found + */ + private static int findLastNewlineIndex(List elements) { + for (int i = elements.size() - 1; i >= 0; i--) { + if (elements.get(i).isNewline()) { + return i; + } + } + return -1; + } + + /** + * Context information for enforcing indentation. + * Contains the starting position and the number of extra characters to remove. + * + * This is an immutable value object returned by analyzeEnforcingContext. + */ + public static class EnforcingContext { + + private final int startIndex; + + private final int extraCharacters; + + public EnforcingContext(int startIndex, int extraCharacters) { + this.startIndex = startIndex; + this.extraCharacters = extraCharacters; + } + + /** + * Returns the starting index of the whitespace sequence to potentially remove. + * + * @return the start index + */ + public int getStartIndex() { + return startIndex; + } + + /** + * Returns the total number of extra whitespace characters found. + * + * @return count of extra characters + */ + public int getExtraCharacters() { + return extraCharacters; + } + + /** + * Returns whether there are any extra characters to remove. + * + * @return true if extraCharacters > 0 + */ + public boolean hasExtraCharacters() { + return extraCharacters > 0; + } + + @Override + public String toString() { + return "EnforcingContext{startIndex=" + startIndex + ", extraCharacters=" + extraCharacters + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + EnforcingContext that = (EnforcingContext) o; + return startIndex == that.startIndex && extraCharacters == that.extraCharacters; + } + + @Override + public int hashCode() { + return 31 * startIndex + extraCharacters; + } + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationConstants.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationConstants.java new file mode 100755 index 0000000000..ef7d7872b2 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationConstants.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +/** + * Constants related to indentation management in lexical preservation. + * + * This class centralizes all indentation-related constants to avoid duplication + * and ensure consistency across IndentationContext and IndentationCalculator. + */ +public final class IndentationConstants { + + /** + * Standard indentation size in spaces. + * This is the number of spaces added or removed when increasing/decreasing indentation. + */ + public static final int STANDARD_INDENTATION_SIZE = 4; + + /** + * Private constructor to prevent instantiation. + * This is a constants class and should not be instantiated. + */ + private IndentationConstants() { + throw new AssertionError("IndentationConstants is a constants class and should not be instantiated"); + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationContext.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationContext.java new file mode 100755 index 0000000000..98e4f06183 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndentationContext.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import static com.github.javaparser.printer.lexicalpreservation.IndentationConstants.STANDARD_INDENTATION_SIZE; + +import com.github.javaparser.GeneratedJavaParserConstants; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Maintains the current indentation state during lexical preservation operations. + * + * This class encapsulates a mutable list of indentation elements (spaces/tabs) + * that represents the current indentation level. It provides methods to + * increase/decrease indentation and query the current state. + * + * Instances of this class are typically created at the start of a difference + * application and maintained throughout the process. + */ +public class IndentationContext { + + /** + * Current indentation represented as a mutable list of TextElements. + * Typically contains space or tab tokens. + */ + private final List elements; + + /** + * Creates a new IndentationContext with empty indentation. + */ + public IndentationContext() { + this.elements = new ArrayList<>(); + } + + /** + * Creates a new IndentationContext with the specified initial indentation. + * The provided list is copied to prevent external modifications. + * + * @param initialIndentation the initial indentation elements (will be copied) + */ + public IndentationContext(List initialIndentation) { + this.elements = new ArrayList<>(initialIndentation); + } + + /** + * Increases indentation by one level. + * Adds STANDARD_INDENTATION_SIZE space characters to the current indentation. + */ + public void increase() { + for (int i = 0; i < STANDARD_INDENTATION_SIZE; i++) { + elements.add(new TokenTextElement(GeneratedJavaParserConstants.SPACE, " ")); + } + } + + /** + * Decreases indentation by one level. + * Removes up to STANDARD_INDENTATION_SIZE characters from the end of the current indentation. + * Does nothing if the current indentation has fewer elements than STANDARD_INDENTATION_SIZE. + */ + public void decrease() { + for (int i = 0; i < STANDARD_INDENTATION_SIZE && !elements.isEmpty(); i++) { + elements.remove(elements.size() - 1); + } + } + + /** + * Returns a copy of the current indentation elements. + * The returned list is unmodifiable to prevent accidental modifications. + * + * @return unmodifiable view of current indentation elements + */ + public List getCurrent() { + return Collections.unmodifiableList(new ArrayList<>(elements)); + } + + /** + * Returns the number of indentation characters currently stored. + * + * @return count of indentation elements + */ + public int size() { + return elements.size(); + } + + /** + * Clears all indentation, resetting to zero indentation. + */ + public void clear() { + elements.clear(); + } + + /** + * Replaces the current indentation with the specified elements. + * The provided list is copied to prevent external modifications. + * + * @param newIndentation the new indentation elements (will be copied) + */ + public void set(List newIndentation) { + elements.clear(); + elements.addAll(newIndentation); + } + + @Override + public String toString() { + return "IndentationContext{size=" + elements.size() + ", elements=" + elements + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + IndentationContext that = (IndentationContext) o; + return elements.equals(that.elements); + } + + @Override + public int hashCode() { + return elements.hashCode(); + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndexTrackingIterator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndexTrackingIterator.java new file mode 100755 index 0000000000..a5a3f9bf77 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/IndexTrackingIterator.java @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import java.util.List; +import java.util.ListIterator; + +/** + * A generic iterator that tracks the index of the current element. + * + *

    This iterator wraps a standard {@link ListIterator} and maintains + * the index of the most recently read element, which can be accessed via + * {@link #currentIndex()}. + * + *

    This class provides a generic implementation that can be used with any + * type of list elements. It correctly handles bidirectional iteration by + * tracking the current index internally. + * + *

    This iterator is particularly useful for operations that need to know + * the position of elements during iteration, such as calculating + * correspondences between lists or tracking modifications. + * + * @param the type of elements in the list + * @since 3.28.0 + */ +public class IndexTrackingIterator implements ListIterator { + + private final ListIterator delegate; + + private int currentIndex; + + /** + * Creates an iterator starting at the beginning of the list. + * + * @param elements the list to iterate over + */ + public IndexTrackingIterator(List elements) { + this(elements, 0); + } + + /** + * Creates an iterator starting at the specified index. + * The current index is initialized to -1, indicating that no element + * has been read yet. + * + * @param elements the list to iterate over + * @param fromIndex the starting index (cursor position) + * @throws IndexOutOfBoundsException if fromIndex is out of range + */ + public IndexTrackingIterator(List elements, int fromIndex) { + this.delegate = elements.listIterator(fromIndex); + // No element read yet + this.currentIndex = -1; + } + + /** + * Returns the index of the element that was returned by the most recent call + * to {@link #next()} or {@link #previous()}. + * + *

    This method can be called multiple times without side effects - it will + * always return the same value until the next call to {@link #next()}, + * {@link #previous()}, or {@link #remove()}. + * + *

    Important: If neither {@link #next()} nor {@link #previous()} has + * been called yet, or if {@link #remove()} was called after the last call to + * {@link #next()} or {@link #previous()}, this method returns -1. + * + *

    Note: In the legacy {@code ArrayIterator} class, this method was + * named {@code index()}. It has been renamed to {@code currentIndex()} for + * better clarity and consistency. + * + * @return the index of the current element, or -1 if no element has been read + * or the current element was removed + */ + public int currentIndex() { + return currentIndex; + } + + // === LISTITERATOR METHODS WITH INDEX TRACKING === + @Override + public boolean hasNext() { + return delegate.hasNext(); + } + + @Override + public T next() { + T result = delegate.next(); + // After next(), previousIndex() points to the element we just read + currentIndex = delegate.previousIndex(); + return result; + } + + @Override + public boolean hasPrevious() { + return delegate.hasPrevious(); + } + + @Override + public T previous() { + T result = delegate.previous(); + // After previous(), nextIndex() points to the element we just read + currentIndex = delegate.nextIndex(); + return result; + } + + @Override + public int nextIndex() { + return delegate.nextIndex(); + } + + @Override + public int previousIndex() { + return delegate.previousIndex(); + } + + @Override + public void remove() { + delegate.remove(); + // After remove, there is no current element + currentIndex = -1; + } + + @Override + public void set(T element) { + delegate.set(element); + // Current index doesn't change when replacing an element + } + + @Override + public void add(T element) { + delegate.add(element); + // After add(), the added element becomes the current element + currentIndex = delegate.previousIndex(); + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java index 47e80befe4..28358de13f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java index 8ca20ac47d..342752d13c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -361,94 +361,53 @@ private void calculatedSyntaxModelForNode(CsmElement csm, Node node, List GeneratedJavaParserConstants.DEFAULT; + case PUBLIC -> GeneratedJavaParserConstants.PUBLIC; + case PRIVATE -> GeneratedJavaParserConstants.PRIVATE; + case PROTECTED -> GeneratedJavaParserConstants.PROTECTED; + case STATIC -> GeneratedJavaParserConstants.STATIC; + case FINAL -> GeneratedJavaParserConstants.FINAL; + case ABSTRACT -> GeneratedJavaParserConstants.ABSTRACT; + case TRANSIENT -> GeneratedJavaParserConstants.TRANSIENT; + case SYNCHRONIZED -> GeneratedJavaParserConstants.SYNCHRONIZED; + case VOLATILE -> GeneratedJavaParserConstants.VOLATILE; + case NATIVE -> GeneratedJavaParserConstants.NATIVE; + case STRICTFP -> GeneratedJavaParserConstants.STRICTFP; + case TRANSITIVE -> GeneratedJavaParserConstants.TRANSITIVE; + case SEALED -> GeneratedJavaParserConstants.SEALED; + case NON_SEALED -> GeneratedJavaParserConstants.NON_SEALED; + case JML_PACKAGE -> GeneratedJavaParserConstants.PACKAGE; + case JML_PURE -> GeneratedJavaParserConstants.PURE; + case JML_STRICTLY_PURE -> GeneratedJavaParserConstants.STRICTLY_PURE; + case JML_HELPER -> GeneratedJavaParserConstants.HELPER; + case JML_INSTANCE -> GeneratedJavaParserConstants.INSTANCE; + case JML_NULLABLE_BY_DEFAULT -> GeneratedJavaParserConstants.NULLABLE_BY_DEFAULT; + case JML_NON_NULL -> GeneratedJavaParserConstants.NON_NULL; + case JML_NULLABLE -> GeneratedJavaParserConstants.NULLABLE; + case JML_GHOST -> GeneratedJavaParserConstants.GHOST; + case JML_MODEL -> GeneratedJavaParserConstants.MODEL; + case JML_SPEC_PUBLIC -> GeneratedJavaParserConstants.SPEC_PUBLIC; + case JML_SPEC_PACKAGE -> GeneratedJavaParserConstants.SPEC_PACKAGE; + case JML_SPEC_PROTECTED -> GeneratedJavaParserConstants.SPEC_PROTECTED; + case JML_SPEC_PRIVATE -> GeneratedJavaParserConstants.SPEC_PRIVATE; + case JML_NO_STATE -> GeneratedJavaParserConstants.NO_STATE; + case JML_TWO_STATE -> GeneratedJavaParserConstants.TWO_STATE; + case JML_NON_NULL_BY_DEFAULT -> GeneratedJavaParserConstants.NON_NULL_BY_DEFAULT; + case JML_CODE_BIGINT_MATH -> GeneratedJavaParserConstants.CODE_BIGINT_MATH; + case JML_CODE_JAVA_MATH -> GeneratedJavaParserConstants.CODE_JAVA_MATH; + case JML_CODE_SAFE_MATH -> GeneratedJavaParserConstants.CODE_SAFE_MATH; + case JML_SPEC_BIGINT_MATH -> GeneratedJavaParserConstants.SPEC_BIGINT_MATH; + case JML_SPEC_JAVA_MATH -> GeneratedJavaParserConstants.SPEC_JAVA_MATH; + case JML_SPEC_SAFE_MATH -> GeneratedJavaParserConstants.SPEC_SAFE_MATH; + case JML_CODE -> GeneratedJavaParserConstants.CODE; + case JML_OT_PEER -> GeneratedJavaParserConstants.PEER; + case JML_OT_REP -> GeneratedJavaParserConstants.REP; + case JML_OT_READ_ONLY -> GeneratedJavaParserConstants.READ_ONLY; + default -> + throw new UnsupportedOperationException( + "Not supported keyword" + modifier.getKeyword().name()); + }; } // / diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java index b5e4842849..b0c46b9e5f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -35,6 +35,7 @@ import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.VariableDeclarator; import com.github.javaparser.ast.comments.*; +import com.github.javaparser.ast.key.IgnoreLexPrinting; import com.github.javaparser.ast.nodeTypes.NodeWithVariables; import com.github.javaparser.ast.observer.AstObserver; import com.github.javaparser.ast.observer.ObservableProperty; @@ -148,6 +149,24 @@ public void concretePropertyChange( if (property == ObservableProperty.RANGE || property == ObservableProperty.COMMENTED_NODE) { return; } + // Handle node replacements with TokenOwnerDetector + if (oldValue instanceof Node && newValue instanceof Node) { + Node oldNode = (Node) oldValue; + Node newNode = (Node) newValue; + // Find the actual token owner + Node tokenOwner = TokenOwnerDetector.findTokenOwner(oldNode); + // Check if we need to regenerate the token owner instead of just the parent + if (TokenOwnerDetector.needsRegeneration(observedNode, tokenOwner, oldNode)) { + NodeText tokenOwnerText = getOrCreateNodeText(tokenOwner); + if (tokenOwnerText != null) { + // Regenerate the token owner's NodeText instead of the observed node + LEXICAL_DIFFERENCE_CALCULATOR.calculatePropertyChange( + tokenOwnerText, tokenOwner, property, oldValue, newValue); + // Early exit - we've handled the change + return; + } + } + } if (property == ObservableProperty.COMMENT) { Optional parentNode = observedNode.getParentNode(); NodeText nodeText = parentNode @@ -156,9 +175,7 @@ public void concretePropertyChange( if (oldValue == null) { // this case corresponds to the addition of a comment // Find the position of the comment node and put in front of it the [...] - int // Find the position of the comment node and put in front of it the [...] - // - index = parentNode.isPresent() ? nodeText.findChild(observedNode) : 0; + int index = parentNode.isPresent() ? nodeText.findChild(observedNode) : 0; /* Add the same indentation to the comment as the previous node * for example if we want to add a comment on the body of the method declaration : * Actual code @@ -179,13 +196,26 @@ public void concretePropertyChange( * } * } */ - fixIndentOfAddedNode(nodeText, index - 1); + // Extract the existing indentation of the line where we'll insert the comment + List precedingElements = nodeText.getElements().subList(0, index); + List existingIndent = + IndentationCalculator.computeFromPrecedingElements(precedingElements); + // Insert the comment (WITHOUT adding indentation before, we'll add it after the EOL) LineSeparator lineSeparator = observedNode.getLineEndingStyleOrDefault(LineSeparator.SYSTEM); for (TokenTextElement element : makeCommentTokens((Comment) newValue)) { nodeText.addElement(index++, element); } + // Insert EOL nodeText.addToken(index, eolTokenKind(lineSeparator), lineSeparator.asRawString()); - // code indentation after inserting an eol token may be wrong + index++; + // Restore the indentation for the node that follows + for (TextElement indentElement : existingIndent) { + if (indentElement instanceof TokenTextElement) { + TokenTextElement tokenElement = (TokenTextElement) indentElement; + nodeText.addElement( + index++, new TokenTextElement(tokenElement.getTokenKind(), tokenElement.getText())); + } + } } else if (newValue == null) { // this case corresponds to a deletion of a comment if (oldValue instanceof Comment) { @@ -211,7 +241,8 @@ public void concretePropertyChange( // this is a replacement of a comment List matchingTokens = findTokenTextElementForComment((Comment) oldValue, nodeText); - if (matchingTokens.size() != 1) { + if ((oldValue instanceof MarkdownComment && matchingTokens.isEmpty()) + || (!(oldValue instanceof MarkdownComment) && matchingTokens.size() != 1)) { throw new IllegalStateException("The matching comment to be replaced could not be found"); } Comment newComment = (Comment) newValue; @@ -513,32 +544,33 @@ private void fixIndentOfAddedNode(NodeText nodeText, int index) { if (index <= 0) { return; } - TextElement currentSpaceCandidate = null; + // finds the existing indentation + List existingIndent = IndentationCalculator.computeFromPrecedingElements( + nodeText.getElements().subList(0, index + 1)); + if (existingIndent.isEmpty()) { + return; + } + // Find the last newline before index + int lastNewlineIndex = -1; for (int i = index; i >= 0; i--) { - TextElement spaceCandidate = nodeText.getTextElement(i); - if (spaceCandidate.isSpaceOrTab()) { - // save the current indentation char - currentSpaceCandidate = nodeText.getTextElement(i); - } - if (!spaceCandidate.isSpaceOrTab()) { - if (spaceCandidate.isNewline() && i != index) { - int numberOfIndentationCharacters = index - i; - for (int j = 0; j < numberOfIndentationCharacters; j++) { - if (currentSpaceCandidate != null) { - // use the current (or last) indentation character - nodeText.addElement( - index, - new TokenTextElement( - JavaToken.Kind.SPACE.getKind(), currentSpaceCandidate.expand())); - } else { - // use the default indentation character - nodeText.addElement(index, new TokenTextElement(JavaToken.Kind.SPACE.getKind())); - } - } - } + if (nodeText.getTextElement(i).isNewline()) { + lastNewlineIndex = i; break; } } + // If there is no newline or if the newline is just before the index, do nothing. + if (lastNewlineIndex == -1 || lastNewlineIndex == index - 1) { + return; + } + // Apply the computed indentation + // The indentation elements are inserted at the given index. + for (TextElement indentElement : existingIndent) { + if (indentElement instanceof TokenTextElement) { + TokenTextElement tokenElement = (TokenTextElement) indentElement; + nodeText.addElement( + index, new TokenTextElement(tokenElement.getTokenKind(), tokenElement.getText())); + } + } } @Override @@ -729,7 +761,8 @@ private static void prettyPrintingTextNode(Node node, NodeText nodeText) { private static NodeText interpret(Node node, CsmElement csm, NodeText nodeText) { LexicalDifferenceCalculator.CalculatedSyntaxModel calculatedSyntaxModel = new LexicalDifferenceCalculator().calculatedSyntaxModelForNode(csm, node); - List indentation = findIndentation(node); + List initialIndentation = findIndentation(node); + IndentationContext indentationContext = new IndentationContext(initialIndentation); boolean pendingIndentation = false; // Add a comment and line separator if necessary node.getComment().ifPresent(comment -> { @@ -746,17 +779,13 @@ private static NodeText interpret(Node node, CsmElement csm, NodeText nodeText) int indexCurrentElement = calculatedSyntaxModel.elements.indexOf(element); if (calculatedSyntaxModel.elements.size() > indexCurrentElement && !(calculatedSyntaxModel.elements.get(indexCurrentElement + 1) instanceof CsmUnindent)) { - for (int i = 0; i < Difference.STANDARD_INDENTATION_SIZE; i++) { - indentation.add(new TokenTextElement(SPACE, " ")); - } + indentationContext.increase(); } } else if (element instanceof CsmUnindent) { - for (int i = 0; i < Difference.STANDARD_INDENTATION_SIZE && indentation.size() > 0; i++) { - indentation.remove(indentation.size() - 1); - } + indentationContext.decrease(); } if (pendingIndentation && !(element instanceof CsmToken && ((CsmToken) element).isNewLine())) { - indentation.forEach(nodeText::addElement); + indentationContext.getCurrent().forEach(nodeText::addElement); } pendingIndentation = false; if (element instanceof LexicalDifferenceCalculator.CsmChild) { @@ -844,7 +873,7 @@ private static boolean isReturningOptionalNodeList(Method m) { private static ObservableProperty findNodeListName(NodeList nodeList) { Node parent = nodeList.getParentNodeForChildren(); for (Method m : parent.getClass().getMethods()) { - if (m.getAnnotation(com.github.javaparser.ast.key.IgnoreLexPrinting.class) != null) { + if (m.getDeclaredAnnotation(IgnoreLexPrinting.class) != null) { continue; } if (m.getParameterCount() == 0 @@ -852,10 +881,8 @@ private static ObservableProperty findNodeListName(NodeList nodeList) { try { Object raw = m.invoke(parent); if (!(raw instanceof NodeList)) { - // TODO weigl fix on feature/key. - continue; - // throw new IllegalStateException( - // "Expected NodeList, found " + raw.getClass().getCanonicalName()); + throw new IllegalStateException( + "Expected NodeList, found " + raw.getClass().getCanonicalName()); } NodeList result = (NodeList) raw; if (result == nodeList) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java index 46eeb36fe9..51f7301c99 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java index 0cece8c009..a3ab58bcc0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java index 642ee82109..b88e078728 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -28,18 +28,28 @@ /** * This contains the lexical information for a single node. * It is basically a list of tokens and children. + * + *

    This class has been refactored to use {@link TextElementList} internally + * for better code reuse and maintainability, while preserving the exact same + * external API and behavior. */ class NodeText { - private final List elements; + // Changed from List to TextElementList for internal optimization + private final TextElementList elements; public static final int NOT_FOUND = -1; // // Constructors // + /** + * Creates a NodeText wrapping the given list of elements. + * + * @param elements the list to wrap (will be wrapped in TextElementList) + */ NodeText(List elements) { - this.elements = elements; + this.elements = new TextElementList(elements); } /** @@ -56,14 +66,14 @@ class NodeText { * Add an element at the end. */ void addElement(TextElement nodeTextElement) { - this.elements.add(nodeTextElement); + elements.insert(elements.size(), nodeTextElement); } /** * Add an element at the given position. */ void addElement(int index, TextElement nodeTextElement) { - this.elements.add(index, nodeTextElement); + elements.insert(index, nodeTextElement); } void addChild(Node child) { @@ -75,51 +85,96 @@ void addChild(int index, Node child) { } void addToken(int tokenKind, String text) { - elements.add(new TokenTextElement(tokenKind, text)); + addElement(new TokenTextElement(tokenKind, text)); } void addToken(int index, int tokenKind, String text) { - elements.add(index, new TokenTextElement(tokenKind, text)); + addElement(index, new TokenTextElement(tokenKind, text)); } // // Finding elements // + /** + * Finds the first element matching the given matcher. + * + * @param matcher the matcher to use + * @return the index of the first matching element + * @throws IllegalArgumentException if no matching element is found + */ int findElement(TextElementMatcher matcher) { return findElement(matcher, 0); } + /** + * Finds the first element matching the given matcher, starting from the given index. + * + * @param matcher the matcher to use + * @param from the starting index (inclusive) + * @return the index of the first matching element + * @throws IllegalArgumentException if no matching element is found + */ int findElement(TextElementMatcher matcher, int from) { int res = tryToFindElement(matcher, from); if (res == NOT_FOUND) { throw new IllegalArgumentException(String.format( - "I could not find child '%s' from position %d. Elements: %s", matcher, from, elements)); + "I could not find child '%s' from position %d. Elements: %s", matcher, from, elements.toList())); } return res; } + /** + * Tries to find an element matching the given matcher, starting from the given index. + * Returns NOT_FOUND if no matching element is found. + * + * @param matcher the matcher to use + * @param from the starting index (inclusive) + * @return the index of the first matching element, or NOT_FOUND + */ int tryToFindElement(TextElementMatcher matcher, int from) { - for (int i = from; i < elements.size(); i++) { - TextElement element = elements.get(i); - if (matcher.match(element)) { - return i; - } - } - return NOT_FOUND; + return elements.findNext(from, matcher::match); } + /** + * Finds the first occurrence of the given child node. + * + * @param child the child to find + * @return the index of the child + * @throws IllegalArgumentException if child is not found + */ int findChild(Node child) { return findChild(child, 0); } + /** + * Finds the first occurrence of the given child node, starting from the given index. + * + * @param child the child to find + * @param from the starting index (inclusive) + * @return the index of the child + * @throws IllegalArgumentException if child is not found + */ int findChild(Node child, int from) { return findElement(TextElementMatchers.byNode(child), from); } + /** + * Tries to find the first occurrence of the given child node. + * + * @param child the child to find + * @return the index of the child, or NOT_FOUND + */ int tryToFindChild(Node child) { return tryToFindChild(child, 0); } + /** + * Tries to find the first occurrence of the given child node, starting from the given index. + * + * @param child the child to find + * @param from the starting index (inclusive) + * @return the index of the child, or NOT_FOUND + */ int tryToFindChild(Node child, int from) { return tryToFindElement(TextElementMatchers.byNode(child), from); } @@ -127,29 +182,43 @@ int tryToFindChild(Node child, int from) { // // Removing single elements // + /** + * Removes the first element matching the given matcher. + * Optionally removes following whitespace. + * + * @param matcher the matcher to use + * @param potentiallyFollowingWhitespace if true, removes following whitespace element + * @throws IllegalArgumentException if no matching element is found + * @throws UnsupportedOperationException if whitespace removal is requested but no element follows + */ public void remove(TextElementMatcher matcher, boolean potentiallyFollowingWhitespace) { - int i = 0; - for (TextElement e : elements) { - if (matcher.match(e)) { - elements.remove(e); - if (potentiallyFollowingWhitespace) { - if (i < elements.size()) { - if (elements.get(i).isWhiteSpace()) { - elements.remove(i); - } - } else { - throw new UnsupportedOperationException("There is no element to remove!"); - } + // Find the matching element using our optimized search + int index = tryToFindElement(matcher, 0); + if (index == NOT_FOUND) { + throw new IllegalArgumentException("No matching element found"); + } + // Remove the element + elements.remove(index); + // Optionally remove following whitespace + if (potentiallyFollowingWhitespace) { + if (index < elements.size()) { + if (elements.get(index).isWhiteSpace()) { + elements.remove(index); } - return; + } else { + throw new UnsupportedOperationException("There is no element to remove!"); } } - throw new IllegalArgumentException(); } // // Removing sequences // + /** + * Removes the element at the given index. + * + * @param index the index of the element to remove + */ void removeElement(int index) { elements.remove(index); } @@ -157,47 +226,85 @@ void removeElement(int index) { // // Replacing elements // + /** + * Replaces the element at the position matched by the given matcher + * with the given new element. + * + * @param position the matcher to find the element to replace + * @param newElement the new element + * @throws IllegalArgumentException if no matching element is found + */ void replace(TextElementMatcher position, TextElement newElement) { int index = findElement(position, 0); elements.remove(index); - elements.add(index, newElement); + elements.insert(index, newElement); } + /** + * Replaces the element at the position matched by the given matcher + * with the given collection of new elements. + * + * @param position the matcher to find the element to replace + * @param newElements the new elements + * @throws IllegalArgumentException if no matching element is found + */ void replace(TextElementMatcher position, Collection newElements) { int index = findElement(position, 0); elements.remove(index); - elements.addAll(index, newElements); + elements.insertAll(index, (List) newElements); } // // Other methods // /** - * Generate the corresponding string. + * Generate the corresponding string by expanding all elements. + * + * @return the expanded string representation */ String expand() { - StringBuffer sb = new StringBuffer(); - elements.forEach(e -> sb.append(e.expand())); + StringBuilder sb = new StringBuilder(); + // Use the underlying list's forEach for efficiency + elements.toList().forEach(e -> sb.append(e.expand())); return sb.toString(); } - // Visible for testing + /** + * Returns the number of elements. + * Visible for testing. + * + * @return the number of elements + */ int numberOfElements() { return elements.size(); } - // Visible for testing + /** + * Returns the element at the given index. + * Visible for testing. + * + * @param index the index + * @return the element at that index + */ TextElement getTextElement(int index) { return elements.get(index); } - // Visible for testing + /** + * Returns the underlying list of elements. + * Visible for testing. + * + *

    IMPORTANT: This returns the internal mutable list. + * External modifications will affect this NodeText. + * + * @return the list of elements (mutable) + */ List getElements() { - return elements; + return elements.toMutableList(); } @Override public String toString() { - return "NodeText{" + elements + '}'; + return "NodeText{" + elements.toList() + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java index 42c0a1e2ce..dd92ebb440 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java index 6e8a2605a0..4f7bd15615 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java index 944438d5af..3a3377ef34 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java index 6b40c43fe0..05e27dac76 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java index 4e9afb0bde..383e6cc2a6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -35,12 +35,13 @@ /** * This class represents a group of {@link Removed} elements. * The {@link Removed} elements are ideally consecutive for the methods in this class to work correctly. - *

    + * * This class consists of methods that calculate information to better handle the difference application for the * containing {@link Removed} elements. * - * @author ThLeu * @see Iterable + * + * @author ThLeu */ final class RemovedGroup implements Iterable { @@ -65,7 +66,7 @@ private RemovedGroup(Integer firstElementIndex, List removedList) { * Factory method to create a RemovedGroup which consists of consecutive Removed elements * * @param firstElementIndex the difference index at which the RemovedGroup starts - * @param removedList list of the consecutive Removed elements + * @param removedList list of the consecutive Removed elements * @return a RemovedGroup object * @throws IllegalArgumentException if the firstElementIndex is null or the removedList is empty or null */ @@ -201,7 +202,7 @@ private boolean hasOnlyWhiteSpaceForTokenFunction( * It is therefore necessary to avoid taking this element into account so we're looking for the first element that isn't a line break.. * For example * class Foo { - * int x; + * int x; * } * If there is something else than whitespace in front this element, Optional.empty() is returned. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java index 4d8669fe55..35732b56da 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java index d2deffa021..916b47fee8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -22,7 +22,6 @@ import com.github.javaparser.printer.concretesyntaxmodel.CsmElement; import com.github.javaparser.printer.concretesyntaxmodel.CsmMix; import com.github.javaparser.printer.concretesyntaxmodel.CsmToken; -import com.github.javaparser.printer.lexicalpreservation.Difference.ArrayIterator; import java.util.*; public class ReshuffledDiffElementExtractor { @@ -56,7 +55,7 @@ private ReshuffledDiffElementExtractor(NodeText nodeText) { } public void extract(List diffElements) { - ArrayIterator iterator = new ArrayIterator<>(diffElements); + IndexTrackingIterator iterator = new IndexTrackingIterator<>(diffElements); while (iterator.hasNext()) { DifferenceElement diffElement = iterator.next(); if (diffElement instanceof Reshuffled) { @@ -170,21 +169,21 @@ public void extract(List diffElements) { private Map getCorrespondanceBetweenNextOrderAndPreviousOrder( CsmMix elementsFromPreviousOrder, CsmMix elementsFromNextOrder) { Map correspondanceBetweenNextOrderAndPreviousOrder = new HashMap<>(); - ArrayIterator previousOrderElementsIterator = - new ArrayIterator<>(elementsFromPreviousOrder.getElements()); + IndexTrackingIterator previousOrderElementsIterator = + new IndexTrackingIterator<>(elementsFromPreviousOrder.getElements()); int syncNextIndex = 0; while (previousOrderElementsIterator.hasNext()) { CsmElement pe = previousOrderElementsIterator.next(); - ArrayIterator nextOrderElementsIterator = - new ArrayIterator<>(elementsFromNextOrder.getElements(), syncNextIndex); + IndexTrackingIterator nextOrderElementsIterator = + new IndexTrackingIterator<>(elementsFromNextOrder.getElements(), syncNextIndex); while (nextOrderElementsIterator.hasNext()) { CsmElement ne = nextOrderElementsIterator.next(); if (!correspondanceBetweenNextOrderAndPreviousOrder .values() - .contains(previousOrderElementsIterator.index()) + .contains(previousOrderElementsIterator.currentIndex()) && DifferenceElementCalculator.matching(ne, pe)) { correspondanceBetweenNextOrderAndPreviousOrder.put( - nextOrderElementsIterator.index(), previousOrderElementsIterator.index()); + nextOrderElementsIterator.currentIndex(), previousOrderElementsIterator.currentIndex()); // set the position to start on the next {@code nextOrderElementsIterator} iteration syncNextIndex = nextOrderElementsIterator.nextIndex(); break; diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java index 06d7bfdfcc..22c3193ae6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIterator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIterator.java new file mode 100755 index 0000000000..9a37b172d3 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIterator.java @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import java.util.List; +import java.util.ListIterator; + +/** + * Iterator that tracks its current position in a TextElement list. + * + *

    Unlike standard {@link ListIterator}, this class provides direct access + * to the current index via {@link #currentIndex()}, which returns the index of + * the element that was returned by the most recent call to {@link #next()} or + * {@link #previous()}. + * + *

    This iterator is a replacement for the internal {@code ArrayIterator} class, + * with clearer semantics and better naming. It correctly handles bidirectional + * iteration by maintaining the current index internally. + * + * @since 3.28.0 + */ +public class TextElementIterator implements ListIterator { + + private final ListIterator delegate; + + private int currentIndex; + + /** + * Creates an iterator starting at the specified index. + * The current index is initialized to -1, indicating that no element + * has been read yet. + * + * @param elements the list to iterate over + * @param fromIndex the starting index (cursor position) + * @throws IndexOutOfBoundsException if fromIndex is out of range + */ + public TextElementIterator(List elements, int fromIndex) { + this.delegate = elements.listIterator(fromIndex); + // No element read yet + this.currentIndex = -1; + } + + /** + * Returns the index of the element that was returned by the most recent call + * to {@link #next()} or {@link #previous()}. + * + *

    This method can be called multiple times without side effects - it will + * always return the same value until the next call to {@link #next()}, + * {@link #previous()}, or {@link #remove()}. + * + *

    Important: If neither {@link #next()} nor {@link #previous()} has + * been called yet, or if {@link #remove()} was called after the last call to + * {@link #next()} or {@link #previous()}, this method returns -1. + * + * @return the index of the current element, or -1 if no element has been read + * or the current element was removed + */ + public int currentIndex() { + return currentIndex; + } + + // === LISTITERATOR METHODS WITH INDEX TRACKING === + @Override + public boolean hasNext() { + return delegate.hasNext(); + } + + @Override + public TextElement next() { + TextElement result = delegate.next(); + // After next(), previousIndex() points to the element we just read + currentIndex = delegate.previousIndex(); + return result; + } + + @Override + public boolean hasPrevious() { + return delegate.hasPrevious(); + } + + @Override + public TextElement previous() { + TextElement result = delegate.previous(); + // After previous(), nextIndex() points to the element we just read + currentIndex = delegate.nextIndex(); + return result; + } + + @Override + public int nextIndex() { + return delegate.nextIndex(); + } + + @Override + public int previousIndex() { + return delegate.previousIndex(); + } + + @Override + public void remove() { + delegate.remove(); + // After remove, there is no current element + currentIndex = -1; + } + + @Override + public void set(TextElement element) { + delegate.set(element); + // Current index doesn't change when replacing an element + } + + @Override + public void add(TextElement element) { + delegate.add(element); + // After add(), the added element becomes the current element + currentIndex = delegate.previousIndex(); + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java index 1d4b8abedc..0920a748da 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementList.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementList.java new file mode 100755 index 0000000000..698891a2a6 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementList.java @@ -0,0 +1,288 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; + +/** + * Default mutable implementation of {@link TextElementSequence}. + * + *

    This class wraps an existing {@code List} without copying it. + * All mutations directly affect the underlying list. + * + *

    The implementation provides optimized search operations and clear semantics + * for index-based manipulations required by lexical preservation operations. + * + * @since 3.28.0 + */ +public class TextElementList implements TextElementSequence { + + private final List elements; + + /** + * Creates a wrapper around the given list. + * The list is NOT copied, mutations affect the original. + * + * @param elements the list to wrap + * @throws NullPointerException if elements is null + */ + public TextElementList(List elements) { + this.elements = Objects.requireNonNull(elements, "elements cannot be null"); + } + + /** + * Creates a new TextElementList containing the given elements. + * + * @param elements varargs of elements + * @return a new list + */ + public static TextElementList of(TextElement... elements) { + return new TextElementList(new ArrayList<>(Arrays.asList(elements))); + } + + /** + * Creates a new TextElementList wrapping the given list. + * + *

    IMPORTANT: This method wraps the list directly without copying. + * Modifications to the TextElementList will affect the original list. + * Use {@link #copyOf(List)} if you need an independent copy. + * + *

    This method is useful for chaining operations: + *

    {@code
    +     * List result = TextElementList.of(list.subList(0, 10))
    +     *     .takeWhile(TextElement::isSpaceOrTab);
    +     * }
    + * + * @param elements the list to wrap (not copied) + * @return a new TextElementList wrapping the given list + * @throws NullPointerException if elements is null + */ + public static TextElementList of(List elements) { + return new TextElementList(elements); + } + + /** + * Creates an empty mutable TextElementList. + * + * @return an empty list + */ + public static TextElementList empty() { + return new TextElementList(new ArrayList<>()); + } + + /** + * Creates a new TextElementList with a copy of the given list. + * + * @param elements the list to copy + * @return a new list with copied elements + * @throws NullPointerException if elements is null + */ + public static TextElementList copyOf(List elements) { + return new TextElementList(new ArrayList<>(elements)); + } + + // === SEARCH BY PREDICATE === + @Override + public int findFirst(Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + for (int i = 0; i < elements.size(); i++) { + if (predicate.test(elements.get(i))) { + return i; + } + } + return -1; + } + + @Override + public int findLast(Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + for (int i = elements.size() - 1; i >= 0; i--) { + if (predicate.test(elements.get(i))) { + return i; + } + } + return -1; + } + + @Override + public int findNext(int fromIndex, Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + if (!isValidIndex(fromIndex)) { + return -1; + } + for (int i = fromIndex; i < elements.size(); i++) { + if (predicate.test(elements.get(i))) { + return i; + } + } + return -1; + } + + @Override + public int findPrevious(int fromIndex, Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + if (fromIndex < 0 || fromIndex >= elements.size()) { + return -1; + } + for (int i = fromIndex; i >= 0; i--) { + if (predicate.test(elements.get(i))) { + return i; + } + } + return -1; + } + + // === FILTERING === + @Override + public List takeWhile(Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + List result = new ArrayList<>(); + for (TextElement element : elements) { + if (!predicate.test(element)) { + break; + } + result.add(element); + } + return result; + } + + @Override + public List subList(int fromIndex, int toIndex) { + return elements.subList(fromIndex, toIndex); + } + + // === MUTATION === + @Override + public void insert(int index, TextElement element) { + Objects.requireNonNull(element, "element cannot be null"); + elements.add(index, element); + } + + @Override + public void insertAll(int index, List elementsToInsert) { + Objects.requireNonNull(elementsToInsert, "elements cannot be null"); + elements.addAll(index, elementsToInsert); + } + + @Override + public void remove(int index) { + elements.remove(index); + } + + @Override + public void removeRange(int fromIndex, int toIndex) { + if (!isValidIndex(fromIndex) || !isValidIndex(toIndex) || fromIndex > toIndex) { + throw new IndexOutOfBoundsException( + "Invalid range: [" + fromIndex + ", " + toIndex + "] for size " + elements.size()); + } + // toIndex is inclusive, subList.clear() expects exclusive upper bound + elements.subList(fromIndex, toIndex + 1).clear(); + } + + // === ACCESS === + @Override + public TextElement get(int index) { + return elements.get(index); + } + + @Override + public boolean isValidIndex(int index) { + return index >= 0 && index < elements.size(); + } + + @Override + public int size() { + return elements.size(); + } + + @Override + public boolean isEmpty() { + return elements.isEmpty(); + } + + @Override + public List toList() { + return Collections.unmodifiableList(elements); + } + + @Override + public List toMutableList() { + return elements; + } + + // === MATCHING (TERMINAL OPERATIONS) === + @Override + public boolean anyMatch(Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + for (TextElement element : elements) { + if (predicate.test(element)) { + return true; + } + } + return false; + } + + @Override + public boolean allMatch(Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + for (TextElement element : elements) { + if (!predicate.test(element)) { + return false; + } + } + return true; + } + + @Override + public boolean noneMatch(Predicate predicate) { + Objects.requireNonNull(predicate, "predicate cannot be null"); + return !anyMatch(predicate); + } + + // === ITERATION === + @Override + public TextElementIterator iterator(int fromIndex) { + return new TextElementIterator(elements, fromIndex); + } + + @Override + public String toString() { + return "TextElementList{size=" + elements.size() + "}"; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof TextElementList)) return false; + TextElementList other = (TextElementList) obj; + return elements.equals(other.elements); + } + + @Override + public int hashCode() { + return elements.hashCode(); + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java index 696d998e70..20c05fdef2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java index 3a21ddac4c..fee837ff68 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementSequence.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementSequence.java new file mode 100755 index 0000000000..6128d23f7b --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementSequence.java @@ -0,0 +1,351 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; +import java.util.stream.Stream; + +/** + * Contract for a specialized sequence of TextElements with enhanced search + * and modification capabilities for lexical preservation operations. + * + *

    Unlike standard {@link List}, this interface provides: + *

      + *
    • Index-based search with predicates (findFirst, findLast, findNext, findPrevious)
    • + *
    • Element-based search (indexOf, lastIndexOf with overloads)
    • + *
    • Controlled mutations (insert, remove) where caller manages index adjustments
    • + *
    + * + *

    Thread safety: Implementations are not required to be thread-safe. + * + *

    Index management: Mutation operations modify the underlying list directly. + * Callers are responsible for tracking index changes after mutations. + * + * @since 3.28.0 + */ +public interface TextElementSequence { + + // === SEARCH BY PREDICATE === + /** + * Finds the first index where the predicate matches, searching forward from index 0. + * + * @param predicate the condition to test + * @return the first matching index, or -1 if no match found + * @throws NullPointerException if predicate is null + */ + int findFirst(Predicate predicate); + + /** + * Finds the last index where the predicate matches, searching backward from the end. + * + * @param predicate the condition to test + * @return the last matching index, or -1 if no match found + * @throws NullPointerException if predicate is null + */ + int findLast(Predicate predicate); + + /** + * Finds the next index where the predicate matches, searching forward from fromIndex (inclusive). + * + * @param fromIndex the starting index (inclusive) + * @param predicate the condition to test + * @return the next matching index, or -1 if no match found + * @throws NullPointerException if predicate is null + */ + int findNext(int fromIndex, Predicate predicate); + + /** + * Finds the previous index where the predicate matches, searching backward from fromIndex (inclusive). + * + * @param fromIndex the starting index (inclusive) + * @param predicate the condition to test + * @return the previous matching index, or -1 if no match found + * @throws NullPointerException if predicate is null + */ + int findPrevious(int fromIndex, Predicate predicate); + + // === MATCHING (TERMINAL OPERATIONS) === + /** + * Tests whether any element in this sequence matches the given predicate. + * + *

    This is a short-circuiting terminal operation: it stops as soon as + * a matching element is found and returns true immediately. + * + *

    Examples: + *

    {@code
    +     * // Check if list contains any comment
    +     * boolean hasComment = list.anyMatch(TextElement::isComment);
    +     *
    +     * // Check if list contains any token with specific text
    +     * boolean hasIdentifier = list.anyMatch(el ->
    +     *     el instanceof TokenTextElement &&
    +     *     ((TokenTextElement) el).getText().equals("myVar")
    +     * );
    +     * }
    + * + * @param predicate the predicate to test elements against + * @return true if any element matches the predicate, false otherwise + * (returns false for empty sequences) + * @throws NullPointerException if predicate is null + */ + boolean anyMatch(Predicate predicate); + + /** + * Tests whether all elements in this sequence match the given predicate. + * + *

    This is a short-circuiting terminal operation: it stops as soon as + * a non-matching element is found and returns false immediately. + * + *

    Returns true for empty sequences (vacuous truth). + * + *

    Examples: + *

    {@code
    +     * // Check if all elements are whitespace
    +     * boolean allWhitespace = list.allMatch(TextElement::isSpaceOrTab);
    +     *
    +     * // Check if all elements are comments
    +     * boolean allComments = list.allMatch(TextElement::isComment);
    +     * }
    + * + * @param predicate the predicate to test elements against + * @return true if all elements match the predicate (or sequence is empty), + * false otherwise + * @throws NullPointerException if predicate is null + */ + boolean allMatch(Predicate predicate); + + /** + * Tests whether no elements in this sequence match the given predicate. + * + *

    This is a short-circuiting terminal operation: it stops as soon as + * a matching element is found and returns false immediately. + * + *

    Returns true for empty sequences. + * + *

    Equivalent to {@code !anyMatch(predicate)}. + * + *

    Examples: + *

    {@code
    +     * // Check if list has no comments
    +     * boolean noComments = list.noneMatch(TextElement::isComment);
    +     *
    +     * // Check if list has no newlines
    +     * boolean noNewlines = list.noneMatch(TextElement::isNewline);
    +     * }
    + * + * @param predicate the predicate to test elements against + * @return true if no elements match the predicate (or sequence is empty), + * false otherwise + * @throws NullPointerException if predicate is null + */ + boolean noneMatch(Predicate predicate); + + // === SEARCH BY ELEMENT === + /** + * Finds the first occurrence of the specified element. + * Equivalent to {@code findFirst(e -> Objects.equals(e, element))}. + * + * @param element the element to search for (may be null) + * @return the first occurrence index, or -1 if not found + */ + default int indexOf(TextElement element) { + return findFirst(e -> Objects.equals(e, element)); + } + + /** + * Finds the last occurrence of the specified element. + * Equivalent to {@code findLast(e -> Objects.equals(e, element))}. + * + * @param element the element to search for (may be null) + * @return the last occurrence index, or -1 if not found + */ + default int lastIndexOf(TextElement element) { + return findLast(e -> Objects.equals(e, element)); + } + + /** + * Finds the next occurrence of element starting from fromIndex (inclusive). + * Equivalent to {@code findNext(fromIndex, e -> Objects.equals(e, element))}. + * + * @param fromIndex the starting index (inclusive) + * @param element the element to search for (may be null) + * @return the next occurrence index, or -1 if not found + */ + default int indexOf(int fromIndex, TextElement element) { + return findNext(fromIndex, e -> Objects.equals(e, element)); + } + + /** + * Finds the previous occurrence of element before fromIndex (inclusive). + * Equivalent to {@code findPrevious(fromIndex, e -> Objects.equals(e, element))}. + * + * @param fromIndex the starting index (inclusive) + * @param element the element to search for (may be null) + * @return the previous occurrence index, or -1 if not found + */ + default int lastIndexOf(int fromIndex, TextElement element) { + return findPrevious(fromIndex, e -> Objects.equals(e, element)); + } + + // === FILTERING === + /** + * Returns a new list containing elements from the start until the predicate fails. + * The returned list is independent of this sequence. + * + * @param predicate the condition to test + * @return a new list of matching elements + * @throws NullPointerException if predicate is null + */ + List takeWhile(Predicate predicate); + + /** + * Returns a sublist view [fromIndex, toIndex). + * The returned list is backed by this sequence, so changes affect both. + * + * @param fromIndex low endpoint (inclusive) + * @param toIndex high endpoint (exclusive) + * @return a sublist view + * @throws IndexOutOfBoundsException if indices are out of range + */ + List subList(int fromIndex, int toIndex); + + // === MUTATION === + /** + * Inserts element at the specified index. + * WARNING: Caller must adjust subsequent indices manually. + * + * @param index position to insert at + * @param element element to insert + * @throws IndexOutOfBoundsException if index is out of range + * @throws NullPointerException if element is null + */ + void insert(int index, TextElement element); + + /** + * Inserts all elements at the specified index. + * WARNING: Caller must adjust subsequent indices manually. + * + * @param index position to insert at + * @param elements elements to insert + * @throws IndexOutOfBoundsException if index is out of range + * @throws NullPointerException if elements is null + */ + void insertAll(int index, List elements); + + /** + * Removes the element at the specified index. + * WARNING: Caller must adjust subsequent indices manually. + * + * @param index position to remove from + * @throws IndexOutOfBoundsException if index is out of range + */ + void remove(int index); + + /** + * Removes elements in range [fromIndex, toIndex] (inclusive on both ends). + * WARNING: Caller must adjust subsequent indices manually. + * + * @param fromIndex start of range (inclusive) + * @param toIndex end of range (inclusive) + * @throws IndexOutOfBoundsException if indices are out of range or fromIndex > toIndex + */ + void removeRange(int fromIndex, int toIndex); + + // === ACCESS === + /** + * Returns the element at the specified index. + * + * @param index the index + * @return the element at that position + * @throws IndexOutOfBoundsException if index is out of range + */ + TextElement get(int index); + + /** + * Checks if the index is valid (0 <= index < size). + * + * @param index the index to check + * @return true if index is valid + */ + boolean isValidIndex(int index); + + /** + * Returns the number of elements in this sequence. + * + * @return the size + */ + int size(); + + /** + * Checks if this sequence is empty. + * + * @return true if size is 0 + */ + boolean isEmpty(); + + /** + * Returns an unmodifiable view of the underlying list. + * Changes to the original list are visible in the returned view. + * + * @return an unmodifiable list view + */ + List toList(); + + /** + * Returns the underlying mutable list. + * + *

    WARNING: This exposes the internal list directly. + * Modifications will affect this sequence. + * + * @return the mutable list + */ + List toMutableList(); + + // === ITERATION === + /** + * Returns an iterator starting at the specified index. + * + * @param fromIndex the starting position + * @return an iterator with position tracking + * @throws IndexOutOfBoundsException if fromIndex is out of range + */ + TextElementIterator iterator(int fromIndex); + + /** + * Returns an iterator starting at index 0. + * + * @return an iterator from the beginning + */ + default TextElementIterator iterator() { + return iterator(0); + } + + /** + * Returns a stream of elements for functional operations. + * + * @return a stream over the elements + */ + default Stream stream() { + return toList().stream(); + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenOwnerDetector.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenOwnerDetector.java new file mode 100755 index 0000000000..69d3265f48 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenOwnerDetector.java @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import com.github.javaparser.ast.Node; +import com.github.javaparser.ast.body.FieldDeclaration; +import com.github.javaparser.ast.type.Type; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +/** + * Detects which node actually owns the tokens for a given node in the AST. + * + *

    This utility is essential for the LexicalPreservingPrinter because the token + * assignment algorithm assigns tokens based on position in the source code, not + * necessarily to the logical AST node. + * + *

    Core Problem: In JavaParser's AST, child nodes may appear in the source + * code before their parent node's position. The LPP assigns tokens to the + * nearest enclosing node whose range includes the token's position. + * + *

    Example: In {@code Set> x;}, the tokens for + * {@code Pair} are assigned to {@code VariableDeclarationExpr}, + * not to the {@code Pair} type node. When replacing {@code Pair}, the LPP needs + * to know to regenerate {@code VariableDeclarationExpr}. + * + *

    Implementation: Uses the Strategy pattern with multiple detection + * strategies, each handling a specific category of nodes (Types, Annotations, + * Modifiers, etc.). Strategies are tried in priority order. + * + * @since 3.28.0 + */ +class TokenOwnerDetector { + + /** + * Strategy interface for detecting token owners. + * + *

    Each strategy implementation checks if it applies to the given node, + * then searches for the token owner by walking up the AST. + */ + @FunctionalInterface + interface DetectionStrategy { + + /** + * Attempts to find the token owner for the given node. + * + * @param node the node to analyze + * @return the token owner if this strategy applies, empty otherwise + */ + Optional detect(Node node); + } + + /** + * Detection strategies in priority order. + * + *

    Order matters: strategies are tried sequentially, first match wins. + * Most frequent cases are placed first for performance (early exit). + * + *

    Priority rationale: + *

      + *
    1. TypeOwnerStrategy - Most common, critical for Issue #3365
    2. + *
    3. AnnotationOwnerStrategy - Common in modern Java code
    4. + *
    5. ModifierOwnerStrategy - Moderately common
    6. + *
    7. TypeParameterOwnerStrategy - Less common (generics only)
    8. + *
    9. NameInExpressionStrategy - Rare edge cases
    10. + *
    + */ + private static final List STRATEGIES = Arrays.asList(new TypeOwnerStrategy()); + + /** + * Finds the node that owns the tokens for the given node. + * + *

    Algorithm: + *

      + *
    1. Try each detection strategy in priority order
    2. + *
    3. Return the first non-null owner found
    4. + *
    5. If no strategy applies, the node owns its own tokens
    6. + *
    + * + * @param node the node to find the token owner for + * @return the node that owns the tokens, never null + * @throws IllegalArgumentException if node is null + */ + static Node findTokenOwner(Node node) { + if (node == null) { + throw new IllegalArgumentException("node cannot be null"); + } + // Try each strategy in order + for (DetectionStrategy strategy : STRATEGIES) { + Optional owner = strategy.detect(node); + if (owner.isPresent() && owner.get() != node) { + return owner.get(); + } + } + // Default: node owns its own tokens + return node; + } + + /** + * Determines if token owner regeneration is needed after a node replacement. + * + *

    Context: When a node is replaced in the AST (e.g., replacing {@code Pair} + * with {@code SimpleImmutableEntry} in Issue #3365), the LexicalPreservingPrinter's + * Observer notifies the change. However, the LPP only regenerates the NodeText for + * the immediate parent of the replaced node by default. + * + *

    Problem: If the tokens for the replaced node are actually owned by an + * ancestor further up the tree (as detected by {@link #findTokenOwner(Node)}), the + * LPP won't regenerate the correct NodeText, resulting in the change not appearing + * in the output. + * + *

    Example where regeneration is needed: + *

    {@code
    +     * Set> x;
    +     *
    +     * // When replacing Pair type:
    +     * // - parent: TypeArguments (immediate parent of Pair)
    +     * // - tokenOwner: VariableDeclarationExpr (owns the tokens)
    +     * // - replacedNode: ClassOrInterfaceType (Pair)
    +     *
    +     * // Result: needsRegeneration = true (tokenOwner != parent)
    +     * }
    + * + *

    Example where regeneration is NOT needed: + *

    {@code
    +     * x = 5;
    +     *
    +     * // When replacing the literal 5:
    +     * // - parent: AssignExpr (immediate parent of literal)
    +     * // - tokenOwner: AssignExpr (same as parent)
    +     * // - replacedNode: IntegerLiteralExpr (5)
    +     *
    +     * // Result: needsRegeneration = false (normal LPP handling works)
    +     * }
    + * + *

    Decision criteria: + *

      + *
    1. If tokenOwner == parent: No regeneration needed (normal path)
    2. + *
    3. If replacedNode is a Type: Regeneration needed (Issue #3365 case)
    4. + *
    5. If replacedNode is inside a Type: Regeneration needed (nested case)
    6. + *
    7. Otherwise: No regeneration needed
    8. + *
    + * + * @param parent the immediate parent of the replaced node (where LPP would normally regenerate) + * @param tokenOwner the actual owner of the tokens (as detected by findTokenOwner) + * @param replacedNode the node being replaced in the AST + * @return true if the tokenOwner's NodeText should be regenerated, false if normal LPP handling is sufficient + */ + static boolean needsRegeneration(Node parent, Node tokenOwner, Node replacedNode) { + // Case 1: Token owner is the same as the immediate parent + // This is the normal case where LPP's default behavior (regenerating the parent) works correctly. + // Example: x = 5; → replacing 5 in AssignExpr + if (tokenOwner.equals(parent)) { + return false; + } + // WORKAROUND: Multiple variable declarations share same type + if (tokenOwner instanceof FieldDeclaration) { + FieldDeclaration field = (FieldDeclaration) tokenOwner; + if (field.getVariables().size() > 1) { + // Let LPP handle it normally + return false; + } + } + // Case 2: Replaced node is directly a Type + // This is the most common case requiring special handling (Issue #3365). + // Types in declarations have their tokens owned by the declaration, not by the Type node itself. + // Example: Set> x; → replacing Pair type + if (replacedNode instanceof Type) { + return true; + } + // Case 3: Replaced node is contained within a Type + // This handles nested cases where a node inside a type (e.g., type arguments) is replaced. + // We walk up from the replaced node to the parent, checking if we pass through a Type node. + // Example: Set> → replacing "String" inside Pair's type arguments + Node current = replacedNode.getParentNode().orElse(null); + while (current != null && current != parent) { + if (current instanceof Type) { + // Found a Type node in the ancestry chain → regeneration needed + return true; + } + current = current.getParentNode().orElse(null); + } + // Case 4: None of the above + // The replaced node is not type-related and tokenOwner != parent. + // This is rare but possible (e.g., annotations, modifiers in some cases). + // Conservative approach: don't regenerate unless we're sure we need to. + // If this causes issues, we can add more cases (annotations, modifiers, etc.) + return false; + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java index d488b53392..2fb0fb4945 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TypeOwnerStrategy.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TypeOwnerStrategy.java new file mode 100755 index 0000000000..a2217fc13b --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TypeOwnerStrategy.java @@ -0,0 +1,331 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import com.github.javaparser.ast.Node; +import com.github.javaparser.ast.body.*; +import com.github.javaparser.ast.expr.*; +import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; +import com.github.javaparser.ast.stmt.ExpressionStmt; +import com.github.javaparser.ast.type.Type; +import com.github.javaparser.utils.Optionals; +import java.util.List; +import java.util.Optional; + +/** + * Strategy for detecting token owners of Type nodes and their children. + * + *

    This is the most complex strategy because types appear in many contexts: + *

      + *
    • Variable declarations (local, field)
    • + *
    • Method return types
    • + *
    • Parameters
    • + *
    • Extends/implements clauses
    • + *
    • Cast expressions
    • + *
    • Instanceof expressions
    • + *
    • Type parameters and bounds
    • + *
    + * + *

    This strategy is critical for fixing Issue #3365 where nested generic types + * (e.g., {@code Set>}) were not properly updated by the LPP. + */ +class TypeOwnerStrategy implements TokenOwnerDetector.DetectionStrategy { + + @Override + public Optional detect(Node node) { + // Check if this strategy applies + Type type = findTypeNode(node); + if (type == null) { + return Optional.empty(); + } + // Find the owner + Node owner = findTypeOwner(type); + return Optional.ofNullable(owner); + } + + /** + * Finds the Type node for the given node. + * Returns the node itself if it's a Type, or searches ancestors. + * + * @param node the node to analyze + * @return the Type node, or null if not found or not in a type context + */ + private Type findTypeNode(Node node) { + if (node instanceof Type) { + return (Type) node; + } + // Search ancestors, but stop at boundaries + Node current = node; + while (current != null) { + if (current instanceof Type) { + return (Type) current; + } + // Stop at boundaries that indicate we're not in a type context + if (current instanceof BodyDeclaration || current instanceof ExpressionStmt) { + return null; + } + current = current.getParentNode().orElse(null); + } + return null; + } + + /** + * Finds the declaration that owns the tokens for the given type. + * + *

    Algorithm: Walk up the AST from the type, checking each parent + * against known contexts where types appear. Return the first matching + * declaration. + * + * @param type the type node (never null) + * @return the token owner, or the type itself if no owner found + */ + private Node findTypeOwner(Type type) { + Node current = type; + while (current != null) { + Node parent = current.getParentNode().orElse(null); + if (parent == null) { + break; + } + final Node currentNode = current; + // Check each context using Optional chaining for clean code + Optional owner = Optionals.or( + () -> checkVariableContext(parent, currentNode), + () -> checkParameterContext(parent, currentNode), + () -> checkMethodContext(parent, currentNode), + () -> checkClassContext(parent, currentNode), + () -> checkExpressionContext(parent, currentNode), + () -> checkStatementContext(parent, currentNode)); + if (owner.isPresent()) { + return owner.get(); + } + current = parent; + } + // Fallback: type owns its own tokens + return type; + } + + // ======================================================================== + // CONTEXT CHECKERS + // Each method checks if the parent is a specific context that owns tokens + // ======================================================================== + /** + * Checks variable declaration contexts: local variables, fields, enum constants. + * + * @param parent the potential owner + * @param current the current node in the walk + * @return the owner if this context applies + */ + private Optional checkVariableContext(Node parent, Node current) { + // Local variable declaration + if (parent instanceof VariableDeclarationExpr) { + return Optional.of(parent); + } + // Field declaration + if (parent instanceof FieldDeclaration) { + return Optional.of(parent); + } + // Enum constant declaration + if (parent instanceof EnumConstantDeclaration) { + return Optional.of(parent); + } + return Optional.empty(); + } + + /** + * Checks parameter contexts: method parameters, receiver parameters. + * + * @param parent the potential owner + * @param current the current node in the walk + * @return the owner if this context applies + */ + private Optional checkParameterContext(Node parent, Node current) { + // Method/constructor parameter + if (parent instanceof Parameter) { + return Optional.of(parent); + } + // Receiver parameter (e.g., void method(MyClass MyClass.this)) + if (parent instanceof ReceiverParameter) { + return Optional.of(parent); + } + return Optional.empty(); + } + + /** + * Checks method/constructor contexts: return types, constructor declarations. + * + * @param parent the potential owner + * @param current the current node in the walk + * @return the owner if this context applies + */ + private Optional checkMethodContext(Node parent, Node current) { + // Method return type + if (parent instanceof MethodDeclaration) { + MethodDeclaration method = (MethodDeclaration) parent; + // Verify that current is actually the return type (not a parameter type) + if (current.equals(method.getType()) || isAncestorOf(method.getType(), current)) { + return Optional.of(parent); + } + } + // Annotation member declaration + if (parent instanceof AnnotationMemberDeclaration) { + AnnotationMemberDeclaration member = (AnnotationMemberDeclaration) parent; + if (current.equals(member.getType()) || isAncestorOf(member.getType(), current)) { + return Optional.of(parent); + } + } + // Constructor declaration + if (parent instanceof ConstructorDeclaration) { + return Optional.of(parent); + } + return Optional.empty(); + } + + /** + * Checks class/interface contexts: extends, implements, permits clauses. + * + * @param parent the potential owner + * @param current the current node in the walk + * @return the owner if this context applies + */ + private Optional checkClassContext(Node parent, Node current) { + // Class or interface declaration + if (parent instanceof ClassOrInterfaceDeclaration) { + ClassOrInterfaceDeclaration classDecl = (ClassOrInterfaceDeclaration) parent; + // Check extends clause + if (isInTypeList(classDecl.getExtendedTypes(), current)) { + return Optional.of(parent); + } + // Check implements clause + if (isInTypeList(classDecl.getImplementedTypes(), current)) { + return Optional.of(parent); + } + // Check permits clause (sealed classes - Java 17+) + if (isInTypeList(classDecl.getPermittedTypes(), current)) { + return Optional.of(parent); + } + } + // Record declaration (Java 14+) + if (parent instanceof RecordDeclaration) { + RecordDeclaration recordDecl = (RecordDeclaration) parent; + // Check implements clause + if (isInTypeList(recordDecl.getImplementedTypes(), current)) { + return Optional.of(parent); + } + } + // Enum declaration + if (parent instanceof EnumDeclaration) { + EnumDeclaration enumDecl = (EnumDeclaration) parent; + // Check implements clause + if (isInTypeList(enumDecl.getImplementedTypes(), current)) { + return Optional.of(parent); + } + } + return Optional.empty(); + } + + /** + * Checks expression contexts: cast, instanceof, record pattern. + * + * @param parent the potential owner + * @param current the current node in the walk + * @return the owner if this context applies + */ + private Optional checkExpressionContext(Node parent, Node current) { + // Cast expression: (String) obj + if (parent instanceof CastExpr) { + CastExpr cast = (CastExpr) parent; + // Verify current is the cast type + if (current.equals(cast.getType()) || isAncestorOf(cast.getType(), current)) { + // The cast expression itself owns the type tokens + return Optional.of(parent); + } + } + // Instanceof expression: obj instanceof String + if (parent instanceof InstanceOfExpr) { + InstanceOfExpr instanceOf = (InstanceOfExpr) parent; + // Verify current is the type being checked + if (current.equals(instanceOf.getType()) || isAncestorOf(instanceOf.getType(), current)) { + // The instanceof expression owns the type tokens + return Optional.of(parent); + } + } + // Record pattern expression + if (parent instanceof RecordPatternExpr) { + RecordPatternExpr pattern = (RecordPatternExpr) parent; + if (current.equals(pattern.getType()) || isAncestorOf(pattern.getType(), current)) { + return Optional.of(parent); + } + } + return Optional.empty(); + } + + /** + * Checks statement contexts: explicit constructor invocations. + * + * @param parent the potential owner + * @param current the current node in the walk + * @return the owner if this context applies + */ + private Optional checkStatementContext(Node parent, Node current) { + // Explicit constructor invocation: this(...), super(...) + if (parent instanceof ExplicitConstructorInvocationStmt) { + return Optional.of(parent); + } + return Optional.empty(); + } + + // ======================================================================== + // UTILITY METHODS + // ======================================================================== + /** + * Checks if a node is contained in a list of types (extends, implements, permits). + * + * @param types the list of types to check + * @param node the node to search for + * @return true if node is in the list or is a descendant of a type in the list + */ + private boolean isInTypeList(List types, Node node) { + for (Type type : types) { + if (type.equals(node) || isAncestorOf(type, node)) { + return true; + } + } + return false; + } + + /** + * Checks if potentialAncestor is actually an ancestor of node. + * + * @param potentialAncestor the potential ancestor + * @param node the node to check + * @return true if potentialAncestor is an ancestor of node + */ + private boolean isAncestorOf(Node potentialAncestor, Node node) { + Node current = node.getParentNode().orElse(null); + while (current != null) { + if (current.equals(potentialAncestor)) { + return true; + } + current = current.getParentNode().orElse(null); + } + return false; + } +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java index 79e6e98259..24abe8e333 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java index c9d5f59fe7..e62ccacc60 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java index 4562806b88..ea1c2fc1ef 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java index afbf5a35d9..9c78019778 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java index a60c7eb4ee..441673fc9a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java index 3fa75ed307..689d69de62 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java index f6e1a2c87f..f81209ce42 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java index d4a3d9d794..8f8e25261a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java index f90f9b8313..62fb02ebe6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java index 522acdd39d..a6279ebc70 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java @@ -97,6 +97,14 @@ public boolean isAssignableBy(ResolvedType other) { } // Check if 'other' can be boxed to match this type if (isCorrespondingBoxingType(other.describe())) return true; + // KeY: Ask the typeDeclaration (e.g., \bigint) if it is assignable by int. + try { + if (this.typeDeclaration.isAssignableBy(other)) { + return true; + } + } catch (UnsupportedOperationException e) { + // ignore + } // All numeric types extend Number return other.isNumericType() && this.isReferenceType() diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/AssignableToPrimitive.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/AssignableToPrimitive.java new file mode 100644 index 0000000000..c4259cdca3 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/AssignableToPrimitive.java @@ -0,0 +1,10 @@ +package com.github.javaparser.resolution.types; + +/** + * @author Alexander Weigl + * @version 1 (3/2/26) + */ +public interface AssignableToPrimitive { + + boolean isAssignableToPrimitive(ResolvedPrimitiveType primitiveType); +} diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java index a0e505848b..39d3a37928 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java @@ -147,6 +147,10 @@ public boolean isAssignableBy(ResolvedType other) { return true; } } + // Hack for KeY: Allow to implement behavior for \bigint & co. + if (other.asReferenceType() instanceof AssignableToPrimitive atp) { + return atp.isAssignableToPrimitive(this); + } return false; } return other.isConstraint() diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/CodeGenerationUtils.java b/javaparser-core/src/main/java/com/github/javaparser/utils/CodeGenerationUtils.java index 6404ee9bd1..2486e0080e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/CodeGenerationUtils.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/CodeGenerationUtils.java @@ -143,7 +143,7 @@ public static Path classLoaderRoot(Class c) { * "target/(test-)classes", giving the directory containing the pom.xml. */ public static Path mavenModuleRoot(Class c) { - return classLoaderRoot(c).resolve(Paths.get("..", "..")).normalize(); + return classLoaderRoot(c).resolve(Paths.get("..", "..", "..", "..")).normalize(); } /** diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/Optionals.java b/javaparser-core/src/main/java/com/github/javaparser/utils/Optionals.java new file mode 100755 index 0000000000..a426431748 --- /dev/null +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/Optionals.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007-2010 Júlio Vilmar Gesser. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.utils; + +import java.util.Optional; +import java.util.function.Supplier; + +/** + * Utility methods for {@link Optional}, backporting Java 9+ operations to Java 8. + * + *

    This class emulates {@code Optional.or()} chaining from Java 9+, allowing + * lazy evaluation of alternative Optional values. + * + *

    Migration notice: Remove this class when upgrading to Java 11+. + * Replace {@code Optionals.or()} calls with native {@code Optional.or()} chaining. + * + * @since 3.28.0 + */ +public final class Optionals { + + private Optionals() { + throw new AssertionError("Optionals is a utility class and should not be instantiated"); + } + + /** + * Returns the first present Optional from the given suppliers. + * + *

    Emulates Java 9+ {@code Optional.or()} chaining with varargs support: + *

    {@code
    +     * // Java 9+
    +     * Optional result = opt1.or(() -> opt2).or(() -> opt3);
    +     *
    +     * // Java 8 with Optionals
    +     * Optional result = Optionals.or(() -> opt1, () -> opt2, () -> opt3);
    +     * }
    + * + *

    Suppliers are evaluated lazily with short-circuit evaluation. + * + * @param the type of the value + * @param suppliers suppliers of Optionals to evaluate in order + * @return the first present Optional, or empty if all are empty + */ + @SafeVarargs + public static Optional or(Supplier>... suppliers) { + for (Supplier> supplier : suppliers) { + Optional result = supplier.get(); + if (result.isPresent()) { + return result; + } + } + return Optional.empty(); + } +} diff --git a/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserBase.java b/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserBase.java index 56bd09a9bf..f4cf0125b2 100644 --- a/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserBase.java +++ b/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserBase.java @@ -21,6 +21,11 @@ package com.github.javaparser; +import static com.github.javaparser.GeneratedJavaParserConstants.EOF; +import static com.github.javaparser.ast.type.ArrayType.unwrapArrayTypes; +import static com.github.javaparser.ast.type.ArrayType.wrapInArrayTypes; +import static com.github.javaparser.utils.Utils.assertNotNull; + import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.BodyDeclaration; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; @@ -31,14 +36,8 @@ import com.github.javaparser.ast.stmt.Statement; import com.github.javaparser.ast.type.*; import com.github.javaparser.utils.Pair; - import java.util.*; -import static com.github.javaparser.GeneratedJavaParserConstants.EOF; -import static com.github.javaparser.ast.type.ArrayType.unwrapArrayTypes; -import static com.github.javaparser.ast.type.ArrayType.wrapInArrayTypes; -import static com.github.javaparser.utils.Utils.assertNotNull; - /** * Base class for {@link GeneratedJavaParser} */ @@ -121,7 +120,6 @@ TokenRange range(NodeList list) { return null; } - /** * Return a TokenRange spanning from begin to end */ @@ -147,22 +145,20 @@ TokenRange range(JavaToken begin, Node end) { */ TokenRange range(Node begin, Node end) { if (storeTokens) { - return new TokenRange(begin.getTokenRange().get().getBegin(), end.getTokenRange().get().getEnd()); + return new TokenRange( + begin.getTokenRange().get().getBegin(), + end.getTokenRange().get().getEnd()); } return null; } - public JavaToken orIfInvalid(Object... nodesOrTokens) { - if (!storeTokens) - return null; + if (!storeTokens) return null; for (Object nort : nodesOrTokens) { if (nort == null) continue; - if (nort instanceof JavaToken j && j.valid()) - return j; - if (nort instanceof Node n) - return n.getTokenRange().get().getBegin(); + if (nort instanceof JavaToken j && j.valid()) return j; + if (nort instanceof Node n) return n.getTokenRange().get().getBegin(); } return null; } @@ -214,7 +210,7 @@ void setStoreTokens(boolean storeTokens) { } /* Called from within a catch block to skip forward to a known token, - and report the occurred exception as a problem. */ + and report the occurred exception as a problem. */ TokenRange recover(int recoveryTokenType, ParseException p) { JavaToken begin = null; if (p.currentToken != null) { @@ -261,7 +257,7 @@ TokenRange recover(ParseException p, int... recoveryTokenTypes) { } /* Called from within a catch block to skip forward to a known token, - and report the occurred exception as a problem. */ + and report the occurred exception as a problem. */ TokenRange recoverStatement(int recoveryTokenType, int lBraceType, int rBraceType, ParseException p) { JavaToken begin = null; if (p.currentToken != null) { @@ -353,7 +349,10 @@ List add(List list, T obj) { private void propagateRangeGrowthOnRight(Node node, Node endNode) { if (storeTokens) { node.getParentNode().ifPresent(nodeParent -> { - boolean isChildOnTheRightBorderOfParent = node.getTokenRange().get().getEnd().equals(nodeParent.getTokenRange().get().getEnd()); + boolean isChildOnTheRightBorderOfParent = node.getTokenRange() + .get() + .getEnd() + .equals(nodeParent.getTokenRange().get().getEnd()); if (isChildOnTheRightBorderOfParent) { propagateRangeGrowthOnRight(nodeParent, endNode); } @@ -369,11 +368,29 @@ Expression generateLambda(Expression ret, Statement lambdaBody) { if (ret instanceof EnclosedExpr) { Expression inner = ((EnclosedExpr) ret).getInner(); SimpleName id = ((NameExpr) inner).getName(); - NodeList params = add(new NodeList<>(), new Parameter(id.getTokenRange().orElse(null), new NodeList<>(), new NodeList<>(), new UnknownType(), false, new NodeList<>(), id)); + NodeList params = add( + new NodeList<>(), + new Parameter( + id.getTokenRange().orElse(null), + new NodeList<>(), + new NodeList<>(), + new UnknownType(), + false, + new NodeList<>(), + id)); ret = new LambdaExpr(range(ret, lambdaBody), params, lambdaBody, true); } else if (ret instanceof NameExpr) { SimpleName id = ((NameExpr) ret).getName(); - NodeList params = add(new NodeList<>(), new Parameter(ret.getTokenRange().orElse(null), new NodeList<>(), new NodeList<>(), new UnknownType(), false, new NodeList<>(), id)); + NodeList params = add( + new NodeList<>(), + new Parameter( + ret.getTokenRange().orElse(null), + new NodeList<>(), + new NodeList<>(), + new UnknownType(), + false, + new NodeList<>(), + id)); ret = new LambdaExpr(range(ret, lambdaBody), params, lambdaBody, false); } else if (ret instanceof LambdaExpr) { ((LambdaExpr) ret).setBody(lambdaBody); @@ -384,7 +401,8 @@ Expression generateLambda(Expression ret, Statement lambdaBody) { castExpr.setExpression(inner); propagateRangeGrowthOnRight(castExpr, inner); } else { - addProblem("Failed to parse lambda expression! Please create an issue at https://github.com/javaparser/javaparser/issues"); + addProblem( + "Failed to parse lambda expression! Please create an issue at https://github.com/javaparser/javaparser/issues"); } return ret; } @@ -392,7 +410,13 @@ Expression generateLambda(Expression ret, Statement lambdaBody) { /** * Throws together an ArrayCreationExpr from a lot of pieces */ - ArrayCreationExpr juggleArrayCreation(TokenRange range, List levelRanges, Type type, NodeList dimensions, List> arrayAnnotations, ArrayInitializerExpr arrayInitializerExpr) { + ArrayCreationExpr juggleArrayCreation( + TokenRange range, + List levelRanges, + Type type, + NodeList dimensions, + List> arrayAnnotations, + ArrayInitializerExpr arrayInitializerExpr) { NodeList levels = new NodeList<>(); for (int i = 0; i < arrayAnnotations.size(); i++) { @@ -408,7 +432,8 @@ Type juggleArrayType(Type partialType, List addition Pair> partialParts = unwrapArrayTypes(partialType); Type elementType = partialParts.a; List leftMostBrackets = partialParts.b; - return wrapInArrayTypes(elementType, additionalBrackets, leftMostBrackets).clone(); + return wrapInArrayTypes(elementType, additionalBrackets, leftMostBrackets) + .clone(); } /** @@ -449,10 +474,7 @@ private String makeMessageForParseException(ParseException exception) { if (image.equals(escapedTokenText)) { sb.append(image); } else { - sb.append(" ") - .append(escapedTokenText) - .append(" ") - .append(image); + sb.append(" ").append(escapedTokenText).append(" ").append(image); } token = token.next; } @@ -476,10 +498,13 @@ Name scopeToName(Expression scope) { } if (scope.isFieldAccessExpr()) { FieldAccessExpr fieldAccessExpr = scope.asFieldAccessExpr(); - return new Name(fieldAccessExpr.getTokenRange().orElse(null), scopeToName(fieldAccessExpr.getScope()), fieldAccessExpr.getName().getIdentifier()); - + return new Name( + fieldAccessExpr.getTokenRange().orElse(null), + scopeToName(fieldAccessExpr.getScope()), + fieldAccessExpr.getName().getIdentifier()); } - throw new IllegalStateException("Unexpected expression type: " + scope.getClass().getSimpleName()); + throw new IllegalStateException( + "Unexpected expression type: " + scope.getClass().getSimpleName()); } String unquote(String s) { @@ -518,14 +543,12 @@ NodeList> typeDeclarationsForCu(NodeList> // We also know at this point that at least one body declaration exists, otherwise allMatch would have matched // the empty list. - ClassOrInterfaceDeclaration compactClass = new ClassOrInterfaceDeclaration( - new NodeList(), - false, - "$COMPACT_CLASS" - ); + ClassOrInterfaceDeclaration compactClass = + new ClassOrInterfaceDeclaration(new NodeList(), false, "$COMPACT_CLASS"); Optional maybeStartingRange = bodyDeclarations.get(0).getTokenRange(); - Optional maybeEndRange = bodyDeclarations.get(bodyDeclarations.size() - 1).getTokenRange(); + Optional maybeEndRange = + bodyDeclarations.get(bodyDeclarations.size() - 1).getTokenRange(); if (maybeStartingRange.isPresent() && maybeEndRange.isPresent()) { JavaToken begin = maybeStartingRange.get().getBegin(); JavaToken end = maybeEndRange.get().getEnd(); diff --git a/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserTokenManagerBase.java b/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserTokenManagerBase.java index ddcffc81d0..beba9ea99e 100644 --- a/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserTokenManagerBase.java +++ b/javaparser-core/src/main/javacc-support/com/github/javaparser/GeneratedJavaParserTokenManagerBase.java @@ -21,12 +21,11 @@ package com.github.javaparser; -import com.github.javaparser.ast.comments.*; +import static com.github.javaparser.GeneratedJavaParserConstants.*; +import com.github.javaparser.ast.comments.*; import java.util.ArrayDeque; -import static com.github.javaparser.GeneratedJavaParserConstants.*; - /** * Base class for {@link com.github.javaparser.GeneratedJavaParserTokenManager} */ @@ -53,13 +52,13 @@ static MarkdownComment createMarkdownCommentFromTokenList(ArrayDeque toke while (!tokens.isEmpty() && TokenTypes.isWhitespace(tokens.peekLast().kind)) { Token lastToken = tokens.removeLast(); - if (TokenTypes.isComment(lastToken.kind)) { tokens.addLast(lastToken); break; } else { if (tokens.isEmpty()) { - throw new IllegalArgumentException("createMarkdownCommentFromTokenList may not be called with a token list consisting only of whitespace tokens"); + throw new IllegalArgumentException( + "createMarkdownCommentFromTokenList may not be called with a token list consisting only of whitespace tokens"); } if (TokenTypes.isEndOfLineToken(lastToken.kind)) { @@ -70,10 +69,7 @@ static MarkdownComment createMarkdownCommentFromTokenList(ArrayDeque toke } } - TokenRange range = new TokenRange( - tokens.peekFirst().javaToken, - tokens.peekLast().javaToken - ); + TokenRange range = new TokenRange(tokens.peekFirst().javaToken, tokens.peekLast().javaToken); StringBuilder contentBuilder = new StringBuilder(); diff --git a/javaparser-core/src/main/javacc-support/com/github/javaparser/ModifierHolder.java b/javaparser-core/src/main/javacc-support/com/github/javaparser/ModifierHolder.java index 44c72fe19a..a4c433bb94 100644 --- a/javaparser-core/src/main/javacc-support/com/github/javaparser/ModifierHolder.java +++ b/javaparser-core/src/main/javacc-support/com/github/javaparser/ModifierHolder.java @@ -21,12 +21,12 @@ package com.github.javaparser; +import static com.github.javaparser.utils.Utils.assertNotNull; + import com.github.javaparser.ast.Modifier; import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.expr.AnnotationExpr; -import static com.github.javaparser.utils.Utils.assertNotNull; - /** * Helper class for {@link GeneratedJavaParser} */ diff --git a/javaparser-core/src/main/javacc-support/com/github/javaparser/RangedList.java b/javaparser-core/src/main/javacc-support/com/github/javaparser/RangedList.java index e272a7ae3e..97c1d16c22 100644 --- a/javaparser-core/src/main/javacc-support/com/github/javaparser/RangedList.java +++ b/javaparser-core/src/main/javacc-support/com/github/javaparser/RangedList.java @@ -29,7 +29,7 @@ */ class RangedList { /* A ranged list MUST be set to a begin and end, - or these temporary values will leak out */ + or these temporary values will leak out */ TokenRange range = new TokenRange(JavaToken.INVALID, JavaToken.INVALID); NodeList list; diff --git a/javaparser-core/src/main/javacc/java.jj b/javaparser-core/src/main/javacc/java.jj index ed09b06700..71db5dc40e 100644 --- a/javaparser-core/src/main/javacc/java.jj +++ b/javaparser-core/src/main/javacc/java.jj @@ -89,6 +89,8 @@ import com.github.javaparser.ast.jml.expr.*; import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.stmt.*; import com.github.javaparser.ast.jml.doc.*; +import com.github.javaparser.ast.jml.doc.JmlDoc; +import com.github.javaparser.ast.jml.doc.JmlDocModifier; import com.github.javaparser.ast.jml.*; import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.stmt.*; @@ -230,6 +232,7 @@ TOKEN : { | | | "> +| | | | @@ -428,7 +431,6 @@ TOKEN : { | | | -| //| //| //| @@ -632,7 +634,6 @@ TOKEN : { : DEFAULT } - SPECIAL_TOKEN : { @@ -660,11 +661,14 @@ MORE : /* RESERVED WORDS AND LITERALS */ + TOKEN :{ + < ASSERT: "assert" > // ASSERT in JML contracts is called JML_ASSERT +} + TOKEN : { < ABSTRACT: "abstract" > -| < ASSERT: "assert" > | < BOOLEAN: "boolean" > | < BREAK: "break" > | < BYTE: "byte" > @@ -1188,10 +1192,12 @@ MORE: { : IN_TEXT_BLOCK } // which might match that doublequote with following doublequotes. MORE :{ } +/* TOKEN: { > } +*/ /* IDENTIFIERS */ @@ -1202,7 +1208,7 @@ TOKEN : | "\u005f" ()+ > | - < JMLIDENTIFIER: "\\" > + < JML_IDENTIFIER: "\\" > | < SVIDENTIFIER: "#" > | @@ -1390,8 +1396,9 @@ TOKEN : | < RBRACKET: "]" > | < SEMICOLON: ";" > | < COMMA: "," > -| < DOT: "." > +| < DOTDOT: ".."> | < ELLIPSIS: "..." > +| < DOT: "." > | < AT: "@" > | < DOUBLECOLON: "::" > } @@ -3522,7 +3529,7 @@ String Identifier(): } { ( - | | | | + | | | | // TODO: Explain why these keywords are explicitly flagged up as "included", and why they're not already covered by {@code }. // TODO: Explain how / where boolean and null literals are excluded. // Make sure the module info keywords don't interfere with normal Java parsing by matching them as normal identifiers. @@ -3530,7 +3537,7 @@ String Identifier(): // Make sure older Java versions parse | | | | | | | "_" | | // overwritten by Key/SV but still valid in Java - "model" | "ghost" | "two_state" | "no_state" | "source" | "merge_point" | "exec" | "ccatch" | "ccat" + "source" | "exec" | "ccatch" | "ccat" // or a bunch of JML clause words | | | | | | | @@ -4674,7 +4681,7 @@ Expression JmlPrimaryPrefix(): Type retType; VariableDeclarationExpr decls; SimpleName name; - Expression ret; + Expression ret; } { ( LOOKAHEAD(2) @@ -5118,7 +5125,6 @@ Statement StatementOrig(): | ret = SynchronizedStatement() | ret = TryStatement() // KEY - //| ret = KeyActiveCommentStatement() | ret = KeyTransactionStatement() | ret = KeyMergePointStatement() | ret = KeyLoopScope() @@ -5310,8 +5316,13 @@ Statement BlockStatementOrig(): // try assert statement separate from more general Statement() because assert can be confused with VariableDeclarationExpression sometimes LOOKAHEAD( AssertStatement() ) ret = AssertStatement() + /* | + // try JML statement separate from more general Statement() because assert/assume & Co. + // can be confused with VariableDeclarationExpression sometimes + LOOKAHEAD( JmlStatement() ) + ret = JmlStatement()*/ | - LOOKAHEAD( VariableDeclarationExpression() ) + LOOKAHEAD( VariableDeclarationExpression() ";" ) expr = VariableDeclarationExpression() ";" { ret = new ExpressionStmt(range(expr, token()), expr); } @@ -7009,7 +7020,7 @@ JmlStatement JmlStatement(): } { ( - ( | | | | ) + ( | | | | | ) { begin = token(); } expr=Expression() ";" @@ -7025,8 +7036,8 @@ JmlStatement JmlStatement(): } JmlStatement JmlSpecialStatement(): -{ - JavaToken begin; Expression expr,target; +{ + JavaToken begin; Expression expr,target; Statement stmt; SimpleName label; JmlStatement ret; } @@ -7901,22 +7912,6 @@ Expression ADTConstructor() : } }*/ -Expression KeyIndexRange() : - /* - * Introduced to handle postfix style sequence ranges as top-level expressions. - * XXX does not yet work since Expression may contain dots - */ -{ - Expression result, end; - JavaToken begin; -} -{ - result = Expression() - [ ".." end = Expression() - { result = new KeyRangeExpression(range(result, token()), result, end); } ] - { return result; } -} - Statement KeyCatchAllStatement() : { @@ -7927,12 +7922,12 @@ Statement KeyCatchAllStatement() : { "#catchAll" {begin=token();} "(" qn = Name() ")" block = Block() { - return new KeyCatchAllStatement(range(begin,token()), qn,block); + return new KeyCatchAllStmt(range(begin,token()), qn,block); } } -KeyMethodCallStatement KeyMethodCallStatement() : +KeyMethodCallStmt KeyMethodCallStatement() : { JavaToken begin; Name qn = null; @@ -7947,7 +7942,7 @@ KeyMethodCallStatement KeyMethodCallStatement() : ")" [":"] block = Block() - { return new KeyMethodCallStatement(range(begin, token()), qn, ec, block); } + { return new KeyMethodCallStmt(range(begin, token()), qn, ec, block); } } KeyAbstractExecutionContext KeyExecutionContextSV(): @@ -8024,7 +8019,7 @@ KeyActiveCommentStatement KeyActiveCommentStatement() : -KeyTransactionStatement KeyTransactionStatement() : +KeyTransactionStmt KeyTransactionStatement() : { JavaToken begin; } @@ -8036,12 +8031,12 @@ KeyTransactionStatement KeyTransactionStatement() : ) {begin=token();} ";" - { return new KeyTransactionStatement(range(begin, token()), begin); } + { return new KeyTransactionStmt(range(begin, token()), begin); } } -KeyLoopScopeBlock KeyLoopScope() : +KeyLoopScopeBlockStmt KeyLoopScope() : { - KeyLoopScopeBlock result; + KeyLoopScopeBlockStmt result; Expression indexPV; BlockStmt block; JavaToken begin; @@ -8050,24 +8045,24 @@ KeyLoopScopeBlock KeyLoopScope() : { begin = token(); } "(" indexPV = Expression() ")" block = Block() - { return new KeyLoopScopeBlock(range(begin, token()), indexPV, block); } + { return new KeyLoopScopeBlockStmt(range(begin, token()), indexPV, block); } } -KeyMergePointStatement KeyMergePointStatement() : +KeyMergePointStmt KeyMergePointStatement() : { Expression expr = null; - KeyMergePointStatement result; + KeyMergePointStmt result; JavaToken begin; } { { begin = token(); } "(" expr = Expression() ")" ";" - { return new KeyMergePointStatement(range(begin, token()), expr); } + { return new KeyMergePointStmt(range(begin, token()), expr); } } -KeyExecStatement KeyExecStatement() : +KeyExecStmt KeyExecStatement() : { JavaToken begin, beginC; BlockStmt block,execBlock; @@ -8142,7 +8137,7 @@ KeyExecStatement KeyExecStatement() : { branches.add(new KeyCcatchParameter(range(beginC, token()), param, block)); } )* ( LOOKAHEAD(3) ["ccatch"|"ccat"] cfsv=CcatchSV() { branches.add(cfsv); } )* - { return new KeyExecStatement(range(begin, token()), execBlock, branches); } + { return new KeyExecStmt(range(begin, token()), execBlock, branches); } } KeyTypeSV TypeSV(NodeList annotations) : @@ -8261,9 +8256,7 @@ KeyMetaConstruct KeyMetaConstructStatement() : | loopStat = DoStatement() ) ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), "#unwind-loop", loopStat, innerLabel, outerLabel); - } + { ret = new KeyMetaConstruct(range(begin, token()), "#unwind-loop", loopStat, innerLabel, outerLabel); } | "#unwind-loop-bounded" {begin=token();} "(" innerLabel = JumpLabelSV() "," outerLabel = JumpLabelSV() "," @@ -8272,88 +8265,56 @@ KeyMetaConstruct KeyMetaConstructStatement() : | loopStat = DoStatement() ) ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), "#unwind-loop-bounded", loopStat, innerLabel, outerLabel); - } + { ret = new KeyMetaConstruct(range(begin, token()), "#unwind-loop-bounded", loopStat, innerLabel, outerLabel); } | {begin=token();} "(" ( loopInit=ForInit() ) ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, loopInit.get(0)); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, loopInit.get(0)); } | {begin=token();} "(" ( loopStat=WhileStatement() ) ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, loopStat); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, loopStat); } | {begin=token();} "(" loopStat=ForStatement() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, loopStat); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, loopStat); } | "#for-to-while" {begin=token();} "(" innerLabel = JumpLabelSV() "," outerLabel = JumpLabelSV() "," stat = Statement() ")" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, stat, innerLabel, outerLabel); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, stat, innerLabel, outerLabel); } | {begin=token();} "(" stat = Statement() ")" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, stat); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, stat); } | "#do-break" {begin=token();} "(" labStat=LabeledStatement() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, labStat); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, labStat); } | "#evaluate-arguments" {begin=token();} "(" methRef = Expression() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, methRef); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, methRef); } | "#replace" {begin=token();} "(" stat = Statement() "," sv = VariableSV() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, stat, sv); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, stat, sv); } | "#method-call" {begin=token();} "(" [ LOOKAHEAD(2) sv = VariableSV() ","] [ LOOKAHEAD(2) execsv = ExecutionContextSV() ","] methRef = PrimaryExpression() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, methRef, sv, execsv); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, methRef, sv, execsv); } | "#expand-method-body" {begin=token();} "(" stat = Statement() ("," sv = VariableSV() )? ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, stat, sv); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, stat, sv); } | "#constructor-call" {begin=token();} "(" sv = VariableSV() "," consRef = ExpressionSV() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, consRef, sv); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, consRef, sv); } | "#special-constructor-call" {begin=token();} "(" consRef = ExpressionSV() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, consRef); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, consRef); } | "#post-work" {begin=token();} "(" consRef = ExpressionSV() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, consRef); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, consRef); } | "#static-initialisation" {begin=token();} "(" activeAccess = PrimaryExpression() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, activeAccess); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, activeAccess); } | "#resolve-multiple-var-decl" {begin=token();} "(" stat = Statement() ")" ";" - { - ret = new KeyMetaConstruct(range(begin, token()), begin, stat); - } + { ret = new KeyMetaConstruct(range(begin, token()), begin, stat); } | "#array-post-declaration" {begin=token();} "(" stat = Statement() ")" ";" { ret = new KeyMetaConstruct(range(begin, token()), begin, stat); } @@ -8372,8 +8333,8 @@ KeyMetaConstruct KeyMetaConstructStatement() : | {begin=token();} "(" loopStat = WhileStatement() ")" ";" { ret = new KeyMetaConstruct(range(begin, token()), begin, loopStat); } - ) - {return ret;} + ) + { return ret; } } @@ -8477,4 +8438,4 @@ KeyCcatchSV CcatchSV() : { { return new KeyCcatchSV(token().toTokenRange(), token().getText()); } -} +} \ No newline at end of file diff --git a/javaparser-key-testing/build.gradle.kts b/javaparser-key-testing/build.gradle.kts new file mode 100644 index 0000000000..cb3f87186f --- /dev/null +++ b/javaparser-key-testing/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + testImplementation(project(":jmlparser-core")) + testImplementation(project(":jmlparser-symbol-solver-core")) + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testing.runtime) +} + +description = "io.github.jmltoolkit:javaparser-key-testing" diff --git a/javaparser-key-testing/pom.xml b/javaparser-key-testing/pom.xml index cbb9521f34..c5eeac6bbb 100644 --- a/javaparser-key-testing/pom.xml +++ b/javaparser-key-testing/pom.xml @@ -5,7 +5,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/GhostTest.java b/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/GhostTest.java new file mode 100644 index 0000000000..26a6cfbb53 --- /dev/null +++ b/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/GhostTest.java @@ -0,0 +1,29 @@ +package com.github.javaparser.ast.key; + +import com.github.javaparser.JavaParser; +import com.github.javaparser.ParserConfiguration; +import com.github.javaparser.ast.body.MethodDeclaration; +import java.io.IOException; +import java.nio.file.Paths; +import org.junit.jupiter.api.Test; + +/** + * + * @author Alexander Weigl + * @version 1 (3/4/26) + */ +public class GhostTest { + + @Test + void m() throws IOException { + final var configuration = new ParserConfiguration(); + configuration.setLanguageLevel(ParserConfiguration.LanguageLevel.RAW); + var parser = new JavaParser(configuration); + var cu = parser.parse(Paths.get("src/test/resources/Ghost.java")); + final var result = cu.getResult().get(); + var body = ((MethodDeclaration) result.getPrimaryType().get().members().get(1)) + .getBody() + .get(); + System.out.println(result); + } +} diff --git a/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/MethodFrameTests.java b/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/MethodFrameTests.java index 7d1316f7ca..477399503f 100644 --- a/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/MethodFrameTests.java +++ b/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/MethodFrameTests.java @@ -1,16 +1,12 @@ package com.github.javaparser.ast.key; -import static org.assertj.core.api.Assertions.assertThat; - import com.github.javaparser.JavaParser; import com.github.javaparser.ParseResult; import com.github.javaparser.ParserConfiguration; import com.github.javaparser.Problem; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.expr.Expression; -import com.github.javaparser.ast.expr.FieldAccessExpr; -import com.github.javaparser.ast.expr.NameExpr; +import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.visitor.VoidVisitorAdapter; import com.github.javaparser.resolution.Resolvable; import com.github.javaparser.resolution.UnsolvedSymbolException; @@ -19,21 +15,32 @@ import com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver; import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver; import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver; +import com.google.common.truth.Truth; import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.nio.file.Path; +import java.util.NoSuchElementException; import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; + public class MethodFrameTests { @Test void mftest1() throws IOException { loadAndResolveAll(new File("src/test/resources/nameResolution/A.java")); } + + @Test + void mftestB() throws IOException { + loadAndResolveAll(new File("src/test/resources/nameResolution/B.java")); + } + private void loadAndResolveAll(File file) throws IOException { final ParserConfiguration configuration = new ParserConfiguration(); configuration.setSymbolResolver(new JavaSymbolSolver(new CombinedTypeSolver( @@ -70,31 +77,56 @@ private static class ResolveAllVisitor extends VoidVisitorAdapter { @Override public void visit(NameExpr n, Void arg) { resolve(n); + super.visit(n, arg); } @Override public void visit(FieldAccessExpr n, Void arg) { resolve(n); + super.visit(n, arg); + } + + @Override + public void visit(MethodCallExpr n, Void arg) { + resolve(n); + super.visit(n, arg); + } + + @Override + public void visit(ObjectCreationExpr n, Void arg) { + resolve(n); + super.visit(n, arg); } public > void resolve(N n) { + Path base = n.findCompilationUnit() + .flatMap(CompilationUnit::getStorage) + .map(it -> it.getPath().getParent()).get(); String pos = n.getRange().map(it -> it.begin.toString()).orElse("_"); + try { ResolvedDeclaration rtype = n.resolve(); + String target; + try { + Node t = rtype.toAst().get(); + target = t.getRange().map(it -> it.begin.toString()).orElse("_"); + target += " in " + t.findCompilationUnit() + .flatMap(CompilationUnit::getStorage) + .map(it -> base.relativize(it.getPath()).toString()) + .orElse(null); + }catch (NoSuchElementException e) { + target = "_"; + } - Node t = rtype.toAst().get(); - String target = t.getRange().map(it -> it.begin.toString()).orElse("_"); - - messages.add(String.format("name: %s@%s to %s@%s", n, pos, rtype.getName(), target)); + messages.add(String.format("name: %s@%s refers to %s@%s", n, pos, rtype.getName(), target)); try { - n.getSymbolResolver().calculateType(n); - messages.add(String.format("type: %s@%s", n, pos)); + var x = n.getSymbolResolver().calculateType(n); + messages.add(String.format("type: %s@%s refers to %s", n, pos, x)); } catch (UnsolvedSymbolException e) { - messages.add(String.format("e type: %s@%s", n, pos)); + messages.add(String.format("ERROR type: %s@%s", n, pos)); } } catch (UnsolvedSymbolException e) { - messages.add(String.format("e name: %s@%s", n, pos)); - // e.printStackTrace(); + messages.add(String.format("ERROR name: %s@%s", n, pos)); } } } diff --git a/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/ReduxTest.java b/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/ReduxTest.java deleted file mode 100644 index 49664b2141..0000000000 --- a/javaparser-key-testing/src/test/java/com/github/javaparser/ast/key/ReduxTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.github.javaparser.ast.key; - -import com.github.javaparser.JavaParser; -import com.github.javaparser.ParseResult; -import com.github.javaparser.ast.CompilationUnit; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.stream.Stream; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.TestFactory; - -/** - * @author Alexander Weigl - * @version 1 (17.04.23) - */ -@Disabled -public class ReduxTest { - public static final String PATHTOREDUX = - "/home/weigl/work/key/key.core/src/main/resources/de/uka/ilkd/key/java/JavaRedux/java"; - - @TestFactory - Stream testRedux() throws IOException { - return Files.walk(Paths.get(PATHTOREDUX)) - .filter(it -> it.toString().endsWith(".java")) - .map(it -> DynamicTest.dynamicTest(it.toString(), () -> parse(it))); - } - - JavaParser parser = new JavaParser(); - - private void parse(Path it) throws IOException { - ParseResult res = parser.parse(it); - if (!res.isSuccessful()) { - res.getProblems().forEach(System.out::println); - Assertions.fail("Problems in file: " + it); - } - } -} diff --git a/javaparser-key-testing/src/test/resources/Ghost.java b/javaparser-key-testing/src/test/resources/Ghost.java new file mode 100644 index 0000000000..981a6a7bef --- /dev/null +++ b/javaparser-key-testing/src/test/resources/Ghost.java @@ -0,0 +1,52 @@ +class Ghost { + //contract encodes "accessible footprint;" + /*@ normal_behaviour + @ requires \inv; + @ requires arrayDep == \singleton(array); + @ requires sizeDep == \singleton(size); + @ requires (\forall int i; arraySlotDep[i] == \singleton(array[i])); + @ requires (\forall int i; arraySlotDep.length == array.length); + @ ensures \subset(ArrayList.resultDep, \old(footprint)); + @ diverges true; + @*/ + public /*@helper@*/ boolean contains(/*@nullable@*/ Object o) { + //@ ghost \locset pcDep = \empty; + //@ ghost \locset oDep = \empty; + + //@ ghost \locset iDep = pcDep; //assignment + int i = 0; + + //@ set pcDep = \set_union(pcDep, \set_union(iDep, sizeDep)); //entering loop + + /*@ loop_invariant 0 <= i && i <= size + @ && \subset(pcDep, \old(footprint)) + @ && \subset(iDep, \old(footprint)); + @ assignable \nothing; + @ decreases size - i; + @*/ + while(i < size) { + //@ set pcDep = \set_union(pcDep, \set_union(arrayDep, \set_union(iDep, \set_union(oDep, arraySlotDep[i])))); //entering conditional + if(array[i] == o) { + //@ set ArrayList.resultDep = pcDep; //return + return true; + } + + //@ set iDep = \set_union(pcDep, iDep); //assignment + i++; + + //@ set pcDep = \set_union(pcDep, \set_union(iDep, sizeDep)); //entering loop again + ; //workaround for RecodeR bug + } + + //@ set ArrayList.resultDep = pcDep; //return + return false; + } + + public /*@helper@*/ int size() { + //@ ghost \locset pcDep = \empty; + final int x; + //@ set ArrayList.resultDep = \set_union(pcDep, sizeDep); + return size; + } + +} diff --git a/javaparser-key-testing/src/test/resources/com/github/javaparser/schemajava.txt b/javaparser-key-testing/src/test/resources/com/github/javaparser/schemajava.txt index 3d191246b9..165db04470 100644 --- a/javaparser-key-testing/src/test/resources/com/github/javaparser/schemajava.txt +++ b/javaparser-key-testing/src/test/resources/com/github/javaparser/schemajava.txt @@ -599,7 +599,6 @@ {.. try { continue #lb; #slist } catch #cs finally { #slist2 } ...} {.. try { continue; #slist } catch #cs ...} {.. try { continue; #slist } catch #cs finally { #slist2 } ...} -{.. try {} #cs ...} {.. try { return #se; #slist } catch #cs ...} {.. try { return #se; #slist } catch #cs finally { #slist2 } ...} {.. try { return; #slist } catch #cs ...} diff --git a/javaparser-key-testing/src/test/resources/nameResolution/A.java b/javaparser-key-testing/src/test/resources/nameResolution/A.java index 455fb10133..757092f1f3 100644 --- a/javaparser-key-testing/src/test/resources/nameResolution/A.java +++ b/javaparser-key-testing/src/test/resources/nameResolution/A.java @@ -11,6 +11,7 @@ void foo() { } } -//? e name: self@(line 8,col 54) -//? name: this.x@(line 9,col 13) to x@(line 2,col 5) -//? type: this.x@(line 9,col 13) +//? name: self@(line 8,col 54) refers to self@(line 8,col 54) in A.java +//? name: this.x@(line 9,col 13) refers to x@(line 2,col 5) in A.java +//? type: self@(line 8,col 54) refers to ReferenceType{A, typeParametersMap=TypeParametersMap{nameToValue={}}} +//? type: this.x@(line 9,col 13) refers to PrimitiveTypeUsage{name='int'} \ No newline at end of file diff --git a/javaparser-key-testing/src/test/resources/nameResolution/B.java b/javaparser-key-testing/src/test/resources/nameResolution/B.java new file mode 100644 index 0000000000..9ac61d9fa7 --- /dev/null +++ b/javaparser-key-testing/src/test/resources/nameResolution/B.java @@ -0,0 +1,18 @@ +class B { + void m() { + $methodFrame(source = setSize(int)@sub1.TestJavaCardDLExtensions){ + $methodFrame(source = setOther(int)@sub2.Other){ + Third four = new Third(); + int other2 = other; + } + TestJavaCardDLExtensions t = new TestJavaCardDLExtensions(); + } + } +} + +//? name: new TestJavaCardDLExtensions()@(line 8,col 42) refers to TestJavaCardDLExtensions@_ +//? name: new Third()@(line 5,col 30) refers to Third@_ +//? name: other@(line 6,col 30) refers to other@(line 4,col 5) in sub2/Other.java +//? type: new TestJavaCardDLExtensions()@(line 8,col 42) refers to ReferenceType{sub1.TestJavaCardDLExtensions, typeParametersMap=TypeParametersMap{nameToValue={}}} +//? type: new Third()@(line 5,col 30) refers to ReferenceType{sub2.Third, typeParametersMap=TypeParametersMap{nameToValue={}}} +//? type: other@(line 6,col 30) refers to PrimitiveTypeUsage{name='int'} \ No newline at end of file diff --git a/javaparser-key-testing/src/test/resources/nameResolution/sub1/TestJavaCardDLExtensions.java b/javaparser-key-testing/src/test/resources/nameResolution/sub1/TestJavaCardDLExtensions.java new file mode 100644 index 0000000000..3552c7b769 --- /dev/null +++ b/javaparser-key-testing/src/test/resources/nameResolution/sub1/TestJavaCardDLExtensions.java @@ -0,0 +1,8 @@ +package sub1; + +public class TestJavaCardDLExtensions { + public int size; + public void setSize(int size) { + this.size = size; + } +} diff --git a/javaparser-key-testing/src/test/resources/nameResolution/sub2/Other.java b/javaparser-key-testing/src/test/resources/nameResolution/sub2/Other.java new file mode 100644 index 0000000000..7f2138e88f --- /dev/null +++ b/javaparser-key-testing/src/test/resources/nameResolution/sub2/Other.java @@ -0,0 +1,8 @@ +package sub2; + +public class Other { + public int other; + public void setOther(int val) { + this.other = val; + } +} diff --git a/javaparser-key-testing/src/test/resources/nameResolution/sub2/Third.java b/javaparser-key-testing/src/test/resources/nameResolution/sub2/Third.java new file mode 100644 index 0000000000..2cc9242f83 --- /dev/null +++ b/javaparser-key-testing/src/test/resources/nameResolution/sub2/Third.java @@ -0,0 +1,11 @@ +package sub2; + +class Third { + + public int third; + + public void setOther(int val) { + this.third = val; + } + +} diff --git a/javaparser-symbol-solver-core/build.gradle.kts b/javaparser-symbol-solver-core/build.gradle.kts new file mode 100644 index 0000000000..7785273220 --- /dev/null +++ b/javaparser-symbol-solver-core/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + api(project(":jmlparser-core")) + api(libs.org.javassist.javassist) + api(libs.com.google.guava.guava) + api(libs.org.checkerframework.checker.qual) +} + +description = "io.github.jmltoolkit:jmlparser-symbol-solver-core" diff --git a/javaparser-symbol-solver-core/pom.xml b/javaparser-symbol-solver-core/pom.xml index 62786e4111..4af745db44 100644 --- a/javaparser-symbol-solver-core/pom.xml +++ b/javaparser-symbol-solver-core/pom.xml @@ -4,7 +4,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/SourceFileInfoExtractor.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/SourceFileInfoExtractor.java index 6ebfdf9ea8..b301d05c3e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/SourceFileInfoExtractor.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/SourceFileInfoExtractor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/DefaultCacheStats.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/DefaultCacheStats.java index 7c51c83099..aa84974efb 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/DefaultCacheStats.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/DefaultCacheStats.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/GuavaCache.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/GuavaCache.java index af277bc69f..35b21f1d4b 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/GuavaCache.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/GuavaCache.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -37,9 +37,11 @@ public class GuavaCache implements Cache { /** * Wrap a Guava cache with a custom cache. * - * @param guavaCache The guava cache to be wrapped- + * @param guavaCache The guava cache to be wrapped- + * * @param The expected type for the key. * @param The expected type for the value. + * * @return A newly created instance of {@link NoCache}. */ public static GuavaCache create( diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/InMemoryCache.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/InMemoryCache.java index b393bb3c03..8292621d4e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/InMemoryCache.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/InMemoryCache.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -43,6 +43,7 @@ public class InMemoryCache implements Cache { * * @param The expected type for the key. * @param The expected type for the value. + * * @return A newly created instance of {@link InMemoryCache}. */ public static InMemoryCache create() { diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/NoCache.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/NoCache.java index d61ccad6d4..a0ee34018e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/NoCache.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/cache/NoCache.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -38,6 +38,7 @@ public class NoCache implements Cache { * * @param The expected type for the key. * @param The expected type for the value. + * * @return A newly created instance of {@link NoCache}. */ public static NoCache create() { diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapability.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapability.java index cc9cb88cda..6b82c6ad84 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapability.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapability.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/SymbolResolutionCapability.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/SymbolResolutionCapability.java index db87902077..e15fd80e2b 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/SymbolResolutionCapability.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/SymbolResolutionCapability.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapability.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapability.java index 5880090e2d..d74905c262 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapability.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapability.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/declarations/common/MethodDeclarationCommonLogic.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/declarations/common/MethodDeclarationCommonLogic.java index 216851b8d2..ef62a74071 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/declarations/common/MethodDeclarationCommonLogic.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/declarations/common/MethodDeclarationCommonLogic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparser/package-info.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparser/package-info.java index 8bbeccc843..fe0df1c0a5 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparser/package-info.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparser/package-info.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/DefaultVisitorAdapter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/DefaultVisitorAdapter.java index bd413462d7..a7de6ec11b 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/DefaultVisitorAdapter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/DefaultVisitorAdapter.java @@ -23,9 +23,10 @@ import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; -import com.github.javaparser.ast.comments.*; import com.github.javaparser.ast.comments.BlockComment; import com.github.javaparser.ast.comments.LineComment; +import com.github.javaparser.ast.comments.MarkdownComment; +import com.github.javaparser.ast.comments.TraditionalJavadocComment; import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.clauses.*; @@ -364,11 +365,6 @@ public ResolvedType visit(JmlDocStmt n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } - @Override - public ResolvedType visit(JmlDoc n, Boolean arg) { - throw new UnsupportedOperationException(n.getClass().getCanonicalName()); - } - @Override public ResolvedType visit(JmlDocType n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); @@ -440,7 +436,7 @@ public ResolvedType visit(KeyCcatchReturn n, Boolean arg) { } @Override - public ResolvedType visit(KeyCatchAllStatement n, Boolean arg) { + public ResolvedType visit(KeyCatchAllStmt n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @@ -450,7 +446,7 @@ public ResolvedType visit(KeyEscapeExpression n, Boolean arg) { } @Override - public ResolvedType visit(KeyExecStatement n, Boolean arg) { + public ResolvedType visit(KeyExecStmt n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @@ -460,12 +456,12 @@ public ResolvedType visit(KeyExecutionContext n, Boolean arg) { } @Override - public ResolvedType visit(KeyLoopScopeBlock n, Boolean arg) { + public ResolvedType visit(KeyLoopScopeBlockStmt n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @Override - public ResolvedType visit(KeyMergePointStatement n, Boolean arg) { + public ResolvedType visit(KeyMergePointStmt n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @@ -475,7 +471,7 @@ public ResolvedType visit(KeyMethodBodyStatement n, Boolean arg) { } @Override - public ResolvedType visit(KeyMethodCallStatement n, Boolean arg) { + public ResolvedType visit(KeyMethodCallStmt n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @@ -485,12 +481,7 @@ public ResolvedType visit(KeyMethodSignature n, Boolean arg) { } @Override - public ResolvedType visit(KeyRangeExpression n, Boolean arg) { - throw new UnsupportedOperationException(n.getClass().getCanonicalName()); - } - - @Override - public ResolvedType visit(KeyTransactionStatement n, Boolean arg) { + public ResolvedType visit(KeyTransactionStmt n, Boolean arg) { throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @@ -556,12 +547,22 @@ public ResolvedType visit(KeyTypeSV n, Boolean arg) { @Override public ResolvedType visit(KeyCcatchSV n, Boolean arg) { - return null; + throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @Override public ResolvedType visit(KeyExecutionContextSV n, Boolean arg) { - return null; + throw new UnsupportedOperationException(n.getClass().getCanonicalName()); + } + + @Override + public ResolvedType visit(JmlDoc n, Boolean arg) { + throw new UnsupportedOperationException(n.getClass().getCanonicalName()); + } + + @Override + public ResolvedType visit(KeYMarkerStatement n, Boolean arg) { + throw new UnsupportedOperationException(n.getClass().getCanonicalName()); } @Override diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/FailureHandler.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/FailureHandler.java index 9b580fdf5d..31b4647f2e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/FailureHandler.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/FailureHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java index 2beb277105..4030719724 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java @@ -32,10 +32,11 @@ import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.key.KeyExecutionContext; -import com.github.javaparser.ast.key.KeyMethodCallStatement; +import com.github.javaparser.ast.key.KeyMethodCallStmt; import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; import com.github.javaparser.ast.stmt.ForEachStmt; import com.github.javaparser.ast.stmt.ReturnStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.type.Type; import com.github.javaparser.resolution.*; import com.github.javaparser.resolution.declarations.*; @@ -132,6 +133,18 @@ public SymbolReference solve(Expression expr .orElseThrow(() -> new IllegalArgumentException(expr.getClass().getCanonicalName())); } + public static ResolvedReferenceTypeDeclaration find(Expression methodCallExpr) { + Optional parent = methodCallExpr.getParentNode(); + while (parent.isPresent() && !(parent.get() instanceof ClassOrInterfaceType)) { + parent = parent.get().getParentNode(); + } + if (parent.isPresent() && parent.get() instanceof ClassOrInterfaceType typeDecl) { + final ResolvedReferenceType refType = typeDecl.resolve().asReferenceType(); + return refType.getTypeDeclaration().orElse(null); + } + return null; + } + public SymbolReference solve(MethodCallExpr methodCallExpr) { return solve(methodCallExpr, true); } @@ -726,8 +739,8 @@ protected Node findContainingTypeDeclOrObjectCreationExpr(Node node) { boolean detachFlag = false; while (true) { parent = demandParentNode(parent); - if (parent instanceof KeyMethodCallStatement) { // weigl: fun with KeY name resolution. - Type type = ((KeyExecutionContext) ((KeyMethodCallStatement) parent).getContext()).getContext(); + if (parent instanceof KeyMethodCallStmt) { // weigl: fun with KeY name resolution. + Type type = ((KeyExecutionContext) ((KeyMethodCallStmt) parent).getContext()).getContext(); ResolvedReferenceTypeDeclaration rt = typeSolver.solveType(type.asString()); return rt.toAst().get(); } else if (parent instanceof BodyDeclaration) { diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java index 115fa4cb67..f3c9665f85 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -27,12 +27,15 @@ import com.github.javaparser.ast.Node; import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.expr.*; +import com.github.javaparser.ast.key.KeyCcatchReturn; +import com.github.javaparser.ast.key.KeyMethodCallStmt; import com.github.javaparser.ast.stmt.*; import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.resolution.Context; import com.github.javaparser.resolution.SymbolDeclarator; import com.github.javaparser.resolution.TypeSolver; import com.github.javaparser.symbolsolver.javaparsermodel.contexts.*; +import com.github.javaparser.symbolsolver.javaparsermodel.contexts.key.KeyCcatchReturnContext; import com.github.javaparser.symbolsolver.javaparsermodel.declarators.*; import java.util.Optional; @@ -46,6 +49,14 @@ public static Context getContext(Node node, TypeSolver typeSolver) { throw new NullPointerException("Node should not be null"); } + if (node instanceof KeyCcatchReturn kcr) { + return new KeyCcatchReturnContext(kcr, typeSolver); + } + + if (node instanceof KeyMethodCallStmt kcr) { + return new KeyMethodCallStatementContext(kcr, typeSolver); + } + if (node instanceof ArrayAccessExpr) { return new ArrayAccessExprContext((ArrayAccessExpr) node, typeSolver); } diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/NormalCompletionVisitor.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/NormalCompletionVisitor.java index a12baf3cef..bb7cad4f85 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/NormalCompletionVisitor.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/NormalCompletionVisitor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableResult.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableResult.java index 88d56c29fa..bcca0242a1 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableResult.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableResult.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableVisitor.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableVisitor.java index dfc7e00173..243cdc3df3 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableVisitor.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/PatternVariableVisitor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java index c60fca38ee..9c588f3792 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -23,10 +23,12 @@ import static com.github.javaparser.ast.expr.Expression.EXCLUDE_ENCLOSED_EXPR; import static com.github.javaparser.ast.expr.Expression.IS_NOT_ENCLOSED_EXPR; +import static com.github.javaparser.ast.stmt.SwitchEntry.Type.THROWS_STATEMENT; import static com.github.javaparser.resolution.Navigator.demandParentNode; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Node; +import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.FieldDeclaration; import com.github.javaparser.ast.body.Parameter; import com.github.javaparser.ast.body.VariableDeclarator; @@ -34,6 +36,8 @@ import com.github.javaparser.ast.stmt.BlockStmt; import com.github.javaparser.ast.stmt.ExpressionStmt; import com.github.javaparser.ast.stmt.ReturnStmt; +import com.github.javaparser.ast.stmt.SwitchEntry; +import com.github.javaparser.ast.stmt.YieldStmt; import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.resolution.*; import com.github.javaparser.resolution.declarations.*; @@ -53,10 +57,12 @@ import com.github.javaparser.symbolsolver.resolution.SymbolSolver; import com.github.javaparser.symbolsolver.resolution.promotion.ConditionalExprResolver; import com.github.javaparser.symbolsolver.resolution.typeinference.LeastUpperBoundLogic; +import com.github.javaparser.symbolsolver.resolution.typeinference.TypeHelper; import com.github.javaparser.utils.Log; import com.github.javaparser.utils.Pair; import com.google.common.collect.ImmutableList; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -375,6 +381,109 @@ public ResolvedType visit(TypeExpr node, Boolean solveLambdas) { "Solving " + node, classOrInterfaceType.getName().getId()); } + @Override + public ResolvedType visit(SwitchExpr node, Boolean solveLambdas) { + NodeList entries = node.getEntries(); + + Set resolvedEntryTypes = entries.stream() + .map(entry -> { + switch (entry.getType()) { + case EXPRESSION: + // "case L -> e;" - the result is the expression value. + // The expression is wrapped in a single ExpressionStmt + return entry.getStatements() + .getOFirst() + .map(statement -> statement.accept(this, solveLambdas)) + .orElseThrow(() -> new IllegalStateException("Empty switch entry")); + case BLOCK: + // "case L -> { ... yield e; }" - the result is the yielded value + // The block is wrapped in a single BlockStmt, search within it for yield + // Blocks may not have a yield if they throw, so return null in that case + return entry.getStatements() + .getOFirst() + .flatMap(block -> findYieldForSwitch(block, node)) + .map(YieldStmt::getExpression) + .map(expr -> expr.accept(this, solveLambdas)) + .orElse(null); + case STATEMENT_GROUP: + // "case L: ... yield e;" - colon-style with yield + // Search all of them for yield + // Some groups may not have yield (e.g., fall-through or throw), so return null + return entry.getStatements().stream() + .map(stmt -> findYieldForSwitch(stmt, node)) + .filter(Optional::isPresent) + .map(Optional::get) + .findFirst() + .map(YieldStmt::getExpression) + .map(expr -> expr.accept(this, solveLambdas)) + .orElse(null); + case THROWS_STATEMENT: + // Throwing statements do not contribute to the computation of the type of the switch + // expression + return null; + default: + throw new IllegalStateException("Unsupported switch entry type: " + entry.getType()); + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + if (resolvedEntryTypes.isEmpty()) { + // Should not happen because of prior validation + throw new IllegalStateException("Invalid switch expression with no result expressions"); + } + + // JLS 15.28.1 - Determine the type of the switch expression + + if (resolvedEntryTypes.size() == 1) { + // If the result expressions all have the same type then that is the type of the switch expression + return resolvedEntryTypes.iterator().next(); + } + + if (resolvedEntryTypes.stream() + .allMatch(type -> type.isPrimitive() && type.asPrimitive().isBoolean() + || type.isReferenceType() + && type.asReferenceType().isUnboxableTo(ResolvedPrimitiveType.BOOLEAN))) { + // If the type of each result expression is boolean or Boolean the switch expression has type boolean. + return ResolvedPrimitiveType.BOOLEAN; + } + + if (resolvedEntryTypes.stream().allMatch(ResolvedType::isNumericType)) { + // If the type of each result expression is convertible to a numeric type, + // then the switch type is determined by applying numeric promotion + return resolvedEntryTypes.stream() + .map(type -> type.isReferenceType() + && type.asReferenceType().isUnboxable() + ? type.asReferenceType().toUnboxedType().get().asPrimitive() + : type.asPrimitive()) + .reduce(ResolvedPrimitiveType::bnp) + .orElseThrow(() -> new IllegalStateException("Unexpected error in numeric promotion")); + } + + // Otherwise, boxing conversion is applied to each result expression that has a primitive type, + // after which the type is the least upper bound of the types of the result expressions. + Set boxedTypes = resolvedEntryTypes.stream() + .map(type -> type.isPrimitive() ? TypeHelper.toBoxedType(type.asPrimitive(), typeSolver) : type) + .collect(Collectors.toSet()); + + return LeastUpperBoundLogic.of().lub(boxedTypes); + } + + /** + * Finds the first YieldStmt that belongs to the given SwitchExpr (not to a nested switch). + */ + private Optional findYieldForSwitch(Node searchRoot, SwitchExpr targetSwitch) { + return searchRoot.findFirst(YieldStmt.class, yieldStmt -> yieldStmt + .findAncestor(SwitchExpr.class) + .map(ancestor -> ancestor == targetSwitch) + .orElse(false)); + } + + @Override + public ResolvedType visit(ExpressionStmt node, Boolean solveLambdas) { + return node.getExpression().accept(this, solveLambdas); + } + @Override public ResolvedType visit(ObjectCreationExpr node, Boolean solveLambdas) { return facade.convertToUsage(node.getType()); diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java index 6dd28d79fe..c1a42869a1 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java index c8a0a46caf..c07908a300 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnnotationDeclarationContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnnotationDeclarationContext.java index 8dfa1b2afc..6b84a56b5e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnnotationDeclarationContext.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnnotationDeclarationContext.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java index c2a8b9d00e..adff240734 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ArrayAccessExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ArrayAccessExprContext.java index 15ba73f6be..a7b5f77a24 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ArrayAccessExprContext.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ArrayAccessExprContext.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -28,9 +28,9 @@ /** *

    - * Required to prevent recursive access to the "parent node" (not necessarily the same as the "parent context"). + * Required to prevent recursive access to the "parent node" (not necessarily the same as the "parent context"). *

    - * Consider, for example, this code where the cursor is currently at the node of type {@code ArrayAccessExpr}: + * Consider, for example, this code where the cursor is currently at the node of type {@code ArrayAccessExpr}: *

    *
    {@code
      *     var1.perPriority[index].recovered
    @@ -74,6 +74,9 @@
      *     
      * 
      *
    + *
    + *
    + *
      * @author Roger Howell
      */
     public class ArrayAccessExprContext extends ExpressionContext {
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BinaryExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BinaryExprContext.java
    index 0aee8a2605..900a272e98 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BinaryExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BinaryExprContext.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (C) 2013-2024 The JavaParser Team.
    + * Copyright (C) 2013-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BlockStmtContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BlockStmtContext.java
    index 943548e9d4..32d237e640 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BlockStmtContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/BlockStmtContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CatchClauseContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CatchClauseContext.java
    index fad48397dd..6c096742c5 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CatchClauseContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CatchClauseContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContext.java
    index 678396eace..58c48d6eb3 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationExtendsContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationExtendsContext.java
    index 0ca5cc3903..0b4c6a82fa 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationExtendsContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationExtendsContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
    - * Copyright (C) 2011, 2013-2024 The JavaParser Team.
    + * Copyright (C) 2011, 2013-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java
    index a53ed20bce..7a6fe98fbc 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConditionalExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConditionalExprContext.java
    index 70c72bfaf0..d24b4ae0ce 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConditionalExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConditionalExprContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConstructorContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConstructorContext.java
    index 2d7266eb31..ef578c4fb6 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConstructorContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConstructorContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    @@ -36,7 +36,6 @@ public class ConstructorContext extends AbstractMethodLikeDeclarationContext parametersExposedToChild(Node child) {
             // TODO/FIXME: Presumably the parameters must be exposed to all children and their descendants, not just the
             // direct child?
    -        var b = wrappedNode.getBody();
    -        if (b.isPresent() && child == b.get()) {
    +        if (child == wrappedNode.getBody().get()) {
                 return wrappedNode.getParameters();
             }
             return Collections.emptyList();
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ContextHelper.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ContextHelper.java
    index 903d83c07a..45db643f5b 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ContextHelper.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ContextHelper.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/DoStatementContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/DoStatementContext.java
    index 6c42f54093..c07c820323 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/DoStatementContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/DoStatementContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnclosedExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnclosedExprContext.java
    index c293407ee4..892354065d 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnclosedExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnclosedExprContext.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (C) 2013-2024 The JavaParser Team.
    + * Copyright (C) 2013-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnumDeclarationContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnumDeclarationContext.java
    index 098f4f0c38..36d56f4caf 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnumDeclarationContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnumDeclarationContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ExpressionContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ExpressionContext.java
    index 81d535d97d..999063e723 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ExpressionContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ExpressionContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/FieldAccessContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/FieldAccessContext.java
    index 8312a80660..967a2f0e90 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/FieldAccessContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/FieldAccessContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForEachStatementContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForEachStatementContext.java
    index 7251c2299f..ccdc337f03 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForEachStatementContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForEachStatementContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForStatementContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForStatementContext.java
    index 67afe3ec27..968b31b56c 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForStatementContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForStatementContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContext.java
    index adbe81d8c9..7b27dc24a9 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContext.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (C) 2013-2024 The JavaParser Team.
    + * Copyright (C) 2013-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/InstanceOfExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/InstanceOfExprContext.java
    index d5bcfcb1a4..a76743ba33 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/InstanceOfExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/InstanceOfExprContext.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (C) 2013-2024 The JavaParser Team.
    + * Copyright (C) 2013-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java
    index b9504fc1b6..2e00288d49 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/KeyMethodCallStatementContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/KeyMethodCallStatementContext.java
    new file mode 100644
    index 0000000000..f18736a549
    --- /dev/null
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/KeyMethodCallStatementContext.java
    @@ -0,0 +1,185 @@
    +package com.github.javaparser.symbolsolver.javaparsermodel.contexts;
    +
    +import com.github.javaparser.ast.Node;
    +import com.github.javaparser.ast.body.Parameter;
    +import com.github.javaparser.ast.body.TypeDeclaration;
    +import com.github.javaparser.ast.body.VariableDeclarator;
    +import com.github.javaparser.ast.expr.Expression;
    +import com.github.javaparser.ast.expr.TypePatternExpr;
    +import com.github.javaparser.ast.key.KeyExecutionContext;
    +import com.github.javaparser.ast.key.KeyMethodCallStmt;
    +import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName;
    +import com.github.javaparser.resolution.Context;
    +import com.github.javaparser.resolution.MethodUsage;
    +import com.github.javaparser.resolution.TypeSolver;
    +import com.github.javaparser.resolution.declarations.*;
    +import com.github.javaparser.resolution.model.SymbolReference;
    +import com.github.javaparser.resolution.model.Value;
    +import com.github.javaparser.resolution.types.ResolvedType;
    +import com.github.javaparser.symbolsolver.javaparsermodel.JavaParserFactory;
    +
    +import java.util.List;
    +import java.util.Objects;
    +import java.util.Optional;
    +
    +/**
    + *
    + * @author Alexander Weigl
    + * @version 1 (3/14/26)
    + */
    +public class KeyMethodCallStatementContext extends AbstractJavaParserContext {
    +    private final Context context;
    +    private final String selfName;
    +    private final ResolvedType selfType;
    +
    +    public KeyMethodCallStatementContext(KeyMethodCallStmt kcr, TypeSolver typeSolver) {
    +        super(kcr, typeSolver);
    +
    +        KeyExecutionContext sourceSpecification = (KeyExecutionContext) kcr.getContext();
    +        var typeName = sourceSpecification.context().toString();
    +        final var ref = solveTypeInParentContext(typeName);
    +        if (!ref.isSolved()) {
    +            throw new RuntimeException("Could not resolve type of method call statement: " + typeName);
    +        }
    +
    +        var resolvedType = ref.getCorrespondingDeclaration();
    +        var typeDeclaration = resolvedType.toAst(TypeDeclaration.class).get();
    +
    +        context = JavaParserFactory.getContext(typeDeclaration, typeSolver);
    +
    +        selfType = sourceSpecification.context().convertToUsage(context);
    +
    +        selfName = sourceSpecification.getInstance()
    +                .flatMap(Expression::toNameExpr)
    +                .map(NodeWithSimpleName::getNameAsString)
    +                .orElse(null);
    +    }
    +
    +
    +    @Override
    +    public Optional solveMethodAsUsage(String name, List argumentsTypes){
    +                                                    //ResolvedReferenceTypeDeclaration invocationContext) {
    +        return context.solveMethodAsUsage(name, argumentsTypes);
    +    }
    +
    +    @Override
    +    public List typePatternExprsExposedToChild(Node child) {
    +        return context.typePatternExprsExposedToChild(child);
    +    }
    +
    +    @Override
    +    public Optional typePatternExprInScope(String name) {
    +        return context.typePatternExprInScope(name);
    +    }
    +
    +    @Override
    +    public SymbolReference solveType(String name, List typeArguments) {
    +        return context.solveType(name, typeArguments);
    +    }
    +
    +    @Override
    +    public SymbolReference solveType(String name) {
    +        return context.solveType(name);
    +    }
    +
    +    @Override
    +    public Optional solveSymbolAsValueInParentContext(String name) {
    +        return context.solveSymbolAsValueInParentContext(name);
    +    }
    +
    +    @Override
    +    public Optional solveSymbolAsValue(String name) {
    +        if (Objects.equals(name, selfName)) {
    +            return Optional.of(new Value(selfType, selfName));
    +        }
    +        return context.solveSymbolAsValue(name);
    +    }
    +
    +    @Override
    +    public SymbolReference solveSymbol(String name) {
    +        if (Objects.equals(name, selfName)) {
    +            return getSymbolicReferenceOfSelfName();
    +        }
    +        return context.solveSymbol(name);
    +    }
    +
    +    private SymbolReference getSymbolicReferenceOfSelfName() {
    +        return SymbolReference.solved(new KeyMethodCallInstanceDeclaration());
    +    }
    +
    +    @Override
    +    public SymbolReference solveMethodInParentContext(String name,
    +                                                                                 List argumentsTypes,
    +                                                                                 boolean staticOnly) {
    +        return context.solveMethodInParentContext(name, argumentsTypes, staticOnly);
    +    }
    +
    +    @Override
    +    public SymbolReference solveMethod(
    +            String name, List argumentsTypes,
    +            boolean staticOnly) {
    +        return context.solveMethod(name, argumentsTypes, staticOnly);
    +    }
    +
    +    @Override
    +    public Optional solveGenericTypeInParentContext(String name) {
    +        return context.solveGenericTypeInParentContext(name);
    +    }
    +
    +    @Override
    +    public Optional solveGenericType(String name) {
    +        return context.solveGenericType(name);
    +    }
    +
    +    @Override
    +    public SymbolReference solveConstructor(List argumentsTypes) {
    +        return context.solveConstructor(argumentsTypes);
    +    }
    +
    +    @Override
    +    public List parametersExposedToChild(Node child) {
    +        return context.parametersExposedToChild(child);
    +    }
    +
    +    @Override
    +    public Optional parameterDeclarationInScope(String name) {
    +        return context.parameterDeclarationInScope(name);
    +    }
    +
    +    @Override
    +    public List localVariablesExposedToChild(Node child) {
    +        return context.localVariablesExposedToChild(child);
    +    }
    +
    +    @Override
    +    public Optional localVariableDeclarationInScope(String name) {
    +        return context.localVariableDeclarationInScope(name);
    +    }
    +
    +    @Override
    +    public List fieldsExposedToChild(Node child) {
    +        return context.fieldsExposedToChild(child);
    +    }
    +
    +    @Override
    +    public Optional fieldDeclarationInScope(String name) {
    +        return context.fieldDeclarationInScope(name);
    +    }
    +
    +    public final class KeyMethodCallInstanceDeclaration implements ResolvedValueDeclaration {
    +        @Override
    +        public ResolvedType getType() {
    +            return selfType;
    +        }
    +
    +        @Override
    +        public String getName() {
    +            return selfName;
    +        }
    +
    +        @Override
    +        public Optional toAst() {
    +            return Optional.ofNullable(((KeyExecutionContext) wrappedNode.getContext()).instance());
    +        }
    +    }
    +}
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java
    index cd663d940f..eb8b7ab888 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java
    index c6062edb1a..44bec2bc7b 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodContext.java
    index 6906cb60b3..1482ea1b2c 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodReferenceExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodReferenceExprContext.java
    index b6d1d1598e..a65eefdebb 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodReferenceExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodReferenceExprContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ObjectCreationContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ObjectCreationContext.java
    index 09894bb263..a07fc751cf 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ObjectCreationContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ObjectCreationContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/RecordDeclarationContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/RecordDeclarationContext.java
    index cb7733c4e6..31f61c4203 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/RecordDeclarationContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/RecordDeclarationContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/StatementContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/StatementContext.java
    index 361c014ff1..9cc0c6f877 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/StatementContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/StatementContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchEntryContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchEntryContext.java
    index 62cf8d6dce..40b000d1a5 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchEntryContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchEntryContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/TryWithResourceContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/TryWithResourceContext.java
    index ee4841b42a..0235d77902 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/TryWithResourceContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/TryWithResourceContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/UnaryExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/UnaryExprContext.java
    index 98654959f1..f714b877e8 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/UnaryExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/UnaryExprContext.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (C) 2013-2024 The JavaParser Team.
    + * Copyright (C) 2013-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclarationExprContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclarationExprContext.java
    index 0856031d07..e1d37e7416 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclarationExprContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclarationExprContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclaratorContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclaratorContext.java
    index 915be0b096..6f605b690f 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclaratorContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/VariableDeclaratorContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/WhileStatementContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/WhileStatementContext.java
    index 49ed537b8c..be0ac8ceb2 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/WhileStatementContext.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/WhileStatementContext.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/key/KeyCcatchReturnContext.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/key/KeyCcatchReturnContext.java
    new file mode 100644
    index 0000000000..5bc628b45b
    --- /dev/null
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/key/KeyCcatchReturnContext.java
    @@ -0,0 +1,80 @@
    +package com.github.javaparser.symbolsolver.javaparsermodel.contexts.key;
    +
    +import com.github.javaparser.ast.Node;
    +import com.github.javaparser.ast.body.Parameter;
    +import com.github.javaparser.ast.body.VariableDeclarator;
    +import com.github.javaparser.ast.key.KeyCcatchReturn;
    +import com.github.javaparser.resolution.SymbolDeclarator;
    +import com.github.javaparser.resolution.TypeSolver;
    +import com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration;
    +import com.github.javaparser.resolution.declarations.ResolvedValueDeclaration;
    +import com.github.javaparser.resolution.model.SymbolReference;
    +import com.github.javaparser.resolution.model.Value;
    +import com.github.javaparser.resolution.types.ResolvedType;
    +import com.github.javaparser.symbolsolver.javaparsermodel.JavaParserFactory;
    +import com.github.javaparser.symbolsolver.javaparsermodel.contexts.AbstractJavaParserContext;
    +import java.util.Collections;
    +import java.util.List;
    +import java.util.Optional;
    +
    +public class KeyCcatchReturnContext extends AbstractJavaParserContext {
    +    public KeyCcatchReturnContext(KeyCcatchReturn kcr, TypeSolver typeSolver) {
    +        super(kcr, typeSolver);
    +    }
    +
    +    @Override
    +    public final SymbolReference solveSymbol(String name) {
    +        if (wrappedNode.getParameter().isPresent()) {
    +            SymbolDeclarator sb = JavaParserFactory.getSymbolDeclarator(
    +                    wrappedNode.getParameter().get(), typeSolver);
    +            SymbolReference symbolReference =
    +                    AbstractJavaParserContext.solveWith(sb, name);
    +            if (symbolReference.isSolved()) {
    +                return symbolReference;
    +            }
    +        }
    +
    +        // if nothing is found we should ask the parent context
    +        return solveSymbolInParentContext(name);
    +    }
    +
    +    @Override
    +    public final Optional solveSymbolAsValue(String name) {
    +        if (wrappedNode.getParameter().isPresent()) {
    +            SymbolDeclarator sb = JavaParserFactory.getSymbolDeclarator(
    +                    wrappedNode.getParameter().get(), typeSolver);
    +            Optional symbolReference = solveWithAsValue(sb, name);
    +            if (symbolReference.isPresent()) {
    +                // Perform parameter type substitution as needed
    +                return symbolReference;
    +            }
    +        }
    +
    +        // if nothing is found we should ask the parent context
    +        return solveSymbolAsValueInParentContext(name);
    +    }
    +
    +    @Override
    +    public final SymbolReference solveMethod(
    +            String name, List argumentsTypes, boolean staticOnly) {
    +        // TODO: Document why staticOnly is forced to be false.
    +        return solveMethodInParentContext(name, argumentsTypes, false);
    +    }
    +
    +    @Override
    +    public List localVariablesExposedToChild(Node child) {
    +        return Collections.emptyList();
    +    }
    +
    +    @Override
    +    public List parametersExposedToChild(Node child) {
    +        // TODO/FIXME: Presumably the parameters must be exposed to all children and their descendants, not just the
    +        // direct child?
    +        if (getWrappedNode().getParameter().isPresent()
    +                && getWrappedNode().getBlock().isPresent()
    +                && child == getWrappedNode().getBlock().get()) {
    +            return Collections.singletonList(getWrappedNode().getParameter().get());
    +        }
    +        return Collections.emptyList();
    +    }
    +}
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/AstResolutionUtils.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/AstResolutionUtils.java
    index 75419e90bb..27f8cef760 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/AstResolutionUtils.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/AstResolutionUtils.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/DefaultConstructorDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/DefaultConstructorDeclaration.java
    index 559a494317..9d99b5515c 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/DefaultConstructorDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/DefaultConstructorDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclaration.java
    index 1f128ce9aa..16d0576452 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    @@ -39,9 +39,9 @@
      */
     public class JavaParserAnnotationDeclaration extends AbstractTypeDeclaration implements ResolvedAnnotationDeclaration {
     
    -    private final com.github.javaparser.ast.body.AnnotationDeclaration wrappedNode;
    -    private final TypeSolver typeSolver;
    -    private final JavaParserTypeAdapter javaParserTypeAdapter;
    +    private com.github.javaparser.ast.body.AnnotationDeclaration wrappedNode;
    +    private TypeSolver typeSolver;
    +    private JavaParserTypeAdapter javaParserTypeAdapter;
     
         public JavaParserAnnotationDeclaration(AnnotationDeclaration wrappedNode, TypeSolver typeSolver) {
             this.wrappedNode = wrappedNode;
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationMemberDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationMemberDeclaration.java
    index 10743be7cd..b70209db1c 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationMemberDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationMemberDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclaration.java
    index d236c2926b..bcc82663f6 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java
    index 63db5f2550..00f52e479b 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    @@ -54,9 +54,9 @@ public class JavaParserClassDeclaration extends AbstractClassDeclaration
         /// Fields
         ///
     
    -    private final TypeSolver typeSolver;
    -    private final ClassOrInterfaceDeclaration wrappedNode;
    -    private final JavaParserTypeAdapter javaParserTypeAdapter;
    +    private TypeSolver typeSolver;
    +    private ClassOrInterfaceDeclaration wrappedNode;
    +    private JavaParserTypeAdapter javaParserTypeAdapter;
     
         ///
         /// Constructors
    @@ -463,7 +463,7 @@ private ResolvedReferenceType toReferenceType(ClassOrInterfaceType classOrInterf
             String className = classOrInterfaceType.getName().getId();
             if (classOrInterfaceType.getScope().isPresent()) {
                 // look for the qualified name (for example class of type Rectangle2D.Double)
    -            className = classOrInterfaceType.getScope().get() + "." + className;
    +            className = classOrInterfaceType.getScope().get().toString() + "." + className;
             }
     
             // Since this is used to resolve reference to "extended" and "implemented" types, and since these type
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java
    index 7815ed3b01..a09bd0db83 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumConstantDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumConstantDeclaration.java
    index 43b9647232..636a2c6531 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumConstantDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumConstantDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java
    index 24153dfbc3..621104514b 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclaration.java
    index 04dd90c821..22b339fb14 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    @@ -21,10 +21,11 @@
     
     package com.github.javaparser.symbolsolver.javaparsermodel.declarations;
     
    +import static com.github.javaparser.ast.Modifier.DefaultKeyword.STATIC;
    +import static com.github.javaparser.ast.Modifier.DefaultKeyword.VOLATILE;
     import static com.github.javaparser.resolution.Navigator.demandParentNode;
     
     import com.github.javaparser.ast.AccessSpecifier;
    -import com.github.javaparser.ast.Modifier;
     import com.github.javaparser.ast.Node;
     import com.github.javaparser.ast.body.TypeDeclaration;
     import com.github.javaparser.ast.body.VariableDeclarator;
    @@ -40,9 +41,9 @@
      */
     public class JavaParserFieldDeclaration implements ResolvedFieldDeclaration {
     
    -    private final VariableDeclarator variableDeclarator;
    -    private final com.github.javaparser.ast.body.FieldDeclaration wrappedNode;
    -    private final TypeSolver typeSolver;
    +    private VariableDeclarator variableDeclarator;
    +    private com.github.javaparser.ast.body.FieldDeclaration wrappedNode;
    +    private TypeSolver typeSolver;
     
         public JavaParserFieldDeclaration(VariableDeclarator variableDeclarator, TypeSolver typeSolver) {
             if (typeSolver == null) {
    @@ -69,12 +70,12 @@ public String getName() {
     
         @Override
         public boolean isStatic() {
    -        return wrappedNode.hasModifier(Modifier.DefaultKeyword.STATIC);
    +        return wrappedNode.hasModifier(STATIC);
         }
     
         @Override
         public boolean isVolatile() {
    -        return wrappedNode.hasModifier(Modifier.DefaultKeyword.VOLATILE);
    +        return wrappedNode.hasModifier(VOLATILE);
         }
     
         @Override
    diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java
    index e6213b22b2..e7a5a67556 100644
    --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java
    +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java
    @@ -1,6 +1,6 @@
     /*
      * Copyright (C) 2015-2016 Federico Tomassetti
    - * Copyright (C) 2017-2024 The JavaParser Team.
    + * Copyright (C) 2017-2026 The JavaParser Team.
      *
      * This file is part of JavaParser.
      *
    @@ -54,9 +54,9 @@ public class JavaParserInterfaceDeclaration extends AbstractTypeDeclaration
                     MethodUsageResolutionCapability,
                     SymbolResolutionCapability {
     
    -    private final TypeSolver typeSolver;
    -    private final ClassOrInterfaceDeclaration wrappedNode;
    -    private final JavaParserTypeAdapter javaParserTypeAdapter;
    +    private TypeSolver typeSolver;
    +    private ClassOrInterfaceDeclaration wrappedNode;
    +    private JavaParserTypeAdapter javaParserTypeAdapter;
     
         public JavaParserInterfaceDeclaration(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver) {
             if (!wrappedNode.isInterface()) {
    @@ -252,7 +252,7 @@ public String toString() {
         /**
          * This method is deprecated because it receives the TypesSolver as a parameter.
          * Eventually we would like to remove all usages of TypeSolver as a parameter.
    -     * 

    + * * Also, resolution should move out of declarations, so that they are pure declarations and the resolution should * work for JavaParser, Reflection and Javassist classes in the same way and not be specific to the three * implementations. diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclaration.java index 6f93ecb7d0..3156bd4a01 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclaration.java index b1734b7a0b..7133618436 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclaration.java index fc190c8c44..57d446f0ed 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclaration.java index 82cbfbd28f..70d4bbf676 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -31,7 +31,7 @@ /** * This should not be used to represent fields of parameters. - *

    + * * Eventually this should be renamed in JavaParserVariableDeclaration. * * @author Federico Tomassetti diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java index 9d627b5d26..fcf52161cd 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java index 880a18de3e..df32093b41 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclaration.java index 31047dd6fb..13709c6fa1 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclaration.java index 2a5cbd595c..fdc96e2605 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclaration.java index 1eb606f527..edfaf8d1c7 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/AbstractSymbolDeclarator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/AbstractSymbolDeclarator.java index e67928d045..c4b1dab155 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/AbstractSymbolDeclarator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/AbstractSymbolDeclarator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/FieldSymbolDeclarator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/FieldSymbolDeclarator.java index aad8181dd8..f8c189e4ae 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/FieldSymbolDeclarator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/FieldSymbolDeclarator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/NoSymbolDeclarator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/NoSymbolDeclarator.java index 1dc377e638..574c297e32 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/NoSymbolDeclarator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/NoSymbolDeclarator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/ParameterSymbolDeclarator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/ParameterSymbolDeclarator.java index cb01a173f0..bd6bb8c7c7 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/ParameterSymbolDeclarator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/ParameterSymbolDeclarator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/TypePatternSymbolDeclarator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/TypePatternSymbolDeclarator.java index ba31d7d1b2..12e5eeec84 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/TypePatternSymbolDeclarator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/TypePatternSymbolDeclarator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/VariableSymbolDeclarator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/VariableSymbolDeclarator.java index d9bf89f345..e4cbb128b8 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/VariableSymbolDeclarator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/declarators/VariableSymbolDeclarator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/package-info.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/package-info.java index 45398024b4..cb1625cfc1 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/package-info.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/package-info.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclaration.java index ff32dfd203..7b5c0e0f57 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -40,9 +40,9 @@ */ public class JavassistAnnotationDeclaration extends AbstractTypeDeclaration implements ResolvedAnnotationDeclaration { - private final CtClass ctClass; - private final TypeSolver typeSolver; - private final JavassistTypeDeclarationAdapter javassistTypeDeclarationAdapter; + private CtClass ctClass; + private TypeSolver typeSolver; + private JavassistTypeDeclarationAdapter javassistTypeDeclarationAdapter; @Override public String toString() { @@ -67,7 +67,7 @@ public String getPackageName() { public String getClassName() { String qualifiedName = getQualifiedName(); if (qualifiedName.contains(".")) { - return qualifiedName.substring(qualifiedName.lastIndexOf(".") + 1); + return qualifiedName.substring(qualifiedName.lastIndexOf(".") + 1, qualifiedName.length()); } return qualifiedName; } diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclaration.java index 2e435a33a4..2c37c779ed 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java index 34ac443aa0..745006accc 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclaration.java index c9d92bb181..ef69fb28b2 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclaration.java index a5bcd9eb97..e181694a78 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclaration.java index 3f79237422..f8814106fe 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java index da863eabc2..62ba1b5b15 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclaration.java index 55e1d11190..55590b7f69 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -36,8 +36,8 @@ * @author Federico Tomassetti */ public class JavassistFieldDeclaration implements ResolvedFieldDeclaration { - private final CtField ctField; - private final TypeSolver typeSolver; + private CtField ctField; + private TypeSolver typeSolver; public JavassistFieldDeclaration(CtField ctField, TypeSolver typeSolver) { this.ctField = ctField; diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java index 55677f77c5..153070c7af 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclaration.java index 0edd7a662a..95e3ba61e9 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodLikeDeclarationAdapter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodLikeDeclarationAdapter.java index 28f154a071..5b115758d1 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodLikeDeclarationAdapter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodLikeDeclarationAdapter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -37,11 +37,11 @@ public class JavassistMethodLikeDeclarationAdapter { - private final CtBehavior ctBehavior; - private final TypeSolver typeSolver; - private final ResolvedMethodLikeDeclaration declaration; + private CtBehavior ctBehavior; + private TypeSolver typeSolver; + private ResolvedMethodLikeDeclaration declaration; - private final SignatureAttribute.MethodSignature methodSignature; + private SignatureAttribute.MethodSignature methodSignature; public JavassistMethodLikeDeclarationAdapter( CtBehavior ctBehavior, TypeSolver typeSolver, ResolvedMethodLikeDeclaration declaration) { diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclaration.java index 3a4f3c5f5d..595be36871 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclaration.java index 7ceaf8bedb..509e8ee912 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java index 94ba920bbe..0b85b85981 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameter.java index 81acb99015..52b8596e3e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java index 006b89464f..d9c130eec7 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/package-info.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/package-info.java index 059db5e6a4..6934158969 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/package-info.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javassistmodel/package-info.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclaration.java index 8935b1251e..969411b5c2 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclaration.java index a55b7c67b7..085209cbd4 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/ObjectProvider.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/ObjectProvider.java index b4e931becf..733705e74e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/ObjectProvider.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/logic/ObjectProvider.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclaration.java index 74029b65ca..6681079367 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationMemberDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationMemberDeclaration.java index cc4579ef1f..af526ae1cf 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationMemberDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationMemberDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java index c2ea78b3b8..ec9141de7b 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java index 04e1858cfe..fd4167d84b 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionConstructorDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionConstructorDeclaration.java index f13d77da3d..9cb45b8310 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionConstructorDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionConstructorDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumConstantDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumConstantDeclaration.java index b8d5b56384..2fea148b90 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumConstantDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumConstantDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java index b39a82056d..e21014bf55 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFactory.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFactory.java index 157b6b4567..05f9486ddc 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFactory.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFactory.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclaration.java index f25f627b78..757e0ff2af 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -34,9 +34,9 @@ */ public class ReflectionFieldDeclaration implements ResolvedFieldDeclaration { - private final Field field; - private final TypeSolver typeSolver; - private final ResolvedType type; + private Field field; + private TypeSolver typeSolver; + private ResolvedType type; public ReflectionFieldDeclaration(Field field, TypeSolver typeSolver) { this.field = field; diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclaration.java index 627c2e583d..fe4154db35 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -143,9 +143,9 @@ public int hashCode() { * This method first resolves the basic method signature, then performs generic type inference * based on the actual parameter types provided at the call site. * - * @param name the method name to resolve - * @param parameterTypes the actual parameter types at the call site - * @param invokationContext the context where the method is invoked + * @param name the method name to resolve + * @param parameterTypes the actual parameter types at the call site + * @param invokationContext the context where the method is invoked * @param typeParameterValues explicit type parameter values (if any) * @return an Optional containing the resolved MethodUsage with inferred types, or empty if resolution fails */ @@ -170,7 +170,7 @@ public Optional solveMethodAsUsage( * between formal parameter types and actual parameter types provided at the call site. * Handles both regular methods and varargs methods with appropriate constraint collection. * - * @param methodUsage the initially resolved method usage + * @param methodUsage the initially resolved method usage * @param parameterTypes the actual parameter types from the call site * @return an Optional containing the method usage with inferred generic types, or empty if inference fails */ @@ -189,8 +189,8 @@ private Optional performTypeInference(MethodUsage methodUsage, List * Automatically detects whether the method is varargs and delegates to the appropriate * constraint collection strategy. Also validates that parameter counts are compatible. * - * @param methodUsage the method usage to analyze - * @param parameterTypes the actual parameter types from the call site + * @param methodUsage the method usage to analyze + * @param parameterTypes the actual parameter types from the call site * @param inferenceContext the inference context for collecting type constraints * @return a list of type constraints that will be used for generic type resolution * @throws IllegalArgumentException if parameter counts are incompatible @@ -216,7 +216,7 @@ private List collectTypeConstraints( * For regular methods, counts must match exactly. For varargs methods, actual parameter * count must be at least the number of required parameters (formal count - 1). * - * @param isVarArgs whether the method is a varargs method + * @param isVarArgs whether the method is a varargs method * @param formalParamCount the number of formal parameters in the method signature * @param actualParamCount the number of actual parameters provided at the call site * @throws IllegalArgumentException if parameter counts are incompatible @@ -235,8 +235,8 @@ private void validateParameterCount(boolean isVarArgs, int formalParamCount, int * between each formal parameter type and its corresponding actual parameter type. * This is a straightforward one-to-one mapping since parameter counts must match exactly. * - * @param methodUsage the method usage to analyze - * @param parameterTypes the actual parameter types from the call site + * @param methodUsage the method usage to analyze + * @param parameterTypes the actual parameter types from the call site * @param inferenceContext the inference context for collecting constraints * @return a list of type constraints, one for each parameter position */ @@ -257,13 +257,13 @@ private List collectRegularConstraints( * Collects type constraints for varargs methods. This involves two phases: * 1. Regular parameters: handled like non-varargs methods (one-to-one mapping) * 2. Varargs parameter: handled specially based on how arguments are passed - *

    + * * The varargs parameter can receive arguments in two ways: * - Direct array passing: method(array) - constraint between array types * - Individual elements: method(elem1, elem2, ...) - constraints between component type and each element * - * @param methodUsage the varargs method usage to analyze - * @param parameterTypes the actual parameter types from the call site + * @param methodUsage the varargs method usage to analyze + * @param parameterTypes the actual parameter types from the call site * @param inferenceContext the inference context for collecting constraints * @param formalParamCount the total number of formal parameters (including varargs) * @return a list of type constraints covering both regular and varargs parameters @@ -295,20 +295,20 @@ private List collectVarArgsConstraints( /** * Processes the varargs parameter by determining how arguments are passed and creating * appropriate type constraints. Handles two scenarios: - *

    + * * 1. Direct array passing: When exactly one argument is passed to varargs and it's an array, - * creates a constraint between the formal array type and the actual array type. - * Example: method(String[] args) called as method(stringArray) - *

    + * creates a constraint between the formal array type and the actual array type. + * Example: method(String[] args) called as method(stringArray) + * * 2. Individual element passing: When multiple arguments are passed to varargs, - * creates constraints between the array's component type and each individual argument. - * Example: method(String... args) called as method("a", "b", "c") + * creates constraints between the array's component type and each individual argument. + * Example: method(String... args) called as method("a", "b", "c") * - * @param varargsParamType the formal type of the varargs parameter (must be an array type) - * @param parameterTypes all actual parameter types from the call site + * @param varargsParamType the formal type of the varargs parameter (must be an array type) + * @param parameterTypes all actual parameter types from the call site * @param regularParamCount the number of regular (non-varargs) parameters - * @param inferenceContext the inference context for collecting constraints - * @param constraints the constraint list to add new constraints to + * @param inferenceContext the inference context for collecting constraints + * @param constraints the constraint list to add new constraints to * @throws IllegalStateException if the varargs parameter is not an array type */ private void processVarArgsParameter( @@ -342,9 +342,9 @@ private void processVarArgsParameter( * This happens when there is exactly one argument for the varargs parameter and that argument * is an array type. This is a special case that requires different constraint handling. * - * @param parameterTypes all actual parameter types from the call site + * @param parameterTypes all actual parameter types from the call site * @param regularParamCount the number of regular (non-varargs) parameters - * @param actualParamCount the total number of actual parameters + * @param actualParamCount the total number of actual parameters * @return true if a single array is being passed directly to varargs, false otherwise */ private boolean isDirectArrayPassing( @@ -358,8 +358,8 @@ private boolean isDirectArrayPassing( * and updating both parameter types and return type with their concrete resolved types. * This is the final step that produces a fully resolved MethodUsage with no remaining generic placeholders. * - * @param methodUsage the method usage to update with resolved types - * @param constraints the collected type constraints from parameter analysis + * @param methodUsage the method usage to update with resolved types + * @param constraints the collected type constraints from parameter analysis * @param inferenceContext the inference context containing all type relationships * @return an Optional containing the fully resolved MethodUsage * @throws ConflictingGenericTypesException if type constraints are contradictory diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclaration.java index f593778721..694461667e 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java index f751e21282..541d0605ac 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclaration.java index 2bcb11af32..a126925b5d 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -37,11 +37,12 @@ public class ReflectionParameterDeclaration implements ResolvedParameterDeclarat private String name; /** + * * @param type * @param genericType * @param typeSolver * @param variadic - * @param name can potentially be null + * @param name can potentially be null */ public ReflectionParameterDeclaration( Class type, java.lang.reflect.Type genericType, TypeSolver typeSolver, boolean variadic, String name) { @@ -53,6 +54,7 @@ public ReflectionParameterDeclaration( } /** + * * @return the name, which can be potentially null */ @Override diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionPatternDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionPatternDeclaration.java index 2bd56e6cd6..89f17b82a2 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionPatternDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionPatternDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclaration.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclaration.java index 0530eae3bb..50b45d6305 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclaration.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclaration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2020 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java index 73da7094f7..b4dafc2ddb 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ClassComparator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ClassComparator.java index 471f2eb415..0a7fb82f8d 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ClassComparator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ClassComparator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/MethodComparator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/MethodComparator.java index a1e8ef37b0..1d6f890e2b 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/MethodComparator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/MethodComparator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ParameterComparator.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ParameterComparator.java index a58341b156..10c11cfa17 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ParameterComparator.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ParameterComparator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/package-info.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/package-info.java index ac7a0a8ae9..cc28397e62 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/package-info.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/reflectionmodel/package-info.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/FileUtils.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/FileUtils.java index b6a509f6a7..74d8edc195 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/FileUtils.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/FileUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/JavassistModuleHelper.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/JavassistModuleHelper.java index f1db9c4d53..e2b9198778 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/JavassistModuleHelper.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/JavassistModuleHelper.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2025 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -29,7 +29,7 @@ import javassist.bytecode.ConstPool; public class JavassistModuleHelper { - public static String MODULE_INFO_CLASS_NAME = "module-info"; + public static final String MODULE_INFO_CLASS_NAME = "module-info"; /** * Javassist does not provide support for modules beyond letting users fetch the module @@ -52,8 +52,8 @@ public static Optional>> getModuleWithExportedPackages // The first 2 bytes give the module_name_index, which is needed to get the module name from the constPool int attrIdx = 0; - int moduleNameIndex = moduleAttribute[attrIdx++] << 16; - moduleNameIndex |= moduleAttribute[attrIdx++]; + int moduleNameIndex = (moduleAttribute[attrIdx++] & 0xFF) << 8; + moduleNameIndex |= (moduleAttribute[attrIdx++] & 0xFF); String moduleName = constPool.getModuleInfo(moduleNameIndex); ArrayList exportedPackages = new ArrayList<>(); @@ -63,32 +63,34 @@ public static Optional>> getModuleWithExportedPackages attrIdx += 4; // The next 2 bytes are the requires_count - int requiresCount = moduleAttribute[attrIdx++] << 16; - requiresCount |= moduleAttribute[attrIdx++]; + int requiresCount = (moduleAttribute[attrIdx++] & 0xFF) << 8; + requiresCount |= (moduleAttribute[attrIdx++] & 0xFF); // Skip the requires table. Each require structure consists of 6 bytes. attrIdx += requiresCount * 6; // The next 2 bytes are the exports count - int exportsCount = moduleAttribute[attrIdx++] << 16; - exportsCount |= moduleAttribute[attrIdx++]; + int exportsCount = (moduleAttribute[attrIdx++] & 0xFF) << 8; + exportsCount |= (moduleAttribute[attrIdx++] & 0xFF); for (int i = 0; i < exportsCount; i++) { - int exportsIndex = moduleAttribute[attrIdx++] << 16; - exportsIndex = moduleAttribute[attrIdx++]; + int exportsIndex = (moduleAttribute[attrIdx++] & 0xFF) << 8; + exportsIndex |= (moduleAttribute[attrIdx++] & 0xFF); String exportedPackageName = constPool.getPackageInfo(exportsIndex).replace('/', '.'); exportedPackages.add(exportedPackageName); // Skip the 2 byte exports_flags attrIdx += 2; // The next 2 bytes are the exports to count. Need this to skip the exports to table for now, but // could use them for better resolution. - int exportsToCount = moduleAttribute[attrIdx++] << 16; - exportsToCount |= moduleAttribute[attrIdx++]; + int exportsToCount = (moduleAttribute[attrIdx++] & 0xFF) << 8; + exportsToCount |= (moduleAttribute[attrIdx++] & 0xFF); // TODO Eventually check exportedTo to see if this is valid // For now, skip each 2 byte exports_to - attrIdx += 2 + exportsToCount; + attrIdx += 2 * exportsToCount; } + // opens, uses and provides tables are not relevant + return Optional.of(new Pair<>(moduleName, exportedPackages)); } } diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/ModuleLayerHelper.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/ModuleLayerHelper.java index 7f6b75109f..883d27f035 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/ModuleLayerHelper.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/ModuleLayerHelper.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2025 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategy.java b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategy.java index 9cc39f854e..da85895852 100644 --- a/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategy.java +++ b/javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategy.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/build.gradle.kts b/javaparser-symbol-solver-testing/build.gradle.kts new file mode 100644 index 0000000000..a0a6e0c108 --- /dev/null +++ b/javaparser-symbol-solver-testing/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + api(project(":jmlparser-symbol-solver-core")) + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testing.runtime) +} + +description = "io.github.jmltoolkit:jmlparser-symbol-solver-testing" diff --git a/javaparser-symbol-solver-testing/pom.xml b/javaparser-symbol-solver-testing/pom.xml index c35601aca7..cf41a57a60 100644 --- a/javaparser-symbol-solver-testing/pom.xml +++ b/javaparser-symbol-solver-testing/pom.xml @@ -4,7 +4,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 @@ -86,6 +86,10 @@ org.hamcrest hamcrest + + com.google.truth + truth + org.junit.jupiter junit-jupiter-engine diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/SlowTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/SlowTest.java index 8440f7a219..79d8946b7e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/SlowTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/SlowTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/ast/type/ClassOrInterfaceTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/ast/type/ClassOrInterfaceTypeTest.java index 60918d722e..47d40e7104 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/ast/type/ClassOrInterfaceTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/ast/type/ClassOrInterfaceTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/key/LogicalTypes.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/key/LogicalTypes.java index 154f2f5ec6..e196df9a90 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/key/LogicalTypes.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/key/LogicalTypes.java @@ -24,9 +24,9 @@ */ public class LogicalTypes { @Test - void resolveFree() { - CompilationUnit cu = StaticJavaParser.parse( - "public class A { public ghost \\free test; " + "public \\map abc() { return test;} }"); + void resolveMap() { + CompilationUnit cu = + StaticJavaParser.parse("public class A { public \\seq test; " + "public \\map abc() { return test;} }"); TypeSolver typeSolver = new TypeSolverBuilder() .withCurrentJRE() diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/AssociableToASTTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/AssociableToASTTest.java index 80289e3700..08d7b9a369 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/AssociableToASTTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/AssociableToASTTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -33,9 +33,10 @@ public interface AssociableToASTTest { /** * Helper method to cast the instance to the correct {@link Class}. * - * @param instance The instance to be casted. - * @param clazz The expected {@link Class}. - * @param The expected type. + * @param instance The instance to be casted. + * @param clazz The expected {@link Class}. + * @param The expected type. + * * @return The instance casted as the correct type. */ default T safeCast(AssociableToAST instance, Class clazz) { @@ -55,6 +56,7 @@ default T safeCast(AssociableToAST instance, Class getWrappedDeclaration(AssociableToAST associableToAST); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/HasAccessSpecifierTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/HasAccessSpecifierTest.java index fe7122c0c9..ac08bbc89b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/HasAccessSpecifierTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/HasAccessSpecifierTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclarationTest.java index f4e256d834..0b7ef7aff8 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclarationTest.java index da2811c346..603514cecd 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclarationTest.java index 6e871e3b3b..3a9c812d47 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclarationTest.java index a59a39f9ae..eec79e36ad 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedDeclarationTest.java index b9e63c4760..f91b34cfce 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclarationTest.java index 8f4d845c8f..6e91371553 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclarationTest.java index 0775afc23a..587ffa125a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclarationTest.java index 67a5f2c0ff..2e211819a1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclarationTest.java index 0c7c18e355..5682584cf6 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclarationTest.java index 9e54c55311..951e198b48 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclarationTest.java index b3aeb33836..d6a4278122 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclarationTest.java index b703c5ce15..9862a5c1e2 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclarationTest.java index 2fcb1a7ec9..31d6249f0b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclarationTest.java index c40ff19dc7..7fc98ff3cb 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizableTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizableTest.java index 881f8e71ac..7b394cc01b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizableTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizableTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclarationTest.java index d6509ebe1e..9b14041bcf 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclarationTest.java index bddf517c1a..4d2149d711 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/AbstractSymbolResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/AbstractSymbolResolutionTest.java index 803ae5ef42..659c377120 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/AbstractSymbolResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/AbstractSymbolResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -52,7 +52,6 @@ public static void tearDown() { /** * An initial attempt at allowing JDK-specific test cases. It is a work-in-progress, and subject to change. - * * @deprecated Note that use of TestJdk should be a last-resort, preferably implementing JDK-agnostic tests. */ @Deprecated @@ -119,9 +118,7 @@ public static TestJdk getCurrentHostJdk() { return JDK18; } - // weigl just return JDK18 return JDK18; - // throw new IllegalStateException("Unable to determine the current version of java running"); } /** diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/FindingAllFieldsTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/FindingAllFieldsTest.java index f839ef6a7a..210ca043d5 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/FindingAllFieldsTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/FindingAllFieldsTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue113Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue113Test.java index bda56c7953..3fa36d637d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue113Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue113Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue116Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue116Test.java index e4620b27c7..90420342a7 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue116Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue116Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue128Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue128Test.java index 04ce98ab30..7e70c1e7c3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue128Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue128Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1364Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1364Test.java index 0ac61e265c..0bdf85d9f9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1364Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1364Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1370Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1370Test.java index f35c9efb55..95c4782d6d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1370Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1370Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue144Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue144Test.java index 7fa02939ae..fecfe7e939 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue144Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue144Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1456Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1456Test.java index 6b278fdfaf..28cab56726 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1456Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1456Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1479Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1479Test.java index b22f8e9a4b..5e2b85b64a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1479Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1479Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1480Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1480Test.java index 795341cf81..d6b1f07d26 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1480Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1480Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1485Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1485Test.java index 426842fad1..f0a815d5fe 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1485Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1485Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1491Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1491Test.java index d2768e8b40..12343e2a9a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1491Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1491Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1511Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1511Test.java index 83a064e7b3..ae314bad54 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1511Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1511Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1518Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1518Test.java index 5d67f51336..9f93aaa46c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1518Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1518Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1526Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1526Test.java index 18bb1b6438..cdfbb8f21b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1526Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1526Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue156Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue156Test.java index 232c431646..462bffa154 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue156Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue156Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1574Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1574Test.java index 7cb246cb21..f1748efc5f 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1574Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1574Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1599Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1599Test.java index 724a544beb..a5d640876c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1599Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1599Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1668Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1668Test.java index 2b4459adb8..bc30d943f4 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1668Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1668Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1713Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1713Test.java index 3e9837a132..a8df43489b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1713Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1713Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1726Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1726Test.java index 31e2ae5733..7a8bda7320 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1726Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1726Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1757Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1757Test.java index 022c687335..ae24f910cb 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1757Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1757Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1769Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1769Test.java index b8a85b57e4..dc30daaab7 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1769Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1769Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1774Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1774Test.java index 522b8f98de..198c647a1a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1774Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1774Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1814Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1814Test.java index fbf97b10e0..383dbbbd7a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1814Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1814Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -21,11 +21,11 @@ package com.github.javaparser.symbolsolver; +import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC; import static org.junit.jupiter.api.Assertions.*; import com.github.javaparser.*; import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.ast.Modifier; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.stmt.BlockStmt; @@ -53,8 +53,8 @@ void setup() { final CompilationUnit compilationUnit = new CompilationUnit(); compilationUnit.setPackageDeclaration("java.lang"); // construct a fake java.lang.Object class with only one method (java.lang.Object#equals(java.lang.Object) - final ClassOrInterfaceDeclaration clazz = compilationUnit.addClass("Object", Modifier.DefaultKeyword.PUBLIC); - final MethodDeclaration equals = clazz.addMethod("equals", Modifier.DefaultKeyword.PUBLIC); + final ClassOrInterfaceDeclaration clazz = compilationUnit.addClass("Object", PUBLIC); + final MethodDeclaration equals = clazz.addMethod("equals", PUBLIC); equals.addParameter("Object", "obj"); final BlockStmt body = new BlockStmt(); body.addStatement("return this == obj;"); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1817Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1817Test.java index a791436024..397537e397 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1817Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1817Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1827Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1827Test.java index da59391497..658762e3b8 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1827Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1827Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue185Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue185Test.java index 1f3a5b49d3..2faec19fff 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue185Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue185Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1868Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1868Test.java index d7337e51be..79a707901a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1868Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1868Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue186Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue186Test.java index 811aca74a2..bba4308188 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue186Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue186Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue18Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue18Test.java index b486a03dd1..287ee1988b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue18Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue18Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1945Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1945Test.java index 2324eedaf6..3dc0064cad 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1945Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1945Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1946Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1946Test.java index ceae9483ae..3919a1985e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1946Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1946Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1950Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1950Test.java index 127fa77351..f23a2438f3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1950Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue1950Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue200Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue200Test.java index bf83ca409f..3508027568 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue200Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue200Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2035Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2035Test.java index 834b97a508..190fc82070 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2035Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2035Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2044Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2044Test.java index 3d6e346e5b..439c65e06c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2044Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2044Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2062Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2062Test.java index 1d73937648..941f11e71e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2062Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2062Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2065Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2065Test.java index b353ec74b3..f82ba5fed7 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2065Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2065Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2083Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2083Test.java index 598f732458..d95a42554e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2083Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2083Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2132Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2132Test.java index b4fead47a3..9ec916afa5 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2132Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2132Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2162Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2162Test.java index 9fb9935a49..590a2eccc4 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2162Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2162Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2210Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2210Test.java index 340b49b247..c81583cf1a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2210Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2210Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2236Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2236Test.java index 0f5b073f70..62516bc3b7 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2236Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2236Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2259Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2259Test.java index f50cdb9743..b6a147d2b9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2259Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2259Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2284Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2284Test.java index 8d1112f8ae..ad6fe4159e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2284Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2284Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2289Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2289Test.java index 8d26f34211..df18f40e38 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2289Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2289Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue228Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue228Test.java index 5e2183fb4d..1ae99fe7b9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue228Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue228Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue232Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue232Test.java index 3e78a24227..62ac11f4be 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue232Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue232Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue235Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue235Test.java index 65c7c7f9ea..c8e9a0a717 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue235Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue235Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2360.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2360.java index 423813c39f..a72bfc531c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2360.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2360.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2362Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2362Test.java index 66d31943fb..24c48b605b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2362Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2362Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2367Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2367Test.java index 382289244b..1d69397d89 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2367Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2367Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2397Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2397Test.java index 01ede43d2c..7fc1dbdaac 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2397Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2397Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2406Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2406Test.java index 3959716211..875d25f0fc 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2406Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2406Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue241Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue241Test.java index 09ef67acd1..8229006778 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue241Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue241Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2477Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2477Test.java index d726e4d5f0..d71b762751 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2477Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2477Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2481Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2481Test.java index fd69c345b4..5d0ee48a58 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2481Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2481Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2489Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2489Test.java index b0f946819f..93302301a3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2489Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2489Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue251Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue251Test.java index 00e7341d7e..927414e7b8 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue251Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue251Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2595Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2595Test.java index 6357ad43b5..aad1fd8f1c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2595Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2595Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2602Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2602Test.java index 2f3b63b6df..7f1ac67ac9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2602Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2602Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2738Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2738Test.java index 19e9bdfb9b..4e2fcae084 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2738Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2738Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2740Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2740Test.java index bb3a864ec8..ba6594067b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2740Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2740Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2764Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2764Test.java index 1606b3d4f7..452c1b6294 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2764Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2764Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue276Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue276Test.java index d9e0df8525..e2c381a6b1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue276Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue276Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2781Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2781Test.java index 48f01b58d5..c70f89910d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2781Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2781Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2823Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2823Test.java index a78bc5724a..5ba0cad137 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2823Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2823Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2878Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2878Test.java index 7e3e2242f1..02c5896c71 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2878Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2878Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2909Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2909Test.java index 19e7b09ae1..5422a75c7d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2909Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2909Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2943Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2943Test.java index 03c320deb2..b046046670 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2943Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2943Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2951Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2951Test.java index aa6fb21277..b91c4981de 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2951Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2951Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2953Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2953Test.java index dc6bade46a..c388793f6f 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2953Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2953Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2987Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2987Test.java index 53cc26f252..908db4f5fc 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2987Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2987Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2995Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2995Test.java index 839c4663f8..790ef8fc33 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2995Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue2995Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue300Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue300Test.java index d8326d081a..347cf167e0 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue300Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue300Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3024Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3024Test.java index 156318a9ad..a3339871f4 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3024Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3024Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3028Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3028Test.java index f32dab0cb2..9fed25d639 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3028Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3028Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3030Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3030Test.java index 9cd49c075a..07fda7c3a0 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3030Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3030Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3038Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3038Test.java index 42a75a8535..e278fb0ec4 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3038Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3038Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3045Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3045Test.java index 34d8242635..d04aa7e45e 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3045Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3045Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3083Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3083Test.java index c8da082914..b5e703bb51 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3083Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3083Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3087Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3087Test.java index 3cc8a56e56..e7df5e92d5 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3087Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3087Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3099Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3099Test.java index a96630c969..03b82e772c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3099Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3099Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3100Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3100Test.java index 5a6fdd4d66..9c74d7c447 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3100Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3100Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3112Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3112Test.java index 98c925eb93..3fee6ccbc1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3112Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3112Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3136Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3136Test.java index 1f436bac42..433684e617 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3136Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3136Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue314Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue314Test.java index 18cceb36df..e19d7f7302 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue314Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue314Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3159Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3159Test.java index 4c213f1814..27197730d0 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3159Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3159Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3173Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3173Test.java index 4d68678210..f6122b3f0f 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3173Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3173Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3184Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3184Test.java index 824eabad05..8007fa21e9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3184Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3184Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3200Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3200Test.java index 413a71a0c6..77d82cadbb 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3200Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3200Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3272Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3272Test.java index b0f98b9b49..c8f1118cb3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3272Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3272Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3277Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3277Test.java index 4a125959ae..6bbcc7dd5c 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3277Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3277Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3278Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3278Test.java index 6dcc3a7741..0b146cd7e9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3278Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3278Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3308Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3308Test.java index be782ecada..df86bce09d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3308Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3308Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue343Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue343Test.java index 43b7980439..8b746c31ce 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue343Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue343Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue347Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue347Test.java index f351de0647..9f7b270cc1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue347Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue347Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3614Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3614Test.java index a7b484eea1..0fbfa5f15b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3614Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3614Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue366Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue366Test.java index cbc42b2aa9..7010f68bcc 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue366Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue366Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3710Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3710Test.java index 520dbc4738..df0207fd0a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3710Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3710Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import com.github.javaparser.JavaParser; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3859Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3859Test.java index 8544ef2182..a15a8ab56a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3859Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3859Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3866Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3866Test.java index 0ad32df842..f27abf06aa 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3866Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3866Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3878Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3878Test.java index 53e2d1130a..173acbc195 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3878Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3878Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3916Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3916Test.java index 801a7646f0..765c8bd33b 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3916Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3916Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3918Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3918Test.java index d6b2b21633..9745d8dd69 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3918Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3918Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3951Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3951Test.java index 467778f0c4..10f23b0e42 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3951Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3951Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3972Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3972Test.java index 0ae2c27288..7dc6b319e3 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3972Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3972Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3976Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3976Test.java index 7fab2a56bb..9a86db1a77 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3976Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue3976Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4037Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4037Test.java index 0e51c986da..55c07f44b7 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4037Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4037Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4047Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4047Test.java index aad9503734..a64669bf38 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4047Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4047Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4124Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4124Test.java index 2b669173a8..cd4e669752 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4124Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4124Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4188Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4188Test.java index f79b0ba8d6..9709a84742 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4188Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4188Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4284Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4284Test.java index ec4d115779..c248ab7ce1 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4284Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4284Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4358Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4358Test.java index d3ef5c2006..12877e0489 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4358Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4358Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4427Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4427Test.java index ba581a91f1..99ff8c2ffe 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4427Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4427Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4450Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4450Test.java index a1847c4348..393a66db1d 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4450Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4450Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4503Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4503Test.java index 886fbf73fc..84f21a92a1 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4503Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4503Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4560Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4560Test.java index f3556bd5af..2975364d4c 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4560Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4560Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4568Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4568Test.java index 1874c60852..7673f3b84c 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4568Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4568Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4668Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4668Test.java index 0e5559424b..7832985091 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4668Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4668Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4710Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4710Test.java index 303906f212..17bb741927 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4710Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4710Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4722Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4722Test.java index 797b612640..ba24d6bfd1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4722Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4722Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4723Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4723Test.java index fc90f3b67c..42aa791e01 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4723Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4723Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4832Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4832Test.java index 22f84d99ee..ade527ea92 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4832Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4832Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4846Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4846Test.java index 9cdbc84bf0..ee8aaf2a34 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4846Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4846Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.*; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4864Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4864Test.java index 46452bfafa..8a8c68014c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4864Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue4864Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2013-2023 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue546Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue546Test.java index 8b5e7903ad..00cafbf3d3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue546Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue546Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue84Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue84Test.java index 4c6550747b..4843d6199c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue84Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/Issue84Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaParserAPIIntegrationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaParserAPIIntegrationTest.java index 2a73a9c314..cc946569c7 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaParserAPIIntegrationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaParserAPIIntegrationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaSymbolSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaSymbolSolverTest.java index c01ed30730..15122f0925 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaSymbolSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/JavaSymbolSolverTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/PullRequest2398Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/PullRequest2398Test.java index 91f0ef3c8c..3eb8ea6d89 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/PullRequest2398Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/PullRequest2398Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/ResolutionOfOverloadedMethodsWithTypeVariablesInvolvedTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/ResolutionOfOverloadedMethodsWithTypeVariablesInvolvedTest.java index 52bc892346..bb9858e0ad 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/ResolutionOfOverloadedMethodsWithTypeVariablesInvolvedTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/ResolutionOfOverloadedMethodsWithTypeVariablesInvolvedTest.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/SolveMethodDeclaredInEnumTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/SolveMethodDeclaredInEnumTest.java index 5d3b095c4f..4bcaceb28e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/SolveMethodDeclaredInEnumTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/SolveMethodDeclaredInEnumTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/GuavaCacheAdapterTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/GuavaCacheAdapterTest.java index bfa0030b18..754c89cc69 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/GuavaCacheAdapterTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/GuavaCacheAdapterTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/InMemoryCacheTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/InMemoryCacheTest.java index ed9497d0d6..a9cefa255d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/InMemoryCacheTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/InMemoryCacheTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/NoCacheTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/NoCacheTest.java index 5c87534398..980a359384 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/NoCacheTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/cache/NoCacheTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapabilityTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapabilityTest.java index aa0953417f..722d4ff820 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapabilityTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/MethodUsageResolutionCapabilityTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapabilityTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapabilityTest.java index ccae608459..0d43e19b57 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapabilityTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/core/resolution/TypeVariableResolutionCapabilityTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/ConvertToUsageTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/ConvertToUsageTest.java index e099437d25..c33a0fe769 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/ConvertToUsageTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/ConvertToUsageTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/DifferentiateDotExpressionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/DifferentiateDotExpressionTest.java index 9217aeac1e..24414480c3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/DifferentiateDotExpressionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/DifferentiateDotExpressionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacadeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacadeTest.java index d74b68311b..85d3f3f9df 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacadeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacadeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContextTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContextTest.java index 95497951d9..a8b2590452 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContextTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContextTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContextTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContextTest.java index ee9c53f8c7..763af24c13 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContextTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/IfStatementContextTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2025 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapterTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapterTest.java index 173810d667..dd8291189b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapterTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MultiCatchMethodCallExprTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MultiCatchMethodCallExprTest.java index b5bd9826d7..0060c2640a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MultiCatchMethodCallExprTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MultiCatchMethodCallExprTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchStatementContextTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchStatementContextTest.java index 6fdf4912bb..f48fa639ae 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchStatementContextTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchStatementContextTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2025 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclarationTest.java index d502a89f0c..d7363ea8aa 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclarationTest.java index 53c7bb4e6b..bb15f5aaf8 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclarationTest.java index 9d76edcfab..515fe7bfed 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -22,8 +22,6 @@ package com.github.javaparser.symbolsolver.javaparsermodel.declarations; import static com.github.javaparser.StaticJavaParser.parse; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.jupiter.api.Assertions.*; import com.github.javaparser.JavaParserAdapter; @@ -53,6 +51,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.common.truth.Truth; import java.io.IOException; import java.nio.file.Path; import java.util.*; @@ -1109,11 +1108,8 @@ void testGetAllMethods() { if (TestJdk.getCurrentHostJdk().getMajorVersion() >= 14) { expected.remove("java.lang.Object.registerNatives()"); } - // weigl: relax new JDKs - assertTrue(expected.size() == signatures.size() || expected.size() + 1 == signatures.size()); - - signatures.remove("java.lang.Object.wait0(long)"); - assertThat(signatures, containsInAnyOrder(expected.toArray())); + // assertEquals(expected.size(), signatures.size()); + Truth.assertThat(signatures).containsAtLeastElementsIn(expected); } /// diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclarationTest.java index bdef5ff17d..ac0a37c0c5 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -21,8 +21,6 @@ package com.github.javaparser.symbolsolver.javaparsermodel.declarations; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.jupiter.api.Assertions.*; import com.github.javaparser.*; @@ -50,6 +48,7 @@ import com.github.javaparser.symbolsolver.utils.LeanParserConfiguration; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; @@ -992,8 +991,8 @@ void testGetAllMethods() { if (TestJdk.getCurrentHostJdk().getMajorVersion() >= 14) { expected.remove("java.lang.Object.registerNatives()"); } - signatures.remove("java.lang.Object.wait0(long)"); - assertThat(signatures, containsInAnyOrder(expected.toArray())); + + Truth.assertThat(signatures).containsAtLeastElementsIn(expected); } /// diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclarationTest.java index c5d88ef961..2ec34179a9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclarationTest.java index 201be70df4..f08b5d973d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -21,8 +21,6 @@ package com.github.javaparser.symbolsolver.javaparsermodel.declarations; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -51,6 +49,7 @@ import com.github.javaparser.symbolsolver.utils.LeanParserConfiguration; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; @@ -1041,9 +1040,8 @@ void testGetAllMethods() { if (TestJdk.getCurrentHostJdk().getMajorVersion() >= 14) { expected.remove("java.lang.Object.registerNatives()"); } - signatures.remove("java.lang.Object.wait0(long)"); - assertThat(signatures, containsInAnyOrder(expected.toArray())); + Truth.assertThat(signatures).containsAtLeastElementsIn(expected.toArray()); } /// diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclarationTest.java index aa231e30a5..88d1574b18 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclarationTest.java index 6d2fcc07ae..c2deb4e7db 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclarationTest.java index 6db04b6130..b201e29461 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserRecordDeclarationTest.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver.javaparsermodel.declarations; import static org.junit.jupiter.api.Assertions.*; @@ -13,7 +33,6 @@ import com.github.javaparser.ast.expr.MethodCallExpr; import com.github.javaparser.ast.expr.ObjectCreationExpr; import com.github.javaparser.resolution.Navigator; -import com.github.javaparser.resolution.UnsolvedSymbolException; import com.github.javaparser.resolution.declarations.*; import com.github.javaparser.resolution.model.SymbolReference; import com.github.javaparser.resolution.types.ResolvedReferenceType; @@ -27,7 +46,6 @@ import java.util.stream.Collectors; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledForJreRange; public class JavaParserRecordDeclarationTest { @@ -228,24 +246,7 @@ void testGetQualifiedName() { /// @Test - @EnabledForJreRange(max = org.junit.jupiter.api.condition.JRE.JAVA_13) - void getGetAncestors_javaLangRecord_notAvailable() { - ParseResult x = javaParser.parse(basicRecordWithImplements); - CompilationUnit compilationUnit = x.getResult().get(); - - RecordDeclaration recordDeclaration = - compilationUnit.findFirst(RecordDeclaration.class).get(); - ResolvedReferenceTypeDeclaration resolvedReferenceTypeDeclaration = recordDeclaration.resolve(); - - /* - * `java.lang.Record` will have been introduced from JRE14 preview / JRE16 release - * -- thus the `java.lang.Record` ancestor will not be available via classloader/reflection before these versions - */ - assertThrows(UnsolvedSymbolException.class, () -> resolvedReferenceTypeDeclaration.getAncestors()); - } - - @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void getGetAncestors_javaLangRecord_available() { ParseResult x = javaParser.parse(basicRecordWithImplements); CompilationUnit compilationUnit = x.getResult().get(); @@ -261,7 +262,7 @@ void getGetAncestors_javaLangRecord_available() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testGetDeclaredFields() { ParseResult x = javaParser.parse("record Test(String s, Integer i) {}"); CompilationUnit compilationUnit = x.getResult().get(); @@ -279,7 +280,7 @@ void testGetDeclaredFields() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testGetDeclaredMethods() { ParseResult x = javaParser.parse("record Test(String s, Integer i) {\n" + " public int foo(int x) {\n" @@ -316,7 +317,7 @@ void testGetDeclaredMethods() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testGetSuperclass() { ParseResult cu = javaParser.parse("record Foo(String s) {}"); @@ -331,7 +332,7 @@ void testGetSuperclass() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testImplicitGetterResolution() { ParseResult cu = javaParser.parse("package test;\n" + "record Test(String s) {\n" @@ -361,7 +362,7 @@ void testImplicitGetterResolution() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testImplicitGetterSolvingFromDecl() { ParseResult cu = javaParser.parse("package test;\n" + "record Test(String s) { }"); @@ -392,7 +393,7 @@ void testImplicitGetterSolvingFromDecl() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testImplicitConstructor() { ParseResult cu = javaParser.parse("package test;\nrecord Test(String s) { }"); @@ -414,7 +415,7 @@ void testImplicitConstructor() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testNonCanonicalConstructor() { ParseResult cu = javaParser.parse("package test;\n" + "record Test(String s) {\n" @@ -453,7 +454,7 @@ void testNonCanonicalConstructor() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testInheritedMethods() { ParseResult cu = javaParser.parse("package test;\n" + "interface Foo {\n" + " default void foo() {}\n" @@ -476,7 +477,7 @@ void testInheritedMethods() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testGetAllStaticFields() { ParseResult cu = javaParser.parse( "package test;\n" + "record Test(String s) {\n" + " static Integer value = 2;" + "}"); @@ -496,7 +497,7 @@ void testGetAllStaticFields() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void testGetAllNonStaticFields() { ParseResult cu = javaParser.parse( "package test;\n" + "record Test(String s) {\n" + " static Integer value = 2;" + "}"); @@ -516,7 +517,7 @@ void testGetAllNonStaticFields() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) public void testStaticMethod() { ParserConfiguration.LanguageLevel oldLevel = StaticJavaParser.getParserConfiguration().getLanguageLevel(); @@ -549,13 +550,16 @@ public void testStaticMethod() { } } + @Test void testGenericInvocation() { - ParseResult cu = javaParser.parse("record GenericBox (T value) {}\n" + "class Test {\n" - + " public static void main(String[] args) {\n" - + " GenericBox box = new GenericBox<>(2);\n" - + " System.out.println(box.value());\n" - + " }\n" - + "}"); + ParseResult cu = javaParser.parse(""" + record GenericBox (T value) {} + class Test { + public static void main(String[] args) { + GenericBox box = new GenericBox<>(2); + System.out.println(box.value()); + } + }"""); MethodCallExpr valueCall = cu.getResult().get().findAll(MethodCallExpr.class).stream() .filter(call -> call.getNameAsString().equals("value")) @@ -569,15 +573,16 @@ void testGenericInvocation() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_14) void genericConstructorTest() { - ParseResult cu = javaParser.parse("record GenericBox(T value) {}\n" - + "class Test {\n" - + " public static void main(String[] args) {\n" - + " GenericBox box = new GenericBox<>(2);\n" - + " System.out.println(box.value());\n" - + " }\n" - + "}"); + ParseResult cu = javaParser.parse(""" + record GenericBox(T value) {} + class Test { + public static void main(String[] args) { + GenericBox box = new GenericBox<>(2); + System.out.println(box.value()); + } + }"""); ObjectCreationExpr constructorInvocation = cu.getResult().get().findFirst(ObjectCreationExpr.class).get(); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclarationTest.java index 18cf288bbb..af5f7b7e0d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclarationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameterTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameterTest.java index 48fc1bd2a6..21789d48d3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameterTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameterTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclarationTest.java index 4667be5779..ff12b58ca7 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypePatternDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclarationTest.java index 22bc0efb4f..010065382b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclarationTest.java index f5854430a4..02a0aea644 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserVariableDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/Issue257Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/Issue257Test.java index 91a9d7407f..5e76911c19 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/Issue257Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/Issue257Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclarationTest.java index c6d75e901c..1b77f2012e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclarationTest.java index 86cd67424a..07255a386c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistAnnotationMemberDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclarationTest.java index 43de8fa4d0..222b8de238 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclarationTest.java index 4a1bcf5eb1..83c475ba11 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclarationTest.java index 1c4d0dea28..0ed19af83c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumConstantDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclarationTest.java index dbfcd2895f..ab31b925d0 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclarationTest.java index 021da4c586..7b55854fa1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclarationTest.java index 65e4c2f50a..13e66d4902 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclarationTest.java index 11c5258b8f..af427da531 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistModuleTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistModuleTest.java index 3a59771680..8e6cb5d159 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistModuleTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistModuleTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2025 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclarationTest.java index eecfe83bee..089029530b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclarationTest.java index a922855c1d..10cf669431 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistRecordDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -332,7 +332,7 @@ void testNonCanonicalConstructor() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void genericConstructorTest() { ParserConfiguration configuration = new ParserConfiguration() .setSymbolResolver(new JavaSymbolSolver(new CombinedTypeSolver(new ReflectionTypeSolver(), typeSolver))) diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapterTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapterTest.java index 906f28e929..8e4215dfd2 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapterTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapterTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameterDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameterDeclarationTest.java index 2355f4fe44..d30127ac34 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameterDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameterDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclarationTest.java index 03478d037b..0c85e3d6bd 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractClassDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclarationTest.java index 30bf53294b..4bcecc57db 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -38,6 +38,7 @@ public abstract class AbstractTypeDeclarationTest extends AbstractSymbolResoluti * Should say if an {@link AbstractTypeDeclaration} is functional interface. * * @param typeDeclaration The type declaration to check. + * * @return {@code True} */ public abstract boolean isFunctionalInterface(AbstractTypeDeclaration typeDeclaration); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/FunctionInterfaceLogicTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/FunctionInterfaceLogicTest.java index b1d5e8a5a0..e40b27a9d9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/FunctionInterfaceLogicTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/FunctionInterfaceLogicTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/InferenceContextTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/InferenceContextTest.java index 83ebf1562e..1747ec7909 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/InferenceContextTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/InferenceContextTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/MethodResolutionCapabilityTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/MethodResolutionCapabilityTest.java index 474c02cd1c..f60d0cf517 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/MethodResolutionCapabilityTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/logic/MethodResolutionCapabilityTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/resolution/SymbolReferenceTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/resolution/SymbolReferenceTest.java index 3b45819bd4..756364397c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/resolution/SymbolReferenceTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/resolution/SymbolReferenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ArrayTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ArrayTypeTest.java index 68f210d320..69f9406a4c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ArrayTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ArrayTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/LazyTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/LazyTypeTest.java index 67631e9963..cde589d4a1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/LazyTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/LazyTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/NullTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/NullTypeTest.java index d4b254c980..df3be96c98 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/NullTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/NullTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveTypeTest.java index dfb030baf7..d9cba64a97 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeTest.java index 49b609bb17..1fe43eef42 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -648,8 +648,7 @@ void testGetAllAncestorsOnRawType() { Map ancestors = new HashMap<>(); rawArrayList.getAllAncestors().forEach(a -> ancestors.put(a.getQualifiedName(), a)); - // weigl: disable test, in new JDKs the number is 10 (SequencedCollection was added) - // assertEquals(9, ancestors.size()); + assertEquals(10, ancestors.size()); ResolvedTypeVariable tv = new ResolvedTypeVariable(arraylist.getTypeParameters().get(0)); @@ -685,6 +684,9 @@ void testGetAllAncestorsOnRawType() { assertEquals( new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(Serializable.class, typeResolver)), ancestors.get("java.io.Serializable")); + assertEquals( + new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(SequencedCollection.class, typeResolver)), + ancestors.get("java.util.SequencedCollection")); } @Test @@ -696,8 +698,7 @@ void testGetAllAncestorsOnTypeWithSpecifiedTypeParametersForInterface() { Map ancestors = new HashMap<>(); listOfString.getAllAncestors().forEach(a -> ancestors.put(a.getQualifiedName(), a)); - // weigl: disable new JDKs are different - // assertEquals(2, ancestors.size()); + assertEquals(3, ancestors.size()); assertEquals( new ReferenceTypeImpl( @@ -707,6 +708,11 @@ void testGetAllAncestorsOnTypeWithSpecifiedTypeParametersForInterface() { new ReferenceTypeImpl( new ReflectionInterfaceDeclaration(Iterable.class, typeResolver), ImmutableList.of(string)), ancestors.get("java.lang.Iterable")); + assertEquals( + new ReferenceTypeImpl( + new ReflectionInterfaceDeclaration(SequencedCollection.class, typeResolver), + ImmutableList.of(string)), + ancestors.get("java.util.SequencedCollection")); } @Test @@ -744,8 +750,6 @@ void testGetAllAncestorsOnTypeWithSpecifiedTypeParametersForClassAbstractList() Map ancestors = new HashMap<>(); abstractListOfString.getAllAncestors().forEach(a -> ancestors.put(a.getQualifiedName(), a)); - // weigl: disable new JDKs are different - // assertEquals(5, ancestors.size()); assertEquals( new ReferenceTypeImpl( @@ -767,6 +771,13 @@ void testGetAllAncestorsOnTypeWithSpecifiedTypeParametersForClassAbstractList() new ReferenceTypeImpl( new ReflectionInterfaceDeclaration(Iterable.class, typeResolver), ImmutableList.of(string)), ancestors.get("java.lang.Iterable")); + assertEquals( + new ReferenceTypeImpl( + new ReflectionInterfaceDeclaration(SequencedCollection.class, typeResolver), + ImmutableList.of(string)), + ancestors.get("java.util.SequencedCollection")); + + assertEquals(6, ancestors.size()); } @Test @@ -778,9 +789,13 @@ void testGetAllAncestorsOnTypeWithSpecifiedTypeParametersForClassArrayList() { Map ancestors = new HashMap<>(); arrayListOfString.getAllAncestors().forEach(a -> ancestors.put(a.getQualifiedName(), a)); - // weigl: disable new JDKs are different - // assertEquals(9, ancestors.size()); + assertEquals(10, ancestors.size()); + assertEquals( + new ReferenceTypeImpl( + new ReflectionInterfaceDeclaration(SequencedCollection.class, typeResolver), + ImmutableList.of(string)), + ancestors.get("java.util.SequencedCollection")); assertEquals( new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(RandomAccess.class, typeResolver)), ancestors.get("java.util.RandomAccess")); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/TypeVariableUsageTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/TypeVariableUsageTest.java index efdc5aef68..b8bbf7e4fd 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/TypeVariableUsageTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/TypeVariableUsageTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/VoidTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/VoidTypeTest.java index 8c3526759c..4975f79fbe 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/VoidTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/VoidTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/WildcardUsageTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/WildcardUsageTest.java index 4c753ad8a0..c05339ff9f 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/WildcardUsageTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/model/typesystem/WildcardUsageTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclarationTest.java index 64511ca9b9..821e6ab807 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionAnnotationDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclarationTest.java index cbc67e2463..b2fc1a4131 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -22,8 +22,6 @@ package com.github.javaparser.symbolsolver.reflectionmodel; import static java.util.Comparator.comparing; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.*; import com.github.javaparser.ast.AccessSpecifier; @@ -37,6 +35,7 @@ import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; import java.io.Serializable; import java.util.*; import java.util.stream.Collectors; @@ -314,17 +313,18 @@ void testGetAllInterfaces() { TypeSolver typeResolver = new ReflectionTypeSolver(); ResolvedClassDeclaration arraylist = new ReflectionClassDeclaration(ArrayList.class, typeResolver); // Serializable, Cloneable, Iterable, Collection, List, RandomAccess - assertThat( - ImmutableSet.of( + var actual = arraylist.getAllInterfaces().stream() + .map(ResolvedReferenceType::getQualifiedName) + .collect(Collectors.toSet()); + Truth.assertThat(actual) + .containsExactly( Serializable.class.getCanonicalName(), + SequencedCollection.class.getCanonicalName(), Cloneable.class.getCanonicalName(), List.class.getCanonicalName(), RandomAccess.class.getCanonicalName(), Collection.class.getCanonicalName(), - Iterable.class.getCanonicalName()), - everyItem(in(arraylist.getAllInterfaces().stream() - .map(i -> i.getQualifiedName()) - .collect(Collectors.toSet())))); + Iterable.class.getCanonicalName()); } @Test @@ -431,14 +431,17 @@ void testAllAncestorsWithDepthFirstTraversalOrder() { ResolvedClassDeclaration arraylist = new ReflectionClassDeclaration(ArrayList.class, typeResolver); Map ancestors = new HashMap<>(); arraylist.getAllAncestors().forEach(a -> ancestors.put(a.getQualifiedName(), a)); - // weigl: disable for later JDKs - // assertEquals(9, ancestors.size()); + assertEquals(10, ancestors.size()); ResolvedTypeVariable typeVariable = new ResolvedTypeVariable(arraylist.getTypeParameters().get(0)); assertEquals( new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(RandomAccess.class, typeResolver)), ancestors.get("java.util.RandomAccess")); + assertEquals( + new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(SequencedCollection.class, typeResolver)), + ancestors.get("java.util.SequencedCollection")); + assertEquals( new ReferenceTypeImpl( new ReflectionClassDeclaration(AbstractCollection.class, typeResolver), @@ -595,12 +598,12 @@ void testGetInterfacesWithParameters() { ResolvedReferenceType interfaze; interfaze = constructorDeclaration.getInterfaces().get(0); - assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", interfaze.getQualifiedName()); + assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt", interfaze.getQualifiedName()); assertEquals( "com.github.javaparser.ast.body.ConstructorDeclaration", interfaze .typeParametersMap() - .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.N") + .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt.N") .get() .asReferenceType() .getQualifiedName()); @@ -731,18 +734,18 @@ void testGetAllInterfacesWithParametersWithDepthFirstTraversalOrder() { ReflectionClassDeclaration constructorDeclaration = (ReflectionClassDeclaration) typeResolver.solveType("com.github.javaparser.ast.body.ConstructorDeclaration"); List interfaces = constructorDeclaration.getAllInterfaces(); - assertEquals(34, interfaces.size()); + assertEquals(35, interfaces.size()); ResolvedReferenceType interfaze; int i = 0; interfaze = constructorDeclaration.getAllInterfaces().get(i++); - assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", interfaze.getQualifiedName()); + assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt", interfaze.getQualifiedName()); assertEquals( "com.github.javaparser.ast.body.ConstructorDeclaration", interfaze .typeParametersMap() - .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.N") + .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt.N") .get() .asReferenceType() .getQualifiedName()); @@ -1107,17 +1110,17 @@ void testGetAncestorsWithTypeParameters() { .asReferenceType() .getQualifiedName()); - ancestor = ancestors.get(1); - assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", ancestor.getQualifiedName()); + ancestor = ancestors.get(2); + assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt", ancestor.getQualifiedName()); assertEquals( "com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap() - .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.N") + .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt.N") .get() .asReferenceType() .getQualifiedName()); - ancestor = ancestors.get(2); + ancestor = ancestors.get(1); assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithJavadoc", ancestor.getQualifiedName()); assertEquals( "com.github.javaparser.ast.body.ConstructorDeclaration", @@ -1242,21 +1245,21 @@ void testGetAllAncestorsWithTypeParametersWithDepthFirstTraversalOrder() { .getQualifiedName()); ancestor = ancestors.remove(0); - assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations", ancestor.getQualifiedName()); + assertEquals("com.github.javaparser.ast.jml.NodeWithContracts", ancestor.getQualifiedName()); assertEquals( "com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap() - .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations.N") + .getValueBySignature("com.github.javaparser.ast.jml.NodeWithContracts.N") .get() .asReferenceType() .getQualifiedName()); ancestor = ancestors.remove(0); - assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", ancestor.getQualifiedName()); + assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations", ancestor.getQualifiedName()); assertEquals( "com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap() - .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.N") + .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations.N") .get() .asReferenceType() .getQualifiedName()); @@ -1294,6 +1297,16 @@ void testGetAllAncestorsWithTypeParametersWithDepthFirstTraversalOrder() { .asReferenceType() .getQualifiedName()); + ancestor = ancestors.remove(0); + assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt", ancestor.getQualifiedName()); + assertEquals( + "com.github.javaparser.ast.body.ConstructorDeclaration", + ancestor.typeParametersMap() + .getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithOptionalBlockStmt.N") + .get() + .asReferenceType() + .getQualifiedName()); + ancestor = ancestors.remove(0); assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithParameters", ancestor.getQualifiedName()); assertEquals( diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclarationTest.java index 0fe3ea2d87..2631bfd4bf 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclarationTest.java index 7386350c8b..a5ca183a5d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -32,7 +32,7 @@ class ReflectionFieldDeclarationTest extends AbstractSymbolResolutionTest { - private final TypeSolver typeSolver = new ReflectionTypeSolver(false); + private TypeSolver typeSolver = new ReflectionTypeSolver(false); @Test void verifyIsVolatileVariableDeclaration() { diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclarationTest.java index aa6461ab4f..8bd3ccdb10 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -79,8 +79,7 @@ void testAllAncestors() { ResolvedInterfaceDeclaration list = new ReflectionInterfaceDeclaration(List.class, typeResolver); Map ancestors = new HashMap<>(); list.getAllAncestors().forEach(a -> ancestors.put(a.getQualifiedName(), a)); - // weigl: disable due to new JDK versions - // assertEquals(2, ancestors.size()); + assertEquals(3, ancestors.size()); // Since List is an interface, Object cannot be an ancestor of List ResolvedTypeVariable typeVariable = @@ -95,6 +94,11 @@ void testAllAncestors() { new ReflectionInterfaceDeclaration(Iterable.class, typeResolver), ImmutableList.of(typeVariable)), ancestors.get("java.lang.Iterable")); + assertEquals( + new ReferenceTypeImpl( + new ReflectionInterfaceDeclaration(SequencedCollection.class, typeResolver), + ImmutableList.of(typeVariable)), + ancestors.get("java.util.SequencedCollection")); } @Test @@ -102,7 +106,6 @@ void testAllAncestorsForAnInterfaceWithBreadthFirstFunc() { TypeSolver typeResolver = new ReflectionTypeSolver(); ResolvedInterfaceDeclaration list = new ReflectionInterfaceDeclaration(List.class, typeResolver); List ancestors = list.getAllAncestors(ResolvedReferenceTypeDeclaration.breadthFirstFunc); - assertEquals(3, ancestors.size()); ResolvedTypeVariable typeVariable = diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclarationTest.java index eaa6ff8baa..759c58e39f 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclarationTest.java index 19f3e2132d..119766a768 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclarationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclarationTest.java index 5f758aa4b8..94f550b546 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclarationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionRecordDeclarationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -78,56 +78,56 @@ private byte[] loadClassData(String name) throws ClassNotFoundException { * The test classes were compiled with Java 17, so attempting to load them with any lower version will crash */ @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testIsClass() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertFalse(compilationUnit.isClass()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testIsInterface() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertFalse(compilationUnit.isInterface()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testIsEnum() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertFalse(compilationUnit.isEnum()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testIsRecord() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertTrue(compilationUnit.isRecord()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testIsTypeVariable() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertFalse(compilationUnit.isTypeParameter()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testIsType() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertTrue(compilationUnit.isType()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testAsType() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals(compilationUnit, compilationUnit.asType()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testAsClass() { assertThrows(UnsupportedOperationException.class, () -> { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); @@ -136,7 +136,7 @@ void testAsClass() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testAsInterface() { assertThrows(UnsupportedOperationException.class, () -> { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); @@ -145,7 +145,7 @@ void testAsInterface() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testAsEnum() { assertThrows(UnsupportedOperationException.class, () -> { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); @@ -154,35 +154,35 @@ void testAsEnum() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testAsRecord() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals(compilationUnit, compilationUnit.asRecord()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetPackageName() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals("box", compilationUnit.getPackageName()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetClassName() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals("Box", compilationUnit.getClassName()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetQualifiedName() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals("box.Box", compilationUnit.getQualifiedName()); } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetGenericTypeField() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); List declarationList = compilationUnit.getAllFields(); @@ -199,7 +199,7 @@ void testGetGenericTypeField() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetDeclaredMethods() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); Set methodsSet = compilationUnit.getDeclaredMethods(); @@ -230,7 +230,7 @@ void testGetDeclaredMethods() { /// @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetSuperclass() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals( @@ -242,7 +242,7 @@ void testGetSuperclass() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetAllSuperclasses() { ReflectionRecordDeclaration cu = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals( @@ -253,7 +253,7 @@ void testGetAllSuperclasses() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetAllAncestorsWithDepthFirstTraversalOrder() { ReflectionRecordDeclaration cu = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals( @@ -264,7 +264,7 @@ void testGetAllAncestorsWithDepthFirstTraversalOrder() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetInterfaces() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals( @@ -275,7 +275,7 @@ void testGetInterfaces() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetAllInterfaces() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); assertEquals( @@ -286,7 +286,7 @@ void testGetAllInterfaces() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetImplicitConstructor() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); @@ -303,7 +303,7 @@ void testGetImplicitConstructor() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testGetExplicitConstructors() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.BoxWithAllConstructors"); @@ -334,7 +334,7 @@ void testGetExplicitConstructors() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testNonCanonicalConstructor() { ReflectionRecordDeclaration compilationUnit = (ReflectionRecordDeclaration) typeSolver.solveType("box.BoxWithNonCanonicalConstructor"); @@ -369,7 +369,7 @@ void testNonCanonicalConstructor() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void genericConstructorTest() { ParserConfiguration configuration = new ParserConfiguration() .setSymbolResolver(new JavaSymbolSolver(new CombinedTypeSolver(new ReflectionTypeSolver(), typeSolver))) @@ -398,7 +398,7 @@ void genericConstructorTest() { } @Test - @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) + // @EnabledForJreRange(min = org.junit.jupiter.api.condition.JRE.JAVA_17) void testToStringShouldUseCorrectClassName() { ReflectionRecordDeclaration decl = (ReflectionRecordDeclaration) typeSolver.solveType("box.Box"); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTestObject.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTestObject.java index ed8f53aedf..2135a065c1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTestObject.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTestObject.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AbstractResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AbstractResolutionTest.java index 2d2a309ddf..260fe515e3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AbstractResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AbstractResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaParserTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaParserTest.java index 4af1b11d2a..a9989c0231 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaParserTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaParserTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaSymbolSolver060Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaSymbolSolver060Test.java index ffc7079e2f..b943286af4 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaSymbolSolver060Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseJavaSymbolSolver060Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -82,7 +82,7 @@ private static String readFile(File file) throws IOException { /** * @param projectName is one of "java-symbol-solver-core", "java-symbol-solver-logic", "java-symbol-solver-model" - * @param fileName describes the file being analyzed + * @param fileName describes the file being analyzed */ private void parse(String projectName, String fileName) throws IOException { Path sourceFile = src.resolve(projectName + "/" + fileName + ".java"); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserHelpersTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserHelpersTest.java index bffd7ec80b..cd32f31104 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserHelpersTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserHelpersTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java index aa95741dfd..760bb4e899 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnnotationsResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnnotationsResolutionTest.java index 66aae8d337..1ce74c1278 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnnotationsResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnnotationsResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnonymousClassesResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnonymousClassesResolutionTest.java index 094d34a441..6d9f9786fe 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnonymousClassesResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnonymousClassesResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ArrayExprTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ArrayExprTest.java index 9a9e9b28a9..05488516fa 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ArrayExprTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ArrayExprTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/CompilationUnitContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/CompilationUnitContextResolutionTest.java index a12be89c83..27f2c434ea 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/CompilationUnitContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/CompilationUnitContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConditionalExprTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConditionalExprTest.java index 1f212c743e..3a6384835a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConditionalExprTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConditionalExprTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConstructorsResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConstructorsResolutionTest.java index add2ea0611..3941cca9d0 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConstructorsResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConstructorsResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ContextTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ContextTest.java index 3e6b396672..e03156b70b 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ContextTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ContextTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/DefaultPackageTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/DefaultPackageTest.java index cf323a7be2..6aaadf47ae 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/DefaultPackageTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/DefaultPackageTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumLiteralsInAnnotatedClassTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumLiteralsInAnnotatedClassTest.java index 4353320d51..2a607b9478 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumLiteralsInAnnotatedClassTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumLiteralsInAnnotatedClassTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumResolutionTest.java index 682df307ef..3753cf09ea 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/EnumResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ExprResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ExprResolutionTest.java index c0d47f15e8..27ecb17568 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ExprResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ExprResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldAccessExprResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldAccessExprResolutionTest.java index b08ffaaa2e..af85ffd3d2 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldAccessExprResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldAccessExprResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldsResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldsResolutionTest.java index 62f482c1a6..dae6b8740c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldsResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/FieldsResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/GenericsResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/GenericsResolutionTest.java index ba5afaf552..b9afdd8c52 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/GenericsResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/GenericsResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ImplementedOrExtendedTypeResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ImplementedOrExtendedTypeResolutionTest.java index 8c2caea5be..6133599476 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ImplementedOrExtendedTypeResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ImplementedOrExtendedTypeResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InstanceOfTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InstanceOfTest.java index c24a3af10a..64cde19597 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InstanceOfTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InstanceOfTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InternalClassInInterfaceTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InternalClassInInterfaceTest.java index e185197af1..0e2112086d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InternalClassInInterfaceTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/InternalClassInInterfaceTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/Issue4703Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/Issue4703Test.java index d0d3395ab9..15437721ee 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/Issue4703Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/Issue4703Test.java @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver.resolution; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/JavaParserFacadeResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/JavaParserFacadeResolutionTest.java index 8cb3dbf67a..0f32d7bee9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/JavaParserFacadeResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/JavaParserFacadeResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaGenericResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaGenericResolutionTest.java index 5b9d7bbc49..edcbba2369 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaGenericResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaGenericResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. - * Copyright (C) 2011, 2013-2024 The JavaParser Team. + * Copyright (C) 2011, 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaResolutionTest.java index 25f81a9c82..8fe4fd30b2 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/LambdaResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodDescriptorTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodDescriptorTest.java index d9e67a0241..70308d4644 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodDescriptorTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodDescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodLikeSignaturesTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodLikeSignaturesTest.java index 1779cac169..605785bddd 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodLikeSignaturesTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodLikeSignaturesTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodReferenceResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodReferenceResolutionTest.java index 328a25b67b..22c2d3b570 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodReferenceResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodReferenceResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionLogicTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionLogicTest.java index 67608c8f1e..b12d2f244f 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionLogicTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionLogicTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionTest.java index 3ff740e8c5..7e61ffa3c3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionWithJavassistTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionWithJavassistTest.java index f0620228ed..516ab660e5 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionWithJavassistTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/MethodsResolutionWithJavassistTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/NotQuiteCyclicParentTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/NotQuiteCyclicParentTest.java index f4c5554d86..f5d4b2a730 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/NotQuiteCyclicParentTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/NotQuiteCyclicParentTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PatternVariableIntroductionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PatternVariableIntroductionTest.java index 6be1527211..77671e31ef 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PatternVariableIntroductionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PatternVariableIntroductionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PolyExpressionResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PolyExpressionResolutionTest.java index e8c71db760..3c011e2a0c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PolyExpressionResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/PolyExpressionResolutionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/QualifiedNameResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/QualifiedNameResolutionTest.java index 971bbc2633..b8ce0d4a54 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/QualifiedNameResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/QualifiedNameResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ReferenceTypeResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ReferenceTypeResolutionTest.java index 3f7da4fd29..7381d516e3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ReferenceTypeResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ReferenceTypeResolutionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/StatementContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/StatementContextResolutionTest.java index d7c7a90688..c0f4251919 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/StatementContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/StatementContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SwitchExprTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SwitchExprTest.java index da1fe66af6..4e88c8db46 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SwitchExprTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SwitchExprTest.java @@ -1,15 +1,38 @@ +/* + * Copyright (C) 2013-2026 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ + package com.github.javaparser.symbolsolver.resolution; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.github.javaparser.JavaParser; import com.github.javaparser.ParserConfiguration; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.expr.NameExpr; +import com.github.javaparser.ast.expr.SwitchExpr; import com.github.javaparser.resolution.Navigator; import com.github.javaparser.resolution.TypeSolver; import com.github.javaparser.resolution.UnsolvedSymbolException; +import com.github.javaparser.resolution.types.ResolvedType; import com.github.javaparser.symbolsolver.JavaSymbolSolver; import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver; import org.junit.jupiter.api.Test; @@ -100,4 +123,660 @@ public void nestedSwitchRecordPatternShouldResolve() { NameExpr name = Navigator.findNameExpression(cu, "s").get(); assertEquals("java.lang.String", name.resolve().getType().describe()); } + + /** + * Test that switch expressions used as method arguments can have their type resolved. + */ + @Test + public void switchExprAsMethodArgShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " System.out.println(\n" + + " switch (\"a\") {\n" + + " case \"a\" -> 3;\n" + + " default -> 0;\n" + + " });\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test that switch expressions returning String can have their type resolved. + */ + @Test + public void switchExprReturningStringShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " String result = switch (1) {\n" + + " case 1 -> \"one\";\n" + + " case 2 -> \"two\";\n" + + " default -> \"other\";\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("java.lang.String", resolvedType.describe()); + } + + /** + * Test that switch expressions with yield statements can have their type resolved. + */ + @Test + public void switchExprWithYieldShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (\"x\") {\n" + + " case \"a\" -> 1;\n" + + " default -> {\n" + + " int val = 42;\n" + + " yield val;\n" + + " }\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test block with multiple yield paths (nested if/else). + */ + @Test + public void switchExprWithMultipleYieldPathsShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test(boolean condition) {\n" + + " int result = switch (\"x\") {\n" + + " default -> {\n" + + " if (condition) {\n" + + " yield 1;\n" + + " } else {\n" + + " yield 2;\n" + + " }\n" + + " }\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test colon-style switch expression (STATEMENT_GROUP) with yield. + * JLS 15.28.1 - "case L:" style requires yield statement. + */ + @Test + public void switchExprWithColonStyleShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (\"x\") {\n" + + " case \"a\":\n" + + " yield 1;\n" + + " default:\n" + + " yield 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test colon-style switch expression with multiple statements before yield. + * This tests that we correctly find the yield even when it's not the first statement. + */ + @Test + public void switchExprWithColonStyleAndMultipleStatementsShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (\"x\") {\n" + + " case \"a\":\n" + + " int val = 42;\n" + + " yield val;\n" + + " default:\n" + + " yield 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test mixed primitive types - int and long should LUB to long. + * JLS 15.28.2 - numeric promotion rules apply. + */ + @Test + public void switchExprWithMixedPrimitiveTypesShouldResolveToLub() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> 1;\n" + + " case 2 -> 2L;\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("long", resolvedType.describe()); + } + + /** + * Test mixed reference types - String and StringBuilder should LUB to a common supertype. + */ + @Test + public void switchExprWithMixedReferenceTypesShouldResolveToLub() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> \"hello\";\n" + + " case 2 -> new StringBuilder();\n" + + " default -> \"world\";\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + // String and StringBuilder both implement CharSequence and Serializable + // LUB should be one of their common supertypes + assertEquals("java.io.Serializable", resolvedType.describe()); + } + + /** + * Test mixed boxed and unboxed types - int and Integer. + */ + @Test + public void switchExprWithBoxedAndUnboxedTypesShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> 1;\n" + + " case 2 -> Integer.valueOf(2);\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + String type = resolvedType.describe(); + assertTrue(type.equals("int"), "Expected int: " + type); + } + + /** + * Test switch expression with throw in a case (THROWS_STATEMENT). + * The throw case doesn't contribute to the type. + */ + @Test + public void switchExprWithThrowCaseShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + " public void test() {\n" + + " int result = switch (\"x\") {\n" + + " case \"error\" -> throw new RuntimeException();\n" + + " default -> 42;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test switch expression with only default case. + */ + @Test + public void switchExprWithDefaultOnlyShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + " public void test() {\n" + + " String result = switch (\"x\") {\n" + + " default -> \"default value\";\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("java.lang.String", resolvedType.describe()); + } + + /** + * Test nested switch expressions. + */ + @Test + public void nestedSwitchExprShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + " public void test() {\n" + + " int result = switch (\"outer\") {\n" + + " case \"outer\" -> switch (\"inner\") {\n" + + " case \"inner\" -> 1;\n" + + " default -> 2;\n" + + " };\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test switch expression in cast context. + */ + @Test + public void switchExprInCastContextShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + " public void test() {\n" + + " Number result = (Number) switch (1) {\n" + + " case 1 -> 1;\n" + + " default -> 2L;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + // As a standalone expression, the type is determined by LUB of int and long + assertEquals("long", resolvedType.describe()); + } + + /** + * Test switch expression in ternary conditional. + */ + @Test + public void switchExprInTernaryContextShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + " public void test(boolean condition) {\n" + + " int result = condition ? switch (1) {\n" + + " case 1 -> 10;\n" + + " default -> 20;\n" + + " } : 0;\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test switch expression as return value. + */ + @Test + public void switchExprAsReturnValueShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public String test() {\n" + + " return switch (1) {\n" + + " case 1 -> \"one\";\n" + + " default -> \"other\";\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("java.lang.String", resolvedType.describe()); + } + + /** + * Test mixed boolean and Boolean types. + * JLS 15.28.2 - If each result is boolean or Boolean, unbox to boolean. + */ + @Test + public void switchExprWithMixedBooleanTypesShouldResolveToBoolean() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> true;\n" + + " case 2 -> Boolean.FALSE;\n" + + " default -> false;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("boolean", resolvedType.describe()); + } + + /** + * Test switch expression where all results are null. + */ + @Test + public void switchExprWithAllNullResultsShouldResolveToNullType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " Object result = switch (1) {\n" + + " case 1 -> null;\n" + + " case 2 -> null;\n" + + " default -> null;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("null", resolvedType.describe()); + } + + /** + * Test null mixed with reference type. + * LUB of String and null should be String. + */ + @Test + public void switchExprWithNullAndReferenceTypeShouldResolveToReferenceType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> \"hello\";\n" + + " case 2 -> null;\n" + + " default -> \"world\";\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("java.lang.String", resolvedType.describe()); + } + + /** + * Test JLS rule 4: primitive boxed before LUB with incompatible reference type. + * int should be boxed to Integer, then LUB with String computed. + */ + @Test + public void switchExprWithPrimitiveAndReferenceTypeShouldBoxThenLub() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> 42;\n" + + " case 2 -> \"hello\";\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + // LUB of Integer and String is Serializable (both implement it) + assertEquals("java.io.Serializable", resolvedType.describe()); + } + + /** + * Test switch expression where all cases throw. + * Since all branches throw, there are no result expressions to determine the type from. + * This is not valid Java code - the validator should catch it. + */ + @Test + public void switchExprWithAllThrowsShouldBeInvalid() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (1) {\n" + + " case 1 -> throw new IllegalArgumentException();\n" + + " default -> throw new RuntimeException();\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + // When all cases throw, there are no result expressions to infer the type from. + // This should be caught earlier by the validator, but here we check that type resolution fails. + assertThrows(IllegalStateException.class, switchExpr::calculateResolvedType); + } + + /** + * Test float/double numeric promotion. + * JLS 15.28.2 - numeric promotion with float and double. + */ + @Test + public void switchExprWithFloatAndDoubleShouldResolveToDouble() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> 1.0f;\n" + + " case 2 -> 2.0;\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("double", resolvedType.describe()); + } + + /** + * Test int/float numeric promotion. + */ + @Test + public void switchExprWithIntAndFloatShouldResolveToFloat() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " var result = switch (1) {\n" + + " case 1 -> 1;\n" + + " case 2 -> 2.0f;\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("float", resolvedType.describe()); + } + + /** + * Test colon-style switch expression with fall-through cases. + * The first case falls through to the second case which has the yield. + */ + @Test + public void switchExprWithColonStyleFallThroughShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (1) {\n" + + " case 1:\n" + + " case 2:\n" + + " yield 10;\n" + + " default:\n" + + " yield 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test colon-style switch expression where a case throws instead of yielding. + * The throw case doesn't contribute to the type, similar to arrow-style throws. + */ + @Test + public void switchExprWithColonStyleThrowShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (1) {\n" + + " case 1:\n" + + " yield 10;\n" + + " default:\n" + + " throw new IllegalArgumentException();\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test colon-style switch expression with multiple fall-through cases. + * Cases 1, 2, and 3 all fall through to case 3's yield. + */ + @Test + public void switchExprWithColonStyleMultipleFallThroughShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " String result = switch (1) {\n" + + " case 1:\n" + + " case 2:\n" + + " case 3:\n" + + " yield \"low\";\n" + + " case 4:\n" + + " case 5:\n" + + " yield \"high\";\n" + + " default:\n" + + " yield \"other\";\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("java.lang.String", resolvedType.describe()); + } + + /** + * Test colon-style switch expression where default throws. + * Only the regular cases contribute to the type. + */ + @Test + public void switchExprWithColonStyleDefaultThrowsShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " String result = switch (1) {\n" + + " case 1:\n" + + " yield \"one\";\n" + + " case 2:\n" + + " yield \"two\";\n" + + " default:\n" + + " throw new IllegalArgumentException(\"unexpected\");\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("java.lang.String", resolvedType.describe()); + } + + /** + * Test colon-style switch expression with mixed fall-through and throw. + * Case 1 falls through to case 2 which yields, case 3 throws. + */ + @Test + public void switchExprWithColonStyleMixedFallThroughAndThrowShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (1) {\n" + + " case 1:\n" + + " case 2:\n" + + " yield 10;\n" + + " case 3:\n" + + " throw new RuntimeException();\n" + + " default:\n" + + " yield 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test arrow-style switch expression where a block throws instead of yielding. + * The throwing block doesn't contribute to the type. + */ + @Test + public void switchExprWithBlockThrowShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (1) {\n" + + " case 1 -> {\n" + + " throw new IllegalArgumentException();\n" + + " }\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + assertEquals("int", resolvedType.describe()); + } + + /** + * Test nested switch expressions in blocks. + * The outer switch should find its own yield, not the inner switch's yield. + */ + @Test + public void switchExprWithNestedSwitchInBlockShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (1) {\n" + + " case 1 -> {\n" + + " String inner = switch (\"x\") {\n" + + " case \"a\" -> {\n" + + " yield \"inner result\";\n" + + " }\n" + + " default -> \"default\";\n" + + " };\n" + + " yield 42;\n" + + " }\n" + + " default -> 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + // The outer switch should resolve to int (from yield 42), not String (from inner yield) + assertEquals("int", resolvedType.describe()); + } + + /** + * Test nested switch expressions in colon-style (STATEMENT_GROUP). + * The outer switch should find its own yield, not the inner switch's yield. + */ + @Test + public void switchExprWithNestedSwitchInStatementGroupShouldResolveType() { + CompilationUnit cu = parse("class Test {\n" + + " public void test() {\n" + + " int result = switch (1) {\n" + + " case 1:\n" + + " String inner = switch (\"x\") {\n" + + " case \"a\":\n" + + " yield \"inner result\";\n" + + " default:\n" + + " yield \"default\";\n" + + " };\n" + + " yield 42;\n" + + " default:\n" + + " yield 0;\n" + + " };\n" + + " }\n" + + "}"); + + SwitchExpr switchExpr = cu.findFirst(SwitchExpr.class).get(); + ResolvedType resolvedType = switchExpr.calculateResolvedType(); + // The outer switch should resolve to int (from yield 42), not String (from inner yield) + assertEquals("int", resolvedType.describe()); + } } diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverTest.java index 51593571f3..9ea19789f6 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistClassTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistClassTest.java index 00e134887f..5b044e2a01 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistClassTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistClassTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistEnumTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistEnumTest.java index f786d10b55..cf66caff17 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistEnumTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistEnumTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistInterfaceTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistInterfaceTest.java index c0c77d7420..d3bfd0246c 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistInterfaceTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/SymbolSolverWithJavassistInterfaceTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeDescriptorTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeDescriptorTest.java index c8cd295c74..f923e19005 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeDescriptorTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeDescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeInClassWithAnnotationAncestorTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeInClassWithAnnotationAncestorTest.java index 478aae9f04..76cf2a29f9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeInClassWithAnnotationAncestorTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeInClassWithAnnotationAncestorTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeResolutionWithSameNameTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeResolutionWithSameNameTest.java index f128df2b14..64dfcd7e72 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeResolutionWithSameNameTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/TypeResolutionWithSameNameTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/UnknownMethodsResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/UnknownMethodsResolutionTest.java index ac125f7eeb..8fa77d7d39 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/UnknownMethodsResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/UnknownMethodsResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariableResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariableResolutionTest.java index 66945a5dbc..08e56826fe 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariableResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariableResolutionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariadicResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariadicResolutionTest.java index 7024feca7d..065137819d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariadicResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/VariadicResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/VarTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/VarTypeTest.java index b7c6d550c8..da187858c1 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/VarTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/VarTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/BlockStmtContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/BlockStmtContextResolutionTest.java index e4ab00b841..d388b8d4a9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/BlockStmtContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/BlockStmtContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/ClassOrInterfaceDeclarationContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/ClassOrInterfaceDeclarationContextResolutionTest.java index 9168e7ef31..8529513bdb 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/ClassOrInterfaceDeclarationContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/ClassOrInterfaceDeclarationContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/CompilationUnitContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/CompilationUnitContextResolutionTest.java index b17439cd45..23761ef51e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/CompilationUnitContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/CompilationUnitContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/EnumDeclarationContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/EnumDeclarationContextResolutionTest.java index ba9fbd40bf..28f577dfe7 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/EnumDeclarationContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/EnumDeclarationContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/FieldAccessContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/FieldAccessContextResolutionTest.java index d0fe07facf..1c2cc60b93 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/FieldAccessContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/FieldAccessContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/LambdaExprContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/LambdaExprContextResolutionTest.java index 1562ffcb14..422198132a 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/LambdaExprContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/LambdaExprContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodCallExprContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodCallExprContextResolutionTest.java index e51c8f2de8..b28f56f6c5 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodCallExprContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodCallExprContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodContextResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodContextResolutionTest.java index ba604eefb6..ddd98a94de 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodContextResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/contexts/MethodContextResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/declarations/JavaParserTypeParameterResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/declarations/JavaParserTypeParameterResolutionTest.java index fb2e97fa7f..a1f7975235 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/declarations/JavaParserTypeParameterResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/javaparser/declarations/JavaParserTypeParameterResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/logic/FunctionalInterfaceLogicTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/logic/FunctionalInterfaceLogicTest.java index f3faacf018..ba8b6e4d36 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/logic/FunctionalInterfaceLogicTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/logic/FunctionalInterfaceLogicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/AbstractNameLogicTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/AbstractNameLogicTest.java index d5c2afe4eb..0507cc8de8 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/AbstractNameLogicTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/AbstractNameLogicTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicDisambiguationTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicDisambiguationTest.java index 6ca609c1ca..a6611520f4 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicDisambiguationTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicDisambiguationTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTest.java index 44fbd249a4..5dfab96bc3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTestingJss060Test.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTestingJss060Test.java index 5dbdba00e3..0a7a6a0cc6 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTestingJss060Test.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/NameLogicTestingJss060Test.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/reflectionmodel/SymbolResolutionResolutionTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/reflectionmodel/SymbolResolutionResolutionTest.java index a1fe0a2b7d..f0696c9937 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/reflectionmodel/SymbolResolutionResolutionTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/reflectionmodel/SymbolResolutionResolutionTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/LeastUpperBoundTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/LeastUpperBoundTest.java index 2785f053f9..a451084a61 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/LeastUpperBoundTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/LeastUpperBoundTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SameAsBoundTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SameAsBoundTest.java index c5c751d5f2..ae6a93c0b5 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SameAsBoundTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SameAsBoundTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SubtypeOfBoundTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SubtypeOfBoundTest.java index 0612cd604f..a9c16ee06e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SubtypeOfBoundTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/bounds/SubtypeOfBoundTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/ConstraintFormulaTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/ConstraintFormulaTest.java index 754e677ae4..27c066508d 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/ConstraintFormulaTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typeinference/constraintformulas/ConstraintFormulaTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -44,7 +44,7 @@ class ConstraintFormulaTest { /** * From JLS 18.1.2 - *

    + * * From Collections.singleton("hi"), we have the constraint formula ‹"hi" → α›. * Through reduction, this will become the constraint formula: ‹String <: α›. */ diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedArrayTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedArrayTypeTest.java index b2d05bcd07..1b6054ec1a 100755 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedArrayTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedArrayTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedPrimitiveTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedPrimitiveTypeTest.java index 763d2e4ea3..052d0b3435 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedPrimitiveTypeTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/types/ResolvedPrimitiveTypeTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AarTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AarTypeSolverTest.java index 44629c8293..070c91b3be 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AarTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AarTypeSolverTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AbstractTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AbstractTypeSolverTest.java index 2180f02925..4c46a28591 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AbstractTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/AbstractTypeSolverTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ClassLoaderTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ClassLoaderTypeSolverTest.java index f968116ec7..327ab49372 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ClassLoaderTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ClassLoaderTypeSolverTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolverTest.java index c21850b531..25c4c3d6e9 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolverTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolverTest.java index 7be10450cc..b27b29ab99 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolverTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolverTest.java index 6e56818fe4..301d0e6455 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolverTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -156,7 +156,7 @@ public void givenJavaParserTypeSolver_tryToSolveAnUnexpectedSourceFileName_expec /** * {@link com.github.javaparser.JavaParser} doesn't work across multiple threads. - *

    + * * This test makes sure the concurrency is handled. */ @RepeatedTest(25) diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/MemoryTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/MemoryTypeSolverTest.java index 3350ad8f3f..88d9b6629f 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/MemoryTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/MemoryTypeSolverTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -88,6 +88,7 @@ void memoryTypeSolversHaveSameHashCodeIfMemoryInformationMatches() { * Create the type solver with pre-registered classes. * * @param multipleClazz The classes to be registered. + * * @return The created memory solver. */ public MemoryTypeSolver createTypeSolver(Class... multipleClazz) { @@ -103,8 +104,8 @@ public MemoryTypeSolver createTypeSolver(Class... multipleClazz) { /** * Register the class in memory. * - * @param memorySolver The memory solver where the information should be registered. - * @param clazz The class to be registered. + * @param memorySolver The memory solver where the information should be registered. + * @param clazz The class to be registered. */ private static void registerClassInMemory(MemoryTypeSolver memorySolver, Class clazz) { ResolvedReferenceTypeDeclaration declaration = ReflectionFactory.typeDeclarationFor(clazz, memorySolver); diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolverTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolverTest.java index b67fbcb204..c5946b4b65 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolverTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolverTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/TypeSolverBuilderTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/TypeSolverBuilderTest.java index 07ab6fac2c..b77337fbd3 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/TypeSolverBuilderTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/typesolvers/TypeSolverBuilderTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -292,7 +292,7 @@ void testBuild_withCustomClassLoaderInConfiguration() { * Assert a class can be resolved inside the current type solver. * * @param typeSolver The type solver to search. - * @param className The class to find. + * @param className The class to find. */ private static void assertIsSolved(TypeSolver typeSolver, String className) { assertTrue(typeSolver.hasType(className), String.format("Unable to solve type %s", className)); @@ -302,7 +302,7 @@ private static void assertIsSolved(TypeSolver typeSolver, String className) { * Assert a class can't be resolved inside the current type solver. * * @param typeSolver The type solver to search. - * @param className The class to find. + * @param className The class to find. */ private static void assertNotSolved(TypeSolver typeSolver, String className) { assertFalse( diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/SomeClass.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/SomeClass.java index 8feefc7392..2289bb94c0 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/SomeClass.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/SomeClass.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/TargetType.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/TargetType.java index 572c59b9e3..5dd21f4735 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/TargetType.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/TargetType.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2024 The JavaParser Team. + * Copyright (C) 2013-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/UtilityClass.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/UtilityClass.java index 0ba036ba0f..36b5788295 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/UtilityClass.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/testingclasses/UtilityClass.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/LeanParserConfiguration.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/LeanParserConfiguration.java index cc220de803..b35f20cb05 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/LeanParserConfiguration.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/LeanParserConfiguration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategyTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategyTest.java index 38c68f7715..4351d2d19e 100644 --- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategyTest.java +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/utils/SymbolSolverCollectionStrategyTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 Federico Tomassetti - * Copyright (C) 2017-2024 The JavaParser Team. + * Copyright (C) 2017-2026 The JavaParser Team. * * This file is part of JavaParser. * @@ -37,12 +37,16 @@ import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; + +import com.google.common.truth.Truth; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@SuppressWarnings("OptionalGetWithoutIsPresent") class SymbolSolverCollectionStrategyTest { private final Path root = classLoaderRoot(SymbolSolverCollectionStrategyTest.class) - .resolve("../../../javaparser-core") + .resolve("../../../../../javaparser-core") .normalize(); private final ProjectRoot projectRoot = new SymbolSolverCollectionStrategy().collect(root); @@ -73,17 +77,18 @@ void resolveExpressions() throws IOException { } @Test + @Disabled("weigl: There are runtime issues (heap space) with this approach.") void resolveMultiSourceRoots() { - String[] relativeRootDir = { - "/src/main/java-templates", + var relativeRootDir = List.of( + "src/main/java-templates", "src/main/java", "src/main/javacc-support", "target/generated-sources/javacc", "target/generated-sources/java-templates", "src/main/java-templates" - }; + ); Path mainDirectory = classLoaderRoot(SymbolSolverCollectionStrategyTest.class) - .resolve("../../../javaparser-core") + .resolve("../../../../../javaparser-core") .normalize(); ProjectRoot projectRoot = new SymbolSolverCollectionStrategy().collect(mainDirectory); List sourceRoots = projectRoot.getSourceRoots(); @@ -92,9 +97,10 @@ void resolveMultiSourceRoots() { .map(s -> s.getRoot().toString()) .collect(Collectors.toList()); // verify each member of the list - Arrays.stream(relativeRootDir).forEach(rrd -> { - Path p = Paths.get(mainDirectory.toString(), rrd); - assertTrue(roots.contains(p.toString())); - }); + var relativeRootDirPaths = relativeRootDir.stream() + .map(rrd -> Paths.get(mainDirectory.toString(), rrd)) + .map(Path::toString) + .toList(); + Truth.assertThat(roots).containsAnyIn(relativeRootDirPaths); } } diff --git a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/00_receiver/main/Parent.java b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/00_receiver/main/Parent.java index 57cd9b9503..3857b76e05 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/00_receiver/main/Parent.java +++ b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/00_receiver/main/Parent.java @@ -1,5 +1,7 @@ package main; +import static main.Parent.MyEnum.*; + public class Parent { public enum MyEnum { diff --git a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/01_parent/main/GrandParent.java b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/01_parent/main/GrandParent.java index 5c0df10588..d037b0adde 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/01_parent/main/GrandParent.java +++ b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/01_parent/main/GrandParent.java @@ -1,5 +1,7 @@ package main; +import static main.GrandParent.MyEnum.*; + public class GrandParent { public enum MyEnum { diff --git a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/02_nested/main/Parent.java b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/02_nested/main/Parent.java index 2ebd0cc20d..e921d55f18 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/02_nested/main/Parent.java +++ b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/02_nested/main/Parent.java @@ -1,5 +1,7 @@ package main; +import static main.Parent.MyEnum.*; + public class Parent { public class ParentNested { diff --git a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/03_symbol/main/Clazz.java b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/03_symbol/main/Clazz.java index a6e89b7a24..5961136cfb 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/03_symbol/main/Clazz.java +++ b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/03_symbol/main/Clazz.java @@ -1,5 +1,7 @@ package main; +import static main.Clazz.MyEnum.*; + public class Clazz { public enum MyEnum { diff --git a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/04_reviewComment/main/Main.java b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/04_reviewComment/main/Main.java index 738fe4d8fb..70afc0ede3 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/04_reviewComment/main/Main.java +++ b/javaparser-symbol-solver-testing/src/test/resources/CompilationUnitContextResolutionTest/04_reviewComment/main/Main.java @@ -13,14 +13,8 @@ public Main() { public enum NestedEnum { ; - - public static void foo() { - } - - public static void bar() { - } - - public void baz() { - } + public static void foo() {} + public static void bar() {} + public void baz() {} } } diff --git a/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/02_ignore_static_non_type_import/main/Main.java b/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/02_ignore_static_non_type_import/main/Main.java index d5ca87a32a..fd7813b3a2 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/02_ignore_static_non_type_import/main/Main.java +++ b/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/02_ignore_static_non_type_import/main/Main.java @@ -1,5 +1,6 @@ package main; +import static another.MyEnum.A; import another.A; class Main { diff --git a/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/05_asterisk_import_precedes_java_lang/main/Main.java b/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/05_asterisk_import_precedes_java_lang/main/Main.java index 11943eb703..ffa3ed7a2d 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/05_asterisk_import_precedes_java_lang/main/Main.java +++ b/javaparser-symbol-solver-testing/src/test/resources/TypeResolutionWithSameNameTest/05_asterisk_import_precedes_java_lang/main/Main.java @@ -1,5 +1,7 @@ package main; +import another.*; + class Main { String s; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/FieldDotExpressions.java b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/FieldDotExpressions.java index b54aeeaa31..63f9b74692 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/FieldDotExpressions.java +++ b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/FieldDotExpressions.java @@ -8,15 +8,12 @@ public static void main(String[] args) { class FieldContainer { FieldContainer containerField = new FieldContainer(); - public String firstContainerMethod() { return "firstContainerMethod()"; } - public String secondContainerMethod() { return "secondContainerMethod()"; } - public String thirdContainerMethod() { return "thirdContainerMethod()"; } @@ -24,13 +21,10 @@ public String thirdContainerMethod() { class InnerClassFieldContainer { FieldContainer outerField = new FieldContainer(); - class InnerClass { FieldContainer innerField = new FieldContainer(); - class InnerInnerClass { FieldContainer innerInnerField = new FieldContainer(); - class InnerInnerInnerClass { FieldContainer innerInnerInnerField = new FieldContainer(); } diff --git a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/InnerClassDotExpressions.java b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/InnerClassDotExpressions.java index 9de73192ea..17b89f02f1 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/InnerClassDotExpressions.java +++ b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/InnerClassDotExpressions.java @@ -11,12 +11,10 @@ class InnerClass { public static String methodCall() { return "CalledMethod"; } - class InnerInnerClass { public static String innerMethodCall() { return "CalledInnerInnerClass"; } - class InnerInnerInnerClass { public static String innerInnerMethodCall() { return "CalledInnerInnerInnerClass"; diff --git a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassContainer.java b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassContainer.java index b13456c6bf..eb80bc9e89 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassContainer.java +++ b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassContainer.java @@ -3,12 +3,10 @@ class InnerClass { public static String methodCall() { return "CalledMethod"; } - class InnerInnerClass { public static String innerMethodCall() { return "CalledInnerInnerClass"; } - class InnerInnerInnerClass { public static String innerInnerMethodCall() { return "CalledInnerInnerInnerClass"; diff --git a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassFieldContainer.java b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassFieldContainer.java index 2dc10970fa..5a09bcf9a6 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassFieldContainer.java +++ b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerClassFieldContainer.java @@ -1,12 +1,9 @@ public class InnerClassFieldContainer { FieldContainer outerField = new FieldContainer(); - class InnerClass { FieldContainer innerField = new FieldContainer(); - class InnerInnerClass { FieldContainer innerInnerField = new FieldContainer(); - class InnerInnerInnerClass { FieldContainer innerInnerInnerField = new FieldContainer(); } @@ -16,15 +13,12 @@ class InnerInnerInnerClass { class FieldContainer { FieldContainer containerField = new FieldContainer(); - public String firstContainerMethod() { return "firstContainerMethod()"; } - public String secondContainerMethod() { return "secondContainerMethod()"; } - public String thirdContainerMethod() { return "thirdContainerMethod()"; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerStaticClassFieldContainer.java b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerStaticClassFieldContainer.java index 874a196689..f9cc6cac8e 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerStaticClassFieldContainer.java +++ b/javaparser-symbol-solver-testing/src/test/resources/differentiate_dot_expressions/com/packageName/InnerStaticClassFieldContainer.java @@ -5,10 +5,8 @@ static class InnerClass { public static String methodCall() { return "CalledMethod"; } - static class InnerInnerClass { public static final String MY_INT = "1"; - public static String innerMethodCall() { return "CalledInnerInnerClass"; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/enumLiteralsInAnnotatedClass/foo/bar/BinaryExpr.java b/javaparser-symbol-solver-testing/src/test/resources/enumLiteralsInAnnotatedClass/foo/bar/BinaryExpr.java index 03bfd31acf..c9a09bbe8b 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/enumLiteralsInAnnotatedClass/foo/bar/BinaryExpr.java +++ b/javaparser-symbol-solver-testing/src/test/resources/enumLiteralsInAnnotatedClass/foo/bar/BinaryExpr.java @@ -6,7 +6,6 @@ enum Operator { OR("||"), AND("&&"); - Operator(String codeRepresentation) { - } + Operator(String codeRepresentation) { } } } diff --git a/javaparser-symbol-solver-testing/src/test/resources/enums/EnumWithInnerType.java b/javaparser-symbol-solver-testing/src/test/resources/enums/EnumWithInnerType.java index 8fe94852c7..d91aaefbaa 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/enums/EnumWithInnerType.java +++ b/javaparser-symbol-solver-testing/src/test/resources/enums/EnumWithInnerType.java @@ -2,7 +2,6 @@ public static enum EnumWithInnerType { PUBLIC, PRIVATE; - public static class EnumInner { - } + public static class EnumInner {} } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/Widget.java b/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/Widget.java index 49de8fe11e..2dcab368f7 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/Widget.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/Widget.java @@ -3,6 +3,9 @@ */ package com.foo; +import java.io.File; +import java.io.IOException; + import com.github.javaparser.JavaParser; import com.github.javaparser.ParseException; import com.github.javaparser.ast.CompilationUnit; @@ -13,9 +16,6 @@ import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver; import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver; -import java.io.File; -import java.io.IOException; - public class Widget extends com.foo.base.Widget { private static final String PROJECT_ROOT = "/Users/peloquina/dev/javasymbolsolver-issue"; private static final String JAVA_ROOT = PROJECT_ROOT + "/src/main/java"; @@ -31,7 +31,7 @@ public static void main(String[] args) throws IOException, ParseException { JavaParserFacade parserFacade = JavaParserFacade.get(combinedTypeSolver); MethodDeclaration methodDeclaration = compilationUnit.getNodesByType(MethodDeclaration.class).stream() - .filter(node -> node.getName().equals("doSomething")).findAny().orElse(null); + .filter(node -> node.getName().equals("doSomething")).findAny().orElse(null); methodDeclaration.getNodesByType(MethodCallExpr.class).forEach(parserFacade::solve); } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/base/Widget.java b/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/base/Widget.java index 1067c43038..cffffefb25 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/base/Widget.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue113/com/foo/base/Widget.java @@ -3,5 +3,4 @@ */ package com.foo.base; -public class Widget { -} +public class Widget {} diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue128/foo/Issue128.java b/javaparser-symbol-solver-testing/src/test/resources/issue128/foo/Issue128.java index 72c0568d3d..50410e15da 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue128/foo/Issue128.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue128/foo/Issue128.java @@ -4,7 +4,7 @@ // here could be the correct import for bar public class JavaTest { - public void test() { - bar(); - } + public void test() { + bar(); + } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue144/HelloWorld.java b/javaparser-symbol-solver-testing/src/test/resources/issue144/HelloWorld.java index 58d6895e95..994d632007 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue144/HelloWorld.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue144/HelloWorld.java @@ -1,6 +1,6 @@ public class HelloWorld { - static String hw = "Hello world"; + static String hw="Hello world"; public static void main(String[] args) { System.out.println(hw); diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1456/bar/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue1456/bar/A.java index 737cf3983e..1c093c30f5 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1456/bar/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1456/bar/A.java @@ -1,5 +1,4 @@ package bar; - public class A extends foo.A { } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1456/foo/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue1456/foo/A.java index 2bd37d8d0b..3ded56e4ed 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1456/foo/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1456/foo/A.java @@ -1,5 +1,4 @@ package foo; - public class A { } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1479/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue1479/A.java index 1c6d914f89..49e14d4486 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1479/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1479/A.java @@ -1,3 +1,3 @@ public class A { - public static final String AFIELD = "a"; + public static final String AFIELD = "a"; } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1479/B.java b/javaparser-symbol-solver-testing/src/test/resources/issue1479/B.java index 5f1ebf5eae..19a79fd319 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1479/B.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1479/B.java @@ -1,3 +1,3 @@ public class B extends A { - public static final String BFIELD = "b"; + public static final String BFIELD = "b"; } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1480/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue1480/A.java index c2223d3086..5e51be7452 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1480/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1480/A.java @@ -1,7 +1,5 @@ -public class A { - public void foo() { - } - private void bar() { - } +public class A { + public void foo() {} + private void bar() {} } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1480/B.java b/javaparser-symbol-solver-testing/src/test/resources/issue1480/B.java index 7d661f3d39..ca992e3e1d 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1480/B.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1480/B.java @@ -1,10 +1,11 @@ + public class B extends A { // public void test1() { // foo(); // should be inherited from A, so there should exist an (implicit) method org.testapp.B.foo() // } - public void test2() { - bar(); // should not be resolvable, since bar() is private in A and not inherited by B - } + public void test2() { + bar(); // should not be resolvable, since bar() is private in A and not inherited by B + } } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1485/Complex.java b/javaparser-symbol-solver-testing/src/test/resources/issue1485/Complex.java index cf2f88a4f7..e05f245379 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1485/Complex.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1485/Complex.java @@ -9,12 +9,12 @@ public class Complex { } Complex(String eval) { - Complex result = new Complex(0, 0); - System.out.println(result.getReal() + "," + result.getImaginary()); + Complex result = new Complex(0,0); + System.out.println(result.getReal()+","+result.getImaginary()); } public Complex add(Complex arg) { - return new Complex(real + arg.getReal(), imaginary + arg.getImaginary()); + return new Complex(real+arg.getReal(), imaginary+arg.getImaginary()); } public double getReal() { diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1518/Test1.java b/javaparser-symbol-solver-testing/src/test/resources/issue1518/Test1.java index 4177114b70..f20a861811 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1518/Test1.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1518/Test1.java @@ -1,7 +1,7 @@ + public class Test1 { public static class Test2 { } - public static class Test3 { } } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/a/b/c/ExampleClass.java b/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/a/b/c/ExampleClass.java index 5df45b26ec..a76e082274 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/a/b/c/ExampleClass.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/a/b/c/ExampleClass.java @@ -1,6 +1,6 @@ package a.b.c; -import d.e.f.DataObjectFactory; +import d.e.f.DataObjectFactory; // Resolving imports takes precedence over within-the-same-package (commenting this line causes a compilation error!). public class ExampleClass { diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/d/e/f/DataObjectFactory.java b/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/d/e/f/DataObjectFactory.java index 1ad1138726..55580df723 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/d/e/f/DataObjectFactory.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1526/compiles/d/e/f/DataObjectFactory.java @@ -4,7 +4,7 @@ public class DataObjectFactory { - public DataObject getDataObject(String objectID) { + public DataObject getDataObject(String objectID){ return null; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1526/errors/d/e/f/DataObjectFactory.java b/javaparser-symbol-solver-testing/src/test/resources/issue1526/errors/d/e/f/DataObjectFactory.java index 1ad1138726..55580df723 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1526/errors/d/e/f/DataObjectFactory.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1526/errors/d/e/f/DataObjectFactory.java @@ -4,7 +4,7 @@ public class DataObjectFactory { - public DataObject getDataObject(String objectID) { + public DataObject getDataObject(String objectID){ return null; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1574/BlockComment.java b/javaparser-symbol-solver-testing/src/test/resources/issue1574/BlockComment.java index 4ec7806b99..b2535d6ffb 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1574/BlockComment.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1574/BlockComment.java @@ -8,9 +8,8 @@ Comment3 */ package aPackage; - -public class comment { - public void main(String args[]) { +public class comment{ + public void main(String args[]){ System.out.println("HelloWorld"); } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1574/ClassWithOrphanComments.java b/javaparser-symbol-solver-testing/src/test/resources/issue1574/ClassWithOrphanComments.java index b7a04dec71..6ca7c9f46f 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1574/ClassWithOrphanComments.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1574/ClassWithOrphanComments.java @@ -1,13 +1,11 @@ package japa.parser.comments; -/** - * Javadoc associated with the class - */ +/**Javadoc associated with the class*/ public class ClassWithOrphanComments { //a first comment floating in the class //comment associated to the method - void foo() { + void foo(){ /*comment floating inside the method*/ } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1574/Comment.java b/javaparser-symbol-solver-testing/src/test/resources/issue1574/Comment.java index 8e1906c96f..d01313122b 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1574/Comment.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1574/Comment.java @@ -2,9 +2,8 @@ //Comment2 //Comment3 package aPackage; - -public class comment { - public void main(String args[]) { +public class comment{ + public void main(String args[]){ System.out.println("HelloWorld"); } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1599/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue1599/A.java index 8fd676f434..dde0ac295b 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1599/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1599/A.java @@ -1,3 +1,3 @@ public abstract class A { - public abstract void bar(); + public abstract void bar(); } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1769/foo/OtherClass.java b/javaparser-symbol-solver-testing/src/test/resources/issue1769/foo/OtherClass.java index 30ee602f38..a9ddb84303 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1769/foo/OtherClass.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1769/foo/OtherClass.java @@ -1,6 +1,4 @@ package foo; - public class OtherClass { - public static class InnerClass { - } + public static class InnerClass {} } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/HairTypeWool.java b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/HairTypeWool.java index 383420ae52..25476be9fd 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/HairTypeWool.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/HairTypeWool.java @@ -1,12 +1,11 @@ package issue1945.implementations; - import issue1945.interfaces.HairType; public class HairTypeWool implements HairType { - - @Override - public WoolRenderer getRenderer() { - return WoolRenderer.INSTANCE; - } - + + @Override + public WoolRenderer getRenderer() { + return WoolRenderer.INSTANCE; + } + } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/Sheep.java b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/Sheep.java index 229b2e0793..d764fa9947 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/Sheep.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/Sheep.java @@ -1,14 +1,13 @@ package issue1945.implementations; - import issue1945.interfaces.HairType; import issue1945.interfaces.HairyAnimal; public class Sheep implements HairyAnimal { - - @Override - public HairType getHairType() { - //simplified - return new HairTypeWool(); - } - + + @Override + public HairType getHairType() { + //simplified + return new HairTypeWool(); + } + } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/WoolRenderer.java b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/WoolRenderer.java index 77ad910529..0f7332bc37 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/WoolRenderer.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/implementations/WoolRenderer.java @@ -1,19 +1,18 @@ package issue1945.implementations; - import issue1945.interfaces.HairTypeRenderer; import issue1945.interfaces.HairyAnimal; public class WoolRenderer extends HairTypeRenderer { - - public final static WoolRenderer INSTANCE = new WoolRenderer(); - - private WoolRenderer() { - //I'm a singleton - } - - @Override - public void renderHair(HairTypeWool type, HairyAnimal animal) { - //... snip ... - } - + + public final static WoolRenderer INSTANCE = new WoolRenderer(); + + private WoolRenderer() { + //I'm a singleton + } + + @Override + public void renderHair(HairTypeWool type, HairyAnimal animal) { + //... snip ... + } + } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairType.java b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairType.java index 2fb5b865f5..b51b267861 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairType.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairType.java @@ -1,7 +1,7 @@ package issue1945.interfaces; public interface HairType> { - - R getRenderer(); - + + R getRenderer(); + } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairTypeRenderer.java b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairTypeRenderer.java index 4e745146c7..357969c19a 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairTypeRenderer.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairTypeRenderer.java @@ -1,20 +1,20 @@ package issue1945.interfaces; public abstract class HairTypeRenderer { - - protected abstract void renderHair(T typeInstance, HairyAnimal animal); - - /** - * A proxy method casting the typeInstance parameter to the appropriate type for this renderer. - * This is necessary because the type that's retrieved by {@link HairyAnimal#getHairType()} is the generic {@link HairType} super interface. - */ - @SuppressWarnings("unchecked") - public final void renderHair(HairType typeInstance, HairyAnimal animal) { - try { - renderHair((T) typeInstance, animal); - } catch (ClassCastException e) { - throw new IllegalStateException("Renderer type and instance type don't match", e); - } - } - + + protected abstract void renderHair(T typeInstance, HairyAnimal animal); + + /** + * A proxy method casting the typeInstance parameter to the appropriate type for this renderer. + * This is necessary because the type that's retrieved by {@link HairyAnimal#getHairType()} is the generic {@link HairType} super interface. + */ + @SuppressWarnings("unchecked") + public final void renderHair(HairType typeInstance, HairyAnimal animal) { + try { + renderHair((T)typeInstance, animal); + } catch (ClassCastException e) { + throw new IllegalStateException("Renderer type and instance type don't match", e); + } + } + } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairyAnimal.java b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairyAnimal.java index 0abd7d1cf6..f6e3749df6 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairyAnimal.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/interfaces/HairyAnimal.java @@ -1,7 +1,7 @@ package issue1945.interfaces; public interface HairyAnimal { - - HairType getHairType(); - + + HairType getHairType(); + } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/main/MainIssue1945.java b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/main/MainIssue1945.java index 4a0387bdd7..b414cbefea 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/main/MainIssue1945.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue1945/issue1945/main/MainIssue1945.java @@ -6,40 +6,43 @@ import issue1945.interfaces.HairyAnimal; public class MainIssue1945 { - - private final HairyAnimal sheep = new Sheep(); - - public void chokes() { - sheep.getHairType().getRenderer().renderHair(sheep.getHairType(), sheep); - } - - public void chokes2() { - HairType hairType = sheep.getHairType(); - hairType.getRenderer().renderHair(hairType, sheep); - } - - public void chokes3() { - HairType hairType = sheep.getHairType(); - hairType.getRenderer().renderHair(sheep.getHairType(), sheep); - } - - - public void works() { - HairType hairType = sheep.getHairType(); - HairTypeRenderer hairTypeRenderer = hairType.getRenderer(); - - hairTypeRenderer.renderHair(hairType, sheep); - } - - public void works2() { - HairTypeRenderer hairTypeRenderer = sheep.getHairType().getRenderer(); - hairTypeRenderer.renderHair(sheep.getHairType(), sheep); - } - - public void works3() { - HairType hairType = sheep.getHairType(); - HairTypeRenderer hairTypeRenderer = hairType.getRenderer(); - - hairTypeRenderer.renderHair(sheep.getHairType(), sheep); - } + + private final HairyAnimal sheep = new Sheep(); + + public void chokes() { + sheep.getHairType().getRenderer().renderHair(sheep.getHairType(), sheep); + } + + public void chokes2() { + HairType hairType = sheep.getHairType(); + hairType.getRenderer().renderHair(hairType, sheep); + } + + public void chokes3() { + HairType hairType = sheep.getHairType(); + hairType.getRenderer().renderHair(sheep.getHairType(), sheep); + } + + + + + + public void works() { + HairType hairType = sheep.getHairType(); + HairTypeRenderer hairTypeRenderer = hairType.getRenderer(); + + hairTypeRenderer.renderHair(hairType, sheep); + } + + public void works2() { + HairTypeRenderer hairTypeRenderer = sheep.getHairType().getRenderer(); + hairTypeRenderer.renderHair(sheep.getHairType(), sheep); + } + + public void works3() { + HairType hairType = sheep.getHairType(); + HairTypeRenderer hairTypeRenderer = hairType.getRenderer(); + + hairTypeRenderer.renderHair(sheep.getHairType(), sheep); + } } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2236/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue2236/A.java index 84f58387a0..4c0184e5eb 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2236/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2236/A.java @@ -1,10 +1,11 @@ -public class A { +public class A +{ A(boolean b) { } - + A(Boolean b) { } - + A(T t) { - } + } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2362/Test.java b/javaparser-symbol-solver-testing/src/test/resources/issue2362/Test.java index dfab9d78b7..ed930e5aae 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2362/Test.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2362/Test.java @@ -1,10 +1,11 @@ -public class Test { - public class InnerClass { - public InnerClass(int i) { - } - } - - public Test() { - new InnerClass(~8); - } +public class Test +{ + public class InnerClass + { + public InnerClass(int i) {} + } + + public Test() { + new InnerClass(~8); + } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2366/Test.java b/javaparser-symbol-solver-testing/src/test/resources/issue2366/Test.java index a93b644f92..97319045a5 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2366/Test.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2366/Test.java @@ -1,13 +1,14 @@ -public class Test { - public class InnerTest { - public InnerTest(int i) { - } - } +public class Test +{ + public class InnerTest + { + public InnerTest(int i) {} + } + + public Test() { + } - public Test() { - } - - public static void main(String[] args) { - new Test().new InnerTest(); - } + public static void main( String[] args ) { + new Test().new InnerTest(); + } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue241/TypeWithMemberType.java b/javaparser-symbol-solver-testing/src/test/resources/issue241/TypeWithMemberType.java index 3657e29431..c6d21a1971 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue241/TypeWithMemberType.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue241/TypeWithMemberType.java @@ -2,8 +2,8 @@ public class TypeWithMemberType { - public interface MemberInterface { - - } + public interface MemberInterface { + + } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2489/ObjectContext.java b/javaparser-symbol-solver-testing/src/test/resources/issue2489/ObjectContext.java index 7a512f8cc1..4fbce9f39b 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2489/ObjectContext.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2489/ObjectContext.java @@ -1,5 +1,5 @@ public class ObjectContext { public void set(String characteristicName, Object value, boolean forced) { - //... + //... } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/A.java index 9be238ad61..c302ef3d21 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/A.java @@ -2,10 +2,10 @@ interface A { - enum FindMeIfYouCan { - CONSTANT - } - - void overrideMe(FindMeIfYouCan v); + enum FindMeIfYouCan { + CONSTANT + } + + void overrideMe(FindMeIfYouCan v); } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/C.java b/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/C.java index 158f004555..bc4f5e6002 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/C.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue276/foo/C.java @@ -1,11 +1,11 @@ package foo; public class C { - public static A getFoo() { - return new B() { - @Override - public void overrideMe(FindMeIfYouCan v) { - } - }; - } + public static A getFoo() { + return new B() { + @Override + public void overrideMe(FindMeIfYouCan v) { + } + }; + } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2878/U9.java b/javaparser-symbol-solver-testing/src/test/resources/issue2878/U9.java index 6aec18c8aa..ab3bfd1d66 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2878/U9.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2878/U9.java @@ -1,12 +1,7 @@ import java.util.Optional; public class U9 { - public U9(Optional parent1, Optional parent2, int i) { - } - - public U9(Optional parent1, Optional parent2, String p) { - } - - public U9(Optional parent1, Optional parent2, boolean p) { - } + public U9(Optional < String > parent1, Optional < U9 > parent2, int i) {} + public U9(Optional < String > parent1, Optional < String > parent2, String p) {} + public U9(Optional < U9 > parent1, Optional < U9 > parent2, boolean p) {} } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2951/foo/A.class b/javaparser-symbol-solver-testing/src/test/resources/issue2951/foo/A.class new file mode 100644 index 0000000000..b25290eec9 Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/issue2951/foo/A.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2951/foo/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue2951/foo/A.java index 7b2c1222db..4d11b21bbf 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2951/foo/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2951/foo/A.java @@ -1,8 +1,5 @@ package foo; - import java.util.List; - class A { - public void get(List b) { - } + public void get(List b) {} } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/A.class b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/A.class new file mode 100644 index 0000000000..f9660720b5 Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/A.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/A.java b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/A.java index c8dbcec6bd..68946ed1e1 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/A.java @@ -1,12 +1,10 @@ package foo; - import foo.IB; public enum A implements IB { X(0); private Integer code; - A(Integer code) { this.code = code; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/IB.class b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/IB.class new file mode 100644 index 0000000000..1f406777fc Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/IB.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/IB.java b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/IB.java index e2f5257e3a..eb7b3056af 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/IB.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue2953/foo/IB.java @@ -1,5 +1,4 @@ package foo; - public interface IB { Integer getCode(); diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Alpha.java b/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Alpha.java index b02efeccdb..83d2b7c917 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Alpha.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Alpha.java @@ -22,6 +22,5 @@ package com.example; interface Alpha { - interface CustomInterface { - } + interface CustomInterface {} } diff --git a/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Beta.java b/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Beta.java index e9d4dc370c..393165f983 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Beta.java +++ b/javaparser-symbol-solver-testing/src/test/resources/issue3099/com/example/Beta.java @@ -22,10 +22,9 @@ package com.example; class Beta implements Alpha.CustomInterface { + + public interface CustomInterface {} - public interface CustomInterface { - } - - private final CustomInterface instanceOfBetaInnerClass; + private final CustomInterface instanceOfBetaInnerClass; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/javassist_generics/javaparser/GenericClass.java b/javaparser-symbol-solver-testing/src/test/resources/javassist_generics/javaparser/GenericClass.java index d7beb7f857..474c4bfb3b 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/javassist_generics/javaparser/GenericClass.java +++ b/javaparser-symbol-solver-testing/src/test/resources/javassist_generics/javaparser/GenericClass.java @@ -5,11 +5,9 @@ public class GenericClass { - public GenericClass(S s) { - } + public GenericClass(S s) {} - public GenericClass(Foo foo) { - } + public GenericClass(Foo foo) {} public S get() { return null; @@ -19,7 +17,7 @@ public List> genericMethodWithNestedReturnType() { return null; } - public Map genericMethodWithDoubleTypedReturnType() { + public Map genericMethodWithDoubleTypedReturnType() { return null; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/javassist_symbols/README.md b/javaparser-symbol-solver-testing/src/test/resources/javassist_symbols/README.md index 140daffeea..389f94c200 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/javassist_symbols/README.md +++ b/javaparser-symbol-solver-testing/src/test/resources/javassist_symbols/README.md @@ -1,12 +1,8 @@ -For the tests regarding resolving symbols in Jar files, we need some jar files. Some other tests within JavaSymbolSolver -use established external jars for that purpose. Given the very specific cases we need here, that would severly -complicate writing and maintaining tests. Therefore, I've decided to write custom jars for the cases we need. +For the tests regarding resolving symbols in Jar files, we need some jar files. Some other tests within JavaSymbolSolver use established external jars for that purpose. Given the very specific cases we need here, that would severly complicate writing and maintaining tests. Therefore, I've decided to write custom jars for the cases we need. -`main_jar` contains most of the necessary classes, `included_jar` and `excluded_jar` both contain an interface and a -superclass. Included_jar is included in the combined type solver, while excluded_jar is not. +`main_jar` contains most of the necessary classes, `included_jar` and `excluded_jar` both contain an interface and a superclass. Included_jar is included in the combined type solver, while excluded_jar is not. Running the buildTestJarMainJar gradle task should rebuild all necessary files. -When you need to rebuild the jar, it is important to make sure you actually update the jar in git. Jar-files are in the -git-ignore, so you'll have to force-add them using `git -f main_jar.jar`. +When you need to rebuild the jar, it is important to make sure you actually update the jar in git. Jar-files are in the git-ignore, so you'll have to force-add them using `git -f main_jar.jar`. (`result` was chosen as a name instead of `target` or `out`, because those seem to be ignored.) \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/modules/com-github-javaparser-testmodule.jar b/javaparser-symbol-solver-testing/src/test/resources/modules/com-github-javaparser-testmodule.jar index 21593b55f8..b138eeaab4 100644 Binary files a/javaparser-symbol-solver-testing/src/test/resources/modules/com-github-javaparser-testmodule.jar and b/javaparser-symbol-solver-testing/src/test/resources/modules/com-github-javaparser-testmodule.jar differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/com/github/javaparser/testpackage2/AnotherClass.java b/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/com/github/javaparser/testpackage2/AnotherClass.java new file mode 100644 index 0000000000..d2f21b3119 --- /dev/null +++ b/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/com/github/javaparser/testpackage2/AnotherClass.java @@ -0,0 +1,5 @@ +package com.github.javaparser.testpackage2; + +public class AnotherClass { + public static void anotherMethod() {} +} diff --git a/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/com/github/javaparser/testpackage3/ThirdClass.java b/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/com/github/javaparser/testpackage3/ThirdClass.java new file mode 100644 index 0000000000..a394f1d606 --- /dev/null +++ b/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/com/github/javaparser/testpackage3/ThirdClass.java @@ -0,0 +1,5 @@ +package com.github.javaparser.testpackage3; + +public class ThirdClass { + public static void thirdMethod() {} +} diff --git a/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/module-info.java b/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/module-info.java index b2da518ba6..d56fd8e8e1 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/module-info.java +++ b/javaparser-symbol-solver-testing/src/test/resources/modules/src/main/java/com.github.javaparser.testmodule/module-info.java @@ -1,3 +1,6 @@ module com.github.javaparser.testmodule { exports com.github.javaparser.testpackage; + exports com.github.javaparser.testpackage2 to java.base, java.logging; + exports com.github.javaparser.testpackage3; + opens com.github.javaparser.testpackage; } diff --git a/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/A.class b/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/A.class new file mode 100644 index 0000000000..1fad334920 Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/A.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/A.java b/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/A.java index a651f7aebe..8084158c43 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/A.java +++ b/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/A.java @@ -3,7 +3,7 @@ * @date 2019-10-25 */ public class A { - public B b() { + public B b(){ return null; } } diff --git a/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/B.class b/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/B.class new file mode 100644 index 0000000000..ed4a82c4a2 Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/pullRequest2398/B.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/Box.class b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/Box.class new file mode 100644 index 0000000000..f6aa9b6f7b Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/Box.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/BoxWithAllConstructors.class b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/BoxWithAllConstructors.class new file mode 100644 index 0000000000..0968cc02cc Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/BoxWithAllConstructors.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/BoxWithNonCanonicalConstructor.class b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/BoxWithNonCanonicalConstructor.class new file mode 100644 index 0000000000..93f8da7aaf Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/BoxWithNonCanonicalConstructor.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/Foo.class b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/Foo.class new file mode 100644 index 0000000000..7193886284 Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/Foo.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/GenericBox.class b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/GenericBox.class new file mode 100644 index 0000000000..f55eae8833 Binary files /dev/null and b/javaparser-symbol-solver-testing/src/test/resources/record_declarations/box/GenericBox.class differ diff --git a/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Base.java b/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Base.java index 551c880a83..1deebf2059 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Base.java +++ b/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Base.java @@ -1,3 +1,5 @@ -public interface Base> { + + +public interface Base>{ } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Extends.java b/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Extends.java index d2f2a31d22..5f69935b4c 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Extends.java +++ b/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Extends.java @@ -1,3 +1,5 @@ +import java.util.stream.BaseStream; + public interface Extends extends Base { public static void foo() { diff --git a/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Usage.java b/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Usage.java index d290277d88..fb8fb2e531 100644 --- a/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Usage.java +++ b/javaparser-symbol-solver-testing/src/test/resources/recursion-issue/Usage.java @@ -1,6 +1,6 @@ -class Usage { +class Usage{ - void bar() { + void bar(){ Extends.foo(); } } \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/CommentsInserter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/CommentsInserter.java index cf5fcaab3b..eee450d20d 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/CommentsInserter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/CommentsInserter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -33,7 +33,7 @@ /** * Assigns comments to nodes of the AST. - * + * * @author Sebastian Kuerten * @author Júlio Vilmar Gesser */ @@ -43,7 +43,7 @@ class CommentsInserter { CommentsInserter(ParserConfiguration configuration) { this.configuration = configuration; } - + /** * Comments are attributed to the thing they comment and are removed from * the comments. @@ -79,9 +79,9 @@ private void insertComments(CompilationUnit cu, TreeSet comments) { void insertComments(Node node, TreeSet commentsToAttribute) { if (commentsToAttribute.isEmpty()) return; - - if (node instanceof CompilationUnit) { - insertComments((CompilationUnit) node, commentsToAttribute); + + if(node instanceof CompilationUnit){ + insertComments((CompilationUnit)node, commentsToAttribute); } // the comments can: @@ -114,9 +114,9 @@ void insertComments(Node node, TreeSet commentsToAttribute) { if (comment.isLineComment()) { for (Node child : children) { if (child.getEnd().line == comment.getBegin().line - && attributeLineCommentToNodeOrChild(child, - comment.asLineComment())) { - attributedComments.add(comment); + && attributeLineCommentToNodeOrChild(child, + comment.asLineComment())) { + attributedComments.add(comment); } } } @@ -165,7 +165,7 @@ private boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineCom // let's give to it the comment if (node.getBegin().line == lineComment.getBegin().line && !node.hasComment()) { - if (!(node instanceof Comment)) { + if(!(node instanceof Comment)) { node.setComment(lineComment); } return true; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/JavaParser.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/JavaParser.java index 64060c04a6..7fdc77f21f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/JavaParser.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/JavaParser.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -46,147 +46,147 @@ * @author Júlio Vilmar Gesser */ public final class JavaParser { - private final CommentsInserter commentsInserter; + private final CommentsInserter commentsInserter; - private ASTParser astParser = null; + private ASTParser astParser = null; - /** - * Instantiate the parser with default configuration. Note that parsing can also be done with the static methods on this class. - * Creating an instance will reduce setup time between parsing files. - */ - public JavaParser() { - this(new ParserConfiguration()); - } + /** + * Instantiate the parser with default configuration. Note that parsing can also be done with the static methods on this class. + * Creating an instance will reduce setup time between parsing files. + */ + public JavaParser() { + this(new ParserConfiguration()); + } - /** - * Instantiate the parser. Note that parsing can also be done with the static methods on this class. - * Creating an instance will reduce setup time between parsing files. - */ - public JavaParser(ParserConfiguration configuration) { - commentsInserter = new CommentsInserter(configuration); - } + /** + * Instantiate the parser. Note that parsing can also be done with the static methods on this class. + * Creating an instance will reduce setup time between parsing files. + */ + public JavaParser(ParserConfiguration configuration) { + commentsInserter = new CommentsInserter(configuration); + } - private ASTParser getParserForProvider(Provider provider) { - if (astParser == null) { - astParser = new ASTParser(provider); - } else { - astParser.ReInit(provider); - } - return astParser; - } + private ASTParser getParserForProvider(Provider provider) { + if (astParser == null) { + astParser = new ASTParser(provider); + } else { + astParser.ReInit(provider); + } + return astParser; + } - /** - * Parses source code. - * It takes the source code from a Provider. - * The start indicates what can be found in the source code (compilation unit, block, import...) - * + /** + * Parses source code. + * It takes the source code from a Provider. + * The start indicates what can be found in the source code (compilation unit, block, import...) + * * @param start refer to the constants in ParseStart to see what can be parsed. * @param provider refer to Providers to see how you can read source. * @param the subclass of Node that is the result of parsing in the start. * @return the parse result, a collection of encountered problems, and some extra data. */ - public ParseResult parse(ParseStart start, Provider provider) { - try { + public ParseResult parse(ParseStart start, Provider provider) { + try { final ASTParser parser = getParserForProvider(provider); - N resultNode = start.parse(parser); + N resultNode = start.parse(parser); final CommentsCollection comments = astParser.getCommentsCollection(); commentsInserter.insertComments(resultNode, comments.copy().getComments()); - - return new ParseResult<>(Optional.of(resultNode), parser.problems, Optional.of(astParser.getTokens()), Optional.of(astParser.getCommentsCollection())); - } catch (ParseException e) { - return new ParseResult<>(e); + + return new ParseResult<>(Optional.of(resultNode), parser.problems, Optional.of(astParser.getTokens()), Optional.of(astParser.getCommentsCollection())); + } catch (ParseException e) { + return new ParseResult<>(e); } catch (TokenMgrException e) { return new ParseResult<>(e); - } finally { - try { - provider.close(); - } catch (IOException e) { - // Since we're done parsing and have our result, we don't care about any errors. - } - } - } + } finally { + try { + provider.close(); + } catch (IOException e) { + // Since we're done parsing and have our result, we don't care about any errors. + } + } + } - /** - * Parses the Java code contained in the {@link InputStream} and returns a - * {@link CompilationUnit} that represents it. - * - * @param in {@link InputStream} containing Java source code - * @param encoding encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws ParseProblemException if the source code has parser errors - */ - public static CompilationUnit parse(final InputStream in, Charset encoding) { - return simplifiedParse(COMPILATION_UNIT, provider(in, encoding)); - } + /** + * Parses the Java code contained in the {@link InputStream} and returns a + * {@link CompilationUnit} that represents it. + * + * @param in {@link InputStream} containing Java source code + * @param encoding encoding of the source code + * @return CompilationUnit representing the Java source code + * @throws ParseProblemException if the source code has parser errors + */ + public static CompilationUnit parse(final InputStream in, Charset encoding) { + return simplifiedParse(COMPILATION_UNIT, provider(in, encoding)); + } - /** - * Parses the Java code contained in the {@link InputStream} and returns a - * {@link CompilationUnit} that represents it.
    - * Note: Uses UTF-8 encoding - * - * @param in {@link InputStream} containing Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseProblemException if the source code has parser errors - */ - public static CompilationUnit parse(final InputStream in) { - return parse(in, UTF8); - } + /** + * Parses the Java code contained in the {@link InputStream} and returns a + * {@link CompilationUnit} that represents it.
    + * Note: Uses UTF-8 encoding + * + * @param in {@link InputStream} containing Java source code + * @return CompilationUnit representing the Java source code + * @throws ParseProblemException if the source code has parser errors + */ + public static CompilationUnit parse(final InputStream in) { + return parse(in, UTF8); + } - /** - * Parses the Java code contained in a {@link File} and returns a - * {@link CompilationUnit} that represents it. - * - * @param file {@link File} containing Java source code - * @param encoding encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws ParseProblemException if the source code has parser errors + /** + * Parses the Java code contained in a {@link File} and returns a + * {@link CompilationUnit} that represents it. + * + * @param file {@link File} containing Java source code + * @param encoding encoding of the source code + * @return CompilationUnit representing the Java source code + * @throws ParseProblemException if the source code has parser errors * @throws FileNotFoundException the file was not found - */ - public static CompilationUnit parse(final File file, final Charset encoding) throws FileNotFoundException { - return simplifiedParse(COMPILATION_UNIT, provider(file, encoding)); - } + */ + public static CompilationUnit parse(final File file, final Charset encoding) throws FileNotFoundException { + return simplifiedParse(COMPILATION_UNIT, provider(file, encoding)); + } - /** - * Parses the Java code contained in a {@link File} and returns a - * {@link CompilationUnit} that represents it.
    - * Note: Uses UTF-8 encoding - * - * @param file {@link File} containing Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseProblemException if the source code has parser errors - * @throws FileNotFoundException the file was not found - */ - public static CompilationUnit parse(final File file) throws FileNotFoundException { - return simplifiedParse(COMPILATION_UNIT, provider(file)); - } + /** + * Parses the Java code contained in a {@link File} and returns a + * {@link CompilationUnit} that represents it.
    + * Note: Uses UTF-8 encoding + * + * @param file {@link File} containing Java source code + * @return CompilationUnit representing the Java source code + * @throws ParseProblemException if the source code has parser errors + * @throws FileNotFoundException the file was not found + */ + public static CompilationUnit parse(final File file) throws FileNotFoundException { + return simplifiedParse(COMPILATION_UNIT, provider(file)); + } - /** - * Parses the Java code contained in a file and returns a - * {@link CompilationUnit} that represents it. - * - * @param path path to a file containing Java source code - * @param encoding encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws IOException the path could not be accessed - * @throws ParseProblemException if the source code has parser errors - */ - public static CompilationUnit parse(final Path path, final Charset encoding) throws IOException { - return simplifiedParse(COMPILATION_UNIT, provider(path, encoding)); - } + /** + * Parses the Java code contained in a file and returns a + * {@link CompilationUnit} that represents it. + * + * @param path path to a file containing Java source code + * @param encoding encoding of the source code + * @return CompilationUnit representing the Java source code + * @throws IOException the path could not be accessed + * @throws ParseProblemException if the source code has parser errors + */ + public static CompilationUnit parse(final Path path, final Charset encoding) throws IOException { + return simplifiedParse(COMPILATION_UNIT, provider(path, encoding)); + } - /** - * Parses the Java code contained in a file and returns a - * {@link CompilationUnit} that represents it.
    - * Note: Uses UTF-8 encoding - * - * @param path path to a file containing Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseProblemException if the source code has parser errors - * @throws IOException the path could not be accessed - */ - public static CompilationUnit parse(final Path path) throws IOException { - return simplifiedParse(COMPILATION_UNIT, provider(path)); - } + /** + * Parses the Java code contained in a file and returns a + * {@link CompilationUnit} that represents it.
    + * Note: Uses UTF-8 encoding + * + * @param path path to a file containing Java source code + * @return CompilationUnit representing the Java source code + * @throws ParseProblemException if the source code has parser errors + * @throws IOException the path could not be accessed + */ + public static CompilationUnit parse(final Path path) throws IOException { + return simplifiedParse(COMPILATION_UNIT, provider(path)); + } /** * Parses Java code from a Reader and returns a @@ -196,123 +196,123 @@ public static CompilationUnit parse(final Path path) throws IOException { * @return CompilationUnit representing the Java source code * @throws ParseProblemException if the source code has parser errors */ - public static CompilationUnit parse(final Reader reader) { - return simplifiedParse(COMPILATION_UNIT, provider(reader)); - } + public static CompilationUnit parse(final Reader reader) { + return simplifiedParse(COMPILATION_UNIT, provider(reader)); + } - /** - * Parses the Java code contained in code and returns a - * {@link CompilationUnit} that represents it. - * - * @param code Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseProblemException if the source code has parser errors - */ - public static CompilationUnit parse(String code) { - return simplifiedParse(COMPILATION_UNIT, provider(code)); - } + /** + * Parses the Java code contained in code and returns a + * {@link CompilationUnit} that represents it. + * + * @param code Java source code + * @return CompilationUnit representing the Java source code + * @throws ParseProblemException if the source code has parser errors + */ + public static CompilationUnit parse(String code) { + return simplifiedParse(COMPILATION_UNIT, provider(code)); + } - /** - * Parses the Java block contained in a {@link String} and returns a - * {@link BlockStmt} that represents it. - * - * @param blockStatement {@link String} containing Java block code - * @return BlockStmt representing the Java block - * @throws ParseProblemException if the source code has parser errors - */ - public static BlockStmt parseBlock(final String blockStatement) { - return simplifiedParse(BLOCK, provider(blockStatement)); - } + /** + * Parses the Java block contained in a {@link String} and returns a + * {@link BlockStmt} that represents it. + * + * @param blockStatement {@link String} containing Java block code + * @return BlockStmt representing the Java block + * @throws ParseProblemException if the source code has parser errors + */ + public static BlockStmt parseBlock(final String blockStatement) { + return simplifiedParse(BLOCK, provider(blockStatement)); + } - /** - * Parses the Java statement contained in a {@link String} and returns a - * {@link Statement} that represents it. - * - * @param statement {@link String} containing Java statement code - * @return Statement representing the Java statement - * @throws ParseProblemException if the source code has parser errors - */ - public static Statement parseStatement(final String statement) { - return simplifiedParse(STATEMENT, provider(statement)); - } + /** + * Parses the Java statement contained in a {@link String} and returns a + * {@link Statement} that represents it. + * + * @param statement {@link String} containing Java statement code + * @return Statement representing the Java statement + * @throws ParseProblemException if the source code has parser errors + */ + public static Statement parseStatement(final String statement) { + return simplifiedParse(STATEMENT, provider(statement)); + } - private static T simplifiedParse(ParseStart context, Provider provider) { - ParseResult result = new JavaParser(new ParserConfiguration()).parse(context, provider); - if (result.isSuccessful()) { - return result.getResult().get(); - } - throw new ParseProblemException(result.getProblems()); - } + private static T simplifiedParse(ParseStart context, Provider provider) { + ParseResult result = new JavaParser(new ParserConfiguration()).parse(context, provider); + if (result.isSuccessful()) { + return result.getResult().get(); + } + throw new ParseProblemException(result.getProblems()); + } - /** - * Parses the Java import contained in a {@link String} and returns a - * {@link ImportDeclaration} that represents it. - * - * @param importDeclaration {@link String} containing Java import code - * @return ImportDeclaration representing the Java import declaration - * @throws ParseProblemException if the source code has parser errors - */ - public static ImportDeclaration parseImport(final String importDeclaration) { - return simplifiedParse(IMPORT_DECLARATION, provider(importDeclaration)); - } + /** + * Parses the Java import contained in a {@link String} and returns a + * {@link ImportDeclaration} that represents it. + * + * @param importDeclaration {@link String} containing Java import code + * @return ImportDeclaration representing the Java import declaration + * @throws ParseProblemException if the source code has parser errors + */ + public static ImportDeclaration parseImport(final String importDeclaration) { + return simplifiedParse(IMPORT_DECLARATION, provider(importDeclaration)); + } - /** - * Parses the Java expression contained in a {@link String} and returns a - * {@link Expression} that represents it. - * - * @param expression {@link String} containing Java expression - * @return Expression representing the Java expression - * @throws ParseProblemException if the source code has parser errors - */ - public static Expression parseExpression(final String expression) { - return simplifiedParse(EXPRESSION, provider(expression)); - } + /** + * Parses the Java expression contained in a {@link String} and returns a + * {@link Expression} that represents it. + * + * @param expression {@link String} containing Java expression + * @return Expression representing the Java expression + * @throws ParseProblemException if the source code has parser errors + */ + public static Expression parseExpression(final String expression) { + return simplifiedParse(EXPRESSION, provider(expression)); + } - /** - * Parses the Java annotation contained in a {@link String} and returns a - * {@link AnnotationExpr} that represents it. - * - * @param annotation {@link String} containing Java annotation - * @return AnnotationExpr representing the Java annotation - * @throws ParseProblemException if the source code has parser errors - */ - public static AnnotationExpr parseAnnotation(final String annotation) { - return simplifiedParse(ANNOTATION, provider(annotation)); - } + /** + * Parses the Java annotation contained in a {@link String} and returns a + * {@link AnnotationExpr} that represents it. + * + * @param annotation {@link String} containing Java annotation + * @return AnnotationExpr representing the Java annotation + * @throws ParseProblemException if the source code has parser errors + */ + public static AnnotationExpr parseAnnotation(final String annotation) { + return simplifiedParse(ANNOTATION, provider(annotation)); + } - /** - * Parses the Java annotation body declaration(e.g fields or methods) contained in a - * {@link String} and returns a {@link BodyDeclaration} that represents it. - * - * @param body {@link String} containing Java body declaration - * @return BodyDeclaration representing the Java annotation - * @throws ParseProblemException if the source code has parser errors - */ - public static BodyDeclaration parseAnnotationBodyDeclaration(final String body) { - return simplifiedParse(ANNOTATION_BODY, provider(body)); - } + /** + * Parses the Java annotation body declaration(e.g fields or methods) contained in a + * {@link String} and returns a {@link BodyDeclaration} that represents it. + * + * @param body {@link String} containing Java body declaration + * @return BodyDeclaration representing the Java annotation + * @throws ParseProblemException if the source code has parser errors + */ + public static BodyDeclaration parseAnnotationBodyDeclaration(final String body) { + return simplifiedParse(ANNOTATION_BODY, provider(body)); + } - /** - * Parses a Java class body declaration(e.g fields or methods) and returns a - * {@link BodyDeclaration} that represents it. - * - * @param body the body of a class - * @return BodyDeclaration representing the Java class body - * @throws ParseProblemException if the source code has parser errors - */ - public static BodyDeclaration parseClassBodyDeclaration(String body) { - return simplifiedParse(CLASS_BODY, provider(body)); - } + /** + * Parses a Java class body declaration(e.g fields or methods) and returns a + * {@link BodyDeclaration} that represents it. + * + * @param body the body of a class + * @return BodyDeclaration representing the Java class body + * @throws ParseProblemException if the source code has parser errors + */ + public static BodyDeclaration parseClassBodyDeclaration(String body) { + return simplifiedParse(CLASS_BODY, provider(body)); + } - /** - * Parses a Java interface body declaration(e.g fields or methods) and returns a - * {@link BodyDeclaration} that represents it. - * - * @param body the body of an interface - * @return BodyDeclaration representing the Java interface body - * @throws ParseProblemException if the source code has parser errors - */ - public static BodyDeclaration parseInterfaceBodyDeclaration(String body) { - return simplifiedParse(INTERFACE_BODY, provider(body)); - } + /** + * Parses a Java interface body declaration(e.g fields or methods) and returns a + * {@link BodyDeclaration} that represents it. + * + * @param body the body of an interface + * @return BodyDeclaration representing the Java interface body + * @throws ParseProblemException if the source code has parser errors + */ + public static BodyDeclaration parseInterfaceBodyDeclaration(String body) { + return simplifiedParse(INTERFACE_BODY, provider(body)); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/PackageLocalClasses.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/PackageLocalClasses.java index 78e5522cfa..90a33f5ba8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/PackageLocalClasses.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/PackageLocalClasses.java @@ -1,7 +1,4 @@ package com.github.javaparser; -class FooClass { -} - -class BarClass { -} \ No newline at end of file +class FooClass {} +class BarClass {} \ No newline at end of file diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseProblemException.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseProblemException.java index af0fef830c..f6a029886b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseProblemException.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseProblemException.java @@ -28,7 +28,7 @@ public class ParseProblemException extends RuntimeException { private static String createMessage(List problems) { StringBuilder message = new StringBuilder(); - for (Problem problem : problems) { + for(Problem problem: problems){ message.append(problem.toString()).append(EOL); } return message.toString(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseResult.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseResult.java index 4777eeca33..88e400525c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseResult.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseResult.java @@ -21,10 +21,9 @@ public class ParseResult { /** * General constructor. - * - * @param result the AST, or empty if it wasn't created. + * @param result the AST, or empty if it wasn't created. * @param problems a list of encountered parsing problems. - * @param tokens the complete list of tokens that were parsed, or empty if parsing failed completely. + * @param tokens the complete list of tokens that were parsed, or empty if parsing failed completely. */ ParseResult(Optional result, List problems, Optional> tokens, Optional commentsCollection) { this.commentsCollection = assertNotNull(commentsCollection); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseStart.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseStart.java index a24402c2e2..f94a662820 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseStart.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ParseStart.java @@ -14,20 +14,19 @@ * For example, * COMPILATION_UNIT indicates a complete Java file, * and CLASS_BODY would indicate the part of a class that is within { and }. - * * @see JavaParser#parse(ParseStart, Provider) */ @FunctionalInterface public interface ParseStart { - ParseStart COMPILATION_UNIT = ASTParser::CompilationUnit; - ParseStart BLOCK = ASTParser::Block; - ParseStart STATEMENT = ASTParser::BlockStatement; - ParseStart IMPORT_DECLARATION = ASTParser::ImportDeclaration; - ParseStart EXPRESSION = ASTParser::Expression; - ParseStart ANNOTATION = ASTParser::Annotation; - ParseStart> ANNOTATION_BODY = ASTParser::AnnotationBodyDeclaration; - ParseStart> CLASS_BODY = p -> p.ClassOrInterfaceBodyDeclaration(false); - ParseStart> INTERFACE_BODY = p -> p.ClassOrInterfaceBodyDeclaration(true); + ParseStart COMPILATION_UNIT = ASTParser::CompilationUnit; + ParseStart BLOCK = ASTParser::Block; + ParseStart STATEMENT = ASTParser::BlockStatement; + ParseStart IMPORT_DECLARATION= ASTParser::ImportDeclaration; + ParseStart EXPRESSION = ASTParser::Expression; + ParseStart ANNOTATION = ASTParser::Annotation; + ParseStart> ANNOTATION_BODY = ASTParser::AnnotationBodyDeclaration; + ParseStart> CLASS_BODY = p -> p.ClassOrInterfaceBodyDeclaration(false); + ParseStart> INTERFACE_BODY = p -> p.ClassOrInterfaceBodyDeclaration(true); - R parse(ASTParser parser) throws ParseException; + R parse(ASTParser parser) throws ParseException; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Position.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Position.java index 12ff3ee400..3128244455 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Position.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Position.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -29,114 +29,114 @@ * A position in a source file. Lines and columns start counting at 1. */ public class Position implements Comparable { - public final int line; - public final int column; - - public static final Position ABSOLUTE_START = new Position(Node.ABSOLUTE_BEGIN_LINE, -1); - public static final Position ABSOLUTE_END = new Position(Node.ABSOLUTE_END_LINE, -1); - - /** - * The first position in the file - */ - public static final Position HOME = new Position(1, 1); - public static final Position UNKNOWN = new Position(0, 0); - - public Position(int line, int column) { - if (line < Node.ABSOLUTE_END_LINE) { - throw new IllegalArgumentException("Can't position at line " + line); - } - if (column < -1) { - throw new IllegalArgumentException("Can't position at column " + column); - } - this.line = line; - this.column = column; - } - - /** - * Convenient factory method. - */ - public static Position pos(int line, int column) { - return new Position(line, column); - } - - public Position withColumn(int column) { - return new Position(this.line, column); - } - - public Position withLine(int line) { - return new Position(line, this.column); - } - - /** - * Check if the position is usable. Does not know what it is pointing at, so it can't check if the position is after the end of the source. - */ - public boolean valid() { - return line > 0 && column > 0; - } - - public boolean invalid() { - return !valid(); - } - - public Position orIfInvalid(Position anotherPosition) { - if (valid()) { - return this; - } - return anotherPosition; - } - - public boolean isAfter(Position position) { - assertNotNull(position); - if (position.line == Node.ABSOLUTE_BEGIN_LINE) return true; - if (line > position.line) { - return true; - } else if (line == position.line) { - return column > position.column; - } - return false; - - } - - public boolean isBefore(Position position) { - assertNotNull(position); - if (position.line == Node.ABSOLUTE_END_LINE) return true; - if (line < position.line) { - return true; - } else if (line == position.line) { - return column < position.column; - } - return false; - } - - @Override - public int compareTo(Position o) { - assertNotNull(o); - if (isBefore(o)) { - return -1; - } - if (isAfter(o)) { - return 1; - } - return 0; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Position position = (Position) o; - - return line == position.line && column == position.column; - } - - @Override - public int hashCode() { - return 31 * line + column; - } - - @Override - public String toString() { - return "(line " + line + ",col " + column + ")"; - } + public final int line; + public final int column; + + public static final Position ABSOLUTE_START = new Position(Node.ABSOLUTE_BEGIN_LINE, -1); + public static final Position ABSOLUTE_END = new Position(Node.ABSOLUTE_END_LINE, -1); + + /** + * The first position in the file + */ + public static final Position HOME = new Position(1, 1); + public static final Position UNKNOWN = new Position(0, 0); + + public Position(int line, int column) { + if (line < Node.ABSOLUTE_END_LINE) { + throw new IllegalArgumentException("Can't position at line " + line); + } + if (column < -1) { + throw new IllegalArgumentException("Can't position at column " + column); + } + this.line = line; + this.column = column; + } + + /** + * Convenient factory method. + */ + public static Position pos(int line, int column) { + return new Position(line, column); + } + + public Position withColumn(int column) { + return new Position(this.line, column); + } + + public Position withLine(int line) { + return new Position(line, this.column); + } + + /** + * Check if the position is usable. Does not know what it is pointing at, so it can't check if the position is after the end of the source. + */ + public boolean valid() { + return line > 0 && column > 0; + } + + public boolean invalid() { + return !valid(); + } + + public Position orIfInvalid(Position anotherPosition) { + if (valid()) { + return this; + } + return anotherPosition; + } + + public boolean isAfter(Position position) { + assertNotNull(position); + if (position.line == Node.ABSOLUTE_BEGIN_LINE) return true; + if (line > position.line) { + return true; + } else if (line == position.line) { + return column > position.column; + } + return false; + + } + + public boolean isBefore(Position position) { + assertNotNull(position); + if (position.line == Node.ABSOLUTE_END_LINE) return true; + if (line < position.line) { + return true; + } else if (line == position.line) { + return column < position.column; + } + return false; + } + + @Override + public int compareTo(Position o) { + assertNotNull(o); + if (isBefore(o)) { + return -1; + } + if (isAfter(o)) { + return 1; + } + return 0; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Position position = (Position) o; + + return line == position.line && column == position.column; + } + + @Override + public int hashCode() { + return 31 * line + column; + } + + @Override + public String toString() { + return "(line " + line + ",col " + column + ")"; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Providers.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Providers.java index 3d8eb4e461..b5e731c094 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Providers.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Providers.java @@ -13,49 +13,49 @@ * Providers that have no parameter for encoding but need it will use UTF-8. */ public final class Providers { - public static final Charset UTF8 = Charset.forName("utf-8"); - - private Providers() { - } - - public static Provider provider(Reader reader) { - return new StreamProvider(assertNotNull(reader)); - } - - public static Provider provider(InputStream input, Charset encoding) { - assertNotNull(input); - assertNotNull(encoding); - try { - return new StreamProvider(input, encoding.name()); - } catch (IOException e) { - // The only one that is thrown is UnsupportedCharacterEncodingException, - // and that's a fundamental problem, so runtime exception. - throw new RuntimeException(e); - } - } - - public static Provider provider(InputStream input) { - return provider(input, UTF8); - } - - public static Provider provider(File file, Charset encoding) throws FileNotFoundException { - return provider(new FileInputStream(assertNotNull(file)), assertNotNull(encoding)); - } - - public static Provider provider(File file) throws FileNotFoundException { - return provider(assertNotNull(file), UTF8); - } - - public static Provider provider(Path path, Charset encoding) throws IOException { - return provider(Files.newInputStream(assertNotNull(path)), assertNotNull(encoding)); - } - - public static Provider provider(Path path) throws IOException { - return provider(assertNotNull(path), UTF8); - } - - public static Provider provider(String source) { - return new StringProvider(assertNotNull(source)); - } + public static final Charset UTF8 = Charset.forName("utf-8"); + + private Providers() { + } + + public static Provider provider(Reader reader) { + return new StreamProvider(assertNotNull(reader)); + } + + public static Provider provider(InputStream input, Charset encoding) { + assertNotNull(input); + assertNotNull(encoding); + try { + return new StreamProvider(input, encoding.name()); + } catch (IOException e) { + // The only one that is thrown is UnsupportedCharacterEncodingException, + // and that's a fundamental problem, so runtime exception. + throw new RuntimeException(e); + } + } + + public static Provider provider(InputStream input) { + return provider(input, UTF8); + } + + public static Provider provider(File file, Charset encoding) throws FileNotFoundException { + return provider(new FileInputStream(assertNotNull(file)), assertNotNull(encoding)); + } + + public static Provider provider(File file) throws FileNotFoundException { + return provider(assertNotNull(file), UTF8); + } + + public static Provider provider(Path path, Charset encoding) throws IOException { + return provider(Files.newInputStream(assertNotNull(path)), assertNotNull(encoding)); + } + + public static Provider provider(Path path) throws IOException { + return provider(assertNotNull(path), UTF8); + } + + public static Provider provider(String source) { + return new StringProvider(assertNotNull(source)); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Range.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Range.java index d7f54de4e1..68e364aede 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Range.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/Range.java @@ -84,6 +84,6 @@ public int hashCode() { @Override public String toString() { - return begin + "-" + end; + return begin+"-"+end; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/AccessSpecifier.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/AccessSpecifier.java index 09a01edd40..f23f8631d0 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/AccessSpecifier.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/AccessSpecifier.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; /** @@ -41,7 +41,7 @@ public enum AccessSpecifier { this.codeRepresenation = codeRepresentation; } - public String getCodeRepresenation() { + public String getCodeRepresenation(){ return this.codeRepresenation; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayBracketPair.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayBracketPair.java index 57dcf3303a..cca0b87615 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayBracketPair.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayBracketPair.java @@ -23,14 +23,12 @@ public ArrayBracketPair(Range range, List annotations) { setAnnotations(annotations); } - @Override - public R accept(final GenericVisitor v, final A arg) { + @Override public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); } public List getAnnotations() { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayCreationLevel.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayCreationLevel.java index b132714bba..2edc68c2aa 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayCreationLevel.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ArrayCreationLevel.java @@ -26,13 +26,11 @@ public ArrayCreationLevel(Range range, Expression dimension, List R accept(final GenericVisitor v, final A arg) { + @Override public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } - @Override - public void accept(final VoidVisitor v, final A arg) { + @Override public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/CompilationUnit.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/CompilationUnit.java index 62e7715b1c..2f30777def 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/CompilationUnit.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/CompilationUnit.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -53,7 +53,7 @@ * compilation unit. *

    * The CompilationUnit is constructed following the syntax:
    - * + * *
      * {@code
      * CompilationUnit ::=  ( }{@link PackageDeclaration}{@code )?
    @@ -61,7 +61,7 @@
      *                      ( }{@link TypeDeclaration}{@code )*
      * }
      * 
    - * + * * @author Julio Vilmar Gesser */ public final class CompilationUnit extends Node { @@ -104,9 +104,9 @@ public
    void accept(VoidVisitor v, A arg) { * Including javadocs, line comments and block comments of all types, * inner-classes and other members.
    * If there is no comment, null is returned. - * + * * @return list with all comments of this compilation unit or - * null + * null * @see JavadocComment * @see com.github.javaparser.ast.comments.LineComment * @see com.github.javaparser.ast.comments.BlockComment @@ -118,7 +118,7 @@ public List getComments() { /** * Retrieves the list of imports declared in this compilation unit or * null if there is no import. - * + * * @return the list of imports or null if there is no import */ public List getImports() { @@ -130,7 +130,7 @@ public List getImports() { * Retrieves the package declaration of this compilation unit.
    * If this compilation unit has no package declaration (default package), * null is returned. - * + * * @return the package declaration or null */ public PackageDeclaration getPackage() { @@ -140,7 +140,7 @@ public PackageDeclaration getPackage() { /** * Return the list of types declared in this compilation unit.
    * If there is no types declared, null is returned. - * + * * @return the list of types or null null if there is no type * @see AnnotationDeclaration * @see ClassOrInterfaceDeclaration @@ -154,8 +154,9 @@ public List> getTypes() { /** * Sets the list of comments of this compilation unit. - * - * @param comments the list of comments + * + * @param comments + * the list of comments */ public CompilationUnit setComments(List comments) { throw new RuntimeException("Not implemented!"); @@ -164,8 +165,9 @@ public CompilationUnit setComments(List comments) { /** * Sets the list of imports of this compilation unit. The list is initially * null. - * - * @param imports the list of imports + * + * @param imports + * the list of imports */ public CompilationUnit setImports(List imports) { this.imports = imports; @@ -175,9 +177,10 @@ public CompilationUnit setImports(List imports) { /** * Sets or clear the package declarations of this compilation unit. - * - * @param pakage the pakage declaration to set or null to default - * package + * + * @param pakage + * the pakage declaration to set or null to default + * package */ public CompilationUnit setPackage(PackageDeclaration pakage) { this.pakage = pakage; @@ -187,8 +190,9 @@ public CompilationUnit setPackage(PackageDeclaration pakage) { /** * Sets the list of types declared in this compilation unit. - * - * @param types the lis of types + * + * @param types + * the lis of types */ public CompilationUnit setTypes(List> types) { this.types = types; @@ -198,7 +202,7 @@ public CompilationUnit setTypes(List> types) { /** * sets the package declaration of this compilation unit - * + * * @param name the name of the package * @return this, the {@link CompilationUnit} */ @@ -210,7 +214,7 @@ public CompilationUnit setPackageName(String name) { /** * Add an import to the list of {@link ImportDeclaration} of this compilation unit
    * shorthand for {@link #addImport(String, boolean, boolean)} with name,false,false - * + * * @param name the import name * @return this, the {@link CompilationUnit} */ @@ -221,7 +225,7 @@ public CompilationUnit addImport(String name) { /** * Add an import to the list of {@link ImportDeclaration} of this compilation unit
    * shorthand for {@link #addImport(String)} with clazz.getName() - * + * * @param clazz the class to import * @return this, the {@link CompilationUnit} */ @@ -237,9 +241,9 @@ else if (clazz.isArray() && !ClassUtils.isPrimitiveOrWrapper(clazz.getComponentT /** * Add an import to the list of {@link ImportDeclaration} of this compilation unit
    * This method check if no import with the same name is already in the list - * - * @param name the import name - * @param isStatic is it an "import static" + * + * @param name the import name + * @param isStatic is it an "import static" * @param isAsterisk does the import end with ".*" * @return this, the {@link CompilationUnit} */ @@ -257,7 +261,7 @@ public CompilationUnit addImport(String name, boolean isStatic, boolean isAsteri /** * Add a public class to the types of this compilation unit - * + * * @param name the class name * @return the newly created class */ @@ -267,8 +271,8 @@ public ClassOrInterfaceDeclaration addClass(String name) { /** * Add a class to the types of this compilation unit - * - * @param name the class name + * + * @param name the class name * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ @@ -284,7 +288,7 @@ public ClassOrInterfaceDeclaration addClass(String name, Modifier... modifiers) /** * Add a public interface class to the types of this compilation unit - * + * * @param name the interface name * @return the newly created class */ @@ -294,8 +298,8 @@ public ClassOrInterfaceDeclaration addInterface(String name) { /** * Add an interface to the types of this compilation unit - * - * @param name the interface name + * + * @param name the interface name * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ @@ -311,7 +315,7 @@ public ClassOrInterfaceDeclaration addInterface(String name, Modifier... modifie /** * Add a public enum to the types of this compilation unit - * + * * @param name the enum name * @return the newly created class */ @@ -321,8 +325,8 @@ public EnumDeclaration addEnum(String name) { /** * Add an enum to the types of this compilation unit - * - * @param name the enum name + * + * @param name the enum name * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ @@ -336,7 +340,7 @@ public EnumDeclaration addEnum(String name, Modifier... modifiers) { /** * Add a public annotation declaration to the types of this compilation unit - * + * * @param name the annotation name * @return the newly created class */ @@ -346,8 +350,8 @@ public AnnotationDeclaration addAnnotationDeclaration(String name) { /** * Add an annotation declaration to the types of this compilation unit - * - * @param name the annotation name + * + * @param name the annotation name * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ @@ -361,49 +365,49 @@ public AnnotationDeclaration addAnnotationDeclaration(String name, Modifier... m /** * Try to get a class by its name - * + * * @param className the class name (case-sensitive) * @return null if not found, the class otherwise */ public ClassOrInterfaceDeclaration getClassByName(String className) { return (ClassOrInterfaceDeclaration) getTypes().stream().filter(type -> type.getName().equals(className) - && type instanceof ClassOrInterfaceDeclaration && !((ClassOrInterfaceDeclaration) type).isInterface()) + && type instanceof ClassOrInterfaceDeclaration && !((ClassOrInterfaceDeclaration) type).isInterface()) .findFirst().orElse(null); } /** * Try to get an interface by its name - * + * * @param interfaceName the interface name (case-sensitive) * @return null if not found, the interface otherwise */ public ClassOrInterfaceDeclaration getInterfaceByName(String interfaceName) { return (ClassOrInterfaceDeclaration) getTypes().stream().filter(type -> type.getName().equals(interfaceName) - && type instanceof ClassOrInterfaceDeclaration && ((ClassOrInterfaceDeclaration) type).isInterface()) + && type instanceof ClassOrInterfaceDeclaration && ((ClassOrInterfaceDeclaration) type).isInterface()) .findFirst().orElse(null); } /** * Try to get an enum by its name - * + * * @param enumName the enum name (case-sensitive) * @return null if not found, the enum otherwise */ public EnumDeclaration getEnumByName(String enumName) { return (EnumDeclaration) getTypes().stream().filter(type -> type.getName().equals(enumName) - && type instanceof EnumDeclaration) + && type instanceof EnumDeclaration) .findFirst().orElse(null); } /** * Try to get an annotation by its name - * + * * @param annotationName the annotation name (case-sensitive) * @return null if not found, the annotation otherwise */ public AnnotationDeclaration getAnnotationDeclarationByName(String annotationName) { return (AnnotationDeclaration) getTypes().stream().filter(type -> type.getName().equals(annotationName) - && type instanceof AnnotationDeclaration) + && type instanceof AnnotationDeclaration) .findFirst().orElse(null); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ImportDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ImportDeclaration.java index 4a6e39d14d..863c8d3648 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ImportDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/ImportDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; import com.github.javaparser.Range; @@ -38,7 +38,6 @@ * } * * An enmpty import declaration is simply a semicolon among the import declarations. - * * @author Julio Vilmar Gesser */ public final class ImportDeclaration extends Node { @@ -64,14 +63,14 @@ private ImportDeclaration(Range range) { /** * Create an empty import declaration without specifying its position. */ - public static ImportDeclaration createEmptyDeclaration() { + public static ImportDeclaration createEmptyDeclaration(){ return new ImportDeclaration(); } /** * Create an empty import declaration specifying its position. */ - public static ImportDeclaration createEmptyDeclaration(Range range) { + public static ImportDeclaration createEmptyDeclaration(Range range){ return new ImportDeclaration(range); } @@ -93,7 +92,7 @@ public ImportDeclaration(Range range, NameExpr name, boolean isStatic, boolean i /** * Is this an empty import declaration or a normal import declaration? */ - public boolean isEmptyImportDeclaration() { + public boolean isEmptyImportDeclaration(){ return this.isEmptyImportDeclaration; } @@ -109,7 +108,7 @@ public
    void accept(VoidVisitor v, A arg) { /** * Retrieves the name of the import. - * + * * @return the name of the import * @throws UnsupportedOperationException when invoked on an empty import declaration */ @@ -122,9 +121,9 @@ public NameExpr getName() { /** * Return if the import ends with "*". - * + * * @return true if the import ends with "*", false - * otherwise + * otherwise */ public boolean isAsterisk() { return asterisk; @@ -132,9 +131,9 @@ public boolean isAsterisk() { /** * Return if the import is static. - * + * * @return true if the import is static, false - * otherwise + * otherwise */ public boolean isStatic() { return static_; @@ -142,8 +141,9 @@ public boolean isStatic() { /** * Sets if this import is asterisk. - * - * @param asterisk true if this import is asterisk + * + * @param asterisk + * true if this import is asterisk * @throws UnsupportedOperationException when setting true on an empty import declaration */ public ImportDeclaration setAsterisk(boolean asterisk) { @@ -156,8 +156,9 @@ public ImportDeclaration setAsterisk(boolean asterisk) { /** * Sets the name this import. - * - * @param name the name to set + * + * @param name + * the name to set * @throws UnsupportedOperationException when invoked on an empty import declaration */ public ImportDeclaration setName(NameExpr name) { @@ -171,8 +172,9 @@ public ImportDeclaration setName(NameExpr name) { /** * Sets if this import is static. - * - * @param static_ true if this import is static + * + * @param static_ + * true if this import is static * @throws UnsupportedOperationException when setting true on an empty import declaration */ public ImportDeclaration setStatic(boolean static_) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Modifier.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Modifier.java index ce226e6cf5..3f5a50b453 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Modifier.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Modifier.java @@ -3,17 +3,17 @@ import java.util.EnumSet; public enum Modifier { - PUBLIC("public"), + PUBLIC("public"), PROTECTED("protected"), - PRIVATE("private"), + PRIVATE("private"), ABSTRACT("abstract"), - STATIC("static"), - FINAL("final"), - TRANSIENT("transient"), + STATIC("static"), + FINAL("final"), + TRANSIENT("transient"), VOLATILE("volatile"), - SYNCHRONIZED("synchronized"), - NATIVE("native"), - STRICTFP("strictfp"); + SYNCHRONIZED("synchronized"), + NATIVE("native"), + STRICTFP("strictfp"); String lib; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Node.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Node.java index 8c6bfb7932..f2bae43b1a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Node.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Node.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -32,11 +32,11 @@ /** * Abstract class for all nodes of the AST. - *

    + * * Each Node can have one associated comment which describe it and * a number of "orphan comments" which it contains but are not specifically * associated to any element. - * + * * @author Julio Vilmar Gesser */ public abstract class Node implements Cloneable { @@ -66,21 +66,28 @@ public Node(Range range) { /** * Accept method for visitor support. - * - * @param the type the return value of the visitor - * @param the type the argument passed to the visitor - * @param v the visitor implementation - * @param arg the argument passed to the visitor + * + * @param + * the type the return value of the visitor + * @param + * the type the argument passed to the visitor + * @param v + * the visitor implementation + * @param arg + * the argument passed to the visitor * @return the result of the visit */ public abstract R accept(GenericVisitor v, A arg); /** * Accept method for visitor support. - * - * @param the type the argument passed for the visitor - * @param v the visitor implementation - * @param arg any value relevant for the visitor + * + * @param + * the type the argument passed for the visitor + * @param v + * the visitor implementation + * @param arg + * any value relevant for the visitor */ public abstract void accept(VoidVisitor v, A arg); @@ -158,6 +165,7 @@ public final Node setComment(final Comment comment) { } + /** * Use this to store additional information to this node. * @@ -178,7 +186,7 @@ public final Node setBlockComment(String comment) { /** * Return the String representation of this node. - * + * * @return the String representation of this node */ @Override @@ -243,13 +251,13 @@ public void addOrphanComment(Comment comment) { /** * This is a list of Comment which are inside the node and are not associated * with any meaningful AST Node. - *

    + * * For example, comments at the end of methods (immediately before the parenthesis) * or at the end of CompilationUnit are orphan comments. - *

    + * * When more than one comment preceeds a statement, the one immediately preceding it * it is associated with the statements, while the others are orphans. - * + * * @return all comments that cannot be attributed to a concept */ public List getOrphanComments() { @@ -260,7 +268,7 @@ public List getOrphanComments() { * This is the list of Comment which are contained in the Node either because * they are properly associated to one of its children or because they are floating * around inside the Node - * + * * @return all Comments within the node as a list */ public List getAllContainedComments() { @@ -350,8 +358,11 @@ public List getNodesByType(Class clazz) { /** * Gets user data for this component using the given key. * - * @param The type of the user data. - * @param key The key for the data + * @param + * The type of the user data. + * + * @param key + * The key for the data * @return The user data or null of no user data was found for the given key * @see UserDataKey */ @@ -366,9 +377,13 @@ public M getUserData(final UserDataKey key) { * Sets user data for this component using the given key. * For information on creating UserDataKey, see {@link UserDataKey}. * - * @param The type of user data - * @param key The singleton key for the user data - * @param object The user data object + * @param + * The type of user data + * + * @param key + * The singleton key for the user data + * @param object + * The user data object * @throws IllegalArgumentException * @see UserDataKey */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/PackageDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/PackageDeclaration.java index 2645307ba1..4252ad4e98 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/PackageDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/PackageDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; import com.github.javaparser.Range; @@ -42,7 +42,6 @@ * PackageDeclaration ::= ( }{@link AnnotationExpr}{@code )* "package" }{@link NameExpr}{@code ) ";" * } * - * * @author Julio Vilmar Gesser */ public final class PackageDeclaration extends Node implements NodeWithAnnotations { @@ -82,7 +81,7 @@ public void accept(VoidVisitor v, A arg) { /** * Retrieves the list of annotations declared before the package * declaration. Return null if there are no annotations. - * + * * @return list of annotations or null */ public List getAnnotations() { @@ -107,7 +106,8 @@ public String getPackageName() { } /** - * @param annotations the annotations to set + * @param annotations + * the annotations to set */ public PackageDeclaration setAnnotations(List annotations) { this.annotations = annotations; @@ -117,8 +117,9 @@ public PackageDeclaration setAnnotations(List annotations) { /** * Sets the name of this package declaration. - * - * @param name the name to set + * + * @param name + * the name to set */ public PackageDeclaration setName(NameExpr name) { this.name = name; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/UserDataKey.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/UserDataKey.java index 39a15f9ae8..4d7caa2e2f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/UserDataKey.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/UserDataKey.java @@ -13,15 +13,18 @@ * public static final UserDataKey<Role> ROLE = new UserDataKey<Role>() { }; * * - *

    + * * This code was taken from the Wicket project. * - * @param The type of the object which is stored + * @param + * The type of the object which is stored + * * @see Node#getUserData(UserDataKey) */ public abstract class UserDataKey { @Override - public int hashCode() { + public int hashCode() + { return getClass().hashCode(); } @@ -29,7 +32,8 @@ public int hashCode() { * @see java.lang.Object#equals(java.lang.Object) */ @Override - public boolean equals(Object obj) { + public boolean equals(Object obj) + { return obj != null && getClass().equals(obj.getClass()); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationDeclaration.java index c6f3a11545..74d84e8221 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import java.util.List; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java index a0797bac7a..66b9dc3a34 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -96,9 +96,9 @@ public Expression getDefaultValue() { /** * Return the modifiers of this member declaration. - * - * @return modifiers + * * @see Modifier + * @return modifiers */ @Override public EnumSet getModifiers() { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/BodyDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/BodyDeclaration.java index 29051122af..9055d96a54 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/BodyDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/BodyDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import java.util.List; @@ -40,12 +40,12 @@ public BodyDeclaration() { } public BodyDeclaration(List annotations) { - setAnnotations(annotations); + setAnnotations(annotations); } public BodyDeclaration(Range range, List annotations) { super(range); - setAnnotations(annotations); + setAnnotations(annotations); } @Override @@ -55,6 +55,7 @@ public final List getAnnotations() { } /** + * * @param annotations a null value is currently treated as an empty list. This behavior could change * in the future, so please avoid passing null */ @@ -62,7 +63,7 @@ public final List getAnnotations() { @Override public final T setAnnotations(List annotations) { this.annotations = annotations; - setAsParentNodeOf(this.annotations); + setAsParentNodeOf(this.annotations); return (T) this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java index 7b1a37cb8a..4120d4a718 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -119,8 +119,9 @@ public boolean isInterface() { } /** + * * @param extendsList a null value is currently treated as an empty list. This behavior could change - * in the future, so please avoid passing null + * in the future, so please avoid passing null * @return */ @Override @@ -131,8 +132,9 @@ public ClassOrInterfaceDeclaration setExtends(final List e } /** + * * @param implementsList a null value is currently treated as an empty list. This behavior could change - * in the future, so please avoid passing null + * in the future, so please avoid passing null */ @Override public ClassOrInterfaceDeclaration setImplements(final List implementsList) { @@ -147,8 +149,9 @@ public ClassOrInterfaceDeclaration setInterface(final boolean interface_) { } /** + * * @param typeParameters a null value is currently treated as an empty list. This behavior could change - * in the future, so please avoid passing null + * in the future, so please avoid passing null */ public ClassOrInterfaceDeclaration setTypeParameters(final List typeParameters) { this.typeParameters = typeParameters; @@ -156,5 +159,7 @@ public ClassOrInterfaceDeclaration setTypeParameters(final List t return this; } + + } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ConstructorDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ConstructorDeclaration.java index 52dca655bb..4a9cd2a2a3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ConstructorDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/ConstructorDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -105,9 +105,9 @@ public void accept(VoidVisitor v, A arg) { /** * Return the modifiers of this member declaration. - * - * @return modifiers + * * @see Modifier + * @return modifiers */ @Override public EnumSet getModifiers() { @@ -180,7 +180,7 @@ public ConstructorDeclaration setTypeParameters(List typeParamete /** * The declaration returned has this schema: - *

    + * * [accessSpecifier] className ([paramType [paramName]]) * [throws exceptionsList] */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyMemberDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyMemberDeclaration.java index 87bf0330fa..102eb7aa42 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyMemberDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyMemberDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.Range; @@ -53,7 +53,7 @@ public void accept(VoidVisitor v, A arg) { @Override public JavadocComment getJavaDoc() { - if (getComment() instanceof JavadocComment) { + if(getComment() instanceof JavadocComment){ return (JavadocComment) getComment(); } return null; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyTypeDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyTypeDeclaration.java index 63b20acbe8..3a774de998 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyTypeDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EmptyTypeDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import java.util.EnumSet; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumConstantDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumConstantDeclaration.java index c0c697f037..646f6c2876 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumConstantDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumConstantDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import static com.github.javaparser.ast.expr.NameExpr.*; @@ -102,13 +102,13 @@ public String getName() { public EnumConstantDeclaration setArgs(List args) { this.args = args; - setAsParentNodeOf(this.args); + setAsParentNodeOf(this.args); return this; } public EnumConstantDeclaration setClassBody(List> classBody) { this.classBody = classBody; - setAsParentNodeOf(this.classBody); + setAsParentNodeOf(this.classBody); return this; } @@ -120,7 +120,7 @@ public EnumConstantDeclaration setName(String name) { @Override public JavadocComment getJavaDoc() { - if (getComment() instanceof JavadocComment) { + if(getComment() instanceof JavadocComment){ return (JavadocComment) getComment(); } return null; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumDeclaration.java index c8c5e09d1b..0ad3089b6b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/EnumDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import static com.github.javaparser.utils.Utils.ensureNotNull; @@ -91,18 +91,19 @@ public List getImplements() { public EnumDeclaration setEntries(List entries) { this.entries = entries; - setAsParentNodeOf(this.entries); + setAsParentNodeOf(this.entries); return this; } @Override public EnumDeclaration setImplements(List implementsList) { this.implementsList = implementsList; - setAsParentNodeOf(this.implementsList); + setAsParentNodeOf(this.implementsList); return this; } + public EnumConstantDeclaration addEnumConstant(String name) { EnumConstantDeclaration enumConstant = new EnumConstantDeclaration(name); getEntries().add(enumConstant); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/FieldDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/FieldDeclaration.java index 61ab8e27aa..aa04a52304 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/FieldDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/FieldDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -101,13 +101,16 @@ public FieldDeclaration(Range range, EnumSet modifiers, List modifiers, Type type, - VariableDeclarator variable) { + VariableDeclarator variable) { List variables = new ArrayList<>(); variables.add(variable); return new FieldDeclaration(modifiers, type, variables); @@ -116,9 +119,12 @@ public static FieldDeclaration create(EnumSet modifiers, Type type, /** * Creates a {@link FieldDeclaration}. * - * @param modifiers modifiers - * @param type type - * @param name field name + * @param modifiers + * modifiers + * @param type + * type + * @param name + * field name * @return instance of {@link FieldDeclaration} */ public static FieldDeclaration create(EnumSet modifiers, Type type, String name) { @@ -139,9 +145,9 @@ public void accept(VoidVisitor v, A arg) { /** * Return the modifiers of this member declaration. - * - * @return modifiers + * * @see Modifier + * @return modifiers */ @Override public EnumSet getModifiers() { @@ -178,10 +184,10 @@ public JavadocComment getJavaDoc() { /** * Create a getter for this field, will only work if this field declares only 1 identifier and if this field is * already added to a ClassOrInterfaceDeclaration - * + * * @return the {@link MethodDeclaration} created * @throws IllegalStateException if there is more than 1 variable identifier or if this field isn't attached to a - * class or enum + * class or enum */ public MethodDeclaration createGetter() { if (getVariables().size() != 1) @@ -210,10 +216,10 @@ public MethodDeclaration createGetter() { /** * Create a setter for this field, will only work if this field declares only 1 identifier and if this field is * already added to a ClassOrInterfaceDeclaration - * + * * @return the {@link MethodDeclaration} created * @throws IllegalStateException if there is more than 1 variable identifier or if this field isn't attached to a - * class or enum + * class or enum */ public MethodDeclaration createSetter() { if (getVariables().size() != 1) diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/InitializerDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/InitializerDeclaration.java index 7146dab426..adb893f03e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/InitializerDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/InitializerDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.Range; @@ -73,7 +73,7 @@ public boolean isStatic() { public InitializerDeclaration setBlock(BlockStmt block) { this.block = block; - setAsParentNodeOf(this.block); + setAsParentNodeOf(this.block); return this; } @@ -84,7 +84,7 @@ public InitializerDeclaration setStatic(boolean isStatic) { @Override public JavadocComment getJavaDoc() { - if (getComment() instanceof JavadocComment) { + if(getComment() instanceof JavadocComment){ return (JavadocComment) getComment(); } return null; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/MethodDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/MethodDeclaration.java index 25e7c3c500..a89103a3b3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/MethodDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/MethodDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -53,15 +53,15 @@ /** * @author Julio Vilmar Gesser */ -public final class MethodDeclaration extends BodyDeclaration implements - NodeWithJavaDoc, - NodeWithDeclaration, +public final class MethodDeclaration extends BodyDeclaration implements + NodeWithJavaDoc, + NodeWithDeclaration, NodeWithName, NodeWithType, NodeWithElementType, - NodeWithModifiers, + NodeWithModifiers, NodeWithParameters, - NodeWithThrowable, + NodeWithThrowable, NodeWithBlockStmt { private EnumSet modifiers = EnumSet.noneOf(Modifier.class); @@ -101,15 +101,15 @@ public MethodDeclaration(final EnumSet modifiers, final Type elementTy setParameters(parameters); } - public MethodDeclaration(final EnumSet modifiers, + public MethodDeclaration(final EnumSet modifiers, final List annotations, - final List typeParameters, + final List typeParameters, final Type elementType, final List arrayBracketPairsAfterElementType, final String name, - final List parameters, + final List parameters, final List arrayBracketPairsAfterParameterList, - final List throws_, + final List throws_, final BlockStmt body) { super(annotations); setModifiers(modifiers); @@ -124,15 +124,15 @@ public MethodDeclaration(final EnumSet modifiers, } public MethodDeclaration(Range range, - final EnumSet modifiers, + final EnumSet modifiers, final List annotations, - final List typeParameters, + final List typeParameters, final Type elementType, final List arrayBracketPairsAfterElementType, final NameExpr nameExpr, - final List parameters, + final List parameters, final List arrayBracketPairsAfterParameterList, - final List throws_, + final List throws_, final BlockStmt body) { super(range, annotations); setModifiers(modifiers); @@ -163,9 +163,9 @@ public BlockStmt getBody() { /** * Return the modifiers of this member declaration. - * - * @return modifiers + * * @see Modifier + * @return modifiers */ @Override public EnumSet getModifiers() { @@ -292,11 +292,11 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includi /** * The declaration returned has this schema: - *

    + * * [accessSpecifier] [static] [abstract] [final] [native] * [synchronized] returnType methodName ([paramType [paramName]]) * [throws exceptionsList] - * + * * @return method declaration as String */ @Override @@ -383,7 +383,7 @@ public MethodDeclaration setArrayBracketPairsAfterElementType(Listint abc()[] {...} */ public List getArrayBracketPairsAfterParameterList() { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/Parameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/Parameter.java index 99ba822f53..d66b39a003 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/Parameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/Parameter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.Range; @@ -34,7 +34,6 @@ import com.github.javaparser.utils.Pair; import static com.github.javaparser.ast.type.ArrayType.wrapInArrayTypes; - import java.util.EnumSet; import java.util.List; @@ -73,8 +72,10 @@ public Parameter(Type elementType, VariableDeclaratorId id) { /** * Creates a new {@link Parameter}. * - * @param elementType type of the parameter - * @param name name of the parameter + * @param elementType + * type of the parameter + * @param name + * name of the parameter * @return instance of {@link Parameter} */ public static Parameter create(Type elementType, String name) { @@ -87,12 +88,12 @@ public Parameter(EnumSet modifiers, Type elementType, VariableDeclarat setElementType(elementType); } - public Parameter(final Range range, - EnumSet modifiers, - List annotations, + public Parameter(final Range range, + EnumSet modifiers, + List annotations, Type elementType, List arrayBracketPairsAfterElementType, - boolean isVarArgs, + boolean isVarArgs, VariableDeclaratorId id) { super(range); setModifiers(modifiers); @@ -137,7 +138,6 @@ public Parameter setVarArgs(boolean isVarArgs) { this.isVarArgs = isVarArgs; return this; } - /** * @return the list returned could be immutable (in that case it will be empty) */ @@ -169,8 +169,8 @@ public Parameter setName(String name) { /** * Return the modifiers of this parameter declaration. * - * @return modifiers * @see Modifier + * @return modifiers */ @Override public EnumSet getModifiers() { @@ -179,7 +179,7 @@ public EnumSet getModifiers() { /** * @param annotations a null value is currently treated as an empty list. This behavior could change - * in the future, so please avoid passing null + * in the future, so please avoid passing null */ @Override @SuppressWarnings("unchecked") diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/TypeDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/TypeDeclaration.java index 4b90e56af3..829d37c263 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/TypeDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/TypeDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import static com.github.javaparser.utils.Utils.ensureNotNull; @@ -44,116 +44,117 @@ public abstract class TypeDeclaration extends BodyDeclaration implements NodeWithName, NodeWithJavaDoc, NodeWithModifiers, NodeWithMembers { - private NameExpr name; + private NameExpr name; private EnumSet modifiers = EnumSet.noneOf(Modifier.class); private List> members; - public TypeDeclaration() { - } + public TypeDeclaration() { + } public TypeDeclaration(EnumSet modifiers, String name) { - setName(name); - setModifiers(modifiers); - } + setName(name); + setModifiers(modifiers); + } - public TypeDeclaration(List annotations, + public TypeDeclaration(List annotations, EnumSet modifiers, String name, List> members) { - super(annotations); - setName(name); - setModifiers(modifiers); - setMembers(members); - } + super(annotations); + setName(name); + setModifiers(modifiers); + setMembers(members); + } - public TypeDeclaration(Range range, List annotations, + public TypeDeclaration(Range range, List annotations, EnumSet modifiers, String name, List> members) { - super(range, annotations); - setName(name); - setModifiers(modifiers); - setMembers(members); - } - - /** - * Adds the given declaration to the specified type. The list of members - * will be initialized if it is null. - * - * @param decl member declaration - */ - public TypeDeclaration addMember(BodyDeclaration decl) { - List> members = getMembers(); - if (isNullOrEmpty(members)) { - members = new ArrayList<>(); - setMembers(members); - } - members.add(decl); - decl.setParentNode(this); - return this; - } + super(range, annotations); + setName(name); + setModifiers(modifiers); + setMembers(members); + } + + /** + * Adds the given declaration to the specified type. The list of members + * will be initialized if it is null. + * + * @param decl + * member declaration + */ + public TypeDeclaration addMember(BodyDeclaration decl) { + List> members = getMembers(); + if (isNullOrEmpty(members)) { + members = new ArrayList<>(); + setMembers(members); + } + members.add(decl); + decl.setParentNode(this); + return this; + } @Override public List> getMembers() { - members = ensureNotNull(members); - return members; - } + members = ensureNotNull(members); + return members; + } - /** + /** * Return the modifiers of this type declaration. - * - * @return modifiers + * * @see Modifier + * @return modifiers */ - @Override + @Override public final EnumSet getModifiers() { - return modifiers; - } + return modifiers; + } - @Override - public final String getName() { - return name.getName(); - } + @Override + public final String getName() { + return name.getName(); + } @SuppressWarnings("unchecked") @Override public T setMembers(List> members) { - this.members = members; - setAsParentNodeOf(this.members); + this.members = members; + setAsParentNodeOf(this.members); return (T) this; - } + } @SuppressWarnings("unchecked") @Override public T setModifiers(EnumSet modifiers) { - this.modifiers = modifiers; + this.modifiers = modifiers; return (T) this; - } + } @Override @SuppressWarnings("unchecked") public T setName(String name) { - setNameExpr(new NameExpr(name)); + setNameExpr(new NameExpr(name)); return (T) this; - } + } @SuppressWarnings("unchecked") public T setNameExpr(NameExpr nameExpr) { - this.name = nameExpr; - setAsParentNodeOf(this.name); + this.name = nameExpr; + setAsParentNodeOf(this.name); return (T) this; - } - - public final NameExpr getNameExpr() { - return name; - } - - @Override - public JavadocComment getJavaDoc() { - if (getComment() instanceof JavadocComment) { - return (JavadocComment) getComment(); - } - return null; - } + } + + public final NameExpr getNameExpr() { + return name; + } + + @Override + public JavadocComment getJavaDoc() { + if(getComment() instanceof JavadocComment){ + return (JavadocComment) getComment(); + } + return null; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclarator.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclarator.java index 73a40260c7..ff78d6e682 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclarator.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclarator.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -61,11 +61,11 @@ public VariableDeclarator(String variableName) { /** * Defines the declaration of a variable. - * - * @param id The identifier for this variable. IE. The variables name. + * + * @param id The identifier for this variable. IE. The variables name. * @param init What this variable should be initialized to. - * An {@link com.github.javaparser.ast.expr.AssignExpr} is unnecessary as the = operator is - * already added. + * An {@link com.github.javaparser.ast.expr.AssignExpr} is unnecessary as the = operator is + * already added. */ public VariableDeclarator(VariableDeclaratorId id, Expression init) { setId(id); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclaratorId.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclaratorId.java index 812eca95e7..b6dccc2aab 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclaratorId.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/body/VariableDeclaratorId.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.Range; @@ -45,7 +45,7 @@ public VariableDeclaratorId() { } public VariableDeclaratorId(String name) { - setName(name); + setName(name); } public VariableDeclaratorId(Range range, String name, List arrayBracketPairsAfterId) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/BlockComment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/BlockComment.java index e4946b790a..ca162f6d91 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/BlockComment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/BlockComment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.Range; @@ -31,7 +31,7 @@ *

    * Block comments can have multi lines and are delimited by "/*" and * "*/". - * + * * @author Julio Vilmar Gesser */ public final class BlockComment extends Comment { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/Comment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/Comment.java index 41c27cad7c..9da994ec45 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/Comment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/Comment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.Range; @@ -26,11 +26,11 @@ /** * Abstract class for all AST nodes that represent comments. - * - * @author Julio Vilmar Gesser + * * @see BlockComment * @see LineComment * @see JavadocComment + * @author Julio Vilmar Gesser */ public abstract class Comment extends Node { @@ -51,7 +51,7 @@ public Comment(Range range, String content) { /** * Return the text of the comment. - * + * * @return text of the comment */ public final String getContent() { @@ -60,15 +60,17 @@ public final String getContent() { /** * Sets the text of the comment. - * - * @param content the text of the comment to set + * + * @param content + * the text of the comment to set */ public Comment setContent(String content) { this.content = content; return this; } - public boolean isLineComment() { + public boolean isLineComment() + { return false; } @@ -80,16 +82,18 @@ public LineComment asLineComment() { } } - public Node getCommentedNode() { + public Node getCommentedNode() + { return this.commentedNode; } - public Comment setCommentedNode(Node commentedNode) { - if (commentedNode == null) { + public Comment setCommentedNode(Node commentedNode) + { + if (commentedNode==null) { this.commentedNode = null; return this; } - if (commentedNode == this) { + if (commentedNode==this) { throw new IllegalArgumentException(); } if (commentedNode instanceof Comment) { @@ -99,7 +103,8 @@ public Comment setCommentedNode(Node commentedNode) { return this; } - public boolean isOrphan() { + public boolean isOrphan() + { return this.commentedNode == null; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/JavadocComment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/JavadocComment.java index a603869f65..18b77af285 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/JavadocComment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/JavadocComment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.Range; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/LineComment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/LineComment.java index d205282077..56b8054d39 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/LineComment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/comments/LineComment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.Range; @@ -30,7 +30,7 @@ * AST node that represent line comments. *

    * Line comments are started with "//" and finish at the end of the line ("\n"). - * + * * @author Julio Vilmar Gesser */ public final class LineComment extends Comment { @@ -57,7 +57,8 @@ public
    void accept(VoidVisitor v, A arg) { } @Override - public boolean isLineComment() { + public boolean isLineComment() + { return true; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AnnotationExpr.java index fef5b3eb67..a1cad1cdb7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -28,22 +28,21 @@ */ public abstract class AnnotationExpr extends Expression { - protected NameExpr name; + protected NameExpr name; - public AnnotationExpr() { - } + public AnnotationExpr() {} - public AnnotationExpr(Range range) { - super(range); - } + public AnnotationExpr(Range range) { + super(range); + } - public NameExpr getName() { - return name; - } + public NameExpr getName() { + return name; + } - public AnnotationExpr setName(NameExpr name) { - this.name = name; - setAsParentNodeOf(name); - return this; - } + public AnnotationExpr setName(NameExpr name) { + this.name = name; + setAsParentNodeOf(name); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayAccessExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayAccessExpr.java index 1db7f23756..b461ea87bb 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayAccessExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayAccessExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -68,13 +68,13 @@ public Expression getName() { public ArrayAccessExpr setIndex(Expression index) { this.index = index; - setAsParentNodeOf(this.index); + setAsParentNodeOf(this.index); return this; } public ArrayAccessExpr setName(Expression name) { this.name = name; - setAsParentNodeOf(this.name); + setAsParentNodeOf(this.name); return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayCreationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayCreationExpr.java index d0dcb19417..79d55a56ca 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayCreationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayCreationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -91,14 +91,14 @@ public Type getType() { public ArrayCreationExpr setInitializer(ArrayInitializerExpr initializer) { this.initializer = initializer; - setAsParentNodeOf(this.initializer); + setAsParentNodeOf(this.initializer); return this; } @Override public ArrayCreationExpr setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); return this; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayInitializerExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayInitializerExpr.java index 4dcb1ac0dd..67c10739bc 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayInitializerExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ArrayInitializerExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -40,7 +40,7 @@ public ArrayInitializerExpr() { } public ArrayInitializerExpr(List values) { - setValues(values); + setValues(values); } public ArrayInitializerExpr(Range range, List values) { @@ -65,7 +65,7 @@ public List getValues() { public ArrayInitializerExpr setValues(List values) { this.values = values; - setAsParentNodeOf(this.values); + setAsParentNodeOf(this.values); return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AssignExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AssignExpr.java index b5fdc75267..cf16c6fff2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AssignExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/AssignExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -96,13 +96,13 @@ public AssignExpr setOperator(Operator op) { public AssignExpr setTarget(Expression target) { this.target = target; - setAsParentNodeOf(this.target); + setAsParentNodeOf(this.target); return this; } public AssignExpr setValue(Expression value) { this.value = value; - setAsParentNodeOf(this.value); + setAsParentNodeOf(this.value); return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BinaryExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BinaryExpr.java index 7809d8f004..83675c8c49 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BinaryExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BinaryExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -62,16 +62,16 @@ public BinaryExpr() { } public BinaryExpr(Expression left, Expression right, Operator op) { - setLeft(left); - setRight(right); - setOperator(op); + setLeft(left); + setRight(right); + setOperator(op); } public BinaryExpr(Range range, Expression left, Expression right, Operator op) { super(range); - setLeft(left); - setRight(right); - setOperator(op); + setLeft(left); + setRight(right); + setOperator(op); } @Override @@ -98,7 +98,7 @@ public Expression getRight() { public BinaryExpr setLeft(Expression left) { this.left = left; - setAsParentNodeOf(this.left); + setAsParentNodeOf(this.left); return this; } @@ -109,7 +109,7 @@ public BinaryExpr setOperator(Operator op) { public BinaryExpr setRight(Expression right) { this.right = right; - setAsParentNodeOf(this.right); + setAsParentNodeOf(this.right); return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BooleanLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BooleanLiteralExpr.java index 359b936a45..a42c8c722a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BooleanLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/BooleanLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -36,7 +36,7 @@ public BooleanLiteralExpr() { } public BooleanLiteralExpr(boolean value) { - setValue(value); + setValue(value); } public BooleanLiteralExpr(Range range, boolean value) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CastExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CastExpr.java index c32b5a5fee..d2a54bc088 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CastExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CastExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -40,14 +40,14 @@ public CastExpr() { } public CastExpr(Type type, Expression expr) { - setType(type); - setExpr(expr); + setType(type); + setExpr(expr); } public CastExpr(Range range, Type type, Expression expr) { super(range); setType(type); - setExpr(expr); + setExpr(expr); } @Override @@ -71,14 +71,14 @@ public Type getType() { public CastExpr setExpr(Expression expr) { this.expr = expr; - setAsParentNodeOf(this.expr); + setAsParentNodeOf(this.expr); return this; } @Override public CastExpr setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CharLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CharLiteralExpr.java index 95ce62e149..e799e887c3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CharLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/CharLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ClassExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ClassExpr.java index ee724d4545..a6dc9058d0 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ClassExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ClassExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -31,9 +31,8 @@ * Defines an expression that accesses the class of a type. * Example: * - * Object.class + * Object.class * - * * @author Julio Vilmar Gesser */ public final class ClassExpr extends Expression implements NodeWithType { @@ -44,7 +43,7 @@ public ClassExpr() { } public ClassExpr(Type type) { - setType(type); + setType(type); } public ClassExpr(Range range, Type type) { @@ -70,7 +69,7 @@ public Type getType() { @Override public ClassExpr setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ConditionalExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ConditionalExpr.java index 08448c00bc..4dd4c4b0f7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ConditionalExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ConditionalExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -76,19 +76,19 @@ public Expression getThenExpr() { public ConditionalExpr setCondition(Expression condition) { this.condition = condition; - setAsParentNodeOf(this.condition); + setAsParentNodeOf(this.condition); return this; } public ConditionalExpr setElseExpr(Expression elseExpr) { this.elseExpr = elseExpr; - setAsParentNodeOf(this.elseExpr); + setAsParentNodeOf(this.elseExpr); return this; } public ConditionalExpr setThenExpr(Expression thenExpr) { this.thenExpr = thenExpr; - setAsParentNodeOf(this.thenExpr); + setAsParentNodeOf(this.thenExpr); return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/DoubleLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/DoubleLiteralExpr.java index df8f70d4f3..b78923851c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/DoubleLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/DoubleLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,24 +30,22 @@ */ public final class DoubleLiteralExpr extends StringLiteralExpr { - public DoubleLiteralExpr() { - } + public DoubleLiteralExpr() { + } - public DoubleLiteralExpr(final String value) { - super(value); - } + public DoubleLiteralExpr(final String value) { + super(value); + } - public DoubleLiteralExpr(final Range range, final String value) { - super(range, value); - } + public DoubleLiteralExpr(final Range range, final String value) { + super(range, value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/EnclosedExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/EnclosedExpr.java index 61b85e6b78..a7c40febc2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/EnclosedExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/EnclosedExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,37 +30,35 @@ */ public final class EnclosedExpr extends Expression { - private Expression inner; + private Expression inner; - public EnclosedExpr() { - } + public EnclosedExpr() { + } - public EnclosedExpr(final Expression inner) { - setInner(inner); - } + public EnclosedExpr(final Expression inner) { + setInner(inner); + } - public EnclosedExpr(final Range range, final Expression inner) { - super(range); - setInner(inner); - } + public EnclosedExpr(final Range range, final Expression inner) { + super(range); + setInner(inner); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getInner() { - return inner; - } + public Expression getInner() { + return inner; + } - public EnclosedExpr setInner(final Expression inner) { - this.inner = inner; - setAsParentNodeOf(this.inner); - return this; - } + public EnclosedExpr setInner(final Expression inner) { + this.inner = inner; + setAsParentNodeOf(this.inner); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/Expression.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/Expression.java index 2b82a323a1..f9745646fb 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/Expression.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/Expression.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -29,11 +29,11 @@ */ public abstract class Expression extends Node { - public Expression() { - } + public Expression() { + } - public Expression(Range range) { - super(range); - } + public Expression(Range range) { + super(range); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/FieldAccessExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/FieldAccessExpr.java index d1ed170a43..0a4badf5cc 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/FieldAccessExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/FieldAccessExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -34,76 +34,74 @@ */ public final class FieldAccessExpr extends Expression implements NodeWithTypeArguments { - private Expression scope; - - private List> typeArguments; - - private NameExpr field; - - public FieldAccessExpr() { - } - - public FieldAccessExpr(final Expression scope, final String field) { - setScope(scope); - setField(field); - } - - public FieldAccessExpr(final Range range, final Expression scope, final List> typeArguments, final String field) { - super(range); - setScope(scope); - setTypeArguments(typeArguments); - setField(field); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public String getField() { - return field.getName(); - } - - public NameExpr getFieldExpr() { - return field; - } - - public Expression getScope() { - return scope; - } - - public FieldAccessExpr setField(final String field) { - setFieldExpr(new NameExpr(field)); - return this; - } - - public FieldAccessExpr setFieldExpr(NameExpr field) { - this.field = field; - setAsParentNodeOf(this.field); - return this; - } - - public FieldAccessExpr setScope(final Expression scope) { - this.scope = scope; - setAsParentNodeOf(this.scope); - return this; - } - - - @Override - public List> getTypeArguments() { - return typeArguments; - } - - @Override - public FieldAccessExpr setTypeArguments(final List> types) { - this.typeArguments = types; - setAsParentNodeOf(this.typeArguments); - return this; - } + private Expression scope; + + private List> typeArguments; + + private NameExpr field; + + public FieldAccessExpr() { + } + + public FieldAccessExpr(final Expression scope, final String field) { + setScope(scope); + setField(field); + } + + public FieldAccessExpr(final Range range, final Expression scope, final List> typeArguments, final String field) { + super(range); + setScope(scope); + setTypeArguments(typeArguments); + setField(field); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public String getField() { + return field.getName(); + } + + public NameExpr getFieldExpr() { + return field; + } + + public Expression getScope() { + return scope; + } + + public FieldAccessExpr setField(final String field) { + setFieldExpr(new NameExpr(field)); + return this; + } + + public FieldAccessExpr setFieldExpr(NameExpr field) { + this.field = field; + setAsParentNodeOf(this.field); + return this; + } + + public FieldAccessExpr setScope(final Expression scope) { + this.scope = scope; + setAsParentNodeOf(this.scope); + return this; + } + + + @Override + public List> getTypeArguments() { + return typeArguments; + } + + @Override + public FieldAccessExpr setTypeArguments(final List> types) { + this.typeArguments = types; + setAsParentNodeOf(this.typeArguments); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/InstanceOfExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/InstanceOfExpr.java index 6283854901..ffc248ce6a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/InstanceOfExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/InstanceOfExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -32,53 +32,51 @@ */ public final class InstanceOfExpr extends Expression implements NodeWithType { - private Expression expr; + private Expression expr; - private Type type; + private Type type; - public InstanceOfExpr() { - } + public InstanceOfExpr() { + } - public InstanceOfExpr(final Expression expr, final Type type) { - setExpr(expr); - setType(type); - } + public InstanceOfExpr(final Expression expr, final Type type) { + setExpr(expr); + setType(type); + } - public InstanceOfExpr(final Range range, final Expression expr, final Type type) { - super(range); - setExpr(expr); - setType(type); - } + public InstanceOfExpr(final Range range, final Expression expr, final Type type) { + super(range); + setExpr(expr); + setType(type); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - @Override - public Type getType() { - return type; - } + @Override + public Type getType() { + return type; + } - public InstanceOfExpr setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - return this; - } + public InstanceOfExpr setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + return this; + } - @Override + @Override public InstanceOfExpr setType(final Type type) { - this.type = type; - setAsParentNodeOf(this.type); + this.type = type; + setAsParentNodeOf(this.type); return this; - } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralExpr.java index 98710883a4..91f5dec770 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,34 +30,32 @@ */ public class IntegerLiteralExpr extends StringLiteralExpr { - private static final String UNSIGNED_MIN_VALUE = "2147483648"; + private static final String UNSIGNED_MIN_VALUE = "2147483648"; - protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE; + protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE; - public IntegerLiteralExpr() { - } + public IntegerLiteralExpr() { + } - public IntegerLiteralExpr(final String value) { - super(value); - } + public IntegerLiteralExpr(final String value) { + super(value); + } - public IntegerLiteralExpr(final Range range, final String value) { - super(range, value); - } + public IntegerLiteralExpr(final Range range, final String value) { + super(range, value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public final boolean isMinValue() { - return value != null && // - value.length() == 10 && // - value.equals(UNSIGNED_MIN_VALUE); - } + public final boolean isMinValue() { + return value != null && // + value.length() == 10 && // + value.equals(UNSIGNED_MIN_VALUE); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java index 779d3ca508..2665aafe39 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,22 +30,20 @@ */ public final class IntegerLiteralMinValueExpr extends IntegerLiteralExpr { - public IntegerLiteralMinValueExpr() { - super(MIN_VALUE); - } + public IntegerLiteralMinValueExpr() { + super(MIN_VALUE); + } - public IntegerLiteralMinValueExpr(final Range range) { - super(range, MIN_VALUE); - } + public IntegerLiteralMinValueExpr(final Range range) { + super(range, MIN_VALUE); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LambdaExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LambdaExpr.java index 35ca49bc92..4db1b0dfb4 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LambdaExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LambdaExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -38,62 +38,62 @@ */ public class LambdaExpr extends Expression { - private List parameters; + private List parameters; - private boolean parametersEnclosed; + private boolean parametersEnclosed; - private Statement body; + private Statement body; - public LambdaExpr() { - } + public LambdaExpr() { + } - public LambdaExpr(Range range, List parameters, Statement body, + public LambdaExpr(Range range, List parameters, Statement body, boolean parametersEnclosed) { - super(range); - setParameters(parameters); - setBody(body); + super(range); + setParameters(parameters); + setBody(body); setParametersEnclosed(parametersEnclosed); - } + } - public List getParameters() { + public List getParameters() { parameters = ensureNotNull(parameters); return parameters; - } - - public LambdaExpr setParameters(List parameters) { - this.parameters = parameters; - setAsParentNodeOf(this.parameters); - return this; - } - - public Statement getBody() { - return body; - } - - public LambdaExpr setBody(Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - return this; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public boolean isParametersEnclosed() { - return parametersEnclosed; - } - - public LambdaExpr setParametersEnclosed(boolean parametersEnclosed) { - this.parametersEnclosed = parametersEnclosed; - return this; - } + } + + public LambdaExpr setParameters(List parameters) { + this.parameters = parameters; + setAsParentNodeOf(this.parameters); + return this; + } + + public Statement getBody() { + return body; + } + + public LambdaExpr setBody(Statement body) { + this.body = body; + setAsParentNodeOf(this.body); + return this; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public boolean isParametersEnclosed() { + return parametersEnclosed; + } + + public LambdaExpr setParametersEnclosed(boolean parametersEnclosed) { + this.parametersEnclosed = parametersEnclosed; + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LiteralExpr.java index 9eaf9d02ae..9cafefdc4c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -28,10 +28,10 @@ */ public abstract class LiteralExpr extends Expression { - public LiteralExpr() { - } + public LiteralExpr() { + } - public LiteralExpr(Range range) { - super(range); - } + public LiteralExpr(Range range) { + super(range); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralExpr.java index 329c80f220..0e2e8f299b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,35 +30,33 @@ */ public class LongLiteralExpr extends StringLiteralExpr { - private static final String UNSIGNED_MIN_VALUE = "9223372036854775808"; + private static final String UNSIGNED_MIN_VALUE = "9223372036854775808"; - protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE + "L"; + protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE + "L"; - public LongLiteralExpr() { - } + public LongLiteralExpr() { + } - public LongLiteralExpr(final String value) { - super(value); - } + public LongLiteralExpr(final String value) { + super(value); + } - public LongLiteralExpr(final Range range, final String value) { - super(range, value); - } + public LongLiteralExpr(final Range range, final String value) { + super(range, value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public final boolean isMinValue() { - return value != null && // - value.length() == 20 && // - value.startsWith(UNSIGNED_MIN_VALUE) && // - (value.charAt(19) == 'L' || value.charAt(19) == 'l'); - } + public final boolean isMinValue() { + return value != null && // + value.length() == 20 && // + value.startsWith(UNSIGNED_MIN_VALUE) && // + (value.charAt(19) == 'L' || value.charAt(19) == 'l'); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java index 34f8938958..d46145a4a1 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,22 +30,20 @@ */ public final class LongLiteralMinValueExpr extends LongLiteralExpr { - public LongLiteralMinValueExpr() { - super(MIN_VALUE); - } + public LongLiteralMinValueExpr() { + super(MIN_VALUE); + } - public LongLiteralMinValueExpr(final Range range) { - super(range, MIN_VALUE); - } + public LongLiteralMinValueExpr(final Range range) { + super(range, MIN_VALUE); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java index 1c58ff6129..1a117ff976 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,26 +30,24 @@ */ public final class MarkerAnnotationExpr extends AnnotationExpr { - public MarkerAnnotationExpr() { - } + public MarkerAnnotationExpr() { + } - public MarkerAnnotationExpr(final NameExpr name) { - setName(name); - } + public MarkerAnnotationExpr(final NameExpr name) { + setName(name); + } - public MarkerAnnotationExpr(final Range range, final NameExpr name) { - super(range); - setName(name); - } + public MarkerAnnotationExpr(final Range range, final NameExpr name) { + super(range); + setName(name); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MemberValuePair.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MemberValuePair.java index 3684599100..f87af5dbbe 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MemberValuePair.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MemberValuePair.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -32,52 +32,50 @@ */ public final class MemberValuePair extends Node implements NodeWithName { - private String name; + private String name; - private Expression value; + private Expression value; - public MemberValuePair() { - } + public MemberValuePair() { + } - public MemberValuePair(final String name, final Expression value) { - setName(name); - setValue(value); - } + public MemberValuePair(final String name, final Expression value) { + setName(name); + setValue(value); + } - public MemberValuePair(final Range range, final String name, final Expression value) { - super(range); - setName(name); - setValue(value); - } + public MemberValuePair(final Range range, final String name, final Expression value) { + super(range); + setName(name); + setValue(value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - @Override - public String getName() { - return name; - } + @Override + public String getName() { + return name; + } - public Expression getValue() { - return value; - } + public Expression getValue() { + return value; + } @Override public MemberValuePair setName(final String name) { - this.name = name; + this.name = name; return this; - } + } - public MemberValuePair setValue(final Expression value) { - this.value = value; - setAsParentNodeOf(this.value); - return this; - } + public MemberValuePair setValue(final Expression value) { + this.value = value; + setAsParentNodeOf(this.value); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodCallExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodCallExpr.java index eba053a7f4..98a2464553 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodCallExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodCallExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -58,18 +58,19 @@ public MethodCallExpr(final Expression scope, final String name, final List> typeArguments, final String name, final List args) { - super(range); - setScope(scope); - setTypeArguments(typeArguments); - setName(name); - setArgs(args); - } + public MethodCallExpr(final Range range, final Expression scope, final List> typeArguments, final String name, final List args) { + super(range); + setScope(scope); + setTypeArguments(typeArguments); + setName(name); + setArgs(args); + } /** * Adds the given argument to the method call. * - * @param arg argument value + * @param arg + * argument value */ public MethodCallExpr addArgument(Expression arg) { getArgs().add(arg); @@ -108,10 +109,10 @@ public Expression getScope() { return scope; } - public void setArgs(final List args) { - this.args = args; - setAsParentNodeOf(this.args); - } + public void setArgs(final List args) { + this.args = args; + setAsParentNodeOf(this.args); + } public MethodCallExpr setName(final String name) { setNameExpr(new NameExpr(name)); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodReferenceExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodReferenceExpr.java index 80d12d3f9e..d048ca16ad 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodReferenceExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/MethodReferenceExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -34,12 +34,12 @@ /** * Method reference expressions introduced in Java 8 specifically designed to simplify lambda Expressions. * These are some examples: - *

    - * System.out::println; - *

    - * (test ? stream.map(String::trim) : stream)::toArray; * + * System.out::println; + * + * (test ? stream.map(String::trim) : stream)::toArray; * @author Raquel Pau + * */ public class MethodReferenceExpr extends Expression implements NodeWithTypeArguments { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NameExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NameExpr.java index ef32048e10..331fa2af3c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NameExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NameExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -31,56 +31,55 @@ */ public class NameExpr extends Expression implements NodeWithName { - private String name; + private String name; - public NameExpr() { - } + public NameExpr() { + } - public NameExpr(final String name) { - this.name = name; - } + public NameExpr(final String name) { + this.name = name; + } - public NameExpr(Range range, final String name) { - super(range); - this.name = name; - } + public NameExpr(Range range, final String name) { + super(range); + this.name = name; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - @Override - public final String getName() { - return name; - } + @Override + public final String getName() { + return name; + } @Override public NameExpr setName(final String name) { - this.name = name; + this.name = name; return this; - } + } - /** - * Creates a new {@link NameExpr} from a qualified name.
    - * The qualified name can contains "." (dot) characters. - * - * @param qualifiedName qualified name - * @return instanceof {@link NameExpr} - */ - public static NameExpr name(String qualifiedName) { - String[] split = qualifiedName.split("\\."); - NameExpr ret = new NameExpr(split[0]); - for (int i = 1; i < split.length; i++) { - ret = new QualifiedNameExpr(ret, split[i]); - } - return ret; - } + /** + * Creates a new {@link NameExpr} from a qualified name.
    + * The qualified name can contains "." (dot) characters. + * + * @param qualifiedName + * qualified name + * @return instanceof {@link NameExpr} + */ + public static NameExpr name(String qualifiedName) { + String[] split = qualifiedName.split("\\."); + NameExpr ret = new NameExpr(split[0]); + for (int i = 1; i < split.length; i++) { + ret = new QualifiedNameExpr(ret, split[i]); + } + return ret; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NormalAnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NormalAnnotationExpr.java index 5750c15240..502b11dbde 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NormalAnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NormalAnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -78,7 +78,7 @@ public NormalAnnotationExpr setPairs(final List pairs) { /** * adds a pair to this annotation - * + * * @return this, the {@link NormalAnnotationExpr} */ public NormalAnnotationExpr addPair(String key, String value) { @@ -87,7 +87,7 @@ public NormalAnnotationExpr addPair(String key, String value) { /** * adds a pair to this annotation - * + * * @return this, the {@link NormalAnnotationExpr} */ public NormalAnnotationExpr addPair(String key, NameExpr value) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NullLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NullLiteralExpr.java index cc4c392a35..cb0a92b83c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NullLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/NullLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,20 +30,18 @@ */ public final class NullLiteralExpr extends LiteralExpr { - public NullLiteralExpr() { - } + public NullLiteralExpr() { + } - public NullLiteralExpr(final Range range) { - super(range); - } + public NullLiteralExpr(final Range range) { + super(range); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public
    void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ObjectCreationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ObjectCreationExpr.java index 541ab332db..4d06ff8db2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ObjectCreationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ObjectCreationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -39,12 +39,12 @@ * Defines constructor call expression. * Example: * - * new Object() + * new Object() * * * @author Julio Vilmar Gesser */ -public final class ObjectCreationExpr extends Expression implements +public final class ObjectCreationExpr extends Expression implements NodeWithTypeArguments, NodeWithType { @@ -64,10 +64,10 @@ public ObjectCreationExpr() { /** * Defines a call to a constructor. - * + * * @param scope may be null - * @param type this is the class that the constructor is being called for. - * @param args Any arguments to pass to the constructor + * @param type this is the class that the constructor is being called for. + * @param args Any arguments to pass to the constructor */ public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final List args) { setScope(scope); @@ -75,16 +75,16 @@ public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType typ setArgs(args); } - public ObjectCreationExpr(final Range range, - final Expression scope, final ClassOrInterfaceType type, final List> typeArguments, + public ObjectCreationExpr(final Range range, + final Expression scope, final ClassOrInterfaceType type, final List> typeArguments, final List args, final List> anonymousBody) { - super(range); - setScope(scope); - setType(type); - setTypeArguments(typeArguments); - setArgs(args); - setAnonymousClassBody(anonymousBody); - } + super(range); + setScope(scope); + setType(type); + setTypeArguments(typeArguments); + setArgs(args); + setAnonymousClassBody(anonymousBody); + } @Override public R accept(final GenericVisitor v, final A arg) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/QualifiedNameExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/QualifiedNameExpr.java index 9185b7d126..dd906310d5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/QualifiedNameExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/QualifiedNameExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,38 +30,36 @@ */ public final class QualifiedNameExpr extends NameExpr { - private NameExpr qualifier; + private NameExpr qualifier; - public QualifiedNameExpr() { - } + public QualifiedNameExpr() { + } - public QualifiedNameExpr(final NameExpr scope, final String name) { - super(name); - setQualifier(scope); - } + public QualifiedNameExpr(final NameExpr scope, final String name) { + super(name); + setQualifier(scope); + } - public QualifiedNameExpr(final Range range, final NameExpr scope, final String name) { - super(range, name); - setQualifier(scope); - } + public QualifiedNameExpr(final Range range, final NameExpr scope, final String name) { + super(range, name); + setQualifier(scope); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public NameExpr getQualifier() { - return qualifier; - } + public NameExpr getQualifier() { + return qualifier; + } - public QualifiedNameExpr setQualifier(final NameExpr qualifier) { - this.qualifier = qualifier; - setAsParentNodeOf(this.qualifier); - return this; - } + public QualifiedNameExpr setQualifier(final NameExpr qualifier) { + this.qualifier = qualifier; + setAsParentNodeOf(this.qualifier); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java index 6d6208311d..bd6692c83c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,39 +30,37 @@ */ public final class SingleMemberAnnotationExpr extends AnnotationExpr { - private Expression memberValue; + private Expression memberValue; - public SingleMemberAnnotationExpr() { - } + public SingleMemberAnnotationExpr() { + } - public SingleMemberAnnotationExpr(final NameExpr name, final Expression memberValue) { - setName(name); - setMemberValue(memberValue); - } + public SingleMemberAnnotationExpr(final NameExpr name, final Expression memberValue) { + setName(name); + setMemberValue(memberValue); + } - public SingleMemberAnnotationExpr(final Range range, final NameExpr name, final Expression memberValue) { - super(range); - setName(name); - setMemberValue(memberValue); - } + public SingleMemberAnnotationExpr(final Range range, final NameExpr name, final Expression memberValue) { + super(range); + setName(name); + setMemberValue(memberValue); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getMemberValue() { - return memberValue; - } + public Expression getMemberValue() { + return memberValue; + } - public SingleMemberAnnotationExpr setMemberValue(final Expression memberValue) { - this.memberValue = memberValue; - setAsParentNodeOf(this.memberValue); - return this; - } + public SingleMemberAnnotationExpr setMemberValue(final Expression memberValue) { + this.memberValue = memberValue; + setAsParentNodeOf(this.memberValue); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/StringLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/StringLiteralExpr.java index 7701550a30..f66a594dac 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/StringLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/StringLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -28,52 +28,49 @@ /** * Java® Language Specification 3.10.5 String Literals - * * @author Julio Vilmar Gesser */ public class StringLiteralExpr extends LiteralExpr { - protected String value; + protected String value; - public StringLiteralExpr() { + public StringLiteralExpr() { this.value = ""; - } + } - public StringLiteralExpr(final String value) { + public StringLiteralExpr(final String value) { if (value.contains("\n") || value.contains("\r")) { throw new IllegalArgumentException("Illegal literal expression: newlines (line feed or carriage return) have to be escaped"); } - this.value = value; - } + this.value = value; + } - /** - * Utility method that creates a new StringLiteralExpr. Escapes EOL characters. - */ - public static StringLiteralExpr escape(String string) { - return new StringLiteralExpr(Utils.escapeEndOfLines(string)); - } + /** + * Utility method that creates a new StringLiteralExpr. Escapes EOL characters. + */ + public static StringLiteralExpr escape(String string) { + return new StringLiteralExpr(Utils.escapeEndOfLines(string)); + } - public StringLiteralExpr(final Range range, final String value) { - super(range); - this.value = value; - } + public StringLiteralExpr(final Range range, final String value) { + super(range); + this.value = value; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public final String getValue() { - return value; - } + public final String getValue() { + return value; + } - public final StringLiteralExpr setValue(final String value) { - this.value = value; - return this; - } + public final StringLiteralExpr setValue(final String value) { + this.value = value; + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SuperExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SuperExpr.java index 9d89128508..3f5e1866cb 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SuperExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/SuperExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,37 +30,35 @@ */ public final class SuperExpr extends Expression { - private Expression classExpr; + private Expression classExpr; - public SuperExpr() { - } + public SuperExpr() { + } - public SuperExpr(final Expression classExpr) { - setClassExpr(classExpr); - } + public SuperExpr(final Expression classExpr) { + setClassExpr(classExpr); + } - public SuperExpr(final Range range, final Expression classExpr) { - super(range); - setClassExpr(classExpr); - } + public SuperExpr(final Range range, final Expression classExpr) { + super(range); + setClassExpr(classExpr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getClassExpr() { - return classExpr; - } + public Expression getClassExpr() { + return classExpr; + } - public SuperExpr setClassExpr(final Expression classExpr) { - this.classExpr = classExpr; - setAsParentNodeOf(this.classExpr); - return this; - } + public SuperExpr setClassExpr(final Expression classExpr) { + this.classExpr = classExpr; + setAsParentNodeOf(this.classExpr); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ThisExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ThisExpr.java index 7916599407..117fed53de 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ThisExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/ThisExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,37 +30,35 @@ */ public final class ThisExpr extends Expression { - private Expression classExpr; + private Expression classExpr; - public ThisExpr() { - } + public ThisExpr() { + } - public ThisExpr(final Expression classExpr) { - setClassExpr(classExpr); - } + public ThisExpr(final Expression classExpr) { + setClassExpr(classExpr); + } - public ThisExpr(final Range range, final Expression classExpr) { - super(range); - setClassExpr(classExpr); - } + public ThisExpr(final Range range, final Expression classExpr) { + super(range); + setClassExpr(classExpr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getClassExpr() { - return classExpr; - } + public Expression getClassExpr() { + return classExpr; + } - public ThisExpr setClassExpr(final Expression classExpr) { - this.classExpr = classExpr; - setAsParentNodeOf(this.classExpr); - return this; - } + public ThisExpr setClassExpr(final Expression classExpr) { + this.classExpr = classExpr; + setAsParentNodeOf(this.classExpr); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/TypeExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/TypeExpr.java index b8ed9eaea0..28b14e19fd 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/TypeExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/TypeExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -29,15 +29,14 @@ /** * This class is just instantiated as scopes for MethodReferenceExpr nodes to encapsulate Types. - * * @author Raquel Pau + * */ public class TypeExpr extends Expression implements NodeWithType { private Type type; - public TypeExpr() { - } + public TypeExpr(){} public TypeExpr(Range range, Type type) { super(range); @@ -67,4 +66,5 @@ public TypeExpr setType(Type type) { } + } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/UnaryExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/UnaryExpr.java index 08460c7f8c..eef9101ee8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/UnaryExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/UnaryExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.Range; @@ -30,61 +30,59 @@ */ public final class UnaryExpr extends Expression { - public enum Operator { - positive, // + - negative, // - - preIncrement, // ++ - preDecrement, // -- - not, // ! - inverse, // ~ - posIncrement, // ++ - posDecrement, // -- - } + public enum Operator { + positive, // + + negative, // - + preIncrement, // ++ + preDecrement, // -- + not, // ! + inverse, // ~ + posIncrement, // ++ + posDecrement, // -- + } - private Expression expr; + private Expression expr; - private Operator op; + private Operator op; - public UnaryExpr() { - } + public UnaryExpr() { + } - public UnaryExpr(final Expression expr, final Operator op) { - setExpr(expr); - setOperator(op); - } + public UnaryExpr(final Expression expr, final Operator op) { + setExpr(expr); + setOperator(op); + } - public UnaryExpr(final Range range, final Expression expr, final Operator op) { - super(range); - setExpr(expr); - setOperator(op); - } + public UnaryExpr(final Range range, final Expression expr, final Operator op) { + super(range); + setExpr(expr); + setOperator(op); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public Operator getOperator() { - return op; - } + public Operator getOperator() { + return op; + } - public UnaryExpr setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - return this; - } + public UnaryExpr setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + return this; + } - public UnaryExpr setOperator(final Operator op) { - this.op = op; - return this; - } + public UnaryExpr setOperator(final Operator op) { + this.op = op; + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/VariableDeclarationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/VariableDeclarationExpr.java index 7c8157011f..5bb0f62998 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/VariableDeclarationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/expr/VariableDeclarationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -139,9 +139,9 @@ public List getAnnotations() { /** * Return the modifiers of this variable declaration. - * - * @return modifiers + * * @see Modifier + * @return modifiers */ @Override public EnumSet getModifiers() { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java index ef4f391b9b..71ff7179b5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -46,7 +46,7 @@ public interface NodeWithAnnotations { /** * Annotates this - * + * * @param name the name of the annotation * @return the {@link NormalAnnotationExpr} added */ @@ -60,7 +60,7 @@ public default NormalAnnotationExpr addAnnotation(String name) { /** * Annotates this and automatically add the import - * + * * @param clazz the class of the annotation * @return the {@link NormalAnnotationExpr} added */ @@ -71,7 +71,7 @@ public default NormalAnnotationExpr addAnnotation(Class cl /** * Annotates this with a marker annotation - * + * * @param name the name of the annotation * @return this */ @@ -86,7 +86,7 @@ public default T addMarkerAnnotation(String name) { /** * Annotates this with a marker annotation and automatically add the import - * + * * @param clazz the class of the annotation * @return this */ @@ -97,8 +97,8 @@ public default T addMarkerAnnotation(Class clazz) { /** * Annotates this with a single member annotation - * - * @param name the name of the annotation + * + * @param name the name of the annotation * @param value the value, don't forget to add \"\" for a string value * @return this */ @@ -113,7 +113,7 @@ public default T addSingleMemberAnnotation(String name, String value) { /** * Annotates this with a single member annotation and automatically add the import - * + * * @param clazz the class of the annotation * @param value the value, don't forget to add \"\" for a string value * @return this @@ -126,7 +126,7 @@ public default T addSingleMemberAnnotation(Class clazz, /** * Check whether an annotation with this name is present on this element - * + * * @param annotationName the name of the annotation * @return true if found, false if not */ @@ -136,7 +136,7 @@ public default boolean isAnnotationPresent(String annotationName) { /** * Check whether an annotation with this class is present on this element - * + * * @param annotationClass the class of the annotation * @return true if found, false if not */ @@ -146,7 +146,7 @@ public default boolean isAnnotationPresent(Class annotatio /** * Try to find an annotation by its name - * + * * @param annotationName the name of the annotation * @return null if not found, the annotation otherwise */ @@ -157,7 +157,7 @@ public default AnnotationExpr getAnnotationByName(String annotationName) { /** * Try to find an annotation by its class - * + * * @param annotationClass the class of the annotation * @return null if not found, the annotation otherwise */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java index d04089e0be..875d28de0c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.nodeTypes; /** @@ -32,7 +32,6 @@ public interface NodeWithDeclaration { /** * As {@link NodeWithDeclaration#getDeclarationAsString(boolean, boolean, boolean)} including * the modifiers, the throws clause and the parameters with both type and name. - * * @return String representation of declaration */ String getDeclarationAsString(); @@ -40,9 +39,8 @@ public interface NodeWithDeclaration { /** * As {@link NodeWithDeclaration#getDeclarationAsString(boolean, boolean, boolean)} including * the parameters with both type and name. - * * @param includingModifiers flag to include the modifiers (if present) in the string produced - * @param includingThrows flag to include the throws clause (if present) in the string produced + * @param includingThrows flag to include the throws clause (if present) in the string produced * @return String representation of declaration based on parameter flags */ String getDeclarationAsString(boolean includingModifiers, boolean includingThrows); @@ -50,9 +48,8 @@ public interface NodeWithDeclaration { /** * A simple representation of the element declaration. * It should fit one string. - * - * @param includingModifiers flag to include the modifiers (if present) in the string produced - * @param includingThrows flag to include the throws clause (if present) in the string produced + * @param includingModifiers flag to include the modifiers (if present) in the string produced + * @param includingThrows flag to include the throws clause (if present) in the string produced * @param includingParameterName flag to include the parameter name (while the parameter type is always included) in the string produced * @return String representation of declaration based on parameter flags */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithElementType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithElementType.java index 309a954ad6..21a41bad81 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithElementType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithElementType.java @@ -35,7 +35,7 @@ * In most cases, the element type is simply the type. * In case of arrays, the element type is the type that is inside the deepest nesting: * for int[][][], the element type is int. - *

    + * * The main reason for this interface is to permit users to manipulate homogeneously all nodes with getElementType/setElementType * methods */ @@ -57,7 +57,7 @@ public interface NodeWithElementType { /** * Sets this type to this class and try to import it to the {@link CompilationUnit} if needed - * + * * @param typeClass the type * @return this */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java index 7a7ed603b4..083fc01b1a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java @@ -12,7 +12,7 @@ public interface NodeWithExtends { /** * Add an extends to this and automatically add the import - * + * * @param clazz the class to extand from * @return this */ @@ -23,7 +23,7 @@ public default T addExtends(Class clazz) { /** * Add an extends to this - * + * * @param name the name of the type to extends from * @return this */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java index bc711990ce..3f5192587f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java @@ -12,7 +12,7 @@ public interface NodeWithImplements { /** * Add an implements to this - * + * * @param name the name of the type to extends from * @return this */ @@ -26,7 +26,7 @@ public default T addImplements(String name) { /** * Add an implements to this and automatically add the import - * + * * @param clazz the type to implements from * @return this */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithJavaDoc.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithJavaDoc.java index 32364fc297..b00cffa5d6 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithJavaDoc.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithJavaDoc.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java index 6cb1173eb8..827e5edee3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java @@ -27,9 +27,10 @@ /** * A node having members. - *

    + * * The main reason for this interface is to permit users to manipulate homogeneously all nodes with a getMembers * method. + * */ public interface NodeWithMembers { List> getMembers(); @@ -40,7 +41,7 @@ public interface NodeWithMembers { * Add a field to this and automatically add the import of the type if needed * * @param typeClass the type of the field - * @param name the name of the field + * @param name the name of the field * @param modifiers the modifiers like {@link Modifier#PUBLIC} * @return the {@link FieldDeclaration} created */ @@ -52,8 +53,8 @@ default FieldDeclaration addField(Class typeClass, String name, Modifier... m /** * Add a field to this * - * @param type the type of the field - * @param name the name of the field + * @param type the type of the field + * @param name the name of the field * @param modifiers the modifiers like {@link Modifier#PUBLIC} * @return the {@link FieldDeclaration} created */ @@ -64,8 +65,8 @@ default FieldDeclaration addField(String type, String name, Modifier... modifier /** * Add a field to this * - * @param type the type of the field - * @param name the name of the field + * @param type the type of the field + * @param name the name of the field * @param modifiers the modifiers like {@link Modifier#PUBLIC} * @return the {@link FieldDeclaration} created */ @@ -86,7 +87,7 @@ default FieldDeclaration addField(Type type, String name, Modifier... modifie * Add a private field to this * * @param typeClass the type of the field - * @param name the name of the field + * @param name the name of the field * @return the {@link FieldDeclaration} created */ default FieldDeclaration addPrivateField(Class typeClass, String name) { @@ -107,9 +108,9 @@ default FieldDeclaration addPrivateField(String type, String name) { /** * Add a public field to this - * + * * @param typeClass the type of the field - * @param name the name of the field + * @param name the name of the field * @return the {@link FieldDeclaration} created */ default FieldDeclaration addPublicField(Class typeClass, String name) { @@ -132,7 +133,7 @@ default FieldDeclaration addPublicField(String type, String name) { * Add a protected field to this * * @param typeClass the type of the field - * @param name the name of the field + * @param name the name of the field * @return the {@link FieldDeclaration} created */ default FieldDeclaration addProtectedField(Class typeClass, String name) { @@ -155,7 +156,7 @@ default FieldDeclaration addProtectedField(String type, String name) { * Adds a methods with void return by default to this * * @param methodName the method name - * @param modifiers the modifiers like {@link Modifier#PUBLIC} + * @param modifiers the modifiers like {@link Modifier#PUBLIC} * @return the {@link MethodDeclaration} created */ default MethodDeclaration addMethod(String methodName, Modifier... modifiers) { @@ -171,7 +172,7 @@ default MethodDeclaration addMethod(String methodName, Modifier... modifiers) { /** * Adds a constructor to this - * + * * @param modifiers the modifiers like {@link Modifier#PUBLIC} * @return the {@link MethodDeclaration} created */ @@ -229,14 +230,14 @@ default List getMethods() { * Try to find a {@link MethodDeclaration} by its parameters types * * @param paramTypes the types of parameters like "Map<Integer,String>","int" to match
    - * void foo(Map<Integer,String> myMap,int number) + * void foo(Map<Integer,String> myMap,int number) * @return the methods found (multiple in case of polymorphism) */ default List getMethodsByParameterTypes(String... paramTypes) { return getMembers().stream() .filter(m -> m instanceof MethodDeclaration && ((MethodDeclaration) m).getParameters().stream().map(p -> p.getType().toString()) - .collect(toSet()).equals(Stream.of(paramTypes).collect(toSet()))) + .collect(toSet()).equals(Stream.of(paramTypes).collect(toSet()))) .map(m -> (MethodDeclaration) m).collect(toList()); } @@ -244,15 +245,15 @@ default List getMethodsByParameterTypes(String... paramTypes) * Try to find a {@link MethodDeclaration} by its parameters types * * @param paramTypes the types of parameters like "Map<Integer,String>","int" to match
    - * void foo(Map<Integer,String> myMap,int number) + * void foo(Map<Integer,String> myMap,int number) * @return the methods found (multiple in case of polymorphism) */ default List getMethodsByParameterTypes(Class... paramTypes) { return getMembers().stream() .filter(m -> m instanceof MethodDeclaration && ((MethodDeclaration) m).getParameters().stream().map(p -> p.getType().toString()) - .collect(toSet()) - .equals(Stream.of(paramTypes).map(Class::getSimpleName).collect(toSet()))) + .collect(toSet()) + .equals(Stream.of(paramTypes).map(Class::getSimpleName).collect(toSet()))) .map(m -> (MethodDeclaration) m).collect(toList()); } @@ -270,13 +271,13 @@ default FieldDeclaration getFieldByName(String name) { } /** - * Find all fields in the members of this node. + * Find all fields in the members of this node. * - * @return the fields found. This list is immutable. + * @return the fields found. This list is immutable. */ default List getFields() { return unmodifiableList(getMembers().stream() - .filter(m -> m instanceof FieldDeclaration) + .filter(m -> m instanceof FieldDeclaration ) .map(m -> (FieldDeclaration) m) .collect(toList())); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java index 9c377def81..6a1959ecfe 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java @@ -13,8 +13,8 @@ public interface NodeWithModifiers { /** * Return the modifiers of this variable declaration. * - * @return modifiers * @see Modifier + * @return modifiers */ EnumSet getModifiers(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithName.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithName.java index ac19520e6a..edcff5cff9 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithName.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithName.java @@ -23,10 +23,10 @@ /** * A node having a name. - *

    + * * The main reason for this interface is to permit users to manipulate homogeneously all nodes with a getName method. - * - * @since 2.0.1 + * + * @since 2.0.1 */ public interface NodeWithName { String getName(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java index 9b4a810b0e..fb8697f3cc 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java @@ -24,9 +24,9 @@ default T addParameter(Class paramClass, String name) { /** * Remember to import the class in the compilation unit yourself - * + * * @param className the name of the class, ex : org.test.Foo or Foo if you added manually the import - * @param name the name of the parameter + * @param name the name of the parameter */ default T addParameter(String className, String name) { return addParameter(new ClassOrInterfaceType(className), name); @@ -50,9 +50,9 @@ default Parameter addAndGetParameter(Class paramClass, String name) { /** * Remember to import the class in the compilation unit yourself - * + * * @param className the name of the class, ex : org.test.Foo or Foo if you added manually the import - * @param name the name of the parameter + * @param name the name of the parameter * @return the {@link Parameter} created */ default Parameter addAndGetParameter(String className, String name) { @@ -67,7 +67,7 @@ default Parameter addAndGetParameter(Parameter parameter) { /** * Try to find a {@link Parameter} by its name - * + * * @param name the name of the param * @return null if not found, the param found otherwise */ @@ -78,7 +78,7 @@ default Parameter getParamByName(String name) { /** * Try to find a {@link Parameter} by its type - * + * * @param type the type of the param * @return null if not found, the param found otherwise */ @@ -89,7 +89,7 @@ default Parameter getParamByType(String type) { /** * Try to find a {@link Parameter} by its type - * + * * @param type the type of the param take care about generics, it wont work * @return null if not found, the param found otherwise */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithThrowable.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithThrowable.java index 593545b9d3..beee9e7274 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithThrowable.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithThrowable.java @@ -13,7 +13,7 @@ public interface NodeWithThrowable { /** * Adds this type to the throws clause - * + * * @param throwType the exception type * @return this */ @@ -26,7 +26,7 @@ default T addThrows(ReferenceType throwType) { /** * Adds this class to the throws clause - * + * * @param clazz the exception class * @return this */ @@ -37,7 +37,7 @@ default T addThrows(Class clazz) { /** * Check whether this elements throws this exception class - * + * * @param clazz the class of the exception * @return true if found in throws clause, false if not */ @@ -47,7 +47,7 @@ public default boolean isThrows(Class clazz) { /** * Check whether this elements throws this exception class - * + * * @param throwableName the class of the exception * @return true if found in throws clause, false if not */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithType.java index 79679f5794..fc183b20bd 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithType.java @@ -28,7 +28,7 @@ /** * A node having a type. - *

    + * * The main reason for this interface is to permit users to manipulate homogeneously all nodes with getType/setType * methods * @@ -37,14 +37,14 @@ public interface NodeWithType { /** * Gets the type - * + * * @return the type */ Type getType(); /** * Sets the type - * + * * @param type the type * @return this */ @@ -52,7 +52,7 @@ public interface NodeWithType { /** * Sets this type to this class and try to import it to the {@link CompilationUnit} if needed - * + * * @param typeClass the type * @return this */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java index c6620ed1bc..3ce27971e5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java @@ -31,8 +31,8 @@ * A node that can have type arguments. *

      *     new X();        --> typeArguments == null
    - *     new X<>();      --> typeArguments.types = [], typeArguments.diamondOperator=true
    - *     new X<C,D>();   --> typeArguments.types = [C,D], typeArguments.diamondOperator=false
    + *     new X<>();      --> typeArguments.types = [], typeArguments.diamondOperator=true 
    + *     new X<C,D>();   --> typeArguments.types = [C,D], typeArguments.diamondOperator=false 
      * 
    */ public interface NodeWithTypeArguments { @@ -43,7 +43,6 @@ public interface NodeWithTypeArguments { /** * Allows you to set the generic arguments - * * @param typeArguments The list of types of the generics */ T setTypeArguments(List> typeArguments); @@ -52,7 +51,7 @@ public interface NodeWithTypeArguments { * @return whether the type arguments look like <>. */ default boolean isUsingDiamondOperator() { - if (getTypeArguments() == null) { + if(getTypeArguments()==null){ return false; } return getTypeArguments().isEmpty(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java index caee195c12..2c6702ac48 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/AssertStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/AssertStmt.java index df42434cf3..85a34a847e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/AssertStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/AssertStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -31,57 +31,55 @@ */ public final class AssertStmt extends Statement { - private Expression check; - - private Expression msg; - - public AssertStmt() { - } - - public AssertStmt(final Expression check) { - setCheck(check); - } - - public AssertStmt(final Expression check, final Expression msg) { - setCheck(check); - setMessage(msg); - } - - public AssertStmt(final Range range, final Expression check, final Expression msg) { - super(range); - - setCheck(check); - setMessage(msg); - - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public Expression getCheck() { - return check; - } - - public Expression getMessage() { - return msg; - } - - public AssertStmt setCheck(final Expression check) { - this.check = check; - setAsParentNodeOf(this.check); - return this; - } - - public AssertStmt setMessage(final Expression msg) { - this.msg = msg; - setAsParentNodeOf(this.msg); - return this; - } + private Expression check; + + private Expression msg; + + public AssertStmt() { + } + + public AssertStmt(final Expression check) { + setCheck(check); + } + + public AssertStmt(final Expression check, final Expression msg) { + setCheck(check); + setMessage(msg); + } + + public AssertStmt(final Range range, final Expression check, final Expression msg) { + super(range); + + setCheck(check); + setMessage(msg); + + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public Expression getCheck() { + return check; + } + + public Expression getMessage() { + return msg; + } + + public AssertStmt setCheck(final Expression check) { + this.check = check; + setAsParentNodeOf(this.check); + return this; + } + + public AssertStmt setMessage(final Expression msg) { + this.msg = msg; + setAsParentNodeOf(this.msg); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BlockStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BlockStmt.java index 4aa6c838a3..31cbfa3917 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BlockStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BlockStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -73,4 +73,5 @@ public BlockStmt setStmts(final List stmts) { } + } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BreakStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BreakStmt.java index d8f0609d33..04c39fb9f5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BreakStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/BreakStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -30,36 +30,34 @@ */ public final class BreakStmt extends Statement { - private String id; + private String id; - public BreakStmt() { - } + public BreakStmt() { + } - public BreakStmt(final String id) { - this.id = id; - } + public BreakStmt(final String id) { + this.id = id; + } - public BreakStmt(final Range range, final String id) { - super(range); - this.id = id; - } + public BreakStmt(final Range range, final String id) { + super(range); + this.id = id; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getId() { - return id; - } + public String getId() { + return id; + } - public BreakStmt setId(final String id) { - this.id = id; - return this; - } + public BreakStmt setId(final String id) { + this.id = id; + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/CatchClause.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/CatchClause.java index 7bd096de8b..a1f3005449 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/CatchClause.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/CatchClause.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -54,59 +54,57 @@ public CatchClause(final Parameter param, final BlockStmt catchBlock) { } public CatchClause(final Range range, - final EnumSet exceptModifier, + final EnumSet exceptModifier, final List exceptAnnotations, final Type exceptType, - final VariableDeclaratorId exceptId, + final VariableDeclaratorId exceptId, final BlockStmt catchBlock) { super(range); setParam(new Parameter(range, exceptModifier, exceptAnnotations, exceptType, null, false, exceptId)); setBody(catchBlock); } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } /** * Use {@link #getBody()} instead */ @Deprecated - public BlockStmt getCatchBlock() { - return catchBlock; - } - - /** - * Note that the type of the Parameter can be a UnionType. In this case, any annotations found at the start of the catch(@X A a |...) - * are found directly in the Parameter. Annotations that are on the second or later type - catch(A a | @X B b ...) are found on those types. - */ - public Parameter getParam() { - return param; - } + public BlockStmt getCatchBlock() { + return catchBlock; + } + + /** + * Note that the type of the Parameter can be a UnionType. In this case, any annotations found at the start of the catch(@X A a |...) + * are found directly in the Parameter. Annotations that are on the second or later type - catch(A a | @X B b ...) are found on those types. + */ + public Parameter getParam() { + return param; + } /** * Use {@link #setBody(BlockStmt)} instead - * + * * @param catchBlock */ @Deprecated - public CatchClause setCatchBlock(final BlockStmt catchBlock) { - this.catchBlock = catchBlock; - setAsParentNodeOf(this.catchBlock); + public CatchClause setCatchBlock(final BlockStmt catchBlock) { + this.catchBlock = catchBlock; + setAsParentNodeOf(this.catchBlock); return this; - } + } - public CatchClause setParam(final Parameter param) { - this.param = param; - setAsParentNodeOf(this.param); + public CatchClause setParam(final Parameter param) { + this.param = param; + setAsParentNodeOf(this.param); return this; - } + } @Override public BlockStmt getBody() { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ContinueStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ContinueStmt.java index d067aebd54..4ba7faa7b6 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ContinueStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ContinueStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -30,36 +30,34 @@ */ public final class ContinueStmt extends Statement { - private String id; + private String id; - public ContinueStmt() { - } + public ContinueStmt() { + } - public ContinueStmt(final String id) { - this.id = id; - } + public ContinueStmt(final String id) { + this.id = id; + } - public ContinueStmt(Range range, final String id) { - super(range); - this.id = id; - } + public ContinueStmt(Range range, final String id) { + super(range); + this.id = id; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getId() { - return id; - } + public String getId() { + return id; + } - public ContinueStmt setId(final String id) { - this.id = id; - return this; - } + public ContinueStmt setId(final String id) { + this.id = id; + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/DoStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/DoStmt.java index 33c398641c..8f293ecab0 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/DoStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/DoStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -32,53 +32,51 @@ */ public final class DoStmt extends Statement implements NodeWithBody { - private Statement body; + private Statement body; - private Expression condition; + private Expression condition; - public DoStmt() { - } + public DoStmt() { + } - public DoStmt(final Statement body, final Expression condition) { - setBody(body); - setCondition(condition); - } + public DoStmt(final Statement body, final Expression condition) { + setBody(body); + setCondition(condition); + } - public DoStmt(Range range, final Statement body, final Expression condition) { - super(range); - setBody(body); - setCondition(condition); - } + public DoStmt(Range range, final Statement body, final Expression condition) { + super(range); + setBody(body); + setCondition(condition); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - @Override + @Override public Statement getBody() { - return body; - } + return body; + } - public Expression getCondition() { - return condition; - } + public Expression getCondition() { + return condition; + } - @Override + @Override public DoStmt setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); + this.body = body; + setAsParentNodeOf(this.body); return this; - } + } - public DoStmt setCondition(final Expression condition) { - this.condition = condition; - setAsParentNodeOf(this.condition); - return this; - } + public DoStmt setCondition(final Expression condition) { + this.condition = condition; + setAsParentNodeOf(this.condition); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/EmptyStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/EmptyStmt.java index d82bb631e0..00709806d4 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/EmptyStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/EmptyStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -30,20 +30,18 @@ */ public final class EmptyStmt extends Statement { - public EmptyStmt() { - } + public EmptyStmt() { + } - public EmptyStmt(Range range) { - super(range); - } + public EmptyStmt(Range range) { + super(range); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java index 7e82a58338..e29205b84e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -41,69 +41,69 @@ public final class ExplicitConstructorInvocationStmt extends Statement implement private boolean isThis; - private Expression expr; - - private List args; - - public ExplicitConstructorInvocationStmt() { - } - - public ExplicitConstructorInvocationStmt(final boolean isThis, - final Expression expr, final List args) { - setThis(isThis); - setExpr(expr); - setArgs(args); - } - - public ExplicitConstructorInvocationStmt(Range range, - final List> typeArguments, final boolean isThis, - final Expression expr, final List args) { - super(range); - setTypeArguments(typeArguments); - setThis(isThis); - setExpr(expr); - setArgs(args); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getArgs() { + private Expression expr; + + private List args; + + public ExplicitConstructorInvocationStmt() { + } + + public ExplicitConstructorInvocationStmt(final boolean isThis, + final Expression expr, final List args) { + setThis(isThis); + setExpr(expr); + setArgs(args); + } + + public ExplicitConstructorInvocationStmt(Range range, + final List> typeArguments, final boolean isThis, + final Expression expr, final List args) { + super(range); + setTypeArguments(typeArguments); + setThis(isThis); + setExpr(expr); + setArgs(args); + } + + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public List getArgs() { args = ensureNotNull(args); return args; - } - - public Expression getExpr() { - return expr; - } - - public boolean isThis() { - return isThis; - } - - public ExplicitConstructorInvocationStmt setArgs(final List args) { - this.args = args; - setAsParentNodeOf(this.args); - return this; - } - - public ExplicitConstructorInvocationStmt setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - return this; - } - - public ExplicitConstructorInvocationStmt setThis(final boolean isThis) { - this.isThis = isThis; - return this; - } + } + + public Expression getExpr() { + return expr; + } + + public boolean isThis() { + return isThis; + } + + public ExplicitConstructorInvocationStmt setArgs(final List args) { + this.args = args; + setAsParentNodeOf(this.args); + return this; + } + + public ExplicitConstructorInvocationStmt setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + return this; + } + + public ExplicitConstructorInvocationStmt setThis(final boolean isThis) { + this.isThis = isThis; + return this; + } @Override public List> getTypeArguments() { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExpressionStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExpressionStmt.java index a184a731af..72d8a2e945 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExpressionStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ExpressionStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -31,38 +31,36 @@ */ public final class ExpressionStmt extends Statement { - private Expression expr; + private Expression expr; - public ExpressionStmt() { - } + public ExpressionStmt() { + } - public ExpressionStmt(final Expression expr) { - setExpression(expr); - } + public ExpressionStmt(final Expression expr) { + setExpression(expr); + } - public ExpressionStmt(Range range, - final Expression expr) { - super(range); - setExpression(expr); - } + public ExpressionStmt(Range range, + final Expression expr) { + super(range); + setExpression(expr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpression() { - return expr; - } + public Expression getExpression() { + return expr; + } - public ExpressionStmt setExpression(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - return this; - } + public ExpressionStmt setExpression(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForStmt.java index 6e5596c7de..52baddb7b4 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -36,86 +36,86 @@ */ public final class ForStmt extends Statement implements NodeWithBody { - private List init; + private List init; - private Expression compare; + private Expression compare; - private List update; + private List update; - private Statement body; + private Statement body; - public ForStmt() { - } + public ForStmt() { + } - public ForStmt(final List init, final Expression compare, - final List update, final Statement body) { - setCompare(compare); - setInit(init); - setUpdate(update); - setBody(body); - } + public ForStmt(final List init, final Expression compare, + final List update, final Statement body) { + setCompare(compare); + setInit(init); + setUpdate(update); + setBody(body); + } - public ForStmt(Range range, - final List init, final Expression compare, - final List update, final Statement body) { - super(range); - setCompare(compare); - setInit(init); - setUpdate(update); - setBody(body); - } + public ForStmt(Range range, + final List init, final Expression compare, + final List update, final Statement body) { + super(range); + setCompare(compare); + setInit(init); + setUpdate(update); + setBody(body); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - @Override + @Override public Statement getBody() { - return body; - } + return body; + } - public Expression getCompare() { - return compare; - } + public Expression getCompare() { + return compare; + } - public List getInit() { + public List getInit() { init = ensureNotNull(init); return init; - } + } - public List getUpdate() { + public List getUpdate() { update = ensureNotNull(update); return update; - } + } - @Override + @Override public ForStmt setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - return this; - } - - public ForStmt setCompare(final Expression compare) { - this.compare = compare; - setAsParentNodeOf(this.compare); - return this; - } - - public ForStmt setInit(final List init) { - this.init = init; - setAsParentNodeOf(this.init); - return this; - } - - public ForStmt setUpdate(final List update) { - this.update = update; - setAsParentNodeOf(this.update); + this.body = body; + setAsParentNodeOf(this.body); return this; - } + } + + public ForStmt setCompare(final Expression compare) { + this.compare = compare; + setAsParentNodeOf(this.compare); + return this; + } + + public ForStmt setInit(final List init) { + this.init = init; + setAsParentNodeOf(this.init); + return this; + } + + public ForStmt setUpdate(final List update) { + this.update = update; + setAsParentNodeOf(this.update); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForeachStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForeachStmt.java index 2351c6923c..3a94572b0b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForeachStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ForeachStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -34,34 +34,34 @@ */ public final class ForeachStmt extends Statement implements NodeWithBody { - private VariableDeclarationExpr var; + private VariableDeclarationExpr var; - private Expression iterable; + private Expression iterable; - private Statement body; + private Statement body; - public ForeachStmt() { - } + public ForeachStmt() { + } - public ForeachStmt(final VariableDeclarationExpr var, - final Expression iterable, final Statement body) { - setVariable(var); - setIterable(iterable); - setBody(body); - } + public ForeachStmt(final VariableDeclarationExpr var, + final Expression iterable, final Statement body) { + setVariable(var); + setIterable(iterable); + setBody(body); + } - public ForeachStmt(Range range, - final VariableDeclarationExpr var, final Expression iterable, - final Statement body) { - super(range); - setVariable(var); - setIterable(iterable); - setBody(body); - } + public ForeachStmt(Range range, + final VariableDeclarationExpr var, final Expression iterable, + final Statement body) { + super(range); + setVariable(var); + setIterable(iterable); + setBody(body); + } /** * Will create a {@link NameExpr} with the iterable param - * + * * @param var * @param iterable * @param body @@ -73,44 +73,44 @@ public ForeachStmt(VariableDeclarationExpr var, String iterable, BlockStmt body) } @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - @Override + @Override public Statement getBody() { - return body; - } + return body; + } - public Expression getIterable() { - return iterable; - } + public Expression getIterable() { + return iterable; + } - public VariableDeclarationExpr getVariable() { - return var; - } + public VariableDeclarationExpr getVariable() { + return var; + } - @Override + @Override public ForeachStmt setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - return this; - } - - public ForeachStmt setIterable(final Expression iterable) { - this.iterable = iterable; - setAsParentNodeOf(this.iterable); - return this; - } - - public ForeachStmt setVariable(final VariableDeclarationExpr var) { - this.var = var; - setAsParentNodeOf(this.var); + this.body = body; + setAsParentNodeOf(this.body); return this; - } + } + + public ForeachStmt setIterable(final Expression iterable) { + this.iterable = iterable; + setAsParentNodeOf(this.iterable); + return this; + } + + public ForeachStmt setVariable(final VariableDeclarationExpr var) { + this.var = var; + setAsParentNodeOf(this.var); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/IfStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/IfStmt.java index f7126a9e61..ace3ec8a5c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/IfStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/IfStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -31,66 +31,64 @@ */ public final class IfStmt extends Statement { - private Expression condition; - - private Statement thenStmt; - - private Statement elseStmt; - - public IfStmt() { - } - - public IfStmt(final Expression condition, final Statement thenStmt, final Statement elseStmt) { - setCondition(condition); - setThenStmt(thenStmt); - setElseStmt(elseStmt); - } - - public IfStmt(Range range, - final Expression condition, final Statement thenStmt, final Statement elseStmt) { - super(range); - setCondition(condition); - setThenStmt(thenStmt); - setElseStmt(elseStmt); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public Expression getCondition() { - return condition; - } - - public Statement getElseStmt() { - return elseStmt; - } - - public Statement getThenStmt() { - return thenStmt; - } - - public IfStmt setCondition(final Expression condition) { - this.condition = condition; - setAsParentNodeOf(this.condition); - return this; - } - - public IfStmt setElseStmt(final Statement elseStmt) { - this.elseStmt = elseStmt; - setAsParentNodeOf(this.elseStmt); - return this; - } - - public IfStmt setThenStmt(final Statement thenStmt) { - this.thenStmt = thenStmt; - setAsParentNodeOf(this.thenStmt); - return this; - } + private Expression condition; + + private Statement thenStmt; + + private Statement elseStmt; + + public IfStmt() { + } + + public IfStmt(final Expression condition, final Statement thenStmt, final Statement elseStmt) { + setCondition(condition); + setThenStmt(thenStmt); + setElseStmt(elseStmt); + } + + public IfStmt(Range range, + final Expression condition, final Statement thenStmt, final Statement elseStmt) { + super(range); + setCondition(condition); + setThenStmt(thenStmt); + setElseStmt(elseStmt); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public Expression getCondition() { + return condition; + } + + public Statement getElseStmt() { + return elseStmt; + } + + public Statement getThenStmt() { + return thenStmt; + } + + public IfStmt setCondition(final Expression condition) { + this.condition = condition; + setAsParentNodeOf(this.condition); + return this; + } + + public IfStmt setElseStmt(final Statement elseStmt) { + this.elseStmt = elseStmt; + setAsParentNodeOf(this.elseStmt); + return this; + } + + public IfStmt setThenStmt(final Statement thenStmt) { + this.thenStmt = thenStmt; + setAsParentNodeOf(this.thenStmt); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/LabeledStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/LabeledStmt.java index dae9f95ff9..ded1ad8d89 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/LabeledStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/LabeledStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -30,50 +30,48 @@ */ public final class LabeledStmt extends Statement { - private String label; + private String label; - private Statement stmt; + private Statement stmt; - public LabeledStmt() { - } + public LabeledStmt() { + } - public LabeledStmt(final String label, final Statement stmt) { - setLabel(label); - setStmt(stmt); - } + public LabeledStmt(final String label, final Statement stmt) { + setLabel(label); + setStmt(stmt); + } - public LabeledStmt(Range range, final String label, final Statement stmt) { - super(range); - setLabel(label); - setStmt(stmt); - } + public LabeledStmt(Range range, final String label, final Statement stmt) { + super(range); + setLabel(label); + setStmt(stmt); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getLabel() { - return label; - } + public String getLabel() { + return label; + } - public Statement getStmt() { - return stmt; - } + public Statement getStmt() { + return stmt; + } - public LabeledStmt setLabel(final String label) { - this.label = label; - return this; - } + public LabeledStmt setLabel(final String label) { + this.label = label; + return this; + } - public LabeledStmt setStmt(final Statement stmt) { - this.stmt = stmt; - setAsParentNodeOf(this.stmt); - return this; - } + public LabeledStmt setStmt(final Statement stmt) { + this.stmt = stmt; + setAsParentNodeOf(this.stmt); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ReturnStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ReturnStmt.java index 8d48dc35e2..6ce31d0bfb 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ReturnStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ReturnStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -32,23 +32,23 @@ */ public final class ReturnStmt extends Statement { - private Expression expr; + private Expression expr; - public ReturnStmt() { - } + public ReturnStmt() { + } - public ReturnStmt(final Expression expr) { - setExpr(expr); - } + public ReturnStmt(final Expression expr) { + setExpr(expr); + } - public ReturnStmt(Range range, final Expression expr) { - super(range); - setExpr(expr); - } + public ReturnStmt(Range range, final Expression expr) { + super(range); + setExpr(expr); + } /** * Will create a NameExpr with the string param - * + * * @param expr */ public ReturnStmt(String expr) { @@ -57,21 +57,20 @@ public ReturnStmt(String expr) { @Override public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public ReturnStmt setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - return this; - } + public ReturnStmt setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/Statement.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/Statement.java index 3aa9caec7b..eacfcc4167 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/Statement.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/Statement.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -29,11 +29,11 @@ */ public abstract class Statement extends Node { - public Statement() { - } + public Statement() { + } - public Statement(final Range range) { - super(range); - } + public Statement(final Range range) { + super(range); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchEntryStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchEntryStmt.java index c75a0b134d..e17e20e94c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchEntryStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchEntryStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -36,55 +36,55 @@ */ public final class SwitchEntryStmt extends Statement implements NodeWithStatements { - private Expression label; + private Expression label; - private List stmts; + private List stmts; - public SwitchEntryStmt() { - } + public SwitchEntryStmt() { + } - public SwitchEntryStmt(final Expression label, final List stmts) { - setLabel(label); - setStmts(stmts); - } + public SwitchEntryStmt(final Expression label, final List stmts) { + setLabel(label); + setStmts(stmts); + } - public SwitchEntryStmt(Range range, final Expression label, - final List stmts) { - super(range); - setLabel(label); - setStmts(stmts); - } + public SwitchEntryStmt(Range range, final Expression label, + final List stmts) { + super(range); + setLabel(label); + setStmts(stmts); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getLabel() { - return label; - } + public Expression getLabel() { + return label; + } - @Override + @Override public List getStmts() { stmts = ensureNotNull(stmts); return stmts; - } + } - public SwitchEntryStmt setLabel(final Expression label) { - this.label = label; - setAsParentNodeOf(this.label); - return this; - } + public SwitchEntryStmt setLabel(final Expression label) { + this.label = label; + setAsParentNodeOf(this.label); + return this; + } - @Override + @Override public SwitchEntryStmt setStmts(final List stmts) { - this.stmts = stmts; - setAsParentNodeOf(this.stmts); + this.stmts = stmts; + setAsParentNodeOf(this.stmts); return this; - } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchStmt.java index 5e2313145b..c909394b2b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SwitchStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -35,54 +35,54 @@ */ public final class SwitchStmt extends Statement { - private Expression selector; + private Expression selector; - private List entries; + private List entries; - public SwitchStmt() { - } + public SwitchStmt() { + } - public SwitchStmt(final Expression selector, - final List entries) { - setSelector(selector); - setEntries(entries); - } + public SwitchStmt(final Expression selector, + final List entries) { + setSelector(selector); + setEntries(entries); + } - public SwitchStmt(Range range, final Expression selector, - final List entries) { - super(range); - setSelector(selector); - setEntries(entries); - } + public SwitchStmt(Range range, final Expression selector, + final List entries) { + super(range); + setSelector(selector); + setEntries(entries); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public List getEntries() { + public List getEntries() { entries = ensureNotNull(entries); return entries; - } - - public Expression getSelector() { - return selector; - } - - public SwitchStmt setEntries(final List entries) { - this.entries = entries; - setAsParentNodeOf(this.entries); - return this; - } - - public SwitchStmt setSelector(final Expression selector) { - this.selector = selector; - setAsParentNodeOf(this.selector); - return this; - } + } + + public Expression getSelector() { + return selector; + } + + public SwitchStmt setEntries(final List entries) { + this.entries = entries; + setAsParentNodeOf(this.entries); + return this; + } + + public SwitchStmt setSelector(final Expression selector) { + this.selector = selector; + setAsParentNodeOf(this.selector); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SynchronizedStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SynchronizedStmt.java index 05c2bd38d6..1a9d2db5d7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SynchronizedStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/SynchronizedStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -62,8 +62,8 @@ public void accept(final VoidVisitor v, final A arg) { } /** - * @return * @deprecated use {@link #getBody()} + * @return */ @Deprecated public BlockStmt getBlock() { @@ -75,8 +75,8 @@ public Expression getExpr() { } /** - * @param block * @deprecated Use {@link #setBody(BlockStmt)} instead + * @param block */ @Deprecated public SynchronizedStmt setBlock(final BlockStmt block) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ThrowStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ThrowStmt.java index ceb8cb3978..180fdd04cd 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ThrowStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/ThrowStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -31,37 +31,35 @@ */ public final class ThrowStmt extends Statement { - private Expression expr; + private Expression expr; - public ThrowStmt() { - } + public ThrowStmt() { + } - public ThrowStmt(final Expression expr) { - setExpr(expr); - } + public ThrowStmt(final Expression expr) { + setExpr(expr); + } - public ThrowStmt(Range range, final Expression expr) { - super(range); - setExpr(expr); - } + public ThrowStmt(Range range, final Expression expr) { + super(range); + setExpr(expr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public ThrowStmt setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - return this; - } + public ThrowStmt setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TryStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TryStmt.java index 5c54beebce..4688454b4d 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TryStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TryStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -34,83 +34,83 @@ * @author Julio Vilmar Gesser */ public final class TryStmt extends Statement { + + private List resources; - private List resources; + private BlockStmt tryBlock; - private BlockStmt tryBlock; + private List catchs; - private List catchs; + private BlockStmt finallyBlock; - private BlockStmt finallyBlock; + public TryStmt() { + } - public TryStmt() { - } + public TryStmt(final BlockStmt tryBlock, final List catchs, + final BlockStmt finallyBlock) { + setTryBlock(tryBlock); + setCatchs(catchs); + setFinallyBlock(finallyBlock); + } - public TryStmt(final BlockStmt tryBlock, final List catchs, - final BlockStmt finallyBlock) { - setTryBlock(tryBlock); - setCatchs(catchs); - setFinallyBlock(finallyBlock); - } + public TryStmt(Range range, List resources, + final BlockStmt tryBlock, final List catchs, final BlockStmt finallyBlock) { + super(range); + setResources(resources); + setTryBlock(tryBlock); + setCatchs(catchs); + setFinallyBlock(finallyBlock); + } - public TryStmt(Range range, List resources, - final BlockStmt tryBlock, final List catchs, final BlockStmt finallyBlock) { - super(range); - setResources(resources); - setTryBlock(tryBlock); - setCatchs(catchs); - setFinallyBlock(finallyBlock); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getCatchs() { + public List getCatchs() { catchs = ensureNotNull(catchs); return catchs; - } - - public BlockStmt getFinallyBlock() { - return finallyBlock; - } + } - public BlockStmt getTryBlock() { - return tryBlock; - } + public BlockStmt getFinallyBlock() { + return finallyBlock; + } - public List getResources() { + public BlockStmt getTryBlock() { + return tryBlock; + } + + public List getResources() { resources = ensureNotNull(resources); return resources; - } - - public TryStmt setCatchs(final List catchs) { - this.catchs = catchs; - setAsParentNodeOf(this.catchs); - return this; - } - - public TryStmt setFinallyBlock(final BlockStmt finallyBlock) { - this.finallyBlock = finallyBlock; - setAsParentNodeOf(this.finallyBlock); - return this; - } - - public TryStmt setTryBlock(final BlockStmt tryBlock) { - this.tryBlock = tryBlock; - setAsParentNodeOf(this.tryBlock); - return this; - } - - public TryStmt setResources(List resources) { - this.resources = resources; - setAsParentNodeOf(this.resources); - return this; - } + } + + public TryStmt setCatchs(final List catchs) { + this.catchs = catchs; + setAsParentNodeOf(this.catchs); + return this; + } + + public TryStmt setFinallyBlock(final BlockStmt finallyBlock) { + this.finallyBlock = finallyBlock; + setAsParentNodeOf(this.finallyBlock); + return this; + } + + public TryStmt setTryBlock(final BlockStmt tryBlock) { + this.tryBlock = tryBlock; + setAsParentNodeOf(this.tryBlock); + return this; + } + + public TryStmt setResources(List resources) { + this.resources = resources; + setAsParentNodeOf(this.resources); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java index b9412eeaab..a9f83bf785 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -31,37 +31,35 @@ */ public final class TypeDeclarationStmt extends Statement { - private TypeDeclaration typeDecl; + private TypeDeclaration typeDecl; - public TypeDeclarationStmt() { - } + public TypeDeclarationStmt() { + } - public TypeDeclarationStmt(final TypeDeclaration typeDecl) { - setTypeDeclaration(typeDecl); - } + public TypeDeclarationStmt(final TypeDeclaration typeDecl) { + setTypeDeclaration(typeDecl); + } - public TypeDeclarationStmt(Range range, final TypeDeclaration typeDecl) { - super(range); - setTypeDeclaration(typeDecl); - } + public TypeDeclarationStmt(Range range, final TypeDeclaration typeDecl) { + super(range); + setTypeDeclaration(typeDecl); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public TypeDeclaration getTypeDeclaration() { - return typeDecl; - } + public TypeDeclaration getTypeDeclaration() { + return typeDecl; + } - public TypeDeclarationStmt setTypeDeclaration(final TypeDeclaration typeDecl) { - this.typeDecl = typeDecl; - setAsParentNodeOf(this.typeDecl); - return this; - } + public TypeDeclarationStmt setTypeDeclaration(final TypeDeclaration typeDecl) { + this.typeDecl = typeDecl; + setAsParentNodeOf(this.typeDecl); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/WhileStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/WhileStmt.java index 4f3b4f7cf8..b843494a40 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/WhileStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/stmt/WhileStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.Range; @@ -32,53 +32,51 @@ */ public final class WhileStmt extends Statement implements NodeWithBody { - private Expression condition; + private Expression condition; - private Statement body; + private Statement body; - public WhileStmt() { - } + public WhileStmt() { + } - public WhileStmt(final Expression condition, final Statement body) { - setCondition(condition); - setBody(body); - } + public WhileStmt(final Expression condition, final Statement body) { + setCondition(condition); + setBody(body); + } - public WhileStmt(Range range, final Expression condition, final Statement body) { - super(range); - setCondition(condition); - setBody(body); - } + public WhileStmt(Range range, final Expression condition, final Statement body) { + super(range); + setCondition(condition); + setBody(body); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - @Override + @Override public Statement getBody() { - return body; - } + return body; + } - public Expression getCondition() { - return condition; - } + public Expression getCondition() { + return condition; + } - @Override + @Override public WhileStmt setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); + this.body = body; + setAsParentNodeOf(this.body); return this; - } + } - public WhileStmt setCondition(final Expression condition) { - this.condition = condition; - setAsParentNodeOf(this.condition); - return this; - } + public WhileStmt setCondition(final Expression condition) { + this.condition = condition; + setAsParentNodeOf(this.condition); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ArrayType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ArrayType.java index f425bdabf0..babf2a5d75 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ArrayType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ArrayType.java @@ -30,13 +30,11 @@ public ArrayType(Range range, Type componentType, List annotatio setAnnotations(annotations); } - @Override - public R accept(final GenericVisitor v, final A arg) { + @Override public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } - @Override - public void accept(final VoidVisitor v, final A arg) { + @Override public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -81,7 +79,7 @@ public static Pair> unwrapArrayTypes(Type type) { } return new Pair<>(type, arrayBracketPairs); } - + public static ArrayType arrayOf(Type type, AnnotationExpr... annotations) { return new ArrayType(type, Arrays.asList(annotations)); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ClassOrInterfaceType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ClassOrInterfaceType.java index ea989585b4..ac308940da 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ClassOrInterfaceType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ClassOrInterfaceType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -35,8 +35,8 @@ /** * @author Julio Vilmar Gesser */ -public final class ClassOrInterfaceType extends ReferenceType implements - NodeWithName, +public final class ClassOrInterfaceType extends ReferenceType implements + NodeWithName, NodeWithAnnotations, NodeWithTypeArguments { @@ -65,13 +65,11 @@ public ClassOrInterfaceType(final Range range, final ClassOrInterfaceType scope, setTypeArguments(typeArguments); } - @Override - public R accept(final GenericVisitor v, final A arg) { + @Override public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } - @Override - public void accept(final VoidVisitor v, final A arg) { + @Override public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/IntersectionType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/IntersectionType.java index 9c78ba5c8e..029d465378 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/IntersectionType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/IntersectionType.java @@ -10,10 +10,10 @@ /** * Represents a set of types. A given value of this type has to be assignable to at all of the element types. * As of Java 8 it is used in casts or while expressing bounds for generic types. - *

    + * * For example: * public class A>T extends Serializable & Cloneable< { } - *

    + * * Or: * void foo((Serializable & Cloneable)myObject); * @@ -49,7 +49,7 @@ public List getElements() { public IntersectionType setElements(List elements) { if (this.elements != null) { - for (ReferenceType element : elements) { + for (ReferenceType element : elements){ element.setParentNode(null); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/PrimitiveType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/PrimitiveType.java index 523dafe94a..29299a4257 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/PrimitiveType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/PrimitiveType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.Range; @@ -35,86 +35,83 @@ */ public final class PrimitiveType extends Type implements NodeWithAnnotations { - public static final PrimitiveType BYTE_TYPE = new PrimitiveType(Primitive.Byte); - - public static final PrimitiveType SHORT_TYPE = new PrimitiveType(Primitive.Short); + public static final PrimitiveType BYTE_TYPE = new PrimitiveType(Primitive.Byte); - public static final PrimitiveType INT_TYPE = new PrimitiveType(Primitive.Int); + public static final PrimitiveType SHORT_TYPE = new PrimitiveType(Primitive.Short); - public static final PrimitiveType LONG_TYPE = new PrimitiveType(Primitive.Long); + public static final PrimitiveType INT_TYPE = new PrimitiveType(Primitive.Int); - public static final PrimitiveType FLOAT_TYPE = new PrimitiveType(Primitive.Float); + public static final PrimitiveType LONG_TYPE = new PrimitiveType(Primitive.Long); - public static final PrimitiveType DOUBLE_TYPE = new PrimitiveType(Primitive.Double); + public static final PrimitiveType FLOAT_TYPE = new PrimitiveType(Primitive.Float); - public static final PrimitiveType BOOLEAN_TYPE = new PrimitiveType(Primitive.Boolean); + public static final PrimitiveType DOUBLE_TYPE = new PrimitiveType(Primitive.Double); - public static final PrimitiveType CHAR_TYPE = new PrimitiveType(Primitive.Char); + public static final PrimitiveType BOOLEAN_TYPE = new PrimitiveType(Primitive.Boolean); - public enum Primitive { - Boolean("Boolean"), - Char("Character"), - Byte("Byte"), - Short("Short"), - Int("Integer"), - Long("Long"), - Float("Float"), - Double("Double"); + public static final PrimitiveType CHAR_TYPE = new PrimitiveType(Primitive.Char); - final String nameOfBoxedType; + public enum Primitive { + Boolean ("Boolean"), + Char ("Character"), + Byte ("Byte"), + Short ("Short"), + Int ("Integer"), + Long ("Long"), + Float ("Float"), + Double ("Double"); - public ClassOrInterfaceType toBoxedType() { - return new ClassOrInterfaceType(nameOfBoxedType); - } + final String nameOfBoxedType; - Primitive(String nameOfBoxedType) { - this.nameOfBoxedType = nameOfBoxedType; - } - } + public ClassOrInterfaceType toBoxedType() { + return new ClassOrInterfaceType(nameOfBoxedType); + } - static final HashMap unboxMap = new HashMap<>(); + Primitive(String nameOfBoxedType) { + this.nameOfBoxedType = nameOfBoxedType; + } + } - static { - for (Primitive unboxedType : Primitive.values()) { - unboxMap.put(unboxedType.nameOfBoxedType, unboxedType); - } - } + static final HashMap unboxMap = new HashMap<>(); + static { + for(Primitive unboxedType : Primitive.values()) { + unboxMap.put(unboxedType.nameOfBoxedType, unboxedType); + } + } - private Primitive type; + private Primitive type; - public PrimitiveType() { - } + public PrimitiveType() { + } - public PrimitiveType(final Primitive type) { - this.type = type; - } + public PrimitiveType(final Primitive type) { + this.type = type; + } - public PrimitiveType(Range range, final Primitive type) { - super(range); - setType(type); - } + public PrimitiveType(Range range, final Primitive type) { + super(range); + setType(type); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Primitive getType() { - return type; - } + public Primitive getType() { + return type; + } - public ClassOrInterfaceType toBoxedType() { - return type.toBoxedType(); - } + public ClassOrInterfaceType toBoxedType() { + return type.toBoxedType(); + } - public PrimitiveType setType(final Primitive type) { - this.type = type; - return this; - } + public PrimitiveType setType(final Primitive type) { + this.type = type; + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ReferenceType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ReferenceType.java index d41eb1439d..1a4666b4f3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ReferenceType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/ReferenceType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.Range; @@ -29,9 +29,9 @@ public abstract class ReferenceType extends Type { public ReferenceType() { - } + } - public ReferenceType(final Range range) { - super(range); - } + public ReferenceType(final Range range) { + super(range); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/Type.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/Type.java index 2f433bee82..6c043557ae 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/Type.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/Type.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.Range; @@ -40,14 +40,14 @@ public abstract class Type extends Node { public Type() { } - public Type(List annotation) { + public Type(List annotation){ this.annotations = annotation; } public Type(Range range) { super(range); } - + public Type(Range range, List annotations) { super(range); setAnnotations(annotations); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/TypeParameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/TypeParameter.java index d6a9f5bbaa..bfec9c9365 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/TypeParameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/TypeParameter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.Range; @@ -42,89 +42,88 @@ * TypeParameter ::= ( "extends" }{@link ClassOrInterfaceType}{@code ( "&" }{@link ClassOrInterfaceType}{@code )* )? * } * - * * @author Julio Vilmar Gesser */ public final class TypeParameter extends ReferenceType implements NodeWithName { - private String name; + private String name; private List annotations; - private List typeBound; - - public TypeParameter() { - } - - public TypeParameter(final String name, final List typeBound) { - setName(name); - setTypeBound(typeBound); - } - - public TypeParameter(Range range, final String name, final List typeBound) { - super(range); - setName(name); - setTypeBound(typeBound); - } - - public TypeParameter(Range range, String name, List typeBound, List annotations) { - this(range, name, typeBound); - setTypeBound(typeBound); - setAnnotations(annotations); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - /** - * Return the name of the paramenter. - * - * @return the name of the paramenter - */ - @Override - public String getName() { - return name; - } - - /** - * Return the list of {@link ClassOrInterfaceType} that this parameter - * extends. Return null null if there are no type. - * - * @return list of types that this paramente extends or null - */ - public List getTypeBound() { + private List typeBound; + + public TypeParameter() { + } + + public TypeParameter(final String name, final List typeBound) { + setName(name); + setTypeBound(typeBound); + } + + public TypeParameter(Range range, final String name, final List typeBound) { + super(range); + setName(name); + setTypeBound(typeBound); + } + + public TypeParameter(Range range, String name, List typeBound, List annotations) { + this(range, name, typeBound); + setTypeBound(typeBound); + setAnnotations(annotations); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + /** + * Return the name of the paramenter. + * + * @return the name of the paramenter + */ + @Override + public String getName() { + return name; + } + + /** + * Return the list of {@link ClassOrInterfaceType} that this parameter + * extends. Return null null if there are no type. + * + * @return list of types that this paramente extends or null + */ + public List getTypeBound() { typeBound = ensureNotNull(typeBound); return typeBound; - } - - /** - * Sets the name of this type parameter. - * - * @param name the name to set - */ + } + + /** + * Sets the name of this type parameter. + * + * @param name + * the name to set + */ @Override public TypeParameter setName(final String name) { - this.name = name; + this.name = name; return this; - } - - /** - * Sets the list o types. - * - * @param typeBound the typeBound to set - */ - public TypeParameter setTypeBound(final List typeBound) { - this.typeBound = typeBound; - setAsParentNodeOf(typeBound); - return this; - } + } + + /** + * Sets the list o types. + * + * @param typeBound + * the typeBound to set + */ + public TypeParameter setTypeBound(final List typeBound) { + this.typeBound = typeBound; + setAsParentNodeOf(typeBound); + return this; + } public List getAnnotations() { annotations = ensureNotNull(annotations); @@ -133,7 +132,7 @@ public List getAnnotations() { public TypeParameter setAnnotations(List annotations) { this.annotations = annotations; - setAsParentNodeOf(this.annotations); - return this; + setAsParentNodeOf(this.annotations); + return this; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnionType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnionType.java index fddbf035b4..74894af0fd 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnionType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnionType.java @@ -31,7 +31,7 @@ public List getElements() { public UnionType setElements(List elements) { if (this.elements != null) { - for (ReferenceType element : elements) { + for (ReferenceType element : elements){ element.setParentNode(null); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnknownType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnknownType.java index cfaf6b8c3e..b76c5962c7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnknownType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/UnknownType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.ast.expr.AnnotationExpr; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/VoidType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/VoidType.java index f1bbf67d24..d5f7273cb8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/VoidType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/VoidType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.Range; @@ -31,23 +31,21 @@ */ public final class VoidType extends Type implements NodeWithAnnotations { - public static final VoidType VOID_TYPE = new VoidType(); + public static final VoidType VOID_TYPE = new VoidType(); - public VoidType() { - } + public VoidType() { + } - public VoidType(Range range) { - super(range); - } + public VoidType(Range range) { + super(range); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/WildcardType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/WildcardType.java index e7e19b6e9f..d1e49bc0b2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/WildcardType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/type/WildcardType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.Range; @@ -31,57 +31,55 @@ */ public final class WildcardType extends Type implements NodeWithAnnotations { - private ReferenceType ext; + private ReferenceType ext; - private ReferenceType sup; + private ReferenceType sup; - public WildcardType() { - } + public WildcardType() { + } - public WildcardType(final ReferenceType ext) { - setExtends(ext); - } + public WildcardType(final ReferenceType ext) { + setExtends(ext); + } - public WildcardType(final ReferenceType ext, final ReferenceType sup) { - setExtends(ext); - setSuper(sup); - } + public WildcardType(final ReferenceType ext, final ReferenceType sup) { + setExtends(ext); + setSuper(sup); + } - public WildcardType(final Range range, - final ReferenceType ext, final ReferenceType sup) { - super(range); - setExtends(ext); - setSuper(sup); - } + public WildcardType(final Range range, + final ReferenceType ext, final ReferenceType sup) { + super(range); + setExtends(ext); + setSuper(sup); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public ReferenceType getExtends() { - return ext; - } + public ReferenceType getExtends() { + return ext; + } - public ReferenceType getSuper() { - return sup; - } + public ReferenceType getSuper() { + return sup; + } - public WildcardType setExtends(final ReferenceType ext) { - this.ext = ext; - setAsParentNodeOf(this.ext); - return this; - } + public WildcardType setExtends(final ReferenceType ext) { + this.ext = ext; + setAsParentNodeOf(this.ext); + return this; + } - public WildcardType setSuper(final ReferenceType sup) { - this.sup = sup; - setAsParentNodeOf(this.sup); - return this; - } + public WildcardType setSuper(final ReferenceType sup) { + this.sup = sup; + setAsParentNodeOf(this.sup); + return this; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/CloneVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/CloneVisitor.java index 9ce436eb36..33ca0e02a7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/CloneVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/CloneVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import java.util.ArrayList; @@ -109,47 +109,47 @@ public class CloneVisitor implements GenericVisitor { - @Override - public Node visit(CompilationUnit _n, Object _arg) { - PackageDeclaration package_ = cloneNodes(_n.getPackage(), _arg); - List imports = visit(_n.getImports(), _arg); + @Override + public Node visit(CompilationUnit _n, Object _arg) { + PackageDeclaration package_ = cloneNodes(_n.getPackage(), _arg); + List imports = visit(_n.getImports(), _arg); List> types = visit(_n.getTypes(), _arg); - return new CompilationUnit( - _n.getRange(), - package_, imports, types - ); - } - - @Override - public Node visit(PackageDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - NameExpr name = cloneNodes(_n.getName(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - PackageDeclaration r = new PackageDeclaration( - _n.getRange(), - annotations, name - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ImportDeclaration _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ImportDeclaration r = new ImportDeclaration( - _n.getRange(), - name, _n.isStatic(), _n.isAsterisk() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(TypeParameter _n, Object _arg) { + return new CompilationUnit( + _n.getRange(), + package_, imports, types + ); + } + + @Override + public Node visit(PackageDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + NameExpr name = cloneNodes(_n.getName(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + PackageDeclaration r = new PackageDeclaration( + _n.getRange(), + annotations, name + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ImportDeclaration _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ImportDeclaration r = new ImportDeclaration( + _n.getRange(), + name, _n.isStatic(), _n.isAsterisk() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(TypeParameter _n, Object _arg) { List typeBound = visit(_n.getTypeBound(), _arg); List annotations = visit(_n.getAnnotations(), _arg); @@ -158,1121 +158,1121 @@ public Node visit(TypeParameter _n, Object _arg) { Comment comment = cloneNodes(_n.getComment(), _arg); r.setComment(comment); - return r; - } + return r; + } - @Override - public Node visit(LineComment _n, Object _arg) { - return new LineComment(_n.getRange(), _n.getContent()); - } + @Override + public Node visit(LineComment _n, Object _arg) { + return new LineComment(_n.getRange(), _n.getContent()); + } - @Override - public Node visit(BlockComment _n, Object _arg) { - return new BlockComment(_n.getRange(), _n.getContent()); - } + @Override + public Node visit(BlockComment _n, Object _arg) { + return new BlockComment(_n.getRange(), _n.getContent()); + } - @Override - public Node visit(ClassOrInterfaceDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - List typeParameters = visit(_n.getTypeParameters(), _arg); - List extendsList = visit(_n.getExtends(), _arg); - List implementsList = visit(_n.getImplements(), _arg); + @Override + public Node visit(ClassOrInterfaceDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + List typeParameters = visit(_n.getTypeParameters(), _arg); + List extendsList = visit(_n.getExtends(), _arg); + List implementsList = visit(_n.getImplements(), _arg); List> members = visit(_n.getMembers(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ClassOrInterfaceDeclaration r = new ClassOrInterfaceDeclaration( - _n.getRange(), - _n.getModifiers(), annotations, _n.isInterface(), _n.getName(), typeParameters, extendsList, implementsList, members - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EnumDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - List implementsList = visit(_n.getImplements(), _arg); - List entries = visit(_n.getEntries(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ClassOrInterfaceDeclaration r = new ClassOrInterfaceDeclaration( + _n.getRange(), + _n.getModifiers(), annotations, _n.isInterface(), _n.getName(), typeParameters, extendsList, implementsList, members + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EnumDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + List implementsList = visit(_n.getImplements(), _arg); + List entries = visit(_n.getEntries(), _arg); List> members = visit(_n.getMembers(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EnumDeclaration r = new EnumDeclaration( - _n.getRange(), - _n.getModifiers(), annotations, _n.getName(), implementsList, entries, members - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EmptyTypeDeclaration _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - EmptyTypeDeclaration r = new EmptyTypeDeclaration( - _n.getRange() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EnumConstantDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - List args = visit(_n.getArgs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EnumDeclaration r = new EnumDeclaration( + _n.getRange(), + _n.getModifiers(), annotations, _n.getName(), implementsList, entries, members + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EmptyTypeDeclaration _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + EmptyTypeDeclaration r = new EmptyTypeDeclaration( + _n.getRange() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EnumConstantDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + List args = visit(_n.getArgs(), _arg); List> classBody = visit(_n.getClassBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EnumConstantDeclaration r = new EnumConstantDeclaration( - _n.getRange(), - annotations, _n.getName(), args, classBody - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AnnotationDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EnumConstantDeclaration r = new EnumConstantDeclaration( + _n.getRange(), + annotations, _n.getName(), args, classBody + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AnnotationDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); List> members = visit(_n.getMembers(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AnnotationDeclaration r = new AnnotationDeclaration( - _n.getRange(), - _n.getModifiers(), annotations, _n.getName(), members - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AnnotationMemberDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - Expression defaultValue = cloneNodes(_n.getDefaultValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AnnotationMemberDeclaration r = new AnnotationMemberDeclaration( - _n.getRange(), - _n.getModifiers(), annotations, type_, _n.getName(), defaultValue - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(FieldDeclaration _n, Object _arg) { - List annotations_ = visit(_n.getAnnotations(), _arg); - Type elementType_ = cloneNodes(_n.getElementType(), _arg); - List variables_ = visit(_n.getVariables(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AnnotationDeclaration r = new AnnotationDeclaration( + _n.getRange(), + _n.getModifiers(), annotations, _n.getName(), members + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AnnotationMemberDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + Expression defaultValue = cloneNodes(_n.getDefaultValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AnnotationMemberDeclaration r = new AnnotationMemberDeclaration( + _n.getRange(), + _n.getModifiers(), annotations, type_, _n.getName(), defaultValue + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(FieldDeclaration _n, Object _arg) { + List annotations_ = visit(_n.getAnnotations(), _arg); + Type elementType_ = cloneNodes(_n.getElementType(), _arg); + List variables_ = visit(_n.getVariables(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); List arrayBracketPairsAfterType_ = visit(_n.getArrayBracketPairsAfterElementType(), _arg); FieldDeclaration r = new FieldDeclaration( - _n.getRange(), - _n.getModifiers(), - annotations_, - elementType_, + _n.getRange(), + _n.getModifiers(), + annotations_, + elementType_, variables_, arrayBracketPairsAfterType_ - - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(VariableDeclarator _n, Object _arg) { - VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); - Expression init = cloneNodes(_n.getInit(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - VariableDeclarator r = new VariableDeclarator( - _n.getRange(), - id, init - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(VariableDeclaratorId _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - List arrayBracketPairsAfterId_ = visit(_n.getArrayBracketPairsAfterId(), _arg); - - VariableDeclaratorId r = new VariableDeclaratorId( - _n.getRange(), - _n.getName(), - arrayBracketPairsAfterId_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ConstructorDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - List typeParameters = visit(_n.getTypeParameters(), _arg); - List parameters = visit(_n.getParameters(), _arg); - List throws_ = visit(_n.getThrows(), _arg); - BlockStmt block = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ConstructorDeclaration r = new ConstructorDeclaration( - _n.getRange(), - _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MethodDeclaration _n, Object _arg) { - List annotations_ = visit(_n.getAnnotations(), _arg); - List typeParameters_ = visit(_n.getTypeParameters(), _arg); - Type type_ = cloneNodes(_n.getElementType(), _arg); + + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(VariableDeclarator _n, Object _arg) { + VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); + Expression init = cloneNodes(_n.getInit(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + VariableDeclarator r = new VariableDeclarator( + _n.getRange(), + id, init + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(VariableDeclaratorId _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + List arrayBracketPairsAfterId_ = visit(_n.getArrayBracketPairsAfterId(), _arg); + + VariableDeclaratorId r = new VariableDeclaratorId( + _n.getRange(), + _n.getName(), + arrayBracketPairsAfterId_ + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ConstructorDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + List typeParameters = visit(_n.getTypeParameters(), _arg); + List parameters = visit(_n.getParameters(), _arg); + List throws_ = visit(_n.getThrows(), _arg); + BlockStmt block = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ConstructorDeclaration r = new ConstructorDeclaration( + _n.getRange(), + _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MethodDeclaration _n, Object _arg) { + List annotations_ = visit(_n.getAnnotations(), _arg); + List typeParameters_ = visit(_n.getTypeParameters(), _arg); + Type type_ = cloneNodes(_n.getElementType(), _arg); NameExpr nameExpr_ = cloneNodes(_n.getNameExpr(), _arg); List parameters_ = visit(_n.getParameters(), _arg); - List throws_ = visit(_n.getThrows(), _arg); - BlockStmt block_ = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - List arrayBracketPairsAfterElementType_ = visit(_n.getArrayBracketPairsAfterElementType(), _arg); - List arrayBracketPairsAfterParameterList_ = visit(_n.getArrayBracketPairsAfterParameterList(), _arg); - - MethodDeclaration r = new MethodDeclaration( - _n.getRange(), - _n.getModifiers(), - annotations_, - typeParameters_, + List throws_ = visit(_n.getThrows(), _arg); + BlockStmt block_ = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + List arrayBracketPairsAfterElementType_ = visit(_n.getArrayBracketPairsAfterElementType(), _arg); + List arrayBracketPairsAfterParameterList_ = visit(_n.getArrayBracketPairsAfterParameterList(), _arg); + + MethodDeclaration r = new MethodDeclaration( + _n.getRange(), + _n.getModifiers(), + annotations_, + typeParameters_, type_, arrayBracketPairsAfterElementType_, - nameExpr_, - parameters_, - arrayBracketPairsAfterParameterList_, - throws_, + nameExpr_, + parameters_, + arrayBracketPairsAfterParameterList_, + throws_, block_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(Parameter _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getElementType(), _arg); - VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(Parameter _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getElementType(), _arg); + VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); List arrayBracketPairsAfterType_ = visit(_n.getArrayBracketPairsAfterElementType(), _arg); Parameter r = new Parameter( - _n.getRange(), - _n.getModifiers(), - annotations, + _n.getRange(), + _n.getModifiers(), + annotations, type_, arrayBracketPairsAfterType_, - _n.isVarArgs(), + _n.isVarArgs(), id - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EmptyMemberDeclaration _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - EmptyMemberDeclaration r = new EmptyMemberDeclaration( - _n.getRange() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(InitializerDeclaration _n, Object _arg) { - BlockStmt block = cloneNodes(_n.getBlock(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - InitializerDeclaration r = new InitializerDeclaration( - _n.getRange(), - _n.isStatic(), block - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(JavadocComment _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - JavadocComment r = new JavadocComment( - _n.getRange(), - _n.getContent() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ClassOrInterfaceType _n, Object _arg) { - ClassOrInterfaceType scope = cloneNodes(_n.getScope(), _arg); - List> typeArguments_ = visit(_n.getTypeArguments(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ClassOrInterfaceType r = new ClassOrInterfaceType( - _n.getRange(), - scope, - _n.getName(), - _n.getTypeArguments() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(PrimitiveType _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - - PrimitiveType r = new PrimitiveType( - _n.getRange(), - _n.getType() - ); - r.setComment(comment); - r.setAnnotations(annotations); - return r; - } - - @Override - public Node visit(ArrayType _n, Object _arg) { - List ann = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getComponentType(), _arg); - - ArrayType r = new ArrayType(_n.getRange(), type_, ann); - Comment comment = cloneNodes(_n.getComment(), _arg); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ArrayCreationLevel _n, Object _arg) { - List ann = visit(_n.getAnnotations(), _arg); - Expression dimension_ = cloneNodes(_n.getDimension(), _arg); - - ArrayCreationLevel r = new ArrayCreationLevel(_n.getRange(), dimension_, ann); - - Comment comment = cloneNodes(_n.getComment(), _arg); - r.setComment(comment); - return r; - } - - @Override + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EmptyMemberDeclaration _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + EmptyMemberDeclaration r = new EmptyMemberDeclaration( + _n.getRange() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(InitializerDeclaration _n, Object _arg) { + BlockStmt block = cloneNodes(_n.getBlock(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + InitializerDeclaration r = new InitializerDeclaration( + _n.getRange(), + _n.isStatic(), block + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(JavadocComment _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + JavadocComment r = new JavadocComment( + _n.getRange(), + _n.getContent() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ClassOrInterfaceType _n, Object _arg) { + ClassOrInterfaceType scope = cloneNodes(_n.getScope(), _arg); + List> typeArguments_ = visit(_n.getTypeArguments(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ClassOrInterfaceType r = new ClassOrInterfaceType( + _n.getRange(), + scope, + _n.getName(), + _n.getTypeArguments() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(PrimitiveType _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + + PrimitiveType r = new PrimitiveType( + _n.getRange(), + _n.getType() + ); + r.setComment(comment); + r.setAnnotations(annotations); + return r; + } + + @Override + public Node visit(ArrayType _n, Object _arg) { + List ann = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getComponentType(), _arg); + + ArrayType r = new ArrayType(_n.getRange(), type_, ann); + Comment comment = cloneNodes(_n.getComment(), _arg); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ArrayCreationLevel _n, Object _arg) { + List ann = visit(_n.getAnnotations(), _arg); + Expression dimension_ = cloneNodes(_n.getDimension(), _arg); + + ArrayCreationLevel r = new ArrayCreationLevel(_n.getRange(), dimension_, ann); + + Comment comment = cloneNodes(_n.getComment(), _arg); + r.setComment(comment); + return r; + } + + @Override public Node visit(IntersectionType _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); List elements = visit(_n.getElements(), _arg); IntersectionType r = new IntersectionType(_n.getRange(), elements); Comment comment = cloneNodes(_n.getComment(), _arg); r.setComment(comment); - r.setAnnotations(annotations); + r.setAnnotations(annotations); return r; } @Override public Node visit(UnionType _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); List elements = visit(_n.getElements(), _arg); UnionType r = new UnionType(_n.getRange(), elements); Comment comment = cloneNodes(_n.getComment(), _arg); r.setComment(comment); - r.setAnnotations(annotations); - return r; - } - - @Override - public Node visit(VoidType _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - VoidType r = new VoidType(_n.getRange()); - r.setAnnotations(annotations); - r.setComment(comment); - return r; - } - - @Override - public Node visit(WildcardType _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - ReferenceType ext = cloneNodes(_n.getExtends(), _arg); - ReferenceType sup = cloneNodes(_n.getSuper(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - WildcardType r = new WildcardType( - _n.getRange(), - ext, sup - ); - r.setComment(comment); - r.setAnnotations(annotations); - return r; - } - - @Override - public Node visit(UnknownType _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - UnknownType r = new UnknownType(); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ArrayAccessExpr _n, Object _arg) { - Expression name = cloneNodes(_n.getName(), _arg); - Expression index = cloneNodes(_n.getIndex(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ArrayAccessExpr r = new ArrayAccessExpr( - _n.getRange(), - name, index - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ArrayCreationExpr _n, Object _arg) { - Type type_ = cloneNodes(_n.getType(), _arg); - List levels_ = visit(_n.getLevels(), _arg); - ArrayInitializerExpr initializer_ = cloneNodes(_n.getInitializer(), _arg); - - ArrayCreationExpr r = new ArrayCreationExpr(_n.getRange(), type_, levels_, initializer_); - - Comment comment = cloneNodes(_n.getComment(), _arg); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ArrayInitializerExpr _n, Object _arg) { - List values = visit(_n.getValues(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ArrayInitializerExpr r = new ArrayInitializerExpr( - _n.getRange(), - values - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AssignExpr _n, Object _arg) { - Expression target = cloneNodes(_n.getTarget(), _arg); - Expression value = cloneNodes(_n.getValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AssignExpr r = new AssignExpr( - _n.getRange(), - target, value, _n.getOperator()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BinaryExpr _n, Object _arg) { - Expression left = cloneNodes(_n.getLeft(), _arg); - Expression right = cloneNodes(_n.getRight(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - BinaryExpr r = new BinaryExpr( - _n.getRange(), - left, right, _n.getOperator() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(CastExpr _n, Object _arg) { - Type type_ = cloneNodes(_n.getType(), _arg); - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - CastExpr r = new CastExpr( - _n.getRange(), - type_, expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ClassExpr _n, Object _arg) { - Type type_ = cloneNodes(_n.getType(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ClassExpr r = new ClassExpr( - _n.getRange(), - type_ - ); - r.setComment(comment); - return r; - } + r.setAnnotations(annotations); + return r; + } + + @Override + public Node visit(VoidType _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + VoidType r = new VoidType(_n.getRange()); + r.setAnnotations(annotations); + r.setComment(comment); + return r; + } + + @Override + public Node visit(WildcardType _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + ReferenceType ext = cloneNodes(_n.getExtends(), _arg); + ReferenceType sup = cloneNodes(_n.getSuper(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + WildcardType r = new WildcardType( + _n.getRange(), + ext, sup + ); + r.setComment(comment); + r.setAnnotations(annotations); + return r; + } + + @Override + public Node visit(UnknownType _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + UnknownType r = new UnknownType(); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ArrayAccessExpr _n, Object _arg) { + Expression name = cloneNodes(_n.getName(), _arg); + Expression index = cloneNodes(_n.getIndex(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ArrayAccessExpr r = new ArrayAccessExpr( + _n.getRange(), + name, index + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ArrayCreationExpr _n, Object _arg) { + Type type_ = cloneNodes(_n.getType(), _arg); + List levels_ = visit(_n.getLevels(), _arg); + ArrayInitializerExpr initializer_ = cloneNodes(_n.getInitializer(), _arg); + + ArrayCreationExpr r = new ArrayCreationExpr(_n.getRange(), type_, levels_, initializer_); + + Comment comment = cloneNodes(_n.getComment(), _arg); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ArrayInitializerExpr _n, Object _arg) { + List values = visit(_n.getValues(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ArrayInitializerExpr r = new ArrayInitializerExpr( + _n.getRange(), + values + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AssignExpr _n, Object _arg) { + Expression target = cloneNodes(_n.getTarget(), _arg); + Expression value = cloneNodes(_n.getValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AssignExpr r = new AssignExpr( + _n.getRange(), + target, value, _n.getOperator()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BinaryExpr _n, Object _arg) { + Expression left = cloneNodes(_n.getLeft(), _arg); + Expression right = cloneNodes(_n.getRight(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + BinaryExpr r = new BinaryExpr( + _n.getRange(), + left, right, _n.getOperator() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(CastExpr _n, Object _arg) { + Type type_ = cloneNodes(_n.getType(), _arg); + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + CastExpr r = new CastExpr( + _n.getRange(), + type_, expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ClassExpr _n, Object _arg) { + Type type_ = cloneNodes(_n.getType(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ClassExpr r = new ClassExpr( + _n.getRange(), + type_ + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ConditionalExpr _n, Object _arg) { + Expression condition = cloneNodes(_n.getCondition(), _arg); + Expression thenExpr = cloneNodes(_n.getThenExpr(), _arg); + Expression elseExpr = cloneNodes(_n.getElseExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ConditionalExpr r = new ConditionalExpr( + _n.getRange(), + condition, thenExpr, elseExpr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EnclosedExpr _n, Object _arg) { + Expression inner = cloneNodes(_n.getInner(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EnclosedExpr r = new EnclosedExpr( + _n.getRange(), + inner + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(FieldAccessExpr _n, Object _arg) { + Expression scope_ = cloneNodes(_n.getScope(), _arg); + List> typeArguments_ = visit(_n.getTypeArguments(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + FieldAccessExpr r = new FieldAccessExpr( + _n.getRange(), + scope_, + typeArguments_, + _n.getField() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(InstanceOfExpr _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + InstanceOfExpr r = new InstanceOfExpr( + _n.getRange(), + expr, type_ + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(StringLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + StringLiteralExpr r = new StringLiteralExpr( + _n.getRange(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(IntegerLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + IntegerLiteralExpr r = new IntegerLiteralExpr( + _n.getRange(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LongLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + LongLiteralExpr r = new LongLiteralExpr( + _n.getRange(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(IntegerLiteralMinValueExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + IntegerLiteralMinValueExpr r = new IntegerLiteralMinValueExpr(_n.getRange()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LongLiteralMinValueExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + LongLiteralMinValueExpr r = new LongLiteralMinValueExpr(_n.getRange()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(CharLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + CharLiteralExpr r = new CharLiteralExpr( + _n.getRange(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(DoubleLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + DoubleLiteralExpr r = new DoubleLiteralExpr( + _n.getRange(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BooleanLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + BooleanLiteralExpr r = new BooleanLiteralExpr( + _n.getRange(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(NullLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + NullLiteralExpr r = new NullLiteralExpr(_n.getRange()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MethodCallExpr _n, Object _arg) { + Expression scope_ = cloneNodes(_n.getScope(), _arg); + List> typeArguments_ = visit(_n.getTypeArguments(), _arg); + List args_ = visit(_n.getArgs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MethodCallExpr r = new MethodCallExpr( + _n.getRange(), + scope_, + typeArguments_, + _n.getName(), + args_ + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(NameExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + NameExpr r = new NameExpr( + _n.getRange(), + _n.getName() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ObjectCreationExpr _n, Object _arg) { + Expression scope = cloneNodes(_n.getScope(), _arg); + ClassOrInterfaceType type_ = cloneNodes(_n.getType(), _arg); + List> typeArgs = visit(_n.getTypeArguments(), _arg); + List args = visit(_n.getArgs(), _arg); + List> anonymousBody = visit(_n.getAnonymousClassBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ObjectCreationExpr r = new ObjectCreationExpr( + _n.getRange(), + scope, type_, typeArgs, args, anonymousBody + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(QualifiedNameExpr _n, Object _arg) { + NameExpr scope = cloneNodes(_n.getQualifier(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + QualifiedNameExpr r = new QualifiedNameExpr( + _n.getRange(), + scope, _n.getName() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ThisExpr _n, Object _arg) { + Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ThisExpr r = new ThisExpr( + _n.getRange(), + classExpr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SuperExpr _n, Object _arg) { + Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SuperExpr r = new SuperExpr( + _n.getRange(), + classExpr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(UnaryExpr _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + UnaryExpr r = new UnaryExpr( + _n.getRange(), + expr, _n.getOperator() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(VariableDeclarationExpr _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getElementType(), _arg); + List vars = visit(_n.getVariables(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + List arrayBracketPairsAfterType_ = visit(_n.getArrayBracketPairsAfterElementType(), _arg); - @Override - public Node visit(ConditionalExpr _n, Object _arg) { - Expression condition = cloneNodes(_n.getCondition(), _arg); - Expression thenExpr = cloneNodes(_n.getThenExpr(), _arg); - Expression elseExpr = cloneNodes(_n.getElseExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); + VariableDeclarationExpr r = new VariableDeclarationExpr( + _n.getRange(), + _n.getModifiers(), + annotations, + type_, + vars, + arrayBracketPairsAfterType_ + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MarkerAnnotationExpr _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MarkerAnnotationExpr r = new MarkerAnnotationExpr( + _n.getRange(), + name + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SingleMemberAnnotationExpr _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + Expression memberValue = cloneNodes(_n.getMemberValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SingleMemberAnnotationExpr r = new SingleMemberAnnotationExpr( + _n.getRange(), + name, memberValue + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(NormalAnnotationExpr _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + List pairs = visit(_n.getPairs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + NormalAnnotationExpr r = new NormalAnnotationExpr( + _n.getRange(), + name, pairs + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MemberValuePair _n, Object _arg) { + Expression value = cloneNodes(_n.getValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MemberValuePair r = new MemberValuePair( + _n.getRange(), + _n.getName(), value + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ExplicitConstructorInvocationStmt _n, Object _arg) { + List> typeArguments_ = visit(_n.getTypeArguments(), _arg); + Expression expr_ = cloneNodes(_n.getExpr(), _arg); + List args_ = visit(_n.getArgs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ExplicitConstructorInvocationStmt r = new ExplicitConstructorInvocationStmt( + _n.getRange(), + typeArguments_, + _n.isThis(), + expr_, + args_ + ); + r.setComment(comment); + return r; + } - ConditionalExpr r = new ConditionalExpr( - _n.getRange(), - condition, thenExpr, elseExpr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EnclosedExpr _n, Object _arg) { - Expression inner = cloneNodes(_n.getInner(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EnclosedExpr r = new EnclosedExpr( - _n.getRange(), - inner - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(FieldAccessExpr _n, Object _arg) { - Expression scope_ = cloneNodes(_n.getScope(), _arg); - List> typeArguments_ = visit(_n.getTypeArguments(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - FieldAccessExpr r = new FieldAccessExpr( - _n.getRange(), - scope_, - typeArguments_, - _n.getField() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(InstanceOfExpr _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - InstanceOfExpr r = new InstanceOfExpr( - _n.getRange(), - expr, type_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(StringLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - StringLiteralExpr r = new StringLiteralExpr( - _n.getRange(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(IntegerLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - IntegerLiteralExpr r = new IntegerLiteralExpr( - _n.getRange(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LongLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - LongLiteralExpr r = new LongLiteralExpr( - _n.getRange(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(IntegerLiteralMinValueExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - IntegerLiteralMinValueExpr r = new IntegerLiteralMinValueExpr(_n.getRange()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LongLiteralMinValueExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - LongLiteralMinValueExpr r = new LongLiteralMinValueExpr(_n.getRange()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(CharLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - CharLiteralExpr r = new CharLiteralExpr( - _n.getRange(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(DoubleLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - DoubleLiteralExpr r = new DoubleLiteralExpr( - _n.getRange(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BooleanLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - BooleanLiteralExpr r = new BooleanLiteralExpr( - _n.getRange(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(NullLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - NullLiteralExpr r = new NullLiteralExpr(_n.getRange()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MethodCallExpr _n, Object _arg) { - Expression scope_ = cloneNodes(_n.getScope(), _arg); - List> typeArguments_ = visit(_n.getTypeArguments(), _arg); - List args_ = visit(_n.getArgs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MethodCallExpr r = new MethodCallExpr( - _n.getRange(), - scope_, - typeArguments_, - _n.getName(), - args_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(NameExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - NameExpr r = new NameExpr( - _n.getRange(), - _n.getName() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ObjectCreationExpr _n, Object _arg) { - Expression scope = cloneNodes(_n.getScope(), _arg); - ClassOrInterfaceType type_ = cloneNodes(_n.getType(), _arg); - List> typeArgs = visit(_n.getTypeArguments(), _arg); - List args = visit(_n.getArgs(), _arg); - List> anonymousBody = visit(_n.getAnonymousClassBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ObjectCreationExpr r = new ObjectCreationExpr( - _n.getRange(), - scope, type_, typeArgs, args, anonymousBody - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(QualifiedNameExpr _n, Object _arg) { - NameExpr scope = cloneNodes(_n.getQualifier(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - QualifiedNameExpr r = new QualifiedNameExpr( - _n.getRange(), - scope, _n.getName() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ThisExpr _n, Object _arg) { - Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ThisExpr r = new ThisExpr( - _n.getRange(), - classExpr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SuperExpr _n, Object _arg) { - Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SuperExpr r = new SuperExpr( - _n.getRange(), - classExpr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(UnaryExpr _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - UnaryExpr r = new UnaryExpr( - _n.getRange(), - expr, _n.getOperator() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(VariableDeclarationExpr _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getElementType(), _arg); - List vars = visit(_n.getVariables(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - List arrayBracketPairsAfterType_ = visit(_n.getArrayBracketPairsAfterElementType(), _arg); - - VariableDeclarationExpr r = new VariableDeclarationExpr( - _n.getRange(), - _n.getModifiers(), - annotations, - type_, - vars, - arrayBracketPairsAfterType_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MarkerAnnotationExpr _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MarkerAnnotationExpr r = new MarkerAnnotationExpr( - _n.getRange(), - name - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SingleMemberAnnotationExpr _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - Expression memberValue = cloneNodes(_n.getMemberValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SingleMemberAnnotationExpr r = new SingleMemberAnnotationExpr( - _n.getRange(), - name, memberValue - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(NormalAnnotationExpr _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - List pairs = visit(_n.getPairs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - NormalAnnotationExpr r = new NormalAnnotationExpr( - _n.getRange(), - name, pairs - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MemberValuePair _n, Object _arg) { - Expression value = cloneNodes(_n.getValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MemberValuePair r = new MemberValuePair( - _n.getRange(), - _n.getName(), value - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ExplicitConstructorInvocationStmt _n, Object _arg) { - List> typeArguments_ = visit(_n.getTypeArguments(), _arg); - Expression expr_ = cloneNodes(_n.getExpr(), _arg); - List args_ = visit(_n.getArgs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ExplicitConstructorInvocationStmt r = new ExplicitConstructorInvocationStmt( - _n.getRange(), - typeArguments_, - _n.isThis(), - expr_, - args_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(TypeDeclarationStmt _n, Object _arg) { + @Override + public Node visit(TypeDeclarationStmt _n, Object _arg) { TypeDeclaration typeDecl = cloneNodes(_n.getTypeDeclaration(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - TypeDeclarationStmt r = new TypeDeclarationStmt( - _n.getRange(), - typeDecl - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AssertStmt _n, Object _arg) { - Expression check = cloneNodes(_n.getCheck(), _arg); - Expression message = cloneNodes(_n.getMessage(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AssertStmt r = new AssertStmt( - _n.getRange(), - check, message - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BlockStmt _n, Object _arg) { - List stmts = visit(_n.getStmts(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - BlockStmt r = new BlockStmt( - _n.getRange(), - stmts - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LabeledStmt _n, Object _arg) { - Statement stmt = cloneNodes(_n.getStmt(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - LabeledStmt r = new LabeledStmt( - _n.getRange(), - _n.getLabel(), stmt - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EmptyStmt _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - EmptyStmt r = new EmptyStmt(_n.getRange()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ExpressionStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpression(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ExpressionStmt r = new ExpressionStmt( - _n.getRange(), - expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SwitchStmt _n, Object _arg) { - Expression selector = cloneNodes(_n.getSelector(), _arg); - List entries = visit(_n.getEntries(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SwitchStmt r = new SwitchStmt( - _n.getRange(), - selector, entries - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SwitchEntryStmt _n, Object _arg) { - Expression label = cloneNodes(_n.getLabel(), _arg); - List stmts = visit(_n.getStmts(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SwitchEntryStmt r = new SwitchEntryStmt( - _n.getRange(), - label, stmts - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BreakStmt _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - BreakStmt r = new BreakStmt( - _n.getRange(), - _n.getId() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ReturnStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ReturnStmt r = new ReturnStmt( - _n.getRange(), - expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(IfStmt _n, Object _arg) { - Expression condition = cloneNodes(_n.getCondition(), _arg); - Statement thenStmt = cloneNodes(_n.getThenStmt(), _arg); - Statement elseStmt = cloneNodes(_n.getElseStmt(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - IfStmt r = new IfStmt( - _n.getRange(), - condition, thenStmt, elseStmt - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(WhileStmt _n, Object _arg) { - Expression condition = cloneNodes(_n.getCondition(), _arg); - Statement body = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - WhileStmt r = new WhileStmt( - _n.getRange(), - condition, body - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ContinueStmt _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - ContinueStmt r = new ContinueStmt( - _n.getRange(), - _n.getId() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(DoStmt _n, Object _arg) { - Statement body = cloneNodes(_n.getBody(), _arg); - Expression condition = cloneNodes(_n.getCondition(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - DoStmt r = new DoStmt( - _n.getRange(), - body, condition - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ForeachStmt _n, Object _arg) { - VariableDeclarationExpr var = cloneNodes(_n.getVariable(), _arg); - Expression iterable = cloneNodes(_n.getIterable(), _arg); - Statement body = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ForeachStmt r = new ForeachStmt( - _n.getRange(), - var, iterable, body - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ForStmt _n, Object _arg) { - List init = visit(_n.getInit(), _arg); - Expression compare = cloneNodes(_n.getCompare(), _arg); - List update = visit(_n.getUpdate(), _arg); - Statement body = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ForStmt r = new ForStmt( - _n.getRange(), - init, compare, update, body - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ThrowStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ThrowStmt r = new ThrowStmt( - _n.getRange(), - expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SynchronizedStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - BlockStmt block = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SynchronizedStmt r = new SynchronizedStmt( - _n.getRange(), - expr, block - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(TryStmt _n, Object _arg) { - List resources = visit(_n.getResources(), _arg); - BlockStmt tryBlock = cloneNodes(_n.getTryBlock(), _arg); - List catchs = visit(_n.getCatchs(), _arg); - BlockStmt finallyBlock = cloneNodes(_n.getFinallyBlock(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - TryStmt r = new TryStmt( - _n.getRange(), - resources, tryBlock, catchs, finallyBlock - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(CatchClause _n, Object _arg) { - Parameter param = cloneNodes(_n.getParam(), _arg); - BlockStmt catchBlock = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - CatchClause r = new CatchClause( - _n.getRange(), - param.getModifiers(), param.getAnnotations(), param.getElementType(), param.getId(), catchBlock - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LambdaExpr _n, Object _arg) { - - List lambdaParameters = visit(_n.getParameters(), _arg); - - Statement body = cloneNodes(_n.getBody(), _arg); - - return new LambdaExpr(_n.getRange(), lambdaParameters, body, - _n.isParametersEnclosed()); - } - - @Override - public Node visit(MethodReferenceExpr _n, Object arg) { - - Expression scope = cloneNodes(_n.getScope(), arg); - - return new MethodReferenceExpr(_n.getRange(), scope, - _n.getTypeArguments(), _n.getIdentifier()); - } - - @Override - public Node visit(TypeExpr n, Object arg) { - - Type t = cloneNodes(n.getType(), arg); - - return new TypeExpr(n.getRange(), t); - } - - @Override - public Node visit(ArrayBracketPair _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - - return new ArrayBracketPair(_n.getRange(), annotations); - } - - public List visit(List _nodes, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + TypeDeclarationStmt r = new TypeDeclarationStmt( + _n.getRange(), + typeDecl + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AssertStmt _n, Object _arg) { + Expression check = cloneNodes(_n.getCheck(), _arg); + Expression message = cloneNodes(_n.getMessage(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AssertStmt r = new AssertStmt( + _n.getRange(), + check, message + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BlockStmt _n, Object _arg) { + List stmts = visit(_n.getStmts(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + BlockStmt r = new BlockStmt( + _n.getRange(), + stmts + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LabeledStmt _n, Object _arg) { + Statement stmt = cloneNodes(_n.getStmt(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + LabeledStmt r = new LabeledStmt( + _n.getRange(), + _n.getLabel(), stmt + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EmptyStmt _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + EmptyStmt r = new EmptyStmt(_n.getRange()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ExpressionStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpression(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ExpressionStmt r = new ExpressionStmt( + _n.getRange(), + expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SwitchStmt _n, Object _arg) { + Expression selector = cloneNodes(_n.getSelector(), _arg); + List entries = visit(_n.getEntries(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SwitchStmt r = new SwitchStmt( + _n.getRange(), + selector, entries + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SwitchEntryStmt _n, Object _arg) { + Expression label = cloneNodes(_n.getLabel(), _arg); + List stmts = visit(_n.getStmts(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SwitchEntryStmt r = new SwitchEntryStmt( + _n.getRange(), + label, stmts + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BreakStmt _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + BreakStmt r = new BreakStmt( + _n.getRange(), + _n.getId() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ReturnStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ReturnStmt r = new ReturnStmt( + _n.getRange(), + expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(IfStmt _n, Object _arg) { + Expression condition = cloneNodes(_n.getCondition(), _arg); + Statement thenStmt = cloneNodes(_n.getThenStmt(), _arg); + Statement elseStmt = cloneNodes(_n.getElseStmt(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + IfStmt r = new IfStmt( + _n.getRange(), + condition, thenStmt, elseStmt + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(WhileStmt _n, Object _arg) { + Expression condition = cloneNodes(_n.getCondition(), _arg); + Statement body = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + WhileStmt r = new WhileStmt( + _n.getRange(), + condition, body + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ContinueStmt _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + ContinueStmt r = new ContinueStmt( + _n.getRange(), + _n.getId() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(DoStmt _n, Object _arg) { + Statement body = cloneNodes(_n.getBody(), _arg); + Expression condition = cloneNodes(_n.getCondition(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + DoStmt r = new DoStmt( + _n.getRange(), + body, condition + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ForeachStmt _n, Object _arg) { + VariableDeclarationExpr var = cloneNodes(_n.getVariable(), _arg); + Expression iterable = cloneNodes(_n.getIterable(), _arg); + Statement body = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ForeachStmt r = new ForeachStmt( + _n.getRange(), + var, iterable, body + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ForStmt _n, Object _arg) { + List init = visit(_n.getInit(), _arg); + Expression compare = cloneNodes(_n.getCompare(), _arg); + List update = visit(_n.getUpdate(), _arg); + Statement body = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ForStmt r = new ForStmt( + _n.getRange(), + init, compare, update, body + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ThrowStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ThrowStmt r = new ThrowStmt( + _n.getRange(), + expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SynchronizedStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + BlockStmt block = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SynchronizedStmt r = new SynchronizedStmt( + _n.getRange(), + expr, block + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(TryStmt _n, Object _arg) { + List resources = visit(_n.getResources(),_arg); + BlockStmt tryBlock = cloneNodes(_n.getTryBlock(), _arg); + List catchs = visit(_n.getCatchs(), _arg); + BlockStmt finallyBlock = cloneNodes(_n.getFinallyBlock(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + TryStmt r = new TryStmt( + _n.getRange(), + resources, tryBlock, catchs, finallyBlock + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(CatchClause _n, Object _arg) { + Parameter param = cloneNodes(_n.getParam(), _arg); + BlockStmt catchBlock = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + CatchClause r = new CatchClause( + _n.getRange(), + param.getModifiers(), param.getAnnotations(), param.getElementType(), param.getId(), catchBlock + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LambdaExpr _n, Object _arg) { + + List lambdaParameters = visit(_n.getParameters(), _arg); + + Statement body = cloneNodes(_n.getBody(), _arg); + + return new LambdaExpr(_n.getRange(), lambdaParameters, body, + _n.isParametersEnclosed()); + } + + @Override + public Node visit(MethodReferenceExpr _n, Object arg) { + + Expression scope = cloneNodes(_n.getScope(), arg); + + return new MethodReferenceExpr(_n.getRange(), scope, + _n.getTypeArguments(), _n.getIdentifier()); + } + + @Override + public Node visit(TypeExpr n, Object arg) { + + Type t = cloneNodes(n.getType(), arg); + + return new TypeExpr(n.getRange(), t); + } + + @Override + public Node visit(ArrayBracketPair _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + + return new ArrayBracketPair(_n.getRange(), annotations); + } + + public List visit(List _nodes, Object _arg) { if (_nodes == null) return null; List r = new ArrayList<>(_nodes.size()); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/DumpVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/DumpVisitor.java index 214a183060..569f395161 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/DumpVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/DumpVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -49,381 +49,381 @@ */ public class DumpVisitor implements VoidVisitor { - private boolean printComments; - - public DumpVisitor() { - this(true); - } - - public DumpVisitor(boolean printComments) { - this.printComments = printComments; - } - - public static class SourcePrinter { - - private final String indentation; - - public SourcePrinter(final String indentation) { - this.indentation = indentation; - } - - private int level = 0; - - private boolean indented = false; - - private final StringBuilder buf = new StringBuilder(); - - public void indent() { - level++; - } - - public void unindent() { - level--; - } - - private void makeIndent() { - for (int i = 0; i < level; i++) { - buf.append(indentation); - } - } - - public void print(final String arg) { - if (!indented) { - makeIndent(); - indented = true; - } - buf.append(arg); - } - - public void printLn(final String arg) { - print(arg); - printLn(); - } - - public void printLn() { - buf.append(EOL); - indented = false; - } - - public String getSource() { - return buf.toString(); - } - - @Override - public String toString() { - return getSource(); - } - } - - private final SourcePrinter printer = createSourcePrinter(); - - protected SourcePrinter createSourcePrinter() { - return new SourcePrinter(" "); - } - - public String getSource() { - return printer.getSource(); - } - - private void printModifiers(final EnumSet modifiers) { - if (modifiers.size() > 0) - printer.print(modifiers.stream().map(Modifier::getLib).collect(Collectors.joining(" ")) + " "); - } - - private void printMembers(final List> members, final Object arg) { - for (final BodyDeclaration member : members) { - printer.printLn(); - member.accept(this, arg); - printer.printLn(); - } - } - - private void printMemberAnnotations(final List annotations, final Object arg) { - if (!isNullOrEmpty(annotations)) { - for (final AnnotationExpr a : annotations) { - a.accept(this, arg); - printer.printLn(); - } - } - } - - private void printAnnotations(final List annotations, boolean prefixWithASpace, final Object arg) { - if (!isNullOrEmpty(annotations)) { - if (prefixWithASpace) { - printer.print(" "); - } - for (AnnotationExpr annotation : annotations) { - annotation.accept(this, arg); - printer.print(" "); - } - } - } - - private void printTypeArgs(final NodeWithTypeArguments nodeWithTypeArguments, final Object arg) { - List> typeArguments = nodeWithTypeArguments.getTypeArguments(); - if (!isNullOrEmpty(typeArguments)) { - printer.print("<"); - for (final Iterator> i = typeArguments.iterator(); i.hasNext(); ) { - final Type t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - private void printTypeParameters(final List args, final Object arg) { - if (!isNullOrEmpty(args)) { - printer.print("<"); - for (final Iterator i = args.iterator(); i.hasNext(); ) { - final TypeParameter t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - private void printArguments(final List args, final Object arg) { - printer.print("("); - if (!isNullOrEmpty(args)) { - for (final Iterator i = args.iterator(); i.hasNext(); ) { - final Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - private void printJavaComment(final Comment javacomment, final Object arg) { - if (javacomment != null) { - javacomment.accept(this, arg); - } - } - - @Override - public void visit(final CompilationUnit n, final Object arg) { - printJavaComment(n.getComment(), arg); - - if (n.getPackage() != null) { - n.getPackage().accept(this, arg); - } - - if (!isNullOrEmpty(n.getImports())) { - for (final ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - printer.printLn(); - } - - if (!isNullOrEmpty(n.getTypes())) { - for (final Iterator> i = n.getTypes().iterator(); i.hasNext(); ) { - i.next().accept(this, arg); - printer.printLn(); - if (i.hasNext()) { - printer.printLn(); - } - } - } - - printOrphanCommentsEnding(n); - } - - @Override - public void visit(final PackageDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), false, arg); - printer.print("package "); - n.getName().accept(this, arg); - printer.printLn(";"); - printer.printLn(); - - printOrphanCommentsEnding(n); - } - - @Override - public void visit(final NameExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getName()); - - printOrphanCommentsEnding(n); - } - - @Override - public void visit(final QualifiedNameExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getQualifier().accept(this, arg); - printer.print("."); - printer.print(n.getName()); - - printOrphanCommentsEnding(n); - } - - @Override - public void visit(final ImportDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (!n.isEmptyImportDeclaration()) { - printer.print("import "); - if (n.isStatic()) { - printer.print("static "); - } - n.getName().accept(this, arg); - if (n.isAsterisk()) { - printer.print(".*"); - } - } - printer.printLn(";"); - - printOrphanCommentsEnding(n); - } - - @Override - public void visit(final ClassOrInterfaceDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - if (n.isInterface()) { - printer.print("interface "); - } else { - printer.print("class "); - } - - printer.print(n.getName()); - - printTypeParameters(n.getTypeParameters(), arg); - - if (!isNullOrEmpty(n.getExtends())) { - printer.print(" extends "); - for (final Iterator i = n.getExtends().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - if (!isNullOrEmpty(n.getImplements())) { - printer.print(" implements "); - for (final Iterator i = n.getImplements().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (!isNullOrEmpty(n.getMembers())) { - printMembers(n.getMembers(), arg); - } - - printOrphanCommentsEnding(n); - - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(final EmptyTypeDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(";"); - - printOrphanCommentsEnding(n); - } - - @Override - public void visit(final JavadocComment n, final Object arg) { - printer.print("/**"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - - @Override - public void visit(final ClassOrInterfaceType n, final Object arg) { - printJavaComment(n.getComment(), arg); - - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - for (AnnotationExpr ae : n.getAnnotations()) { - ae.accept(this, arg); - printer.print(" "); - } - - printer.print(n.getName()); - - if (n.isUsingDiamondOperator()) { - printer.print("<>"); - } else { - printTypeArgs(n, arg); - } - } - - @Override - public void visit(final TypeParameter n, final Object arg) { - printJavaComment(n.getComment(), arg); - for (AnnotationExpr ann : n.getAnnotations()) { - ann.accept(this, arg); - printer.print(" "); - } - printer.print(n.getName()); - if (!isNullOrEmpty(n.getTypeBound())) { - printer.print(" extends "); - for (final Iterator i = n.getTypeBound().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(" & "); - } - } - } - } - - @Override - public void visit(final PrimitiveType n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), true, arg); - switch (n.getType()) { - case Boolean: - printer.print("boolean"); - break; - case Byte: - printer.print("byte"); - break; - case Char: - printer.print("char"); - break; - case Double: - printer.print("double"); - break; - case Float: - printer.print("float"); - break; - case Int: - printer.print("int"); - break; - case Long: - printer.print("long"); - break; - case Short: - printer.print("short"); - break; - } - } - - @Override + private boolean printComments; + + public DumpVisitor() { + this(true); + } + + public DumpVisitor(boolean printComments) { + this.printComments = printComments; + } + + public static class SourcePrinter { + + private final String indentation; + + public SourcePrinter(final String indentation) { + this.indentation = indentation; + } + + private int level = 0; + + private boolean indented = false; + + private final StringBuilder buf = new StringBuilder(); + + public void indent() { + level++; + } + + public void unindent() { + level--; + } + + private void makeIndent() { + for (int i = 0; i < level; i++) { + buf.append(indentation); + } + } + + public void print(final String arg) { + if (!indented) { + makeIndent(); + indented = true; + } + buf.append(arg); + } + + public void printLn(final String arg) { + print(arg); + printLn(); + } + + public void printLn() { + buf.append(EOL); + indented = false; + } + + public String getSource() { + return buf.toString(); + } + + @Override + public String toString() { + return getSource(); + } + } + + private final SourcePrinter printer = createSourcePrinter(); + + protected SourcePrinter createSourcePrinter() { + return new SourcePrinter(" "); + } + + public String getSource() { + return printer.getSource(); + } + + private void printModifiers(final EnumSet modifiers) { + if (modifiers.size() > 0) + printer.print(modifiers.stream().map(Modifier::getLib).collect(Collectors.joining(" ")) + " "); + } + + private void printMembers(final List> members, final Object arg) { + for (final BodyDeclaration member : members) { + printer.printLn(); + member.accept(this, arg); + printer.printLn(); + } + } + + private void printMemberAnnotations(final List annotations, final Object arg) { + if (!isNullOrEmpty(annotations)) { + for (final AnnotationExpr a : annotations) { + a.accept(this, arg); + printer.printLn(); + } + } + } + + private void printAnnotations(final List annotations, boolean prefixWithASpace, final Object arg) { + if (!isNullOrEmpty(annotations)) { + if(prefixWithASpace){ + printer.print(" "); + } + for (AnnotationExpr annotation : annotations) { + annotation.accept(this, arg); + printer.print(" "); + } + } + } + + private void printTypeArgs(final NodeWithTypeArguments nodeWithTypeArguments, final Object arg) { + List> typeArguments = nodeWithTypeArguments.getTypeArguments(); + if (!isNullOrEmpty(typeArguments)) { + printer.print("<"); + for (final Iterator> i = typeArguments.iterator(); i.hasNext(); ) { + final Type t = i.next(); + t.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(">"); + } + } + + private void printTypeParameters(final List args, final Object arg) { + if (!isNullOrEmpty(args)) { + printer.print("<"); + for (final Iterator i = args.iterator(); i.hasNext(); ) { + final TypeParameter t = i.next(); + t.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(">"); + } + } + + private void printArguments(final List args, final Object arg) { + printer.print("("); + if (!isNullOrEmpty(args)) { + for (final Iterator i = args.iterator(); i.hasNext(); ) { + final Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + } + + private void printJavaComment(final Comment javacomment, final Object arg) { + if (javacomment != null) { + javacomment.accept(this, arg); + } + } + + @Override + public void visit(final CompilationUnit n, final Object arg) { + printJavaComment(n.getComment(), arg); + + if (n.getPackage() != null) { + n.getPackage().accept(this, arg); + } + + if (!isNullOrEmpty(n.getImports())) { + for (final ImportDeclaration i : n.getImports()) { + i.accept(this, arg); + } + printer.printLn(); + } + + if (!isNullOrEmpty(n.getTypes())) { + for (final Iterator> i = n.getTypes().iterator(); i.hasNext(); ) { + i.next().accept(this, arg); + printer.printLn(); + if (i.hasNext()) { + printer.printLn(); + } + } + } + + printOrphanCommentsEnding(n); + } + + @Override + public void visit(final PackageDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), false, arg); + printer.print("package "); + n.getName().accept(this, arg); + printer.printLn(";"); + printer.printLn(); + + printOrphanCommentsEnding(n); + } + + @Override + public void visit(final NameExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getName()); + + printOrphanCommentsEnding(n); + } + + @Override + public void visit(final QualifiedNameExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getQualifier().accept(this, arg); + printer.print("."); + printer.print(n.getName()); + + printOrphanCommentsEnding(n); + } + + @Override + public void visit(final ImportDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (!n.isEmptyImportDeclaration()) { + printer.print("import "); + if (n.isStatic()) { + printer.print("static "); + } + n.getName().accept(this, arg); + if (n.isAsterisk()) { + printer.print(".*"); + } + } + printer.printLn(";"); + + printOrphanCommentsEnding(n); + } + + @Override + public void visit(final ClassOrInterfaceDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + if (n.isInterface()) { + printer.print("interface "); + } else { + printer.print("class "); + } + + printer.print(n.getName()); + + printTypeParameters(n.getTypeParameters(), arg); + + if (!isNullOrEmpty(n.getExtends())) { + printer.print(" extends "); + for (final Iterator i = n.getExtends().iterator(); i.hasNext(); ) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + if (!isNullOrEmpty(n.getImplements())) { + printer.print(" implements "); + for (final Iterator i = n.getImplements().iterator(); i.hasNext(); ) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + printer.printLn(" {"); + printer.indent(); + if (!isNullOrEmpty(n.getMembers())) { + printMembers(n.getMembers(), arg); + } + + printOrphanCommentsEnding(n); + + printer.unindent(); + printer.print("}"); + } + + @Override + public void visit(final EmptyTypeDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(";"); + + printOrphanCommentsEnding(n); + } + + @Override + public void visit(final JavadocComment n, final Object arg) { + printer.print("/**"); + printer.print(n.getContent()); + printer.printLn("*/"); + } + + @Override + public void visit(final ClassOrInterfaceType n, final Object arg) { + printJavaComment(n.getComment(), arg); + + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + for (AnnotationExpr ae : n.getAnnotations()) { + ae.accept(this, arg); + printer.print(" "); + } + + printer.print(n.getName()); + + if (n.isUsingDiamondOperator()) { + printer.print("<>"); + } else { + printTypeArgs(n, arg); + } + } + + @Override + public void visit(final TypeParameter n, final Object arg) { + printJavaComment(n.getComment(), arg); + for (AnnotationExpr ann : n.getAnnotations()) { + ann.accept(this, arg); + printer.print(" "); + } + printer.print(n.getName()); + if (!isNullOrEmpty(n.getTypeBound())) { + printer.print(" extends "); + for (final Iterator i = n.getTypeBound().iterator(); i.hasNext(); ) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(" & "); + } + } + } + } + + @Override + public void visit(final PrimitiveType n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), true, arg); + switch (n.getType()) { + case Boolean: + printer.print("boolean"); + break; + case Byte: + printer.print("byte"); + break; + case Char: + printer.print("char"); + break; + case Double: + printer.print("double"); + break; + case Float: + printer.print("float"); + break; + case Int: + printer.print("int"); + break; + case Long: + printer.print("long"); + break; + case Short: + printer.print("short"); + break; + } + } + + @Override public void visit(final ArrayType n, final Object arg) { final List arrayTypeBuffer = new LinkedList<>(); Type type = n; @@ -440,35 +440,34 @@ public void visit(final ArrayType n, final Object arg) { } } - @Override - public void visit(final ArrayCreationLevel n, final Object arg) { - printAnnotations(n.getAnnotations(), true, arg); - printer.print("["); - if (n.getDimension() != null) { - n.getDimension().accept(this, arg); - } - printer.print("]"); - } - - @Override - public void visit(final IntersectionType n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), false, arg); - boolean isFirst = true; - for (ReferenceType element : n.getElements()) { - element.accept(this, arg); - if (isFirst) { - isFirst = false; - } else { - printer.print(" & "); - } - } - } - - @Override - public void visit(final UnionType n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), true, arg); + @Override + public void visit(final ArrayCreationLevel n, final Object arg) { + printAnnotations(n.getAnnotations(), true, arg); + printer.print("["); + if (n.getDimension() != null) { + n.getDimension().accept(this, arg); + } + printer.print("]"); + } + + @Override + public void visit(final IntersectionType n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), false, arg); + boolean isFirst = true; + for (ReferenceType element : n.getElements()) { + element.accept(this, arg); + if (isFirst) { + isFirst = false; + } else { + printer.print(" & "); + } + } + } + + @Override public void visit(final UnionType n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), true, arg); boolean isFirst = true; for (ReferenceType element : n.getElements()) { if (isFirst) { @@ -476,1170 +475,1170 @@ public void visit(final UnionType n, final Object arg) { } else { printer.print(" | "); } - element.accept(this, arg); - } - } - - - @Override - public void visit(final WildcardType n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), false, arg); - printer.print("?"); - if (n.getExtends() != null) { - printer.print(" extends "); - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - printer.print(" super "); - n.getSuper().accept(this, arg); - } - } - - @Override - public void visit(final UnknownType n, final Object arg) { - // Nothing to dump - } - - @Override - public void visit(final FieldDeclaration n, final Object arg) { - printOrphanCommentsBeforeThisChildNode(n); - - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - n.getElementType().accept(this, arg); - for (ArrayBracketPair pair : n.getArrayBracketPairsAfterElementType()) { - pair.accept(this, arg); - } - - printer.print(" "); - for (final Iterator i = n.getVariables().iterator(); i.hasNext(); ) { - final VariableDeclarator var = i.next(); - var.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - - printer.print(";"); - } - - @Override - public void visit(final VariableDeclarator n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getId().accept(this, arg); - if (n.getInit() != null) { - printer.print(" = "); - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(final VariableDeclaratorId n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getName()); - for (ArrayBracketPair pair : n.getArrayBracketPairsAfterId()) { - pair.accept(this, arg); - } - } - - @Override - public void visit(final ArrayInitializerExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("{"); - if (!isNullOrEmpty(n.getValues())) { - printer.print(" "); - for (final Iterator i = n.getValues().iterator(); i.hasNext(); ) { - final Expression expr = i.next(); - expr.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(" "); - } - printer.print("}"); - } - - @Override - public void visit(final VoidType n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), false, arg); - printer.print("void"); - } - - @Override - public void visit(final ArrayAccessExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getName().accept(this, arg); - printer.print("["); - n.getIndex().accept(this, arg); - printer.print("]"); - } - - @Override - public void visit(final ArrayCreationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("new "); - n.getType().accept(this, arg); - for (ArrayCreationLevel level : n.getLevels()) { - level.accept(this, arg); - } - if (n.getInitializer() != null) { - printer.print(" "); - n.getInitializer().accept(this, arg); - } - } - - @Override - public void visit(final AssignExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getTarget().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case assign: - printer.print("="); - break; - case and: - printer.print("&="); - break; - case or: - printer.print("|="); - break; - case xor: - printer.print("^="); - break; - case plus: - printer.print("+="); - break; - case minus: - printer.print("-="); - break; - case rem: - printer.print("%="); - break; - case slash: - printer.print("/="); - break; - case star: - printer.print("*="); - break; - case lShift: - printer.print("<<="); - break; - case rSignedShift: - printer.print(">>="); - break; - case rUnsignedShift: - printer.print(">>>="); - break; - } - printer.print(" "); - n.getValue().accept(this, arg); - } - - @Override - public void visit(final BinaryExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getLeft().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case or: - printer.print("||"); - break; - case and: - printer.print("&&"); - break; - case binOr: - printer.print("|"); - break; - case binAnd: - printer.print("&"); - break; - case xor: - printer.print("^"); - break; - case equals: - printer.print("=="); - break; - case notEquals: - printer.print("!="); - break; - case less: - printer.print("<"); - break; - case greater: - printer.print(">"); - break; - case lessEquals: - printer.print("<="); - break; - case greaterEquals: - printer.print(">="); - break; - case lShift: - printer.print("<<"); - break; - case rSignedShift: - printer.print(">>"); - break; - case rUnsignedShift: - printer.print(">>>"); - break; - case plus: - printer.print("+"); - break; - case minus: - printer.print("-"); - break; - case times: - printer.print("*"); - break; - case divide: - printer.print("/"); - break; - case remainder: - printer.print("%"); - break; - } - printer.print(" "); - n.getRight().accept(this, arg); - } - - @Override - public void visit(final CastExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("("); - n.getType().accept(this, arg); - printer.print(") "); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final ClassExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getType().accept(this, arg); - printer.print(".class"); - } - - @Override - public void visit(final ConditionalExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - printer.print(" ? "); - n.getThenExpr().accept(this, arg); - printer.print(" : "); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(final EnclosedExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("("); - if (n.getInner() != null) { - n.getInner().accept(this, arg); - } - printer.print(")"); - } - - @Override - public void visit(final FieldAccessExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getScope().accept(this, arg); - printer.print("."); - printer.print(n.getField()); - } - - @Override - public void visit(final InstanceOfExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - printer.print(" instanceof "); - n.getType().accept(this, arg); - } - - @Override - public void visit(final CharLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("'"); - printer.print(n.getValue()); - printer.print("'"); - } - - @Override - public void visit(final DoubleLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final IntegerLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final LongLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final IntegerLiteralMinValueExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final LongLiteralMinValueExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final StringLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("\""); - printer.print(n.getValue()); - printer.print("\""); - } - - @Override - public void visit(final BooleanLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(String.valueOf(n.getValue())); - } - - @Override - public void visit(final NullLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("null"); - } - - @Override - public void visit(final ThisExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("this"); - } - - @Override - public void visit(final SuperExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("super"); - } - - @Override - public void visit(final MethodCallExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - printTypeArgs(n, arg); - printer.print(n.getName()); - printArguments(n.getArgs(), arg); - } - - @Override - public void visit(final ObjectCreationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - - printer.print("new "); - - printTypeArgs(n, arg); - if (!isNullOrEmpty(n.getTypeArguments())) { - printer.print(" "); - } - - n.getType().accept(this, arg); - - printArguments(n.getArgs(), arg); - - if (n.getAnonymousClassBody() != null) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getAnonymousClassBody(), arg); - printer.unindent(); - printer.print("}"); - } - } - - @Override - public void visit(final UnaryExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - switch (n.getOperator()) { - case positive: - printer.print("+"); - break; - case negative: - printer.print("-"); - break; - case inverse: - printer.print("~"); - break; - case not: - printer.print("!"); - break; - case preIncrement: - printer.print("++"); - break; - case preDecrement: - printer.print("--"); - break; - default: - } - - n.getExpr().accept(this, arg); - - switch (n.getOperator()) { - case posIncrement: - printer.print("++"); - break; - case posDecrement: - printer.print("--"); - break; - default: - } - } - - @Override - public void visit(final ConstructorDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printTypeParameters(n.getTypeParameters(), arg); - if (!n.getTypeParameters().isEmpty()) { - printer.print(" "); - } - printer.print(n.getName()); - - printer.print("("); - if (!n.getParameters().isEmpty()) { - for (final Iterator i = n.getParameters().iterator(); i.hasNext(); ) { - final Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - if (!isNullOrEmpty(n.getThrows())) { - printer.print(" throws "); - for (final Iterator i = n.getThrows().iterator(); i.hasNext(); ) { - final ReferenceType name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(" "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final MethodDeclaration n, final Object arg) { - printOrphanCommentsBeforeThisChildNode(n); - - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - if (n.isDefault()) { - printer.print("default "); - } - printTypeParameters(n.getTypeParameters(), arg); - if (!isNullOrEmpty(n.getTypeParameters())) { - printer.print(" "); - } - - n.getElementType().accept(this, arg); - for (ArrayBracketPair pair : n.getArrayBracketPairsAfterElementType()) { - pair.accept(this, arg); - } - printer.print(" "); - printer.print(n.getName()); - - printer.print("("); - if (!isNullOrEmpty(n.getParameters())) { - for (final Iterator i = n.getParameters().iterator(); i.hasNext(); ) { - final Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - for (ArrayBracketPair pair : n.getArrayBracketPairsAfterParameterList()) { - pair.accept(this, arg); - } - - if (!isNullOrEmpty(n.getThrows())) { - printer.print(" throws "); - for (final Iterator i = n.getThrows().iterator(); i.hasNext(); ) { - final ReferenceType name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (n.getBody() == null) { - printer.print(";"); - } else { - printer.print(" "); - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(final Parameter n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), false, arg); - printModifiers(n.getModifiers()); - if (n.getElementType() != null) { - n.getElementType().accept(this, arg); - } - for (ArrayBracketPair pair : n.getArrayBracketPairsAfterElementType()) { - pair.accept(this, arg); - } - if (n.isVarArgs()) { - printer.print("..."); - } - printer.print(" "); - n.getId().accept(this, arg); - } - - @Override - public void visit(final ExplicitConstructorInvocationStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.isThis()) { - printTypeArgs(n, arg); - printer.print("this"); - } else { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - printer.print("."); - } - printTypeArgs(n, arg); - printer.print("super"); - } - printArguments(n.getArgs(), arg); - printer.print(";"); - } - - @Override - public void visit(final VariableDeclarationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), false, arg); - printModifiers(n.getModifiers()); - - n.getElementType().accept(this, arg); - for (ArrayBracketPair pair : n.getArrayBracketPairsAfterElementType()) { - pair.accept(this, arg); - } - printer.print(" "); - - for (final Iterator i = n.getVariables().iterator(); i.hasNext(); ) { - final VariableDeclarator v = i.next(); - v.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - @Override - public void visit(final TypeDeclarationStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(final AssertStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("assert "); - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - printer.print(" : "); - n.getMessage().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(final BlockStmt n, final Object arg) { - printOrphanCommentsBeforeThisChildNode(n); - printJavaComment(n.getComment(), arg); - printer.printLn("{"); - if (n.getStmts() != null) { - printer.indent(); - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - printer.unindent(); - } - printOrphanCommentsEnding(n); - printer.print("}"); - - } - - @Override - public void visit(final LabeledStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getLabel()); - printer.print(": "); - n.getStmt().accept(this, arg); - } - - @Override - public void visit(final EmptyStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(";"); - } - - @Override - public void visit(final ExpressionStmt n, final Object arg) { - printOrphanCommentsBeforeThisChildNode(n); - printJavaComment(n.getComment(), arg); - n.getExpression().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(final SwitchStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("switch("); - n.getSelector().accept(this, arg); - printer.printLn(") {"); - if (n.getEntries() != null) { - printer.indent(); - for (final SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - printer.unindent(); - } - printer.print("}"); - - } - - @Override - public void visit(final SwitchEntryStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getLabel() != null) { - printer.print("case "); - n.getLabel().accept(this, arg); - printer.print(":"); - } else { - printer.print("default:"); - } - printer.printLn(); - printer.indent(); - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - } - printer.unindent(); - } - - @Override - public void visit(final BreakStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("break"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(final ReturnStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("return"); - if (n.getExpr() != null) { - printer.print(" "); - n.getExpr().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(final EnumDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("enum "); - printer.print(n.getName()); - - if (!n.getImplements().isEmpty()) { - printer.print(" implements "); - for (final Iterator i = n.getImplements().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (n.getEntries() != null) { - printer.printLn(); - for (final Iterator i = n.getEntries().iterator(); i.hasNext(); ) { - final EnumConstantDeclaration e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (!n.getMembers().isEmpty()) { - printer.printLn(";"); - printMembers(n.getMembers(), arg); - } else { - if (!n.getEntries().isEmpty()) { - printer.printLn(); - } - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(final EnumConstantDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printer.print(n.getName()); - - if (!n.getArgs().isEmpty()) { - printArguments(n.getArgs(), arg); - } - - if (!n.getClassBody().isEmpty()) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getClassBody(), arg); - printer.unindent(); - printer.printLn("}"); - } - } - - @Override - public void visit(final EmptyMemberDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(";"); - } - - @Override - public void visit(final InitializerDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.isStatic()) { - printer.print("static "); - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final IfStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("if ("); - n.getCondition().accept(this, arg); - final boolean thenBlock = n.getThenStmt() instanceof BlockStmt; - if (thenBlock) // block statement should start on the same line - printer.print(") "); - else { - printer.printLn(")"); - printer.indent(); - } - n.getThenStmt().accept(this, arg); - if (!thenBlock) - printer.unindent(); - if (n.getElseStmt() != null) { - if (thenBlock) - printer.print(" "); - else - printer.printLn(); - final boolean elseIf = n.getElseStmt() instanceof IfStmt; - final boolean elseBlock = n.getElseStmt() instanceof BlockStmt; - if (elseIf || elseBlock) // put chained if and start of block statement on a same level - printer.print("else "); - else { - printer.printLn("else"); - printer.indent(); - } - n.getElseStmt().accept(this, arg); - if (!(elseIf || elseBlock)) - printer.unindent(); - } - } - - @Override - public void visit(final WhileStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("while ("); - n.getCondition().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ContinueStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("continue"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(final DoStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("do "); - n.getBody().accept(this, arg); - printer.print(" while ("); - n.getCondition().accept(this, arg); - printer.print(");"); - } - - @Override - public void visit(final ForeachStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("for ("); - n.getVariable().accept(this, arg); - printer.print(" : "); - n.getIterable().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ForStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("for ("); - if (n.getInit() != null) { - for (final Iterator i = n.getInit().iterator(); i.hasNext(); ) { - final Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print("; "); - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - printer.print("; "); - if (n.getUpdate() != null) { - for (final Iterator i = n.getUpdate().iterator(); i.hasNext(); ) { - final Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ThrowStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("throw "); - n.getExpr().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(final SynchronizedStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("synchronized ("); - n.getExpr().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final TryStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("try "); - if (!n.getResources().isEmpty()) { - printer.print("("); - Iterator resources = n.getResources().iterator(); - boolean first = true; - while (resources.hasNext()) { - visit(resources.next(), arg); - if (resources.hasNext()) { - printer.print(";"); - printer.printLn(); - if (first) { - printer.indent(); - } - } - first = false; - } - if (n.getResources().size() > 1) { - printer.unindent(); - } - printer.print(") "); - } - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (final CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - printer.print(" finally "); - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(final CatchClause n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(" catch ("); - n.getParam().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - - } - - @Override - public void visit(final AnnotationDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("@interface "); - printer.print(n.getName()); - printer.printLn(" {"); - printer.indent(); - if (n.getMembers() != null) { - printMembers(n.getMembers(), arg); - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(final AnnotationMemberDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - printer.print(" "); - printer.print(n.getName()); - printer.print("()"); - if (n.getDefaultValue() != null) { - printer.print(" default "); - n.getDefaultValue().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(final MarkerAnnotationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("@"); - n.getName().accept(this, arg); - } - - @Override - public void visit(final SingleMemberAnnotationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - n.getMemberValue().accept(this, arg); - printer.print(")"); - } - - @Override - public void visit(final NormalAnnotationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - if (n.getPairs() != null) { - for (final Iterator i = n.getPairs().iterator(); i.hasNext(); ) { - final MemberValuePair m = i.next(); - m.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - @Override - public void visit(final MemberValuePair n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getName()); - printer.print(" = "); - n.getValue().accept(this, arg); - } - - @Override - public void visit(final LineComment n, final Object arg) { - if (!this.printComments) { - return; - } - printer.print("//"); - String tmp = n.getContent(); - tmp = tmp.replace('\r', ' '); - tmp = tmp.replace('\n', ' '); - printer.printLn(tmp); - } - - @Override - public void visit(final BlockComment n, final Object arg) { - if (!this.printComments) { - return; - } - printer.print("/*"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - - @Override - public void visit(LambdaExpr n, Object arg) { - printJavaComment(n.getComment(), arg); - - final List parameters = n.getParameters(); - final boolean printPar = n.isParametersEnclosed(); - - if (printPar) { - printer.print("("); - } - if (parameters != null) { - for (Iterator i = parameters.iterator(); i.hasNext(); ) { - Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (printPar) { - printer.print(")"); - } - - printer.print(" -> "); - final Statement body = n.getBody(); - if (body instanceof ExpressionStmt) { - // Print the expression directly - ((ExpressionStmt) body).getExpression().accept(this, arg); - } else { - body.accept(this, arg); - } - } - - - @Override - public void visit(MethodReferenceExpr n, Object arg) { - printJavaComment(n.getComment(), arg); - Expression scope = n.getScope(); - String identifier = n.getIdentifier(); - if (scope != null) { - n.getScope().accept(this, arg); - } - - printer.print("::"); - printTypeArgs(n, arg); - if (identifier != null) { - printer.print(identifier); - } - - } - - @Override - public void visit(TypeExpr n, Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getType() != null) { - n.getType().accept(this, arg); - } - } - - @Override - public void visit(ArrayBracketPair arrayBracketPair, Object arg) { - printAnnotations(arrayBracketPair.getAnnotations(), true, arg); - printer.print("[]"); - } - - private void printOrphanCommentsBeforeThisChildNode(final Node node) { - if (node instanceof Comment) return; - - Node parent = node.getParentNode(); - if (parent == null) return; - List everything = new LinkedList<>(); - everything.addAll(parent.getChildrenNodes()); - sortByBeginPosition(everything); - int positionOfTheChild = -1; - for (int i = 0; i < everything.size(); i++) { - if (everything.get(i) == node) positionOfTheChild = i; - } - if (positionOfTheChild == -1) throw new RuntimeException("My index not found!!! " + node); - int positionOfPreviousChild = -1; - for (int i = positionOfTheChild - 1; i >= 0 && positionOfPreviousChild == -1; i--) { - if (!(everything.get(i) instanceof Comment)) positionOfPreviousChild = i; - } - for (int i = positionOfPreviousChild + 1; i < positionOfTheChild; i++) { - Node nodeToPrint = everything.get(i); - if (!(nodeToPrint instanceof Comment)) - throw new RuntimeException("Expected comment, instead " + nodeToPrint.getClass() + ". Position of previous child: " + positionOfPreviousChild + ", position of child " + positionOfTheChild); - nodeToPrint.accept(this, null); - } - } - - - private void printOrphanCommentsEnding(final Node node) { - List everything = new LinkedList<>(); - everything.addAll(node.getChildrenNodes()); - sortByBeginPosition(everything); - if (everything.isEmpty()) { - return; - } - - int commentsAtEnd = 0; - boolean findingComments = true; - while (findingComments && commentsAtEnd < everything.size()) { - Node last = everything.get(everything.size() - 1 - commentsAtEnd); - findingComments = (last instanceof Comment); - if (findingComments) { - commentsAtEnd++; - } - } - for (int i = 0; i < commentsAtEnd; i++) { - everything.get(everything.size() - commentsAtEnd + i).accept(this, null); - } - } + element.accept(this, arg); + } + } + + + @Override + public void visit(final WildcardType n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), false, arg); + printer.print("?"); + if (n.getExtends() != null) { + printer.print(" extends "); + n.getExtends().accept(this, arg); + } + if (n.getSuper() != null) { + printer.print(" super "); + n.getSuper().accept(this, arg); + } + } + + @Override + public void visit(final UnknownType n, final Object arg) { + // Nothing to dump + } + + @Override + public void visit(final FieldDeclaration n, final Object arg) { + printOrphanCommentsBeforeThisChildNode(n); + + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + n.getElementType().accept(this, arg); + for(ArrayBracketPair pair: n.getArrayBracketPairsAfterElementType()){ + pair.accept(this, arg); + } + + printer.print(" "); + for (final Iterator i = n.getVariables().iterator(); i.hasNext(); ) { + final VariableDeclarator var = i.next(); + var.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + + printer.print(";"); + } + + @Override + public void visit(final VariableDeclarator n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getId().accept(this, arg); + if (n.getInit() != null) { + printer.print(" = "); + n.getInit().accept(this, arg); + } + } + + @Override + public void visit(final VariableDeclaratorId n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getName()); + for(ArrayBracketPair pair: n.getArrayBracketPairsAfterId()){ + pair.accept(this, arg); + } + } + + @Override + public void visit(final ArrayInitializerExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("{"); + if (!isNullOrEmpty(n.getValues())) { + printer.print(" "); + for (final Iterator i = n.getValues().iterator(); i.hasNext(); ) { + final Expression expr = i.next(); + expr.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(" "); + } + printer.print("}"); + } + + @Override + public void visit(final VoidType n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), false, arg); + printer.print("void"); + } + + @Override + public void visit(final ArrayAccessExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getName().accept(this, arg); + printer.print("["); + n.getIndex().accept(this, arg); + printer.print("]"); + } + + @Override + public void visit(final ArrayCreationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("new "); + n.getType().accept(this, arg); + for (ArrayCreationLevel level : n.getLevels()) { + level.accept(this, arg); + } + if (n.getInitializer() != null) { + printer.print(" "); + n.getInitializer().accept(this, arg); + } + } + + @Override + public void visit(final AssignExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getTarget().accept(this, arg); + printer.print(" "); + switch (n.getOperator()) { + case assign: + printer.print("="); + break; + case and: + printer.print("&="); + break; + case or: + printer.print("|="); + break; + case xor: + printer.print("^="); + break; + case plus: + printer.print("+="); + break; + case minus: + printer.print("-="); + break; + case rem: + printer.print("%="); + break; + case slash: + printer.print("/="); + break; + case star: + printer.print("*="); + break; + case lShift: + printer.print("<<="); + break; + case rSignedShift: + printer.print(">>="); + break; + case rUnsignedShift: + printer.print(">>>="); + break; + } + printer.print(" "); + n.getValue().accept(this, arg); + } + + @Override + public void visit(final BinaryExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getLeft().accept(this, arg); + printer.print(" "); + switch (n.getOperator()) { + case or: + printer.print("||"); + break; + case and: + printer.print("&&"); + break; + case binOr: + printer.print("|"); + break; + case binAnd: + printer.print("&"); + break; + case xor: + printer.print("^"); + break; + case equals: + printer.print("=="); + break; + case notEquals: + printer.print("!="); + break; + case less: + printer.print("<"); + break; + case greater: + printer.print(">"); + break; + case lessEquals: + printer.print("<="); + break; + case greaterEquals: + printer.print(">="); + break; + case lShift: + printer.print("<<"); + break; + case rSignedShift: + printer.print(">>"); + break; + case rUnsignedShift: + printer.print(">>>"); + break; + case plus: + printer.print("+"); + break; + case minus: + printer.print("-"); + break; + case times: + printer.print("*"); + break; + case divide: + printer.print("/"); + break; + case remainder: + printer.print("%"); + break; + } + printer.print(" "); + n.getRight().accept(this, arg); + } + + @Override + public void visit(final CastExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("("); + n.getType().accept(this, arg); + printer.print(") "); + n.getExpr().accept(this, arg); + } + + @Override + public void visit(final ClassExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getType().accept(this, arg); + printer.print(".class"); + } + + @Override + public void visit(final ConditionalExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + printer.print(" ? "); + n.getThenExpr().accept(this, arg); + printer.print(" : "); + n.getElseExpr().accept(this, arg); + } + + @Override + public void visit(final EnclosedExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("("); + if (n.getInner() != null) { + n.getInner().accept(this, arg); + } + printer.print(")"); + } + + @Override + public void visit(final FieldAccessExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getScope().accept(this, arg); + printer.print("."); + printer.print(n.getField()); + } + + @Override + public void visit(final InstanceOfExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + printer.print(" instanceof "); + n.getType().accept(this, arg); + } + + @Override + public void visit(final CharLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("'"); + printer.print(n.getValue()); + printer.print("'"); + } + + @Override + public void visit(final DoubleLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override + public void visit(final IntegerLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override + public void visit(final LongLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override + public void visit(final IntegerLiteralMinValueExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override + public void visit(final LongLiteralMinValueExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override + public void visit(final StringLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("\""); + printer.print(n.getValue()); + printer.print("\""); + } + + @Override + public void visit(final BooleanLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(String.valueOf(n.getValue())); + } + + @Override + public void visit(final NullLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("null"); + } + + @Override + public void visit(final ThisExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + printer.print("."); + } + printer.print("this"); + } + + @Override + public void visit(final SuperExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + printer.print("."); + } + printer.print("super"); + } + + @Override + public void visit(final MethodCallExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + printTypeArgs(n, arg); + printer.print(n.getName()); + printArguments(n.getArgs(), arg); + } + + @Override + public void visit(final ObjectCreationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + + printer.print("new "); + + printTypeArgs(n, arg); + if (!isNullOrEmpty(n.getTypeArguments())) { + printer.print(" "); + } + + n.getType().accept(this, arg); + + printArguments(n.getArgs(), arg); + + if (n.getAnonymousClassBody() != null) { + printer.printLn(" {"); + printer.indent(); + printMembers(n.getAnonymousClassBody(), arg); + printer.unindent(); + printer.print("}"); + } + } + + @Override + public void visit(final UnaryExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + switch (n.getOperator()) { + case positive: + printer.print("+"); + break; + case negative: + printer.print("-"); + break; + case inverse: + printer.print("~"); + break; + case not: + printer.print("!"); + break; + case preIncrement: + printer.print("++"); + break; + case preDecrement: + printer.print("--"); + break; + default: + } + + n.getExpr().accept(this, arg); + + switch (n.getOperator()) { + case posIncrement: + printer.print("++"); + break; + case posDecrement: + printer.print("--"); + break; + default: + } + } + + @Override + public void visit(final ConstructorDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printTypeParameters(n.getTypeParameters(), arg); + if (!n.getTypeParameters().isEmpty()) { + printer.print(" "); + } + printer.print(n.getName()); + + printer.print("("); + if (!n.getParameters().isEmpty()) { + for (final Iterator i = n.getParameters().iterator(); i.hasNext(); ) { + final Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + + if (!isNullOrEmpty(n.getThrows())) { + printer.print(" throws "); + for (final Iterator i = n.getThrows().iterator(); i.hasNext(); ) { + final ReferenceType name = i.next(); + name.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(" "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(final MethodDeclaration n, final Object arg) { + printOrphanCommentsBeforeThisChildNode(n); + + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + if (n.isDefault()) { + printer.print("default "); + } + printTypeParameters(n.getTypeParameters(), arg); + if (!isNullOrEmpty(n.getTypeParameters())) { + printer.print(" "); + } + + n.getElementType().accept(this, arg); + for(ArrayBracketPair pair: n.getArrayBracketPairsAfterElementType()){ + pair.accept(this, arg); + } + printer.print(" "); + printer.print(n.getName()); + + printer.print("("); + if (!isNullOrEmpty(n.getParameters())) { + for (final Iterator i = n.getParameters().iterator(); i.hasNext(); ) { + final Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + + for(ArrayBracketPair pair: n.getArrayBracketPairsAfterParameterList()){ + pair.accept(this, arg); + } + + if (!isNullOrEmpty(n.getThrows())) { + printer.print(" throws "); + for (final Iterator i = n.getThrows().iterator(); i.hasNext(); ) { + final ReferenceType name = i.next(); + name.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (n.getBody() == null) { + printer.print(";"); + } else { + printer.print(" "); + n.getBody().accept(this, arg); + } + } + + @Override + public void visit(final Parameter n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), false, arg); + printModifiers(n.getModifiers()); + if (n.getElementType() != null) { + n.getElementType().accept(this, arg); + } + for(ArrayBracketPair pair: n.getArrayBracketPairsAfterElementType()){ + pair.accept(this, arg); + } + if (n.isVarArgs()) { + printer.print("..."); + } + printer.print(" "); + n.getId().accept(this, arg); + } + + @Override + public void visit(final ExplicitConstructorInvocationStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.isThis()) { + printTypeArgs(n, arg); + printer.print("this"); + } else { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + printer.print("."); + } + printTypeArgs(n, arg); + printer.print("super"); + } + printArguments(n.getArgs(), arg); + printer.print(";"); + } + + @Override + public void visit(final VariableDeclarationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), false, arg); + printModifiers(n.getModifiers()); + + n.getElementType().accept(this, arg); + for(ArrayBracketPair pair: n.getArrayBracketPairsAfterElementType()){ + pair.accept(this, arg); + } + printer.print(" "); + + for (final Iterator i = n.getVariables().iterator(); i.hasNext(); ) { + final VariableDeclarator v = i.next(); + v.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + @Override + public void visit(final TypeDeclarationStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getTypeDeclaration().accept(this, arg); + } + + @Override + public void visit(final AssertStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("assert "); + n.getCheck().accept(this, arg); + if (n.getMessage() != null) { + printer.print(" : "); + n.getMessage().accept(this, arg); + } + printer.print(";"); + } + + @Override + public void visit(final BlockStmt n, final Object arg) { + printOrphanCommentsBeforeThisChildNode(n); + printJavaComment(n.getComment(), arg); + printer.printLn("{"); + if (n.getStmts() != null) { + printer.indent(); + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + printer.printLn(); + } + printer.unindent(); + } + printOrphanCommentsEnding(n); + printer.print("}"); + + } + + @Override + public void visit(final LabeledStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getLabel()); + printer.print(": "); + n.getStmt().accept(this, arg); + } + + @Override + public void visit(final EmptyStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(";"); + } + + @Override + public void visit(final ExpressionStmt n, final Object arg) { + printOrphanCommentsBeforeThisChildNode(n); + printJavaComment(n.getComment(), arg); + n.getExpression().accept(this, arg); + printer.print(";"); + } + + @Override + public void visit(final SwitchStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("switch("); + n.getSelector().accept(this, arg); + printer.printLn(") {"); + if (n.getEntries() != null) { + printer.indent(); + for (final SwitchEntryStmt e : n.getEntries()) { + e.accept(this, arg); + } + printer.unindent(); + } + printer.print("}"); + + } + + @Override + public void visit(final SwitchEntryStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getLabel() != null) { + printer.print("case "); + n.getLabel().accept(this, arg); + printer.print(":"); + } else { + printer.print("default:"); + } + printer.printLn(); + printer.indent(); + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + printer.printLn(); + } + } + printer.unindent(); + } + + @Override + public void visit(final BreakStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("break"); + if (n.getId() != null) { + printer.print(" "); + printer.print(n.getId()); + } + printer.print(";"); + } + + @Override + public void visit(final ReturnStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("return"); + if (n.getExpr() != null) { + printer.print(" "); + n.getExpr().accept(this, arg); + } + printer.print(";"); + } + + @Override + public void visit(final EnumDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printer.print("enum "); + printer.print(n.getName()); + + if (!n.getImplements().isEmpty()) { + printer.print(" implements "); + for (final Iterator i = n.getImplements().iterator(); i.hasNext(); ) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + printer.printLn(" {"); + printer.indent(); + if (n.getEntries() != null) { + printer.printLn(); + for (final Iterator i = n.getEntries().iterator(); i.hasNext(); ) { + final EnumConstantDeclaration e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (!n.getMembers().isEmpty()) { + printer.printLn(";"); + printMembers(n.getMembers(), arg); + } else { + if (!n.getEntries().isEmpty()) { + printer.printLn(); + } + } + printer.unindent(); + printer.print("}"); + } + + @Override + public void visit(final EnumConstantDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printer.print(n.getName()); + + if (!n.getArgs().isEmpty()) { + printArguments(n.getArgs(), arg); + } + + if (!n.getClassBody().isEmpty()) { + printer.printLn(" {"); + printer.indent(); + printMembers(n.getClassBody(), arg); + printer.unindent(); + printer.printLn("}"); + } + } + + @Override + public void visit(final EmptyMemberDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(";"); + } + + @Override + public void visit(final InitializerDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.isStatic()) { + printer.print("static "); + } + n.getBlock().accept(this, arg); + } + + @Override + public void visit(final IfStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("if ("); + n.getCondition().accept(this, arg); + final boolean thenBlock = n.getThenStmt() instanceof BlockStmt; + if (thenBlock) // block statement should start on the same line + printer.print(") "); + else { + printer.printLn(")"); + printer.indent(); + } + n.getThenStmt().accept(this, arg); + if (!thenBlock) + printer.unindent(); + if (n.getElseStmt() != null) { + if (thenBlock) + printer.print(" "); + else + printer.printLn(); + final boolean elseIf = n.getElseStmt() instanceof IfStmt; + final boolean elseBlock = n.getElseStmt() instanceof BlockStmt; + if (elseIf || elseBlock) // put chained if and start of block statement on a same level + printer.print("else "); + else { + printer.printLn("else"); + printer.indent(); + } + n.getElseStmt().accept(this, arg); + if (!(elseIf || elseBlock)) + printer.unindent(); + } + } + + @Override + public void visit(final WhileStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("while ("); + n.getCondition().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(final ContinueStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("continue"); + if (n.getId() != null) { + printer.print(" "); + printer.print(n.getId()); + } + printer.print(";"); + } + + @Override + public void visit(final DoStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("do "); + n.getBody().accept(this, arg); + printer.print(" while ("); + n.getCondition().accept(this, arg); + printer.print(");"); + } + + @Override + public void visit(final ForeachStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("for ("); + n.getVariable().accept(this, arg); + printer.print(" : "); + n.getIterable().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(final ForStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("for ("); + if (n.getInit() != null) { + for (final Iterator i = n.getInit().iterator(); i.hasNext(); ) { + final Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print("; "); + if (n.getCompare() != null) { + n.getCompare().accept(this, arg); + } + printer.print("; "); + if (n.getUpdate() != null) { + for (final Iterator i = n.getUpdate().iterator(); i.hasNext(); ) { + final Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(final ThrowStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("throw "); + n.getExpr().accept(this, arg); + printer.print(";"); + } + + @Override + public void visit(final SynchronizedStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("synchronized ("); + n.getExpr().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(final TryStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("try "); + if (!n.getResources().isEmpty()) { + printer.print("("); + Iterator resources = n.getResources().iterator(); + boolean first = true; + while (resources.hasNext()) { + visit(resources.next(), arg); + if (resources.hasNext()) { + printer.print(";"); + printer.printLn(); + if (first) { + printer.indent(); + } + } + first = false; + } + if (n.getResources().size() > 1) { + printer.unindent(); + } + printer.print(") "); + } + n.getTryBlock().accept(this, arg); + if (n.getCatchs() != null) { + for (final CatchClause c : n.getCatchs()) { + c.accept(this, arg); + } + } + if (n.getFinallyBlock() != null) { + printer.print(" finally "); + n.getFinallyBlock().accept(this, arg); + } + } + + @Override + public void visit(final CatchClause n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(" catch ("); + n.getParam().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + + } + + @Override + public void visit(final AnnotationDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printer.print("@interface "); + printer.print(n.getName()); + printer.printLn(" {"); + printer.indent(); + if (n.getMembers() != null) { + printMembers(n.getMembers(), arg); + } + printer.unindent(); + printer.print("}"); + } + + @Override + public void visit(final AnnotationMemberDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + n.getType().accept(this, arg); + printer.print(" "); + printer.print(n.getName()); + printer.print("()"); + if (n.getDefaultValue() != null) { + printer.print(" default "); + n.getDefaultValue().accept(this, arg); + } + printer.print(";"); + } + + @Override + public void visit(final MarkerAnnotationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("@"); + n.getName().accept(this, arg); + } + + @Override + public void visit(final SingleMemberAnnotationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("@"); + n.getName().accept(this, arg); + printer.print("("); + n.getMemberValue().accept(this, arg); + printer.print(")"); + } + + @Override + public void visit(final NormalAnnotationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("@"); + n.getName().accept(this, arg); + printer.print("("); + if (n.getPairs() != null) { + for (final Iterator i = n.getPairs().iterator(); i.hasNext(); ) { + final MemberValuePair m = i.next(); + m.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + } + + @Override + public void visit(final MemberValuePair n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getName()); + printer.print(" = "); + n.getValue().accept(this, arg); + } + + @Override + public void visit(final LineComment n, final Object arg) { + if (!this.printComments) { + return; + } + printer.print("//"); + String tmp = n.getContent(); + tmp = tmp.replace('\r', ' '); + tmp = tmp.replace('\n', ' '); + printer.printLn(tmp); + } + + @Override + public void visit(final BlockComment n, final Object arg) { + if (!this.printComments) { + return; + } + printer.print("/*"); + printer.print(n.getContent()); + printer.printLn("*/"); + } + + @Override + public void visit(LambdaExpr n, Object arg) { + printJavaComment(n.getComment(), arg); + + final List parameters = n.getParameters(); + final boolean printPar = n.isParametersEnclosed(); + + if (printPar) { + printer.print("("); + } + if (parameters != null) { + for (Iterator i = parameters.iterator(); i.hasNext(); ) { + Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (printPar) { + printer.print(")"); + } + + printer.print(" -> "); + final Statement body = n.getBody(); + if (body instanceof ExpressionStmt) { + // Print the expression directly + ((ExpressionStmt) body).getExpression().accept(this, arg); + } else { + body.accept(this, arg); + } + } + + + @Override + public void visit(MethodReferenceExpr n, Object arg) { + printJavaComment(n.getComment(), arg); + Expression scope = n.getScope(); + String identifier = n.getIdentifier(); + if (scope != null) { + n.getScope().accept(this, arg); + } + + printer.print("::"); + printTypeArgs(n, arg); + if (identifier != null) { + printer.print(identifier); + } + + } + + @Override + public void visit(TypeExpr n, Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getType() != null) { + n.getType().accept(this, arg); + } + } + + @Override + public void visit(ArrayBracketPair arrayBracketPair, Object arg) { + printAnnotations(arrayBracketPair.getAnnotations(), true, arg); + printer.print("[]"); + } + + private void printOrphanCommentsBeforeThisChildNode(final Node node) { + if (node instanceof Comment) return; + + Node parent = node.getParentNode(); + if (parent == null) return; + List everything = new LinkedList<>(); + everything.addAll(parent.getChildrenNodes()); + sortByBeginPosition(everything); + int positionOfTheChild = -1; + for (int i = 0; i < everything.size(); i++) { + if (everything.get(i) == node) positionOfTheChild = i; + } + if (positionOfTheChild == -1) throw new RuntimeException("My index not found!!! " + node); + int positionOfPreviousChild = -1; + for (int i = positionOfTheChild - 1; i >= 0 && positionOfPreviousChild == -1; i--) { + if (!(everything.get(i) instanceof Comment)) positionOfPreviousChild = i; + } + for (int i = positionOfPreviousChild + 1; i < positionOfTheChild; i++) { + Node nodeToPrint = everything.get(i); + if (!(nodeToPrint instanceof Comment)) + throw new RuntimeException("Expected comment, instead " + nodeToPrint.getClass() + ". Position of previous child: " + positionOfPreviousChild + ", position of child " + positionOfTheChild); + nodeToPrint.accept(this, null); + } + } + + + private void printOrphanCommentsEnding(final Node node) { + List everything = new LinkedList<>(); + everything.addAll(node.getChildrenNodes()); + sortByBeginPosition(everything); + if (everything.isEmpty()) { + return; + } + + int commentsAtEnd = 0; + boolean findingComments = true; + while (findingComments && commentsAtEnd < everything.size()) { + Node last = everything.get(everything.size() - 1 - commentsAtEnd); + findingComments = (last instanceof Comment); + if (findingComments) { + commentsAtEnd++; + } + } + for (int i = 0; i < commentsAtEnd; i++) { + everything.get(everything.size() - commentsAtEnd + i).accept(this, null); + } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/EqualsVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/EqualsVisitor.java index 327c197887..e10184ce9c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/EqualsVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/EqualsVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import java.util.List; @@ -105,15 +105,15 @@ */ public class EqualsVisitor implements GenericVisitor { - private static final EqualsVisitor SINGLETON = new EqualsVisitor(); + private static final EqualsVisitor SINGLETON = new EqualsVisitor(); - public static boolean equals(final Node n1, final Node n2) { - return SINGLETON.nodeEquals(n1, n2); - } + public static boolean equals(final Node n1, final Node n2) { + return SINGLETON.nodeEquals(n1, n2); + } - private EqualsVisitor() { - // hide constructor - } + private EqualsVisitor() { + // hide constructor + } /** * Check for equality that can be applied to each kind of node, @@ -123,1423 +123,1345 @@ private boolean commonNodeEquality(Node n1, Node n2) { if (!nodeEquals(n1.getComment(), n2.getComment())) { return false; } - return nodesEquals(n1.getOrphanComments(), n2.getOrphanComments()); - } + return nodesEquals(n1.getOrphanComments(), n2.getOrphanComments()); + } + + private boolean nodesEquals(final List nodes1, final List nodes2) { + if (nodes1 == null) { + return nodes2 == null; + } else if (nodes2 == null) { + return false; + } + if (nodes1.size() != nodes2.size()) { + return false; + } + for (int i = 0; i < nodes1.size(); i++) { + if (!nodeEquals(nodes1.get(i), nodes2.get(i))) { + return false; + } + } + return true; + } + + private boolean nodeEquals(final T n1, final T n2) { + if (n1 == n2) { + return true; + } + if (n1 == null || n2 == null) { + return false; + } + if (n1.getClass() != n2.getClass()) { + return false; + } + if (!commonNodeEquality(n1, n2)){ + return false; + } + return n1.accept(this, n2); + } + + private boolean objEquals(final Object n1, final Object n2) { + if (n1 == n2) { + return true; + } + if (n1 == null || n2 == null) { + return false; + } + return n1.equals(n2); + } + + @Override public Boolean visit(final CompilationUnit n1, final Node arg) { + final CompilationUnit n2 = (CompilationUnit) arg; + + if (!nodeEquals(n1.getPackage(), n2.getPackage())) { + return false; + } + + if (!nodesEquals(n1.getImports(), n2.getImports())) { + return false; + } + + if (!nodesEquals(n1.getTypes(), n2.getTypes())) { + return false; + } + + if (!nodesEquals(n1.getComments(), n2.getComments())) { + return false; + } + + return true; + } + + @Override public Boolean visit(final PackageDeclaration n1, final Node arg) { + final PackageDeclaration n2 = (PackageDeclaration) arg; + + if (!nodeEquals(n1.getName(), n2.getName())) { + return false; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + + return true; + } + + @Override public Boolean visit(final ImportDeclaration n1, final Node arg) { + final ImportDeclaration n2 = (ImportDeclaration) arg; + + if (!nodeEquals(n1.getName(), n2.getName())) { + return false; + } + + return true; + } + + @Override public Boolean visit(final TypeParameter n1, final Node arg) { + final TypeParameter n2 = (TypeParameter) arg; + + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } + + if (!nodesEquals(n1.getTypeBound(), n2.getTypeBound())) { + return false; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + return true; + } + + @Override public Boolean visit(final LineComment n1, final Node arg) { + final LineComment n2 = (LineComment) arg; + + if (!objEquals(n1.getContent(), n2.getContent())) { + return false; + } - private boolean nodesEquals(final List nodes1, final List nodes2) { - if (nodes1 == null) { - return nodes2 == null; - } else if (nodes2 == null) { - return false; - } - if (nodes1.size() != nodes2.size()) { - return false; - } - for (int i = 0; i < nodes1.size(); i++) { - if (!nodeEquals(nodes1.get(i), nodes2.get(i))) { - return false; - } - } - return true; - } + if (!objEquals(n1.getBegin().line, n2.getBegin().line)) { + return false; + } - private boolean nodeEquals(final T n1, final T n2) { - if (n1 == n2) { - return true; - } - if (n1 == null || n2 == null) { - return false; - } - if (n1.getClass() != n2.getClass()) { - return false; - } - if (!commonNodeEquality(n1, n2)) { - return false; - } - return n1.accept(this, n2); - } + return true; + } - private boolean objEquals(final Object n1, final Object n2) { - if (n1 == n2) { - return true; - } - if (n1 == null || n2 == null) { - return false; - } - return n1.equals(n2); - } + @Override public Boolean visit(final BlockComment n1, final Node arg) { + final BlockComment n2 = (BlockComment) arg; - @Override - public Boolean visit(final CompilationUnit n1, final Node arg) { - final CompilationUnit n2 = (CompilationUnit) arg; + if (!objEquals(n1.getContent(), n2.getContent())) { + return false; + } - if (!nodeEquals(n1.getPackage(), n2.getPackage())) { - return false; - } + if (!objEquals(n1.getBegin().line, n2.getBegin().line)) { + return false; + } - if (!nodesEquals(n1.getImports(), n2.getImports())) { - return false; - } + return true; + } - if (!nodesEquals(n1.getTypes(), n2.getTypes())) { - return false; - } + @Override public Boolean visit(final ClassOrInterfaceDeclaration n1, final Node arg) { + final ClassOrInterfaceDeclaration n2 = (ClassOrInterfaceDeclaration) arg; - if (!nodesEquals(n1.getComments(), n2.getComments())) { - return false; - } + // javadoc are checked at CompilationUnit - return true; - } + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } - @Override - public Boolean visit(final PackageDeclaration n1, final Node arg) { - final PackageDeclaration n2 = (PackageDeclaration) arg; + if (n1.isInterface() != n2.isInterface()) { + return false; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return false; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { + return false; + } - @Override - public Boolean visit(final ImportDeclaration n1, final Node arg) { - final ImportDeclaration n2 = (ImportDeclaration) arg; + if (!nodesEquals(n1.getExtends(), n2.getExtends())) { + return false; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return false; - } + if (!nodesEquals(n1.getImplements(), n2.getImplements())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getMembers(), n2.getMembers())) { + return false; + } - @Override - public Boolean visit(final TypeParameter n1, final Node arg) { - final TypeParameter n2 = (TypeParameter) arg; + return true; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final EnumDeclaration n1, final Node arg) { + final EnumDeclaration n2 = (EnumDeclaration) arg; - if (!nodesEquals(n1.getTypeBound(), n2.getTypeBound())) { - return false; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } - return true; - } + // javadoc are checked at CompilationUnit - @Override - public Boolean visit(final LineComment n1, final Node arg) { - final LineComment n2 = (LineComment) arg; + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } - if (!objEquals(n1.getContent(), n2.getContent())) { - return false; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - if (!objEquals(n1.getBegin().line, n2.getBegin().line)) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getImplements(), n2.getImplements())) { + return false; + } - @Override - public Boolean visit(final BlockComment n1, final Node arg) { - final BlockComment n2 = (BlockComment) arg; + if (!nodesEquals(n1.getEntries(), n2.getEntries())) { + return false; + } - if (!objEquals(n1.getContent(), n2.getContent())) { - return false; - } + if (!nodesEquals(n1.getMembers(), n2.getMembers())) { + return false; + } - if (!objEquals(n1.getBegin().line, n2.getBegin().line)) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final EmptyTypeDeclaration n1, final Node arg) { + return true; + } - @Override - public Boolean visit(final ClassOrInterfaceDeclaration n1, final Node arg) { - final ClassOrInterfaceDeclaration n2 = (ClassOrInterfaceDeclaration) arg; + @Override public Boolean visit(final EnumConstantDeclaration n1, final Node arg) { + final EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; - // javadoc are checked at CompilationUnit + // javadoc are checked at CompilationUnit - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - if (n1.isInterface() != n2.isInterface()) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) { + return false; + } - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return false; - } + return true; + } - if (!nodesEquals(n1.getExtends(), n2.getExtends())) { - return false; - } + @Override public Boolean visit(final AnnotationDeclaration n1, final Node arg) { + final AnnotationDeclaration n2 = (AnnotationDeclaration) arg; - if (!nodesEquals(n1.getImplements(), n2.getImplements())) { - return false; - } + // javadoc are checked at CompilationUnit - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return false; - } + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } - return true; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - @Override - public Boolean visit(final EnumDeclaration n1, final Node arg) { - final EnumDeclaration n2 = (EnumDeclaration) arg; + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - // javadoc are checked at CompilationUnit + if (!nodesEquals(n1.getMembers(), n2.getMembers())) { + return false; + } - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + return true; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final AnnotationMemberDeclaration n1, final Node arg) { + final AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg; - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + // javadoc are checked at CompilationUnit - if (!nodesEquals(n1.getImplements(), n2.getImplements())) { - return false; - } + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } - if (!nodesEquals(n1.getEntries(), n2.getEntries())) { - return false; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getDefaultValue(), n2.getDefaultValue())) { + return false; + } - @Override - public Boolean visit(final EmptyTypeDeclaration n1, final Node arg) { - return true; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return false; + } - @Override - public Boolean visit(final EnumConstantDeclaration n1, final Node arg) { - final EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; + return true; + } - // javadoc are checked at CompilationUnit + @Override public Boolean visit(final FieldDeclaration n1, final Node arg) { + final FieldDeclaration n2 = (FieldDeclaration) arg; - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + // javadoc are checked at CompilationUnit - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) { - return false; - } + if (!nodeEquals(n1.getElementType(), n2.getElementType())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getVariables(), n2.getVariables())) { + return false; + } - @Override - public Boolean visit(final AnnotationDeclaration n1, final Node arg) { - final AnnotationDeclaration n2 = (AnnotationDeclaration) arg; + if(!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())){ + return false; + } + + return true; + } - // javadoc are checked at CompilationUnit + @Override public Boolean visit(final VariableDeclarator n1, final Node arg) { + final VariableDeclarator n2 = (VariableDeclarator) arg; - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + if (!nodeEquals(n1.getId(), n2.getId())) { + return false; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + if (!nodeEquals(n1.getInit(), n2.getInit())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + return true; + } - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return false; - } + @Override public Boolean visit(final VariableDeclaratorId n1, final Node arg) { + final VariableDeclaratorId n2 = (VariableDeclaratorId) arg; - return true; - } + if(!nodesEquals(n1.getArrayBracketPairsAfterId(), n2.getArrayBracketPairsAfterId())){ + return false; + } - @Override - public Boolean visit(final AnnotationMemberDeclaration n1, final Node arg) { - final AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg; + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - // javadoc are checked at CompilationUnit + return true; + } + + @Override public Boolean visit(final ConstructorDeclaration n1, final Node arg) { + final ConstructorDeclaration n2 = (ConstructorDeclaration) arg; + + // javadoc are checked at CompilationUnit if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + return false; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - if (!nodeEquals(n1.getDefaultValue(), n2.getDefaultValue())) { - return false; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } - if (!nodeEquals(n1.getType(), n2.getType())) { - return false; - } + if (!nodesEquals(n1.getParameters(), n2.getParameters())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getThrows(), n2.getThrows())) { + return false; + } - @Override - public Boolean visit(final FieldDeclaration n1, final Node arg) { - final FieldDeclaration n2 = (FieldDeclaration) arg; + if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { + return false; + } - // javadoc are checked at CompilationUnit + return true; + } - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + @Override public Boolean visit(final MethodDeclaration n1, final Node arg) { + final MethodDeclaration n2 = (MethodDeclaration) arg; - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + // javadoc are checked at CompilationUnit - if (!nodeEquals(n1.getElementType(), n2.getElementType())) { - return false; - } + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } + + if(!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())){ + return false; + } + + if(!nodesEquals(n1.getArrayBracketPairsAfterParameterList(), n2.getArrayBracketPairsAfterParameterList())){ + return false; + } + + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } + + if (!nodeEquals(n1.getElementType(), n2.getElementType())) { + return false; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } + + if (!nodesEquals(n1.getParameters(), n2.getParameters())) { + return false; + } + + if (!nodesEquals(n1.getThrows(), n2.getThrows())) { + return false; + } + + if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { + return false; + } + if(n1.isDefault() != n2.isDefault()){ + return false; + } + return true; + } + + @Override public Boolean visit(final Parameter n1, final Node arg) { + final Parameter n2 = (Parameter) arg; + if (!nodeEquals(n1.getElementType(), n2.getElementType())) { + return false; + } + + if(!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())){ + return false; + } + + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } + + if (!nodeEquals(n1.getId(), n2.getId())) { + return false; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + + return true; + } + + @Override public Boolean visit(final EmptyMemberDeclaration n1, final Node arg) { + return true; + } + + @Override public Boolean visit(final InitializerDeclaration n1, final Node arg) { + final InitializerDeclaration n2 = (InitializerDeclaration) arg; + + if (!nodeEquals(n1.getBlock(), n2.getBlock())) { + return false; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + + return true; + } + + @Override public Boolean visit(final JavadocComment n1, final Node arg) { + final JavadocComment n2 = (JavadocComment) arg; + + if (!objEquals(n1.getContent(), n2.getContent())) { + return false; + } + + return true; + } + + @Override public Boolean visit(final ClassOrInterfaceType n1, final Node arg) { + final ClassOrInterfaceType n2 = (ClassOrInterfaceType) arg; + + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } + + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return false; + } + + if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { + return false; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + + return true; + } + + @Override public Boolean visit(final PrimitiveType n1, final Node arg) { + final PrimitiveType n2 = (PrimitiveType) arg; + + if (n1.getType() != n2.getType()) { + return false; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + return true; + } + + @Override + public Boolean visit(ArrayType n1, Node arg) { + final ArrayType n2 = (ArrayType) arg; + + if (!nodeEquals(n1.getComponentType(), n2.getComponentType())) { + return false; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + return true; + } + + @Override + public Boolean visit(ArrayCreationLevel n1, Node arg) { + final ArrayCreationLevel n2 = (ArrayCreationLevel) arg; + + if (!nodeEquals(n1.getDimension(), n2.getDimension())) { + return false; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + return true; + } + + @Override public Boolean visit(final IntersectionType n1, final Node arg) { + final IntersectionType n2 = (IntersectionType) arg; - if (!nodesEquals(n1.getVariables(), n2.getVariables())) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + + List n1Elements = n1.getElements(); + List n2Elements = n2.getElements(); - if (!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())) { + if (n1Elements !=null && n2Elements != null) { + if(n1Elements.size() != n2Elements.size()){ + return false; + } + else{ + int i = 0; + for(ReferenceType aux: n1Elements){ + if(aux.accept(this, n2Elements.get(i))) { + return false; + } + i++; + } + } + } else if (n1Elements != n2Elements){ return false; } - return true; } - @Override - public Boolean visit(final VariableDeclarator n1, final Node arg) { - final VariableDeclarator n2 = (VariableDeclarator) arg; + @Override public Boolean visit(final UnionType n1, final Node arg) { + final UnionType n2 = (UnionType) arg; - if (!nodeEquals(n1.getId(), n2.getId())) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + + List n1Elements = n1.getElements(); + List n2Elements = n2.getElements(); - if (!nodeEquals(n1.getInit(), n2.getInit())) { + if (n1Elements !=null && n2Elements != null) { + if(n1Elements.size() != n2Elements.size()){ + return false; + } + else{ + int i = 0; + for(ReferenceType aux: n1Elements){ + if(aux.accept(this, n2Elements.get(i))) { + return false; + } + i++; + } + } + } else if (n1Elements != n2Elements){ return false; } - return true; } - @Override - public Boolean visit(final VariableDeclaratorId n1, final Node arg) { - final VariableDeclaratorId n2 = (VariableDeclaratorId) arg; + @Override + public Boolean visit(VoidType n1, Node arg) { + VoidType n2 = (VoidType) arg; + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + return true; + } - if (!nodesEquals(n1.getArrayBracketPairsAfterId(), n2.getArrayBracketPairsAfterId())) { - return false; - } + @Override public Boolean visit(final WildcardType n1, final Node arg) { + final WildcardType n2 = (WildcardType) arg; - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + if (!nodeEquals(n1.getExtends(), n2.getExtends())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getSuper(), n2.getSuper())) { + return false; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } + return true; + } - @Override - public Boolean visit(final ConstructorDeclaration n1, final Node arg) { - final ConstructorDeclaration n2 = (ConstructorDeclaration) arg; + @Override public Boolean visit(final UnknownType n1, final Node arg) { + return true; + } - // javadoc are checked at CompilationUnit + @Override public Boolean visit(final ArrayAccessExpr n1, final Node arg) { + final ArrayAccessExpr n2 = (ArrayAccessExpr) arg; - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + if (!nodeEquals(n1.getName(), n2.getName())) { + return false; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + if (!nodeEquals(n1.getIndex(), n2.getIndex())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + return true; + } - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + @Override public Boolean visit(final ArrayCreationExpr n1, final Node arg) { + final ArrayCreationExpr n2 = (ArrayCreationExpr) arg; - if (!nodesEquals(n1.getParameters(), n2.getParameters())) { - return false; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return false; + } - if (!nodesEquals(n1.getThrows(), n2.getThrows())) { - return false; - } + if (!nodesEquals(n1.getLevels(), n2.getLevels())) { + return false; + } - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return false; - } + if (!nodeEquals(n1.getInitializer(), n2.getInitializer())) { + return false; + } - return true; - } + return true; + } - @Override - public Boolean visit(final MethodDeclaration n1, final Node arg) { - final MethodDeclaration n2 = (MethodDeclaration) arg; + @Override public Boolean visit(final ArrayInitializerExpr n1, final Node arg) { + final ArrayInitializerExpr n2 = (ArrayInitializerExpr) arg; - // javadoc are checked at CompilationUnit + if (!nodesEquals(n1.getValues(), n2.getValues())) { + return false; + } - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + return true; + } - if (!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())) { - return false; - } + @Override public Boolean visit(final AssignExpr n1, final Node arg) { + final AssignExpr n2 = (AssignExpr) arg; - if (!nodesEquals(n1.getArrayBracketPairsAfterParameterList(), n2.getArrayBracketPairsAfterParameterList())) { - return false; - } + if (n1.getOperator() != n2.getOperator()) { + return false; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + if (!nodeEquals(n1.getTarget(), n2.getTarget())) { + return false; + } - if (!nodeEquals(n1.getElementType(), n2.getElementType())) { - return false; - } + if (!nodeEquals(n1.getValue(), n2.getValue())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + return true; + } - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + @Override public Boolean visit(final BinaryExpr n1, final Node arg) { + final BinaryExpr n2 = (BinaryExpr) arg; - if (!nodesEquals(n1.getParameters(), n2.getParameters())) { - return false; - } + if (n1.getOperator() != n2.getOperator()) { + return false; + } - if (!nodesEquals(n1.getThrows(), n2.getThrows())) { - return false; - } + if (!nodeEquals(n1.getLeft(), n2.getLeft())) { + return false; + } - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return false; - } - if (n1.isDefault() != n2.isDefault()) { - return false; - } - return true; - } + if (!nodeEquals(n1.getRight(), n2.getRight())) { + return false; + } - @Override - public Boolean visit(final Parameter n1, final Node arg) { - final Parameter n2 = (Parameter) arg; - if (!nodeEquals(n1.getElementType(), n2.getElementType())) { - return false; - } + return true; + } - if (!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())) { - return false; - } + @Override public Boolean visit(final CastExpr n1, final Node arg) { + final CastExpr n2 = (CastExpr) arg; - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return false; + } - if (!nodeEquals(n1.getId(), n2.getId())) { - return false; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final ClassExpr n1, final Node arg) { + final ClassExpr n2 = (ClassExpr) arg; - @Override - public Boolean visit(final EmptyMemberDeclaration n1, final Node arg) { - return true; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return false; + } - @Override - public Boolean visit(final InitializerDeclaration n1, final Node arg) { - final InitializerDeclaration n2 = (InitializerDeclaration) arg; + return true; + } - if (!nodeEquals(n1.getBlock(), n2.getBlock())) { - return false; - } + @Override public Boolean visit(final ConditionalExpr n1, final Node arg) { + final ConditionalExpr n2 = (ConditionalExpr) arg; - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getThenExpr(), n2.getThenExpr())) { + return false; + } - @Override - public Boolean visit(final JavadocComment n1, final Node arg) { - final JavadocComment n2 = (JavadocComment) arg; + if (!nodeEquals(n1.getElseExpr(), n2.getElseExpr())) { + return false; + } - if (!objEquals(n1.getContent(), n2.getContent())) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final EnclosedExpr n1, final Node arg) { + final EnclosedExpr n2 = (EnclosedExpr) arg; - @Override - public Boolean visit(final ClassOrInterfaceType n1, final Node arg) { - final ClassOrInterfaceType n2 = (ClassOrInterfaceType) arg; + if (!nodeEquals(n1.getInner(), n2.getInner())) { + return false; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + return true; + } - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return false; - } + @Override public Boolean visit(final FieldAccessExpr n1, final Node arg) { + final FieldAccessExpr n2 = (FieldAccessExpr) arg; - if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { - return false; - } + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + if (!objEquals(n1.getField(), n2.getField())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { + return false; + } - @Override - public Boolean visit(final PrimitiveType n1, final Node arg) { - final PrimitiveType n2 = (PrimitiveType) arg; + return true; + } - if (n1.getType() != n2.getType()) { - return false; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } - return true; - } + @Override public Boolean visit(final InstanceOfExpr n1, final Node arg) { + final InstanceOfExpr n2 = (InstanceOfExpr) arg; - @Override - public Boolean visit(ArrayType n1, Node arg) { - final ArrayType n2 = (ArrayType) arg; + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return false; + } - if (!nodeEquals(n1.getComponentType(), n2.getComponentType())) { - return false; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } - return true; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return false; + } - @Override - public Boolean visit(ArrayCreationLevel n1, Node arg) { - final ArrayCreationLevel n2 = (ArrayCreationLevel) arg; + return true; + } - if (!nodeEquals(n1.getDimension(), n2.getDimension())) { - return false; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } - return true; - } + @Override public Boolean visit(final StringLiteralExpr n1, final Node arg) { + final StringLiteralExpr n2 = (StringLiteralExpr) arg; - @Override - public Boolean visit(final IntersectionType n1, final Node arg) { - final IntersectionType n2 = (IntersectionType) arg; + if (!objEquals(n1.getValue(), n2.getValue())) { + return false; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + return true; + } - List n1Elements = n1.getElements(); - List n2Elements = n2.getElements(); + @Override public Boolean visit(final IntegerLiteralExpr n1, final Node arg) { + final IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg; - if (n1Elements != null && n2Elements != null) { - if (n1Elements.size() != n2Elements.size()) { - return false; - } else { - int i = 0; - for (ReferenceType aux : n1Elements) { - if (aux.accept(this, n2Elements.get(i))) { - return false; - } - i++; - } - } - } else if (n1Elements != n2Elements) { - return false; - } - return true; - } - - @Override - public Boolean visit(final UnionType n1, final Node arg) { - final UnionType n2 = (UnionType) arg; - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } - - List n1Elements = n1.getElements(); - List n2Elements = n2.getElements(); - - if (n1Elements != null && n2Elements != null) { - if (n1Elements.size() != n2Elements.size()) { - return false; - } else { - int i = 0; - for (ReferenceType aux : n1Elements) { - if (aux.accept(this, n2Elements.get(i))) { - return false; - } - i++; - } - } - } else if (n1Elements != n2Elements) { - return false; - } - return true; - } - - @Override - public Boolean visit(VoidType n1, Node arg) { - VoidType n2 = (VoidType) arg; - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } - return true; - } - - @Override - public Boolean visit(final WildcardType n1, final Node arg) { - final WildcardType n2 = (WildcardType) arg; - - if (!nodeEquals(n1.getExtends(), n2.getExtends())) { - return false; - } - - if (!nodeEquals(n1.getSuper(), n2.getSuper())) { - return false; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } - return true; - } - - @Override - public Boolean visit(final UnknownType n1, final Node arg) { - return true; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return false; + } - @Override - public Boolean visit(final ArrayAccessExpr n1, final Node arg) { - final ArrayAccessExpr n2 = (ArrayAccessExpr) arg; + return true; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final LongLiteralExpr n1, final Node arg) { + final LongLiteralExpr n2 = (LongLiteralExpr) arg; - if (!nodeEquals(n1.getIndex(), n2.getIndex())) { - return false; - } - - return true; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return false; + } - @Override - public Boolean visit(final ArrayCreationExpr n1, final Node arg) { - final ArrayCreationExpr n2 = (ArrayCreationExpr) arg; + return true; + } - if (!nodeEquals(n1.getType(), n2.getType())) { - return false; - } + @Override public Boolean visit(final IntegerLiteralMinValueExpr n1, final Node arg) { + final IntegerLiteralMinValueExpr n2 = (IntegerLiteralMinValueExpr) arg; - if (!nodesEquals(n1.getLevels(), n2.getLevels())) { - return false; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return false; + } - if (!nodeEquals(n1.getInitializer(), n2.getInitializer())) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final LongLiteralMinValueExpr n1, final Node arg) { + final LongLiteralMinValueExpr n2 = (LongLiteralMinValueExpr) arg; - @Override - public Boolean visit(final ArrayInitializerExpr n1, final Node arg) { - final ArrayInitializerExpr n2 = (ArrayInitializerExpr) arg; + if (!objEquals(n1.getValue(), n2.getValue())) { + return false; + } - if (!nodesEquals(n1.getValues(), n2.getValues())) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final CharLiteralExpr n1, final Node arg) { + final CharLiteralExpr n2 = (CharLiteralExpr) arg; - @Override - public Boolean visit(final AssignExpr n1, final Node arg) { - final AssignExpr n2 = (AssignExpr) arg; + if (!objEquals(n1.getValue(), n2.getValue())) { + return false; + } - if (n1.getOperator() != n2.getOperator()) { - return false; - } + return true; + } - if (!nodeEquals(n1.getTarget(), n2.getTarget())) { - return false; - } - - if (!nodeEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final BinaryExpr n1, final Node arg) { - final BinaryExpr n2 = (BinaryExpr) arg; - - if (n1.getOperator() != n2.getOperator()) { - return false; - } - - if (!nodeEquals(n1.getLeft(), n2.getLeft())) { - return false; - } - - if (!nodeEquals(n1.getRight(), n2.getRight())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final CastExpr n1, final Node arg) { - final CastExpr n2 = (CastExpr) arg; - - if (!nodeEquals(n1.getType(), n2.getType())) { - return false; - } - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final ClassExpr n1, final Node arg) { - final ClassExpr n2 = (ClassExpr) arg; - - if (!nodeEquals(n1.getType(), n2.getType())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final ConditionalExpr n1, final Node arg) { - final ConditionalExpr n2 = (ConditionalExpr) arg; - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return false; - } - - if (!nodeEquals(n1.getThenExpr(), n2.getThenExpr())) { - return false; - } - - if (!nodeEquals(n1.getElseExpr(), n2.getElseExpr())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final EnclosedExpr n1, final Node arg) { - final EnclosedExpr n2 = (EnclosedExpr) arg; - - if (!nodeEquals(n1.getInner(), n2.getInner())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final FieldAccessExpr n1, final Node arg) { - final FieldAccessExpr n2 = (FieldAccessExpr) arg; - - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return false; - } - - if (!objEquals(n1.getField(), n2.getField())) { - return false; - } - - if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final InstanceOfExpr n1, final Node arg) { - final InstanceOfExpr n2 = (InstanceOfExpr) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return false; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final StringLiteralExpr n1, final Node arg) { - final StringLiteralExpr n2 = (StringLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final IntegerLiteralExpr n1, final Node arg) { - final IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final LongLiteralExpr n1, final Node arg) { - final LongLiteralExpr n2 = (LongLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final IntegerLiteralMinValueExpr n1, final Node arg) { - final IntegerLiteralMinValueExpr n2 = (IntegerLiteralMinValueExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final LongLiteralMinValueExpr n1, final Node arg) { - final LongLiteralMinValueExpr n2 = (LongLiteralMinValueExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final CharLiteralExpr n1, final Node arg) { - final CharLiteralExpr n2 = (CharLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } - - @Override - public Boolean visit(final DoubleLiteralExpr n1, final Node arg) { - final DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return false; - } - - return true; - } + @Override public Boolean visit(final DoubleLiteralExpr n1, final Node arg) { + final DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg; - @Override - public Boolean visit(final BooleanLiteralExpr n1, final Node arg) { - final BooleanLiteralExpr n2 = (BooleanLiteralExpr) arg; + if (!objEquals(n1.getValue(), n2.getValue())) { + return false; + } - if (n1.getValue() != n2.getValue()) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final BooleanLiteralExpr n1, final Node arg) { + final BooleanLiteralExpr n2 = (BooleanLiteralExpr) arg; - @Override - public Boolean visit(final NullLiteralExpr n1, final Node arg) { - return true; - } + if (n1.getValue() != n2.getValue()) { + return false; + } - @Override - public Boolean visit(final MethodCallExpr n1, final Node arg) { - final MethodCallExpr n2 = (MethodCallExpr) arg; + return true; + } - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return false; - } + @Override public Boolean visit(final NullLiteralExpr n1, final Node arg) { + return true; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final MethodCallExpr n1, final Node arg) { + final MethodCallExpr n2 = (MethodCallExpr) arg; - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return false; - } + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return false; + } - if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { - return false; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return false; + } - @Override - public Boolean visit(final NameExpr n1, final Node arg) { - final NameExpr n2 = (NameExpr) arg; + if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { + return false; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final NameExpr n1, final Node arg) { + final NameExpr n2 = (NameExpr) arg; - @Override - public Boolean visit(final ObjectCreationExpr n1, final Node arg) { - final ObjectCreationExpr n2 = (ObjectCreationExpr) arg; + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return false; - } + return true; + } - if (!nodeEquals(n1.getType(), n2.getType())) { - return false; - } + @Override public Boolean visit(final ObjectCreationExpr n1, final Node arg) { + final ObjectCreationExpr n2 = (ObjectCreationExpr) arg; - if (!nodesEquals(n1.getAnonymousClassBody(), n2.getAnonymousClassBody())) { - return false; - } + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return false; + } - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return false; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return false; + } - if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { - return false; - } + if (!nodesEquals(n1.getAnonymousClassBody(), n2.getAnonymousClassBody())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return false; + } - @Override - public Boolean visit(final QualifiedNameExpr n1, final Node arg) { - final QualifiedNameExpr n2 = (QualifiedNameExpr) arg; + if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { + return false; + } - if (!nodeEquals(n1.getQualifier(), n2.getQualifier())) { - return false; - } + return true; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final QualifiedNameExpr n1, final Node arg) { + final QualifiedNameExpr n2 = (QualifiedNameExpr) arg; - return true; - } + if (!nodeEquals(n1.getQualifier(), n2.getQualifier())) { + return false; + } - @Override - public Boolean visit(final ThisExpr n1, final Node arg) { - final ThisExpr n2 = (ThisExpr) arg; + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final ThisExpr n1, final Node arg) { + final ThisExpr n2 = (ThisExpr) arg; - @Override - public Boolean visit(final SuperExpr n1, final Node arg) { - final SuperExpr n2 = (SuperExpr) arg; + if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { + return false; + } - if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { - return false; - } + return true; + } - return true; - } + @Override public Boolean visit(final SuperExpr n1, final Node arg) { + final SuperExpr n2 = (SuperExpr) arg; - @Override - public Boolean visit(final UnaryExpr n1, final Node arg) { - final UnaryExpr n2 = (UnaryExpr) arg; + if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { + return false; + } - if (n1.getOperator() != n2.getOperator()) { - return false; - } + return true; + } - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return false; - } + @Override public Boolean visit(final UnaryExpr n1, final Node arg) { + final UnaryExpr n2 = (UnaryExpr) arg; - return true; - } + if (n1.getOperator() != n2.getOperator()) { + return false; + } - @Override - public Boolean visit(final VariableDeclarationExpr n1, final Node arg) { - final VariableDeclarationExpr n2 = (VariableDeclarationExpr) arg; + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return false; + } - if (!n1.getModifiers().equals(n2.getModifiers())) { - return false; - } + return true; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + @Override public Boolean visit(final VariableDeclarationExpr n1, final Node arg) { + final VariableDeclarationExpr n2 = (VariableDeclarationExpr) arg; - if (!nodeEquals(n1.getElementType(), n2.getElementType())) { - return false; - } + if (!n1.getModifiers().equals(n2.getModifiers())) { + return false; + } - if (!nodesEquals(n1.getVariables(), n2.getVariables())) { - return false; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - if (!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())) { - return false; - } + if (!nodeEquals(n1.getElementType(), n2.getElementType())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getVariables(), n2.getVariables())) { + return false; + } - @Override - public Boolean visit(final MarkerAnnotationExpr n1, final Node arg) { - final MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg; + if(!nodesEquals(n1.getArrayBracketPairsAfterElementType(), n2.getArrayBracketPairsAfterElementType())){ + return false; + } + + return true; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final MarkerAnnotationExpr n1, final Node arg) { + final MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg; - return true; - } + if (!nodeEquals(n1.getName(), n2.getName())) { + return false; + } - @Override - public Boolean visit(final SingleMemberAnnotationExpr n1, final Node arg) { - final SingleMemberAnnotationExpr n2 = (SingleMemberAnnotationExpr) arg; + return true; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final SingleMemberAnnotationExpr n1, final Node arg) { + final SingleMemberAnnotationExpr n2 = (SingleMemberAnnotationExpr) arg; - if (!nodeEquals(n1.getMemberValue(), n2.getMemberValue())) { - return false; - } + if (!nodeEquals(n1.getName(), n2.getName())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getMemberValue(), n2.getMemberValue())) { + return false; + } - @Override - public Boolean visit(final NormalAnnotationExpr n1, final Node arg) { - final NormalAnnotationExpr n2 = (NormalAnnotationExpr) arg; + return true; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final NormalAnnotationExpr n1, final Node arg) { + final NormalAnnotationExpr n2 = (NormalAnnotationExpr) arg; - if (!nodesEquals(n1.getPairs(), n2.getPairs())) { - return false; - } + if (!nodeEquals(n1.getName(), n2.getName())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getPairs(), n2.getPairs())) { + return false; + } - @Override - public Boolean visit(final MemberValuePair n1, final Node arg) { - final MemberValuePair n2 = (MemberValuePair) arg; + return true; + } - if (!objEquals(n1.getName(), n2.getName())) { - return false; - } + @Override public Boolean visit(final MemberValuePair n1, final Node arg) { + final MemberValuePair n2 = (MemberValuePair) arg; - if (!nodeEquals(n1.getValue(), n2.getValue())) { - return false; - } + if (!objEquals(n1.getName(), n2.getName())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getValue(), n2.getValue())) { + return false; + } - @Override - public Boolean visit(final ExplicitConstructorInvocationStmt n1, final Node arg) { - final ExplicitConstructorInvocationStmt n2 = (ExplicitConstructorInvocationStmt) arg; + return true; + } - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return false; - } + @Override public Boolean visit(final ExplicitConstructorInvocationStmt n1, final Node arg) { + final ExplicitConstructorInvocationStmt n2 = (ExplicitConstructorInvocationStmt) arg; - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return false; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return false; + } - if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { - return false; - } + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { + return false; + } - @Override - public Boolean visit(final TypeDeclarationStmt n1, final Node arg) { - final TypeDeclarationStmt n2 = (TypeDeclarationStmt) arg; + return true; + } - if (!nodeEquals(n1.getTypeDeclaration(), n2.getTypeDeclaration())) { - return false; - } + @Override public Boolean visit(final TypeDeclarationStmt n1, final Node arg) { + final TypeDeclarationStmt n2 = (TypeDeclarationStmt) arg; - return true; - } + if (!nodeEquals(n1.getTypeDeclaration(), n2.getTypeDeclaration())) { + return false; + } - @Override - public Boolean visit(final AssertStmt n1, final Node arg) { - final AssertStmt n2 = (AssertStmt) arg; + return true; + } - if (!nodeEquals(n1.getCheck(), n2.getCheck())) { - return false; - } + @Override public Boolean visit(final AssertStmt n1, final Node arg) { + final AssertStmt n2 = (AssertStmt) arg; - if (!nodeEquals(n1.getMessage(), n2.getMessage())) { - return false; - } + if (!nodeEquals(n1.getCheck(), n2.getCheck())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getMessage(), n2.getMessage())) { + return false; + } - @Override - public Boolean visit(final BlockStmt n1, final Node arg) { - final BlockStmt n2 = (BlockStmt) arg; + return true; + } - if (!nodesEquals(n1.getStmts(), n2.getStmts())) { - return false; - } + @Override public Boolean visit(final BlockStmt n1, final Node arg) { + final BlockStmt n2 = (BlockStmt) arg; - return true; - } + if (!nodesEquals(n1.getStmts(), n2.getStmts())) { + return false; + } - @Override - public Boolean visit(final LabeledStmt n1, final Node arg) { - final LabeledStmt n2 = (LabeledStmt) arg; + return true; + } - if (!nodeEquals(n1.getStmt(), n2.getStmt())) { - return false; - } + @Override public Boolean visit(final LabeledStmt n1, final Node arg) { + final LabeledStmt n2 = (LabeledStmt) arg; - return true; - } + if (!nodeEquals(n1.getStmt(), n2.getStmt())) { + return false; + } - @Override - public Boolean visit(final EmptyStmt n1, final Node arg) { - return true; - } + return true; + } - @Override - public Boolean visit(final ExpressionStmt n1, final Node arg) { - final ExpressionStmt n2 = (ExpressionStmt) arg; + @Override public Boolean visit(final EmptyStmt n1, final Node arg) { + return true; + } - if (!nodeEquals(n1.getExpression(), n2.getExpression())) { - return false; - } + @Override public Boolean visit(final ExpressionStmt n1, final Node arg) { + final ExpressionStmt n2 = (ExpressionStmt) arg; - return true; - } + if (!nodeEquals(n1.getExpression(), n2.getExpression())) { + return false; + } - @Override - public Boolean visit(final SwitchStmt n1, final Node arg) { - final SwitchStmt n2 = (SwitchStmt) arg; + return true; + } - if (!nodeEquals(n1.getSelector(), n2.getSelector())) { - return false; - } + @Override public Boolean visit(final SwitchStmt n1, final Node arg) { + final SwitchStmt n2 = (SwitchStmt) arg; - if (!nodesEquals(n1.getEntries(), n2.getEntries())) { - return false; - } + if (!nodeEquals(n1.getSelector(), n2.getSelector())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getEntries(), n2.getEntries())) { + return false; + } - @Override - public Boolean visit(final SwitchEntryStmt n1, final Node arg) { - final SwitchEntryStmt n2 = (SwitchEntryStmt) arg; + return true; + } - if (!nodeEquals(n1.getLabel(), n2.getLabel())) { - return false; - } + @Override public Boolean visit(final SwitchEntryStmt n1, final Node arg) { + final SwitchEntryStmt n2 = (SwitchEntryStmt) arg; - if (!nodesEquals(n1.getStmts(), n2.getStmts())) { - return false; - } + if (!nodeEquals(n1.getLabel(), n2.getLabel())) { + return false; + } - return true; - } + if (!nodesEquals(n1.getStmts(), n2.getStmts())) { + return false; + } - @Override - public Boolean visit(final BreakStmt n1, final Node arg) { - final BreakStmt n2 = (BreakStmt) arg; + return true; + } - if (!objEquals(n1.getId(), n2.getId())) { - return false; - } + @Override public Boolean visit(final BreakStmt n1, final Node arg) { + final BreakStmt n2 = (BreakStmt) arg; - return true; - } + if (!objEquals(n1.getId(), n2.getId())) { + return false; + } - @Override - public Boolean visit(final ReturnStmt n1, final Node arg) { - final ReturnStmt n2 = (ReturnStmt) arg; + return true; + } - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return false; - } + @Override public Boolean visit(final ReturnStmt n1, final Node arg) { + final ReturnStmt n2 = (ReturnStmt) arg; - return true; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return false; + } - @Override - public Boolean visit(final IfStmt n1, final Node arg) { - final IfStmt n2 = (IfStmt) arg; + return true; + } - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return false; - } + @Override public Boolean visit(final IfStmt n1, final Node arg) { + final IfStmt n2 = (IfStmt) arg; - if (!nodeEquals(n1.getThenStmt(), n2.getThenStmt())) { - return false; - } + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return false; + } - if (!nodeEquals(n1.getElseStmt(), n2.getElseStmt())) { - return false; - } + if (!nodeEquals(n1.getThenStmt(), n2.getThenStmt())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getElseStmt(), n2.getElseStmt())) { + return false; + } - @Override - public Boolean visit(final WhileStmt n1, final Node arg) { - final WhileStmt n2 = (WhileStmt) arg; + return true; + } - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return false; - } + @Override public Boolean visit(final WhileStmt n1, final Node arg) { + final WhileStmt n2 = (WhileStmt) arg; - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } - @Override - public Boolean visit(final ContinueStmt n1, final Node arg) { - final ContinueStmt n2 = (ContinueStmt) arg; + return true; + } - if (!objEquals(n1.getId(), n2.getId())) { - return false; - } + @Override public Boolean visit(final ContinueStmt n1, final Node arg) { + final ContinueStmt n2 = (ContinueStmt) arg; - return true; - } + if (!objEquals(n1.getId(), n2.getId())) { + return false; + } - @Override - public Boolean visit(final DoStmt n1, final Node arg) { - final DoStmt n2 = (DoStmt) arg; + return true; + } - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + @Override public Boolean visit(final DoStmt n1, final Node arg) { + final DoStmt n2 = (DoStmt) arg; - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return false; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return false; + } - @Override - public Boolean visit(final ForeachStmt n1, final Node arg) { - final ForeachStmt n2 = (ForeachStmt) arg; + return true; + } - if (!nodeEquals(n1.getVariable(), n2.getVariable())) { - return false; - } + @Override public Boolean visit(final ForeachStmt n1, final Node arg) { + final ForeachStmt n2 = (ForeachStmt) arg; - if (!nodeEquals(n1.getIterable(), n2.getIterable())) { - return false; - } + if (!nodeEquals(n1.getVariable(), n2.getVariable())) { + return false; + } - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + if (!nodeEquals(n1.getIterable(), n2.getIterable())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } - @Override - public Boolean visit(final ForStmt n1, final Node arg) { - final ForStmt n2 = (ForStmt) arg; + return true; + } - if (!nodesEquals(n1.getInit(), n2.getInit())) { - return false; - } + @Override public Boolean visit(final ForStmt n1, final Node arg) { + final ForStmt n2 = (ForStmt) arg; - if (!nodeEquals(n1.getCompare(), n2.getCompare())) { - return false; - } + if (!nodesEquals(n1.getInit(), n2.getInit())) { + return false; + } - if (!nodesEquals(n1.getUpdate(), n2.getUpdate())) { - return false; - } + if (!nodeEquals(n1.getCompare(), n2.getCompare())) { + return false; + } - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + if (!nodesEquals(n1.getUpdate(), n2.getUpdate())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } - @Override - public Boolean visit(final ThrowStmt n1, final Node arg) { - final ThrowStmt n2 = (ThrowStmt) arg; + return true; + } - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return false; - } + @Override public Boolean visit(final ThrowStmt n1, final Node arg) { + final ThrowStmt n2 = (ThrowStmt) arg; - return true; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return false; + } - @Override - public Boolean visit(final SynchronizedStmt n1, final Node arg) { - final SynchronizedStmt n2 = (SynchronizedStmt) arg; + return true; + } - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return false; - } + @Override public Boolean visit(final SynchronizedStmt n1, final Node arg) { + final SynchronizedStmt n2 = (SynchronizedStmt) arg; - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return false; + } - return true; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } - @Override - public Boolean visit(final TryStmt n1, final Node arg) { - final TryStmt n2 = (TryStmt) arg; + return true; + } - if (!nodeEquals(n1.getTryBlock(), n2.getTryBlock())) { - return false; - } + @Override public Boolean visit(final TryStmt n1, final Node arg) { + final TryStmt n2 = (TryStmt) arg; - if (!nodesEquals(n1.getCatchs(), n2.getCatchs())) { - return false; - } + if (!nodeEquals(n1.getTryBlock(), n2.getTryBlock())) { + return false; + } - if (!nodesEquals(n1.getResources(), n2.getResources())) { - return false; - } + if (!nodesEquals(n1.getCatchs(), n2.getCatchs())) { + return false; + } + + if(!nodesEquals(n1.getResources(), n2.getResources())) { + return false; + } - if (!nodeEquals(n1.getFinallyBlock(), n2.getFinallyBlock())) { - return false; - } + if (!nodeEquals(n1.getFinallyBlock(), n2.getFinallyBlock())) { + return false; + } - return true; - } + return true; + } - @Override - public Boolean visit(final CatchClause n1, final Node arg) { - final CatchClause n2 = (CatchClause) arg; + @Override public Boolean visit(final CatchClause n1, final Node arg) { + final CatchClause n2 = (CatchClause) arg; - if (!nodeEquals(n1.getParam(), n2.getParam())) { - return false; - } + if (!nodeEquals(n1.getParam(), n2.getParam())) { + return false; + } - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return false; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return false; + } - return true; - } + return true; + } @Override public Boolean visit(LambdaExpr n1, Node arg) { @@ -1547,7 +1469,7 @@ public Boolean visit(LambdaExpr n1, Node arg) { if (!nodesEquals(n1.getParameters(), n2.getParameters())) { return false; } - if (n1.isParametersEnclosed() != n2.isParametersEnclosed()) { + if(n1.isParametersEnclosed() != n2.isParametersEnclosed()){ return false; } if (!nodeEquals(n1.getBody(), n2.getBody())) { @@ -1562,7 +1484,7 @@ public Boolean visit(MethodReferenceExpr n1, Node arg) { if (!nodeEquals(n1.getScope(), n2.getScope())) { return false; } - if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { + if (!nodesEquals(n1.getTypeArguments(), n2.getTypeArguments())) { return false; } if (!objEquals(n1.getIdentifier(), n2.getIdentifier())) { @@ -1580,13 +1502,13 @@ public Boolean visit(TypeExpr n, Node arg) { return true; } - @Override - public Boolean visit(ArrayBracketPair n1, Node arg) { - ArrayBracketPair n2 = (ArrayBracketPair) arg; - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return false; - } + @Override + public Boolean visit(ArrayBracketPair n1, Node arg) { + ArrayBracketPair n2 = (ArrayBracketPair) arg; + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return false; + } - return true; - } + return true; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitor.java index d71ce1bbe3..9f4e9bc7fa 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.*; @@ -66,186 +66,186 @@ /** * A visitor that has a return value. - * + * * @author Julio Vilmar Gesser */ public interface GenericVisitor { - //- Compilation Unit ---------------------------------- - - R visit(CompilationUnit n, A arg); - - R visit(PackageDeclaration n, A arg); + //- Compilation Unit ---------------------------------- - R visit(ImportDeclaration n, A arg); + R visit(CompilationUnit n, A arg); - R visit(TypeParameter n, A arg); + R visit(PackageDeclaration n, A arg); - R visit(LineComment n, A arg); + R visit(ImportDeclaration n, A arg); - R visit(BlockComment n, A arg); + R visit(TypeParameter n, A arg); - //- Body ---------------------------------------------- + R visit(LineComment n, A arg); - R visit(ClassOrInterfaceDeclaration n, A arg); + R visit(BlockComment n, A arg); - R visit(EnumDeclaration n, A arg); + //- Body ---------------------------------------------- - R visit(EmptyTypeDeclaration n, A arg); + R visit(ClassOrInterfaceDeclaration n, A arg); - R visit(EnumConstantDeclaration n, A arg); + R visit(EnumDeclaration n, A arg); - R visit(AnnotationDeclaration n, A arg); + R visit(EmptyTypeDeclaration n, A arg); - R visit(AnnotationMemberDeclaration n, A arg); + R visit(EnumConstantDeclaration n, A arg); - R visit(FieldDeclaration n, A arg); + R visit(AnnotationDeclaration n, A arg); - R visit(VariableDeclarator n, A arg); + R visit(AnnotationMemberDeclaration n, A arg); - R visit(VariableDeclaratorId n, A arg); + R visit(FieldDeclaration n, A arg); - R visit(ConstructorDeclaration n, A arg); + R visit(VariableDeclarator n, A arg); - R visit(MethodDeclaration n, A arg); + R visit(VariableDeclaratorId n, A arg); - R visit(Parameter n, A arg); + R visit(ConstructorDeclaration n, A arg); - R visit(EmptyMemberDeclaration n, A arg); + R visit(MethodDeclaration n, A arg); - R visit(InitializerDeclaration n, A arg); + R visit(Parameter n, A arg); + + R visit(EmptyMemberDeclaration n, A arg); - R visit(JavadocComment n, A arg); + R visit(InitializerDeclaration n, A arg); - //- Type ---------------------------------------------- + R visit(JavadocComment n, A arg); - R visit(ClassOrInterfaceType n, A arg); + //- Type ---------------------------------------------- - R visit(PrimitiveType n, A arg); + R visit(ClassOrInterfaceType n, A arg); - R visit(ArrayType n, A arg); + R visit(PrimitiveType n, A arg); - R visit(ArrayCreationLevel n, A arg); + R visit(ArrayType n, A arg); + + R visit(ArrayCreationLevel n, A arg); R visit(IntersectionType n, A arg); R visit(UnionType n, A arg); - R visit(VoidType n, A arg); + R visit(VoidType n, A arg); - R visit(WildcardType n, A arg); + R visit(WildcardType n, A arg); - R visit(UnknownType n, A arg); + R visit(UnknownType n, A arg); - //- Expression ---------------------------------------- + //- Expression ---------------------------------------- - R visit(ArrayAccessExpr n, A arg); + R visit(ArrayAccessExpr n, A arg); - R visit(ArrayCreationExpr n, A arg); + R visit(ArrayCreationExpr n, A arg); - R visit(ArrayInitializerExpr n, A arg); + R visit(ArrayInitializerExpr n, A arg); - R visit(AssignExpr n, A arg); + R visit(AssignExpr n, A arg); - R visit(BinaryExpr n, A arg); + R visit(BinaryExpr n, A arg); - R visit(CastExpr n, A arg); + R visit(CastExpr n, A arg); - R visit(ClassExpr n, A arg); + R visit(ClassExpr n, A arg); - R visit(ConditionalExpr n, A arg); + R visit(ConditionalExpr n, A arg); - R visit(EnclosedExpr n, A arg); + R visit(EnclosedExpr n, A arg); - R visit(FieldAccessExpr n, A arg); + R visit(FieldAccessExpr n, A arg); - R visit(InstanceOfExpr n, A arg); + R visit(InstanceOfExpr n, A arg); - R visit(StringLiteralExpr n, A arg); + R visit(StringLiteralExpr n, A arg); - R visit(IntegerLiteralExpr n, A arg); + R visit(IntegerLiteralExpr n, A arg); - R visit(LongLiteralExpr n, A arg); + R visit(LongLiteralExpr n, A arg); - R visit(IntegerLiteralMinValueExpr n, A arg); + R visit(IntegerLiteralMinValueExpr n, A arg); - R visit(LongLiteralMinValueExpr n, A arg); + R visit(LongLiteralMinValueExpr n, A arg); - R visit(CharLiteralExpr n, A arg); + R visit(CharLiteralExpr n, A arg); - R visit(DoubleLiteralExpr n, A arg); + R visit(DoubleLiteralExpr n, A arg); - R visit(BooleanLiteralExpr n, A arg); + R visit(BooleanLiteralExpr n, A arg); - R visit(NullLiteralExpr n, A arg); + R visit(NullLiteralExpr n, A arg); - R visit(MethodCallExpr n, A arg); + R visit(MethodCallExpr n, A arg); - R visit(NameExpr n, A arg); + R visit(NameExpr n, A arg); - R visit(ObjectCreationExpr n, A arg); + R visit(ObjectCreationExpr n, A arg); - R visit(QualifiedNameExpr n, A arg); + R visit(QualifiedNameExpr n, A arg); - R visit(ThisExpr n, A arg); + R visit(ThisExpr n, A arg); - R visit(SuperExpr n, A arg); + R visit(SuperExpr n, A arg); - R visit(UnaryExpr n, A arg); + R visit(UnaryExpr n, A arg); - R visit(VariableDeclarationExpr n, A arg); + R visit(VariableDeclarationExpr n, A arg); - R visit(MarkerAnnotationExpr n, A arg); + R visit(MarkerAnnotationExpr n, A arg); - R visit(SingleMemberAnnotationExpr n, A arg); + R visit(SingleMemberAnnotationExpr n, A arg); - R visit(NormalAnnotationExpr n, A arg); + R visit(NormalAnnotationExpr n, A arg); - R visit(MemberValuePair n, A arg); + R visit(MemberValuePair n, A arg); - //- Statements ---------------------------------------- + //- Statements ---------------------------------------- - R visit(ExplicitConstructorInvocationStmt n, A arg); + R visit(ExplicitConstructorInvocationStmt n, A arg); - R visit(TypeDeclarationStmt n, A arg); + R visit(TypeDeclarationStmt n, A arg); - R visit(AssertStmt n, A arg); + R visit(AssertStmt n, A arg); - R visit(BlockStmt n, A arg); + R visit(BlockStmt n, A arg); - R visit(LabeledStmt n, A arg); + R visit(LabeledStmt n, A arg); - R visit(EmptyStmt n, A arg); + R visit(EmptyStmt n, A arg); - R visit(ExpressionStmt n, A arg); + R visit(ExpressionStmt n, A arg); - R visit(SwitchStmt n, A arg); + R visit(SwitchStmt n, A arg); - R visit(SwitchEntryStmt n, A arg); + R visit(SwitchEntryStmt n, A arg); - R visit(BreakStmt n, A arg); + R visit(BreakStmt n, A arg); - R visit(ReturnStmt n, A arg); + R visit(ReturnStmt n, A arg); - R visit(IfStmt n, A arg); + R visit(IfStmt n, A arg); - R visit(WhileStmt n, A arg); + R visit(WhileStmt n, A arg); - R visit(ContinueStmt n, A arg); + R visit(ContinueStmt n, A arg); - R visit(DoStmt n, A arg); + R visit(DoStmt n, A arg); - R visit(ForeachStmt n, A arg); + R visit(ForeachStmt n, A arg); - R visit(ForStmt n, A arg); + R visit(ForStmt n, A arg); - R visit(ThrowStmt n, A arg); + R visit(ThrowStmt n, A arg); - R visit(SynchronizedStmt n, A arg); + R visit(SynchronizedStmt n, A arg); - R visit(TryStmt n, A arg); + R visit(TryStmt n, A arg); - R visit(CatchClause n, A arg); + R visit(CatchClause n, A arg); R visit(LambdaExpr n, A arg); @@ -253,5 +253,5 @@ public interface GenericVisitor { R visit(TypeExpr n, A arg); - R visit(ArrayBracketPair arrayBracketPair, A arg); + R visit(ArrayBracketPair arrayBracketPair, A arg); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java index a1890e45de..af01fdffba 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.*; @@ -38,54 +38,1188 @@ */ public abstract class GenericVisitorAdapter implements GenericVisitor { - @Override - public R visit(final AnnotationDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getMembers() != null) { + @Override + public R visit(final AnnotationDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getMembers() != null) { for (final BodyDeclaration member : n.getMembers()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final AnnotationMemberDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final AnnotationMemberDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getDefaultValue() != null) { + { + R result = n.getDefaultValue().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ArrayAccessExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getIndex().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ArrayCreationExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + for(ArrayCreationLevel level: n.getLevels()){ + R result = level.accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getInitializer() != null) { + R result = n.getInitializer().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ArrayInitializerExpr n, final A arg) { + visitComment(n, arg); + if (n.getValues() != null) { + for (final Expression expr : n.getValues()) { + { + R result = expr.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final AssertStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getCheck().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getMessage() != null) { + { + R result = n.getMessage().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final AssignExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getTarget().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getValue().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final BinaryExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getLeft().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getRight().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final BlockStmt n, final A arg) { + visitComment(n, arg); + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + { + R result = s.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + + } + + @Override + public R visit(final BooleanLiteralExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final BreakStmt n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final CastExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final CatchClause n, final A arg) { + visitComment(n, arg); + { + R result = n.getParam().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + + } + + @Override + public R visit(final CharLiteralExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final ClassExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ClassOrInterfaceDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getExtends() != null) { + for (final ClassOrInterfaceType c : n.getExtends()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + + if (n.getImplements() != null) { + for (final ClassOrInterfaceType c : n.getImplements()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ClassOrInterfaceType n, final A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getScope() != null) { + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getTypeArguments() != null) { + for (Type type : n.getTypeArguments()) { + R result = type.accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final CompilationUnit n, final A arg) { + visitComment(n, arg); + if (n.getPackage() != null) { + { + R result = n.getPackage().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getImports() != null) { + for (final ImportDeclaration i : n.getImports()) { + { + R result = i.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypes() != null) { + for (final TypeDeclaration typeDeclaration : n.getTypes()) { + { + R result = typeDeclaration.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ConditionalExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getThenExpr().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getElseExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ConstructorDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + { + R result = p.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getThrows() != null) { + for (final ReferenceType name : n.getThrows()) { + { + R result = name.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ContinueStmt n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final DoStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final DoubleLiteralExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final EmptyMemberDeclaration n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final EmptyStmt n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final EmptyTypeDeclaration n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final EnclosedExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getInner().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final EnumConstantDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getClassBody() != null) { + for (final BodyDeclaration member : n.getClassBody()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final EnumDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getImplements() != null) { + for (final ClassOrInterfaceType c : n.getImplements()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getEntries() != null) { + for (final EnumConstantDeclaration e : n.getEntries()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { + visitComment(n, arg); + if (!n.isThis() && n.getExpr() != null) { + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getTypeArguments() != null) { + for (Type type : n.getTypeArguments()) { + R result = type.accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ExpressionStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getExpression().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final FieldAccessExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + { + if (n.getTypeArguments() != null) { + for (Type type : n.getTypeArguments()) { + R result = type.accept(this, arg); if (result != null) { return result; } } } } + return null; + } + + @Override + public R visit(final FieldDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getElementType().accept(this, arg); + if (result != null) { + return result; + } + } + for (final VariableDeclarator var : n.getVariables()) { + { + R result = var.accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ForeachStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getVariable().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getIterable().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ForStmt n, final A arg) { + visitComment(n, arg); + if (n.getInit() != null) { + for (final Expression e : n.getInit()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getCompare() != null) { + { + R result = n.getCompare().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getUpdate() != null) { + for (final Expression e : n.getUpdate()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final IfStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getThenStmt().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getElseStmt() != null) { + { + R result = n.getElseStmt().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ImportDeclaration n, final A arg) { + visitComment(n, arg); + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final InitializerDeclaration n, final A arg) { + visitComment(n, arg); + { + R result = n.getBlock().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final InstanceOfExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final IntegerLiteralExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final IntegerLiteralMinValueExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final JavadocComment n, final A arg) { + return null; + } + + @Override + public R visit(final LabeledStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getStmt().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final LongLiteralExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final LongLiteralMinValueExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final MarkerAnnotationExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final MemberValuePair n, final A arg) { + visitComment(n, arg); + { + R result = n.getValue().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final MethodCallExpr n, final A arg) { + visitComment(n, arg); + if (n.getScope() != null) { + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getTypeArguments() != null) { + for (Type type : n.getTypeArguments()) { + R result = type.accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final MethodDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getElementType().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + { + R result = p.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getThrows() != null) { + for (final ReferenceType name : n.getThrows()) { + { + R result = name.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getBody() != null) { + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final NameExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final NormalAnnotationExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getPairs() != null) { + for (final MemberValuePair m : n.getPairs()) { + { + R result = m.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final NullLiteralExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final ObjectCreationExpr n, final A arg) { + visitComment(n, arg); + if (n.getScope() != null) { + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getTypeArguments() != null) { + for (Type type : n.getTypeArguments()) { + R result = type.accept(this, arg); + if (result != null) { + return result; + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getAnonymousClassBody() != null) { + for (final BodyDeclaration member : n.getAnonymousClassBody()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final PackageDeclaration n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final Parameter n, final A arg) { + visitComment(n, arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getElementType().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getId().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final PrimitiveType n, final A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final QualifiedNameExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getQualifier().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(ArrayType n, A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getComponentType().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(ArrayCreationLevel n, A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + { + if(n.getDimension()!=null) { + R result = n.getDimension().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final IntersectionType n, final A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getDefaultValue() != null) { - { - R result = n.getDefaultValue().accept(this, arg); + for (ReferenceType element : n.getElements()) { + R result = element.accept(this, arg); if (result != null) { return result; } @@ -95,75 +1229,17 @@ public R visit(final AnnotationMemberDeclaration n, final A arg) { } @Override - public R visit(final ArrayAccessExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getIndex().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ArrayCreationExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - for (ArrayCreationLevel level : n.getLevels()) { - R result = level.accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getInitializer() != null) { - R result = n.getInitializer().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ArrayInitializerExpr n, final A arg) { - visitComment(n, arg); - if (n.getValues() != null) { - for (final Expression expr : n.getValues()) { - { - R result = expr.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final AssertStmt n, final A arg) { - visitComment(n, arg); + public R visit(final UnionType n, final A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } { - R result = n.getCheck().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getMessage() != null) { - { - R result = n.getMessage().accept(this, arg); + for (ReferenceType element : n.getElements()) { + R result = element.accept(this, arg); if (result != null) { return result; } @@ -172,1506 +1248,430 @@ public R visit(final AssertStmt n, final A arg) { return null; } - @Override - public R visit(final AssignExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getTarget().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getValue().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final BinaryExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getLeft().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getRight().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final BlockStmt n, final A arg) { - visitComment(n, arg); - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - { - R result = s.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - - } - - @Override - public R visit(final BooleanLiteralExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final BreakStmt n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final CastExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final CatchClause n, final A arg) { - visitComment(n, arg); - { - R result = n.getParam().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - - } + @Override + public R visit(final ReturnStmt n, final A arg) { + visitComment(n, arg); + if (n.getExpr() != null) { + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final SingleMemberAnnotationExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getMemberValue().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final StringLiteralExpr n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final SuperExpr n, final A arg) { + visitComment(n, arg); + if (n.getClassExpr() != null) { + { + R result = n.getClassExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final SwitchEntryStmt n, final A arg) { + visitComment(n, arg); + if (n.getLabel() != null) { + { + R result = n.getLabel().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + { + R result = s.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final SwitchStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getSelector().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getEntries() != null) { + for (final SwitchEntryStmt e : n.getEntries()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + + } + + @Override + public R visit(final SynchronizedStmt n, final A arg) { + visitComment(n, arg); + { + if (n.getExpr() != null) { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ThisExpr n, final A arg) { + visitComment(n, arg); + if (n.getClassExpr() != null) { + { + R result = n.getClassExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ThrowStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final TryStmt n, final A arg) { + visitComment(n, arg); + if (n.getResources() != null) { + for (final VariableDeclarationExpr v : n.getResources()) { + { + R result = v.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getTryBlock().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getCatchs() != null) { + for (final CatchClause c : n.getCatchs()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getFinallyBlock() != null) { + { + R result = n.getFinallyBlock().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final TypeDeclarationStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getTypeDeclaration().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final TypeParameter n, final A arg) { + visitComment(n, arg); + if (n.getTypeBound() != null) { + for (final ClassOrInterfaceType c : n.getTypeBound()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final UnaryExpr n, final A arg) { + visitComment(n, arg); + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final UnknownType n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final VariableDeclarationExpr n, final A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getElementType().accept(this, arg); + if (result != null) { + return result; + } + } + for (final VariableDeclarator v : n.getVariables()) { + { + R result = v.accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final VariableDeclarator n, final A arg) { + visitComment(n, arg); + { + R result = n.getId().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getInit() != null) { + { + R result = n.getInit().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final VariableDeclaratorId n, final A arg) { + visitComment(n, arg); + return null; + } + + @Override + public R visit(final VoidType n, final A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final WhileStmt n, final A arg) { + visitComment(n, arg); + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final WildcardType n, final A arg) { + visitComment(n, arg); + for (final AnnotationExpr a : n.getAnnotations()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getExtends() != null) { + { + R result = n.getExtends().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getSuper() != null) { + { + R result = n.getSuper().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } @Override - public R visit(final CharLiteralExpr n, final A arg) { - visitComment(n, arg); - return null; + public R visit(LambdaExpr n, A arg) { + visitComment(n, arg); + if (n.getParameters() != null) { + for (final Parameter a : n.getParameters()) { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getBody() != null) { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; } @Override - public R visit(final ClassExpr n, final A arg) { + public R visit(MethodReferenceExpr n, A arg) { visitComment(n, arg); { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ClassOrInterfaceDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getExtends() != null) { - for (final ClassOrInterfaceType c : n.getExtends()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - - if (n.getImplements() != null) { - for (final ClassOrInterfaceType c : n.getImplements()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - { - R result = member.accept(this, arg); + if (n.getTypeArguments() != null) { + for (Type type : n.getTypeArguments()) { + R result = type.accept(this, arg); if (result != null) { return result; } } } } - return null; - } - - @Override - public R visit(final ClassOrInterfaceType n, final A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } if (n.getScope() != null) { - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getTypeArguments() != null) { - for (Type type : n.getTypeArguments()) { - R result = type.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final CompilationUnit n, final A arg) { - visitComment(n, arg); - if (n.getPackage() != null) { - { - R result = n.getPackage().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getImports() != null) { - for (final ImportDeclaration i : n.getImports()) { - { - R result = i.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypes() != null) { - for (final TypeDeclaration typeDeclaration : n.getTypes()) { - { - R result = typeDeclaration.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final ConditionalExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getThenExpr().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getElseExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ConstructorDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - { - R result = p.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getThrows() != null) { - for (final ReferenceType name : n.getThrows()) { - { - R result = name.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ContinueStmt n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final DoStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final DoubleLiteralExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final EmptyMemberDeclaration n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final EmptyStmt n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final EmptyTypeDeclaration n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final EnclosedExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getInner().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final EnumConstantDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getClassBody() != null) { - for (final BodyDeclaration member : n.getClassBody()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final EnumDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getImplements() != null) { - for (final ClassOrInterfaceType c : n.getImplements()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getEntries() != null) { - for (final EnumConstantDeclaration e : n.getEntries()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { - visitComment(n, arg); - if (!n.isThis() && n.getExpr() != null) { - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getTypeArguments() != null) { - for (Type type : n.getTypeArguments()) { - R result = type.accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final ExpressionStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getExpression().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final FieldAccessExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - { - if (n.getTypeArguments() != null) { - for (Type type : n.getTypeArguments()) { - R result = type.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final FieldDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getElementType().accept(this, arg); - if (result != null) { - return result; - } - } - for (final VariableDeclarator var : n.getVariables()) { - { - R result = var.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ForeachStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getVariable().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getIterable().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ForStmt n, final A arg) { - visitComment(n, arg); - if (n.getInit() != null) { - for (final Expression e : n.getInit()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getCompare() != null) { - { - R result = n.getCompare().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getUpdate() != null) { - for (final Expression e : n.getUpdate()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final IfStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getThenStmt().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getElseStmt() != null) { - { - R result = n.getElseStmt().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ImportDeclaration n, final A arg) { - visitComment(n, arg); - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final InitializerDeclaration n, final A arg) { - visitComment(n, arg); - { - R result = n.getBlock().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final InstanceOfExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final IntegerLiteralExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final IntegerLiteralMinValueExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final JavadocComment n, final A arg) { - return null; - } - - @Override - public R visit(final LabeledStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getStmt().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final LongLiteralExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final LongLiteralMinValueExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final MarkerAnnotationExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final MemberValuePair n, final A arg) { - visitComment(n, arg); - { - R result = n.getValue().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final MethodCallExpr n, final A arg) { - visitComment(n, arg); - if (n.getScope() != null) { - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getTypeArguments() != null) { - for (Type type : n.getTypeArguments()) { - R result = type.accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final MethodDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getElementType().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - { - R result = p.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getThrows() != null) { - for (final ReferenceType name : n.getThrows()) { - { - R result = name.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getBody() != null) { - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final NameExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final NormalAnnotationExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getPairs() != null) { - for (final MemberValuePair m : n.getPairs()) { - { - R result = m.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final NullLiteralExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final ObjectCreationExpr n, final A arg) { - visitComment(n, arg); - if (n.getScope() != null) { - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getTypeArguments() != null) { - for (Type type : n.getTypeArguments()) { - R result = type.accept(this, arg); - if (result != null) { - return result; - } - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getAnonymousClassBody() != null) { - for (final BodyDeclaration member : n.getAnonymousClassBody()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final PackageDeclaration n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final Parameter n, final A arg) { - visitComment(n, arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getElementType().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getId().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final PrimitiveType n, final A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final QualifiedNameExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getQualifier().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(ArrayType n, A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getComponentType().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(ArrayCreationLevel n, A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - { - if (n.getDimension() != null) { - R result = n.getDimension().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final IntersectionType n, final A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - { - for (ReferenceType element : n.getElements()) { - R result = element.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final UnionType n, final A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - { - for (ReferenceType element : n.getElements()) { - R result = element.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ReturnStmt n, final A arg) { - visitComment(n, arg); - if (n.getExpr() != null) { - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final SingleMemberAnnotationExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getMemberValue().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final StringLiteralExpr n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final SuperExpr n, final A arg) { - visitComment(n, arg); - if (n.getClassExpr() != null) { - { - R result = n.getClassExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final SwitchEntryStmt n, final A arg) { - visitComment(n, arg); - if (n.getLabel() != null) { - { - R result = n.getLabel().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - { - R result = s.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final SwitchStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getSelector().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getEntries() != null) { - for (final SwitchEntryStmt e : n.getEntries()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - - } - - @Override - public R visit(final SynchronizedStmt n, final A arg) { - visitComment(n, arg); - { - if (n.getExpr() != null) { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ThisExpr n, final A arg) { - visitComment(n, arg); - if (n.getClassExpr() != null) { - { - R result = n.getClassExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ThrowStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final TryStmt n, final A arg) { - visitComment(n, arg); - if (n.getResources() != null) { - for (final VariableDeclarationExpr v : n.getResources()) { - { - R result = v.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getTryBlock().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getCatchs() != null) { - for (final CatchClause c : n.getCatchs()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getFinallyBlock() != null) { - { - R result = n.getFinallyBlock().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final TypeDeclarationStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getTypeDeclaration().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final TypeParameter n, final A arg) { - visitComment(n, arg); - if (n.getTypeBound() != null) { - for (final ClassOrInterfaceType c : n.getTypeBound()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final UnaryExpr n, final A arg) { - visitComment(n, arg); - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final UnknownType n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final VariableDeclarationExpr n, final A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getElementType().accept(this, arg); - if (result != null) { - return result; - } - } - for (final VariableDeclarator v : n.getVariables()) { - { - R result = v.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final VariableDeclarator n, final A arg) { - visitComment(n, arg); - { - R result = n.getId().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getInit() != null) { - { - R result = n.getInit().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final VariableDeclaratorId n, final A arg) { - visitComment(n, arg); - return null; - } - - @Override - public R visit(final VoidType n, final A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final WhileStmt n, final A arg) { - visitComment(n, arg); - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final WildcardType n, final A arg) { - visitComment(n, arg); - for (final AnnotationExpr a : n.getAnnotations()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getExtends() != null) { - { - R result = n.getExtends().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getSuper() != null) { - { - R result = n.getSuper().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(LambdaExpr n, A arg) { - visitComment(n, arg); - if (n.getParameters() != null) { - for (final Parameter a : n.getParameters()) { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getBody() != null) { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(MethodReferenceExpr n, A arg) { - visitComment(n, arg); - { - if (n.getTypeArguments() != null) { - for (Type type : n.getTypeArguments()) { - R result = type.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getScope() != null) { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(TypeExpr n, A arg) { - visitComment(n, arg); - if (n.getType() != null) { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(ArrayBracketPair n, A arg) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final BlockComment n, final A arg) { - return null; - } - - @Override - public R visit(final LineComment n, final A arg) { - return null; - } - - private void visitComment(Node n, A arg) { - if (n.getComment() != null) { - Comment result = (Comment) n.getComment().accept(this, arg); - if (result != null) { - n.setComment(result); - } - } - } + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(TypeExpr n, A arg){ + visitComment(n, arg); + if (n.getType() != null) { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(ArrayBracketPair n, A arg) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final BlockComment n, final A arg) { + return null; + } + + @Override + public R visit(final LineComment n, final A arg) { + return null; + } + + private void visitComment(Node n, A arg) { + if(n.getComment()!=null){ + Comment result = (Comment) n.getComment().accept(this, arg); + if(result!=null){ + n.setComment(result); + } + } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java index 0c0226c739..78b0e29317 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import java.util.List; @@ -111,448 +111,418 @@ * This visitor adapter can be used to save time when some specific nodes needs * to be changed. To do that just extend this class and override the methods * from the nodes who needs to be changed, returning the changed node. - * + * * @author Julio Vilmar Gesser */ public class ModifierVisitorAdapter implements GenericVisitor { - private void removeNulls(final List list) { - for (int i = list.size() - 1; i >= 0; i--) { - if (list.get(i) == null) { - list.remove(i); - } - } - } - - @Override - public Node visit(final AnnotationDeclaration n, final A arg) { - visitAnnotations(n, arg); - visitComment(n, arg); + private void removeNulls(final List list) { + for (int i = list.size() - 1; i >= 0; i--) { + if (list.get(i) == null) { + list.remove(i); + } + } + } + + @Override public Node visit(final AnnotationDeclaration n, final A arg) { + visitAnnotations(n, arg); + visitComment(n, arg); final List> members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { + if (members != null) { + for (int i = 0; i < members.size(); i++) { members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - private void visitAnnotations(NodeWithAnnotations n, A arg) { - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - } - - @Override - public Node visit(final AnnotationMemberDeclaration n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - if (n.getDefaultValue() != null) { - n.setDefaultValue((Expression) n.getDefaultValue().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ArrayAccessExpr n, final A arg) { - visitComment(n, arg); - n.setName((Expression) n.getName().accept(this, arg)); - n.setIndex((Expression) n.getIndex().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ArrayCreationExpr n, final A arg) { - visitComment(n, arg); - n.setType((Type) n.getType().accept(this, arg)); - - final List values = n.getLevels(); - for (int i = 0; i < values.size(); i++) { - values.set(i, (ArrayCreationLevel) values.get(i).accept(this, arg)); - } - removeNulls(values); - - if (n.getInitializer() != null) { - n.setInitializer((ArrayInitializerExpr) n.getInitializer().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ArrayInitializerExpr n, final A arg) { - visitComment(n, arg); - if (n.getValues() != null) { - final List values = n.getValues(); - if (values != null) { - for (int i = 0; i < values.size(); i++) { - values.set(i, (Expression) values.get(i).accept(this, arg)); - } - removeNulls(values); - } - } - return n; - } - - @Override - public Node visit(final AssertStmt n, final A arg) { - visitComment(n, arg); - n.setCheck((Expression) n.getCheck().accept(this, arg)); - if (n.getMessage() != null) { - n.setMessage((Expression) n.getMessage().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final AssignExpr n, final A arg) { - visitComment(n, arg); - final Expression target = (Expression) n.getTarget().accept(this, arg); - if (target == null) { - return null; - } + } + removeNulls(members); + } + return n; + } + + private void visitAnnotations(NodeWithAnnotations n, A arg) { + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + } + + @Override public Node visit(final AnnotationMemberDeclaration n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + n.setType((Type) n.getType().accept(this, arg)); + if (n.getDefaultValue() != null) { + n.setDefaultValue((Expression) n.getDefaultValue().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ArrayAccessExpr n, final A arg) { + visitComment(n, arg); + n.setName((Expression) n.getName().accept(this, arg)); + n.setIndex((Expression) n.getIndex().accept(this, arg)); + return n; + } + + @Override public Node visit(final ArrayCreationExpr n, final A arg) { + visitComment(n, arg); + n.setType((Type) n.getType().accept(this, arg)); + + final List values = n.getLevels(); + for (int i = 0; i < values.size(); i++) { + values.set(i, (ArrayCreationLevel) values.get(i).accept(this, arg)); + } + removeNulls(values); + + if (n.getInitializer() != null) { + n.setInitializer((ArrayInitializerExpr) n.getInitializer().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ArrayInitializerExpr n, final A arg) { + visitComment(n, arg); + if (n.getValues() != null) { + final List values = n.getValues(); + if (values != null) { + for (int i = 0; i < values.size(); i++) { + values.set(i, (Expression) values.get(i).accept(this, arg)); + } + removeNulls(values); + } + } + return n; + } + + @Override public Node visit(final AssertStmt n, final A arg) { + visitComment(n, arg); + n.setCheck((Expression) n.getCheck().accept(this, arg)); + if (n.getMessage() != null) { + n.setMessage((Expression) n.getMessage().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final AssignExpr n, final A arg) { + visitComment(n, arg); + final Expression target = (Expression) n.getTarget().accept(this, arg); + if (target == null) { + return null; + } n.setTarget(target); - final Expression value = (Expression) n.getValue().accept(this, arg); - if (value == null) { - return null; - } - n.setValue(value); - - return n; - } - - @Override - public Node visit(final BinaryExpr n, final A arg) { - visitComment(n, arg); - final Expression left = (Expression) n.getLeft().accept(this, arg); - final Expression right = (Expression) n.getRight().accept(this, arg); - if (left == null) { - return right; - } - if (right == null) { - return left; - } - n.setLeft(left); - n.setRight(right); - return n; - } - - @Override - public Node visit(final BlockStmt n, final A arg) { - visitComment(n, arg); - final List stmts = n.getStmts(); - if (stmts != null) { - for (int i = 0; i < stmts.size(); i++) { - stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); - } - removeNulls(stmts); - } - return n; - } - - @Override - public Node visit(final BooleanLiteralExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final BreakStmt n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final CastExpr n, final A arg) { - visitComment(n, arg); - final Type type = (Type) n.getType().accept(this, arg); - final Expression expr = (Expression) n.getExpr().accept(this, arg); - if (type == null) { - return expr; - } - if (expr == null) { - return null; - } - n.setType(type); - n.setExpr(expr); - return n; - } - - @Override - public Node visit(final CatchClause n, final A arg) { - visitComment(n, arg); - n.setParam((Parameter) n.getParam().accept(this, arg)); - n.setBody((BlockStmt) n.getBody().accept(this, arg)); - return n; - - } - - @Override - public Node visit(final CharLiteralExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final ClassExpr n, final A arg) { - visitComment(n, arg); - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ClassOrInterfaceDeclaration n, final A arg) { - visitAnnotations(n, arg); - visitComment(n, arg); - final List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - final List extendz = n.getExtends(); - if (extendz != null) { - for (int i = 0; i < extendz.size(); i++) { - extendz.set(i, (ClassOrInterfaceType) extendz.get(i).accept(this, arg)); - } - removeNulls(extendz); - } - final List implementz = n.getImplements(); - if (implementz != null) { - for (int i = 0; i < implementz.size(); i++) { - implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); - } - removeNulls(implementz); - } + final Expression value = (Expression) n.getValue().accept(this, arg); + if (value == null) { + return null; + } + n.setValue(value); + + return n; + } + + @Override public Node visit(final BinaryExpr n, final A arg) { + visitComment(n, arg); + final Expression left = (Expression) n.getLeft().accept(this, arg); + final Expression right = (Expression) n.getRight().accept(this, arg); + if (left == null) { + return right; + } + if (right == null) { + return left; + } + n.setLeft(left); + n.setRight(right); + return n; + } + + @Override public Node visit(final BlockStmt n, final A arg) { + visitComment(n, arg); + final List stmts = n.getStmts(); + if (stmts != null) { + for (int i = 0; i < stmts.size(); i++) { + stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); + } + removeNulls(stmts); + } + return n; + } + + @Override public Node visit(final BooleanLiteralExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final BreakStmt n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final CastExpr n, final A arg) { + visitComment(n, arg); + final Type type = (Type) n.getType().accept(this, arg); + final Expression expr = (Expression) n.getExpr().accept(this, arg); + if (type == null) { + return expr; + } + if (expr == null) { + return null; + } + n.setType(type); + n.setExpr(expr); + return n; + } + + @Override public Node visit(final CatchClause n, final A arg) { + visitComment(n, arg); + n.setParam((Parameter)n.getParam().accept(this, arg)); + n.setBody((BlockStmt) n.getBody().accept(this, arg)); + return n; + + } + + @Override public Node visit(final CharLiteralExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final ClassExpr n, final A arg) { + visitComment(n, arg); + n.setType((Type) n.getType().accept(this, arg)); + return n; + } + + @Override public Node visit(final ClassOrInterfaceDeclaration n, final A arg) { + visitAnnotations(n, arg); + visitComment(n, arg); + final List typeParameters = n.getTypeParameters(); + if (typeParameters != null) { + for (int i = 0; i < typeParameters.size(); i++) { + typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); + } + removeNulls(typeParameters); + } + final List extendz = n.getExtends(); + if (extendz != null) { + for (int i = 0; i < extendz.size(); i++) { + extendz.set(i, (ClassOrInterfaceType) extendz.get(i).accept(this, arg)); + } + removeNulls(extendz); + } + final List implementz = n.getImplements(); + if (implementz != null) { + for (int i = 0; i < implementz.size(); i++) { + implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); + } + removeNulls(implementz); + } final List> members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { + if (members != null) { + for (int i = 0; i < members.size(); i++) { members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(final ClassOrInterfaceType n, final A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - if (n.getScope() != null) { - n.setScope((ClassOrInterfaceType) n.getScope().accept(this, arg)); - } - final List> typeArguments = n.getTypeArguments(); - if (typeArguments != null) { - for (int i = 0; i < typeArguments.size(); i++) { - typeArguments.set(i, (Type) typeArguments.get(i).accept(this, arg)); - } - removeNulls(typeArguments); - } - return n; - } - - @Override - public Node visit(final CompilationUnit n, final A arg) { - visitComment(n, arg); - if (n.getPackage() != null) { - n.setPackage((PackageDeclaration) n.getPackage().accept(this, arg)); - } - final List imports = n.getImports(); - if (imports != null) { - for (int i = 0; i < imports.size(); i++) { - imports.set(i, (ImportDeclaration) imports.get(i).accept(this, arg)); - } - removeNulls(imports); - } + } + removeNulls(members); + } + return n; + } + + @Override public Node visit(final ClassOrInterfaceType n, final A arg) { + visitComment(n, arg); + visitAnnotations(n, arg); + if (n.getScope() != null) { + n.setScope((ClassOrInterfaceType) n.getScope().accept(this, arg)); + } + final List> typeArguments = n.getTypeArguments(); + if (typeArguments != null) { + for (int i = 0; i < typeArguments.size(); i++) { + typeArguments.set(i, (Type) typeArguments.get(i).accept(this, arg)); + } + removeNulls(typeArguments); + } + return n; + } + + @Override public Node visit(final CompilationUnit n, final A arg) { + visitComment(n, arg); + if (n.getPackage() != null) { + n.setPackage((PackageDeclaration) n.getPackage().accept(this, arg)); + } + final List imports = n.getImports(); + if (imports != null) { + for (int i = 0; i < imports.size(); i++) { + imports.set(i, (ImportDeclaration) imports.get(i).accept(this, arg)); + } + removeNulls(imports); + } final List> types = n.getTypes(); - if (types != null) { - for (int i = 0; i < types.size(); i++) { + if (types != null) { + for (int i = 0; i < types.size(); i++) { types.set(i, (TypeDeclaration) types.get(i).accept(this, arg)); - } - removeNulls(types); - } - return n; - } - - @Override - public Node visit(final ConditionalExpr n, final A arg) { - visitComment(n, arg); - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setThenExpr((Expression) n.getThenExpr().accept(this, arg)); - n.setElseExpr((Expression) n.getElseExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ConstructorDeclaration n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - final List parameters = n.getParameters(); - if (parameters != null) { - for (int i = 0; i < parameters.size(); i++) { - parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); - } - removeNulls(parameters); - } - final List throwz = n.getThrows(); - if (throwz != null) { - for (int i = 0; i < throwz.size(); i++) { - throwz.set(i, (ReferenceType) throwz.get(i).accept(this, arg)); - } - removeNulls(throwz); - } - n.setBody((BlockStmt) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ContinueStmt n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final DoStmt n, final A arg) { - visitComment(n, arg); - final Statement body = (Statement) n.getBody().accept(this, arg); - if (body == null) { - return null; - } - n.setBody(body); - - final Expression condition = (Expression) n.getCondition().accept(this, arg); - if (condition == null) { - return null; - } - n.setCondition(condition); - - return n; - } - - @Override - public Node visit(final DoubleLiteralExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final EmptyMemberDeclaration n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final EmptyStmt n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final EmptyTypeDeclaration n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final EnclosedExpr n, final A arg) { - visitComment(n, arg); - n.setInner((Expression) n.getInner().accept(this, arg)); - return n; - } - - @Override - public Node visit(final EnumConstantDeclaration n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } + } + removeNulls(types); + } + return n; + } + + @Override public Node visit(final ConditionalExpr n, final A arg) { + visitComment(n, arg); + n.setCondition((Expression) n.getCondition().accept(this, arg)); + n.setThenExpr((Expression) n.getThenExpr().accept(this, arg)); + n.setElseExpr((Expression) n.getElseExpr().accept(this, arg)); + return n; + } + + @Override public Node visit(final ConstructorDeclaration n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List typeParameters = n.getTypeParameters(); + if (typeParameters != null) { + for (int i = 0; i < typeParameters.size(); i++) { + typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); + } + removeNulls(typeParameters); + } + final List parameters = n.getParameters(); + if (parameters != null) { + for (int i = 0; i < parameters.size(); i++) { + parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); + } + removeNulls(parameters); + } + final List throwz = n.getThrows(); + if (throwz != null) { + for (int i = 0; i < throwz.size(); i++) { + throwz.set(i, (ReferenceType) throwz.get(i).accept(this, arg)); + } + removeNulls(throwz); + } + n.setBody((BlockStmt) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final ContinueStmt n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final DoStmt n, final A arg) { + visitComment(n, arg); + final Statement body = (Statement) n.getBody().accept(this, arg); + if (body == null) { + return null; + } + n.setBody(body); + + final Expression condition = (Expression) n.getCondition().accept(this, arg); + if (condition == null) { + return null; + } + n.setCondition(condition); + + return n; + } + + @Override public Node visit(final DoubleLiteralExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final EmptyMemberDeclaration n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final EmptyStmt n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final EmptyTypeDeclaration n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final EnclosedExpr n, final A arg) { + visitComment(n, arg); + n.setInner((Expression) n.getInner().accept(this, arg)); + return n; + } + + @Override public Node visit(final EnumConstantDeclaration n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } final List> classBody = n.getClassBody(); - if (classBody != null) { - for (int i = 0; i < classBody.size(); i++) { + if (classBody != null) { + for (int i = 0; i < classBody.size(); i++) { classBody.set(i, (BodyDeclaration) classBody.get(i).accept(this, arg)); - } - removeNulls(classBody); - } - return n; - } - - @Override - public Node visit(final EnumDeclaration n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List implementz = n.getImplements(); - if (implementz != null) { - for (int i = 0; i < implementz.size(); i++) { - implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); - } - removeNulls(implementz); - } - final List entries = n.getEntries(); - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - entries.set(i, (EnumConstantDeclaration) entries.get(i).accept(this, arg)); - } - removeNulls(entries); - } + } + removeNulls(classBody); + } + return n; + } + + @Override public Node visit(final EnumDeclaration n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List implementz = n.getImplements(); + if (implementz != null) { + for (int i = 0; i < implementz.size(); i++) { + implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); + } + removeNulls(implementz); + } + final List entries = n.getEntries(); + if (entries != null) { + for (int i = 0; i < entries.size(); i++) { + entries.set(i, (EnumConstantDeclaration) entries.get(i).accept(this, arg)); + } + removeNulls(entries); + } final List> members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { + if (members != null) { + for (int i = 0; i < members.size(); i++) { members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(final ExplicitConstructorInvocationStmt n, final A arg) { - visitComment(n, arg); - if (!n.isThis() && n.getExpr() != null) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - } + } + removeNulls(members); + } + return n; + } + + @Override public Node visit(final ExplicitConstructorInvocationStmt n, final A arg) { + visitComment(n, arg); + if (!n.isThis() && n.getExpr() != null) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + } final List> typeArguments = n.getTypeArguments(); if (typeArguments != null) { for (int i = 0; i < typeArguments.size(); i++) { @@ -560,191 +530,173 @@ public Node visit(final ExplicitConstructorInvocationStmt n, final A arg) { } removeNulls(typeArguments); } - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - return n; - } - - @Override - public Node visit(final ExpressionStmt n, final A arg) { - visitComment(n, arg); - final Expression expr = (Expression) n.getExpression().accept(this, arg); - if (expr == null) { - return null; - } - n.setExpression(expr); - return n; - } - - @Override - public Node visit(final FieldAccessExpr n, final A arg) { - visitComment(n, arg); - final Expression scope = (Expression) n.getScope().accept(this, arg); - if (scope == null) { - return null; - } - n.setScope(scope); - return n; - } - - @Override - public Node visit(final FieldDeclaration n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setElementType((Type) n.getElementType().accept(this, arg)); - final List variables = n.getVariables(); - for (int i = 0; i < variables.size(); i++) { - variables.set(i, (VariableDeclarator) variables.get(i).accept(this, arg)); - } - removeNulls(variables); - return n; - } - - @Override - public Node visit(final ForeachStmt n, final A arg) { - visitComment(n, arg); - n.setVariable((VariableDeclarationExpr) n.getVariable().accept(this, arg)); - n.setIterable((Expression) n.getIterable().accept(this, arg)); - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ForStmt n, final A arg) { - visitComment(n, arg); - final List init = n.getInit(); - if (init != null) { - for (int i = 0; i < init.size(); i++) { - init.set(i, (Expression) init.get(i).accept(this, arg)); - } - removeNulls(init); - } - if (n.getCompare() != null) { - n.setCompare((Expression) n.getCompare().accept(this, arg)); - } - final List update = n.getUpdate(); - if (update != null) { - for (int i = 0; i < update.size(); i++) { - update.set(i, (Expression) update.get(i).accept(this, arg)); - } - removeNulls(update); - } - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final IfStmt n, final A arg) { - visitComment(n, arg); - final Expression condition = (Expression) - n.getCondition().accept(this, arg); - if (condition == null) { - return null; - } - n.setCondition(condition); - final Statement thenStmt = (Statement) n.getThenStmt().accept(this, arg); - if (thenStmt == null) { - // Remove the entire statement if the then-clause was removed. - // DumpVisitor, used for toString, has no null check for the - // then-clause. - return null; - } - n.setThenStmt(thenStmt); - if (n.getElseStmt() != null) { - n.setElseStmt((Statement) n.getElseStmt().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ImportDeclaration n, final A arg) { - visitComment(n, arg); - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(final InitializerDeclaration n, final A arg) { - visitComment(n, arg); - n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); - return n; - } - - @Override - public Node visit(final InstanceOfExpr n, final A arg) { - visitComment(n, arg); - n.setExpr((Expression) n.getExpr().accept(this, arg)); - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(final IntegerLiteralExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final IntegerLiteralMinValueExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final JavadocComment n, final A arg) { - return n; - } - - @Override - public Node visit(final LabeledStmt n, final A arg) { - visitComment(n, arg); - n.setStmt((Statement) n.getStmt().accept(this, arg)); - return n; - } - - @Override - public Node visit(final LongLiteralExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final LongLiteralMinValueExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final MarkerAnnotationExpr n, final A arg) { - visitComment(n, arg); - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(final MemberValuePair n, final A arg) { - visitComment(n, arg); - n.setValue((Expression) n.getValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(final MethodCallExpr n, final A arg) { - visitComment(n, arg); - if (n.getScope() != null) { - n.setScope((Expression) n.getScope().accept(this, arg)); - } + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } + return n; + } + + @Override public Node visit(final ExpressionStmt n, final A arg) { + visitComment(n, arg); + final Expression expr = (Expression) n.getExpression().accept(this, arg); + if (expr == null) { + return null; + } + n.setExpression(expr); + return n; + } + + @Override public Node visit(final FieldAccessExpr n, final A arg) { + visitComment(n, arg); + final Expression scope = (Expression) n.getScope().accept(this, arg); + if (scope == null) { + return null; + } + n.setScope(scope); + return n; + } + + @Override public Node visit(final FieldDeclaration n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + n.setElementType((Type) n.getElementType().accept(this, arg)); + final List variables = n.getVariables(); + for (int i = 0; i < variables.size(); i++) { + variables.set(i, (VariableDeclarator) variables.get(i).accept(this, arg)); + } + removeNulls(variables); + return n; + } + + @Override public Node visit(final ForeachStmt n, final A arg) { + visitComment(n, arg); + n.setVariable((VariableDeclarationExpr) n.getVariable().accept(this, arg)); + n.setIterable((Expression) n.getIterable().accept(this, arg)); + n.setBody((Statement) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final ForStmt n, final A arg) { + visitComment(n, arg); + final List init = n.getInit(); + if (init != null) { + for (int i = 0; i < init.size(); i++) { + init.set(i, (Expression) init.get(i).accept(this, arg)); + } + removeNulls(init); + } + if (n.getCompare() != null) { + n.setCompare((Expression) n.getCompare().accept(this, arg)); + } + final List update = n.getUpdate(); + if (update != null) { + for (int i = 0; i < update.size(); i++) { + update.set(i, (Expression) update.get(i).accept(this, arg)); + } + removeNulls(update); + } + n.setBody((Statement) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final IfStmt n, final A arg) { + visitComment(n, arg); + final Expression condition = (Expression) + n.getCondition().accept(this, arg); + if (condition == null) { + return null; + } + n.setCondition(condition); + final Statement thenStmt = (Statement) n.getThenStmt().accept(this, arg); + if (thenStmt == null) { + // Remove the entire statement if the then-clause was removed. + // DumpVisitor, used for toString, has no null check for the + // then-clause. + return null; + } + n.setThenStmt(thenStmt); + if (n.getElseStmt() != null) { + n.setElseStmt((Statement) n.getElseStmt().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ImportDeclaration n, final A arg) { + visitComment(n, arg); + n.setName((NameExpr) n.getName().accept(this, arg)); + return n; + } + + @Override public Node visit(final InitializerDeclaration n, final A arg) { + visitComment(n, arg); + n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); + return n; + } + + @Override public Node visit(final InstanceOfExpr n, final A arg) { + visitComment(n, arg); + n.setExpr((Expression) n.getExpr().accept(this, arg)); + n.setType((Type) n.getType().accept(this, arg)); + return n; + } + + @Override public Node visit(final IntegerLiteralExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final IntegerLiteralMinValueExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final JavadocComment n, final A arg) { + return n; + } + + @Override public Node visit(final LabeledStmt n, final A arg) { + visitComment(n, arg); + n.setStmt((Statement) n.getStmt().accept(this, arg)); + return n; + } + + @Override public Node visit(final LongLiteralExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final LongLiteralMinValueExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final MarkerAnnotationExpr n, final A arg) { + visitComment(n, arg); + n.setName((NameExpr) n.getName().accept(this, arg)); + return n; + } + + @Override public Node visit(final MemberValuePair n, final A arg) { + visitComment(n, arg); + n.setValue((Expression) n.getValue().accept(this, arg)); + return n; + } + + @Override public Node visit(final MethodCallExpr n, final A arg) { + visitComment(n, arg); + if (n.getScope() != null) { + n.setScope((Expression) n.getScope().accept(this, arg)); + } final List> typeArguments = n.getTypeArguments(); if (typeArguments != null) { for (int i = 0; i < typeArguments.size(); i++) { @@ -752,86 +704,81 @@ public Node visit(final MethodCallExpr n, final A arg) { } removeNulls(typeArguments); } - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - return n; - } - - @Override - public Node visit(final MethodDeclaration n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - n.setElementType((Type) n.getElementType().accept(this, arg)); - final List parameters = n.getParameters(); - if (parameters != null) { - for (int i = 0; i < parameters.size(); i++) { - parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); - } - removeNulls(parameters); - } - final List throwz = n.getThrows(); - if (throwz != null) { - for (int i = 0; i < throwz.size(); i++) { - throwz.set(i, (ReferenceType) throwz.get(i).accept(this, arg)); - } - removeNulls(throwz); - } - if (n.getBody() != null) { - n.setBody((BlockStmt) n.getBody().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final NameExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final NormalAnnotationExpr n, final A arg) { - visitComment(n, arg); - n.setName((NameExpr) n.getName().accept(this, arg)); - final List pairs = n.getPairs(); - if (pairs != null) { - for (int i = 0; i < pairs.size(); i++) { - pairs.set(i, (MemberValuePair) pairs.get(i).accept(this, arg)); - } - removeNulls(pairs); - } - return n; - } - - @Override - public Node visit(final NullLiteralExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final ObjectCreationExpr n, final A arg) { - visitComment(n, arg); - if (n.getScope() != null) { - n.setScope((Expression) n.getScope().accept(this, arg)); - } + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } + return n; + } + + @Override public Node visit(final MethodDeclaration n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List typeParameters = n.getTypeParameters(); + if (typeParameters != null) { + for (int i = 0; i < typeParameters.size(); i++) { + typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); + } + removeNulls(typeParameters); + } + n.setElementType((Type) n.getElementType().accept(this, arg)); + final List parameters = n.getParameters(); + if (parameters != null) { + for (int i = 0; i < parameters.size(); i++) { + parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); + } + removeNulls(parameters); + } + final List throwz = n.getThrows(); + if (throwz != null) { + for (int i = 0; i < throwz.size(); i++) { + throwz.set(i, (ReferenceType) throwz.get(i).accept(this, arg)); + } + removeNulls(throwz); + } + if (n.getBody() != null) { + n.setBody((BlockStmt) n.getBody().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final NameExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final NormalAnnotationExpr n, final A arg) { + visitComment(n, arg); + n.setName((NameExpr) n.getName().accept(this, arg)); + final List pairs = n.getPairs(); + if (pairs != null) { + for (int i = 0; i < pairs.size(); i++) { + pairs.set(i, (MemberValuePair) pairs.get(i).accept(this, arg)); + } + removeNulls(pairs); + } + return n; + } + + @Override public Node visit(final NullLiteralExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final ObjectCreationExpr n, final A arg) { + visitComment(n, arg); + if (n.getScope() != null) { + n.setScope((Expression) n.getScope().accept(this, arg)); + } final List> typeArguments = n.getTypeArguments(); if (typeArguments != null) { for (int i = 0; i < typeArguments.size(); i++) { @@ -839,83 +786,79 @@ public Node visit(final ObjectCreationExpr n, final A arg) { } removeNulls(typeArguments); } - n.setType((ClassOrInterfaceType) n.getType().accept(this, arg)); - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } + n.setType((ClassOrInterfaceType) n.getType().accept(this, arg)); + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } final List> anonymousClassBody = n.getAnonymousClassBody(); - if (anonymousClassBody != null) { - for (int i = 0; i < anonymousClassBody.size(); i++) { + if (anonymousClassBody != null) { + for (int i = 0; i < anonymousClassBody.size(); i++) { anonymousClassBody.set(i, (BodyDeclaration) anonymousClassBody.get(i).accept(this, arg)); - } - removeNulls(anonymousClassBody); - } - return n; - } - - @Override - public Node visit(final PackageDeclaration n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(final Parameter n, final A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); - n.setElementType((Type) n.getElementType().accept(this, arg)); - return n; - } - - @Override - public Node visit(final PrimitiveType n, final A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - return n; - } - - @Override - public Node visit(final QualifiedNameExpr n, final A arg) { - visitComment(n, arg); - n.setQualifier((NameExpr) n.getQualifier().accept(this, arg)); - return n; - } - - @Override - public Node visit(ArrayType n, A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - n.setComponentType((Type) n.getComponentType().accept(this, arg)); - return n; - } - - @Override - public Node visit(ArrayCreationLevel n, A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - if (n.getDimension() != null) { - n.setDimension((Expression) n.getDimension().accept(this, arg)); - } - return n; - } - - @Override + } + removeNulls(anonymousClassBody); + } + return n; + } + + @Override public Node visit(final PackageDeclaration n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + n.setName((NameExpr) n.getName().accept(this, arg)); + return n; + } + + @Override public Node visit(final Parameter n, final A arg) { + visitComment(n, arg); + visitAnnotations(n, arg); + n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); + n.setElementType((Type) n.getElementType().accept(this, arg)); + return n; + } + + @Override public Node visit(final PrimitiveType n, final A arg) { + visitComment(n, arg); + visitAnnotations(n, arg); + return n; + } + + @Override public Node visit(final QualifiedNameExpr n, final A arg) { + visitComment(n, arg); + n.setQualifier((NameExpr) n.getQualifier().accept(this, arg)); + return n; + } + + @Override + public Node visit(ArrayType n, A arg) { + visitComment(n, arg); + visitAnnotations(n, arg); + n.setComponentType((Type) n.getComponentType().accept(this, arg)); + return n; + } + + @Override + public Node visit(ArrayCreationLevel n, A arg) { + visitComment(n, arg); + visitAnnotations(n, arg); + if(n.getDimension()!=null) { + n.setDimension((Expression) n.getDimension().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final IntersectionType n, final A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); + visitComment(n, arg); + visitAnnotations(n, arg); final List elements = n.getElements(); if (elements != null) { for (int i = 0; i < elements.size(); i++) { @@ -928,9 +871,9 @@ public Node visit(final IntersectionType n, final A arg) { @Override public Node visit(final UnionType n, final A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - final List elements = n.getElements(); + visitComment(n, arg); + visitAnnotations(n, arg); + final List elements = n.getElements(); if (elements != null) { for (int i = 0; i < elements.size(); i++) { elements.set(i, (ReferenceType) elements.get(i).accept(this, arg)); @@ -940,287 +883,267 @@ public Node visit(final UnionType n, final A arg) { return n; } - @Override - public Node visit(final ReturnStmt n, final A arg) { - visitComment(n, arg); - if (n.getExpr() != null) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final SingleMemberAnnotationExpr n, final A arg) { - visitComment(n, arg); - n.setName((NameExpr) n.getName().accept(this, arg)); - n.setMemberValue((Expression) n.getMemberValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(final StringLiteralExpr n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final SuperExpr n, final A arg) { - visitComment(n, arg); - if (n.getClassExpr() != null) { - n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final SwitchEntryStmt n, final A arg) { - visitComment(n, arg); - if (n.getLabel() != null) { - n.setLabel((Expression) n.getLabel().accept(this, arg)); - } - final List stmts = n.getStmts(); - if (stmts != null) { - for (int i = 0; i < stmts.size(); i++) { - stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); - } - removeNulls(stmts); - } - return n; - } - - @Override - public Node visit(final SwitchStmt n, final A arg) { - visitComment(n, arg); - n.setSelector((Expression) n.getSelector().accept(this, arg)); - final List entries = n.getEntries(); - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - entries.set(i, (SwitchEntryStmt) entries.get(i).accept(this, arg)); - } - removeNulls(entries); - } - return n; - - } - - @Override - public Node visit(final SynchronizedStmt n, final A arg) { - visitComment(n, arg); - n.setExpr((Expression) n.getExpr().accept(this, arg)); - n.setBody((BlockStmt) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ThisExpr n, final A arg) { - visitComment(n, arg); - if (n.getClassExpr() != null) { - n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ThrowStmt n, final A arg) { - visitComment(n, arg); - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(final TryStmt n, final A arg) { - visitComment(n, arg); - final List types = n.getResources(); - for (int i = 0; i < types.size(); i++) { - n.getResources().set(i, - (VariableDeclarationExpr) n.getResources().get(i).accept(this, arg)); - } - n.setTryBlock((BlockStmt) n.getTryBlock().accept(this, arg)); - final List catchs = n.getCatchs(); - if (catchs != null) { - for (int i = 0; i < catchs.size(); i++) { - catchs.set(i, (CatchClause) catchs.get(i).accept(this, arg)); - } - removeNulls(catchs); - } - if (n.getFinallyBlock() != null) { - n.setFinallyBlock((BlockStmt) n.getFinallyBlock().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final TypeDeclarationStmt n, final A arg) { - visitComment(n, arg); - n.setTypeDeclaration((TypeDeclaration) n.getTypeDeclaration().accept(this, arg)); - return n; - } - - @Override - public Node visit(final TypeParameter n, final A arg) { - visitComment(n, arg); - final List typeBound = n.getTypeBound(); - if (typeBound != null) { - for (int i = 0; i < typeBound.size(); i++) { - typeBound.set(i, (ClassOrInterfaceType) typeBound.get(i).accept(this, arg)); - } - removeNulls(typeBound); - } - return n; - } - - @Override - public Node visit(final UnaryExpr n, final A arg) { - visitComment(n, arg); - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(final UnknownType n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final VariableDeclarationExpr n, final A arg) { - visitComment(n, arg); - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - - final Type type = (Type) n.getElementType().accept(this, arg); - if (type == null) { - return null; - } - n.setElementType(type); - - final List vars = n.getVariables(); - for (int i = 0; i < vars.size(); ) { - final VariableDeclarator decl = (VariableDeclarator) - vars.get(i).accept(this, arg); - if (decl == null) { - vars.remove(i); - } else { - vars.set(i++, decl); - } - } - if (vars.isEmpty()) { - return null; - } - - return n; - } - - @Override - public Node visit(final VariableDeclarator n, final A arg) { - visitComment(n, arg); - final VariableDeclaratorId id = (VariableDeclaratorId) - n.getId().accept(this, arg); - if (id == null) { - return null; - } - n.setId(id); - if (n.getInit() != null) { - n.setInit((Expression) n.getInit().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final VariableDeclaratorId n, final A arg) { - visitComment(n, arg); - return n; - } - - @Override - public Node visit(final VoidType n, final A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - return n; - } - - @Override - public Node visit(final WhileStmt n, final A arg) { - visitComment(n, arg); - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final WildcardType n, final A arg) { - visitComment(n, arg); - visitAnnotations(n, arg); - if (n.getExtends() != null) { - n.setExtends((ReferenceType) n.getExtends().accept(this, arg)); - } - if (n.getSuper() != null) { - n.setSuper((ReferenceType) n.getSuper().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final LambdaExpr n, final A arg) { - visitComment(n, arg); - final List parameters = n.getParameters(); - for (int i = 0; i < parameters.size(); i++) { - parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); - } - removeNulls(parameters); - if (n.getBody() != null) { - n.setBody((Statement) n.getBody().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final MethodReferenceExpr n, final A arg) { - visitComment(n, arg); - final List> types = n.getTypeArguments(); - for (int i = 0; i < types.size(); i++) { - n.getTypeArguments().set(i, - (Type) n.getTypeArguments().get(i).accept(this, arg)); - } - if (n.getScope() != null) { - n.setScope((Expression) n.getScope().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final TypeExpr n, final A arg) { - visitComment(n, arg); - if (n.getType() != null) { + @Override public Node visit(final ReturnStmt n, final A arg) { + visitComment(n, arg); + if (n.getExpr() != null) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final SingleMemberAnnotationExpr n, final A arg) { + visitComment(n, arg); + n.setName((NameExpr) n.getName().accept(this, arg)); + n.setMemberValue((Expression) n.getMemberValue().accept(this, arg)); + return n; + } + + @Override public Node visit(final StringLiteralExpr n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final SuperExpr n, final A arg) { + visitComment(n, arg); + if (n.getClassExpr() != null) { + n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final SwitchEntryStmt n, final A arg) { + visitComment(n, arg); + if (n.getLabel() != null) { + n.setLabel((Expression) n.getLabel().accept(this, arg)); + } + final List stmts = n.getStmts(); + if (stmts != null) { + for (int i = 0; i < stmts.size(); i++) { + stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); + } + removeNulls(stmts); + } + return n; + } + + @Override public Node visit(final SwitchStmt n, final A arg) { + visitComment(n, arg); + n.setSelector((Expression) n.getSelector().accept(this, arg)); + final List entries = n.getEntries(); + if (entries != null) { + for (int i = 0; i < entries.size(); i++) { + entries.set(i, (SwitchEntryStmt) entries.get(i).accept(this, arg)); + } + removeNulls(entries); + } + return n; + + } + + @Override public Node visit(final SynchronizedStmt n, final A arg) { + visitComment(n, arg); + n.setExpr((Expression) n.getExpr().accept(this, arg)); + n.setBody((BlockStmt) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final ThisExpr n, final A arg) { + visitComment(n, arg); + if (n.getClassExpr() != null) { + n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ThrowStmt n, final A arg) { + visitComment(n, arg); + n.setExpr((Expression) n.getExpr().accept(this, arg)); + return n; + } + + @Override public Node visit(final TryStmt n, final A arg) { + visitComment(n, arg); + final List types = n.getResources(); + for (int i = 0; i < types.size(); i++) { + n.getResources().set(i, + (VariableDeclarationExpr) n.getResources().get(i).accept(this, arg)); + } + n.setTryBlock((BlockStmt) n.getTryBlock().accept(this, arg)); + final List catchs = n.getCatchs(); + if (catchs != null) { + for (int i = 0; i < catchs.size(); i++) { + catchs.set(i, (CatchClause) catchs.get(i).accept(this, arg)); + } + removeNulls(catchs); + } + if (n.getFinallyBlock() != null) { + n.setFinallyBlock((BlockStmt) n.getFinallyBlock().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final TypeDeclarationStmt n, final A arg) { + visitComment(n, arg); + n.setTypeDeclaration((TypeDeclaration) n.getTypeDeclaration().accept(this, arg)); + return n; + } + + @Override public Node visit(final TypeParameter n, final A arg) { + visitComment(n, arg); + final List typeBound = n.getTypeBound(); + if (typeBound != null) { + for (int i = 0; i < typeBound.size(); i++) { + typeBound.set(i, (ClassOrInterfaceType) typeBound.get(i).accept(this, arg)); + } + removeNulls(typeBound); + } + return n; + } + + @Override public Node visit(final UnaryExpr n, final A arg) { + visitComment(n, arg); + n.setExpr((Expression) n.getExpr().accept(this, arg)); + return n; + } + + @Override public Node visit(final UnknownType n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final VariableDeclarationExpr n, final A arg) { + visitComment(n, arg); + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + + final Type type = (Type) n.getElementType().accept(this, arg); + if (type == null) { + return null; + } + n.setElementType(type); + + final List vars = n.getVariables(); + for (int i = 0; i < vars.size();) { + final VariableDeclarator decl = (VariableDeclarator) + vars.get(i).accept(this, arg); + if (decl == null) { + vars.remove(i); + } else { + vars.set(i++, decl); + } + } + if (vars.isEmpty()) { + return null; + } + + return n; + } + + @Override public Node visit(final VariableDeclarator n, final A arg) { + visitComment(n, arg); + final VariableDeclaratorId id = (VariableDeclaratorId) + n.getId().accept(this, arg); + if (id == null) { + return null; + } + n.setId(id); + if (n.getInit() != null) { + n.setInit((Expression) n.getInit().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final VariableDeclaratorId n, final A arg) { + visitComment(n, arg); + return n; + } + + @Override public Node visit(final VoidType n, final A arg) { + visitComment(n, arg); + visitAnnotations(n, arg); + return n; + } + + @Override public Node visit(final WhileStmt n, final A arg) { + visitComment(n, arg); + n.setCondition((Expression) n.getCondition().accept(this, arg)); + n.setBody((Statement) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final WildcardType n, final A arg) { + visitComment(n, arg); + visitAnnotations(n, arg); + if (n.getExtends() != null) { + n.setExtends((ReferenceType) n.getExtends().accept(this, arg)); + } + if (n.getSuper() != null) { + n.setSuper((ReferenceType) n.getSuper().accept(this, arg)); + } + return n; + } + + @Override + public Node visit(final LambdaExpr n, final A arg) { + visitComment(n, arg); + final List parameters = n.getParameters(); + for (int i = 0; i < parameters.size(); i++) { + parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); + } + removeNulls(parameters); + if (n.getBody() != null) { + n.setBody((Statement) n.getBody().accept(this, arg)); + } + return n; + } + + @Override + public Node visit(final MethodReferenceExpr n, final A arg) { + visitComment(n, arg); + final List> types = n.getTypeArguments(); + for (int i = 0; i < types.size(); i++) { + n.getTypeArguments().set(i, + (Type) n.getTypeArguments().get(i).accept(this, arg)); + } + if (n.getScope() != null) { + n.setScope((Expression)n.getScope().accept(this, arg)); + } + return n; + } + + @Override + public Node visit(final TypeExpr n, final A arg) { + visitComment(n, arg); + if (n.getType() != null) { n.setType((Type) n.getType().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(ArrayBracketPair n, A arg) { - visitAnnotations(n, arg); - return n; - } - - @Override - public Node visit(final BlockComment n, final A arg) { - return n; - } - - @Override - public Node visit(final LineComment n, final A arg) { - return n; - } - - private void visitComment(Node n, final A arg) { - if (n != null && n.getComment() != null) { - n.setComment((Comment) n.getComment().accept(this, arg)); - } - } + } + return n; + } + + @Override + public Node visit(ArrayBracketPair n, A arg) { + visitAnnotations(n, arg); + return n; + } + + @Override + public Node visit(final BlockComment n, final A arg) { + return n; + } + + @Override + public Node visit(final LineComment n, final A arg) { + return n; + } + + private void visitComment(Node n, final A arg) { + if (n != null && n.getComment() != null) { + n.setComment((Comment) n.getComment().accept(this, arg)); + } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/TreeVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/TreeVisitor.java index 946230cc70..c1b7eaee61 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/TreeVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/TreeVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -28,17 +28,17 @@ */ public abstract class TreeVisitor { - /** - * https://en.wikipedia.org/wiki/Depth-first_search - * - * @param node the start node, and the first one that is passed to process(node). - */ - public void visitDepthFirst(Node node) { - process(node); - for (Node child : node.getChildrenNodes()) { - visitDepthFirst(child); - } - } + /** + * https://en.wikipedia.org/wiki/Depth-first_search + * + * @param node the start node, and the first one that is passed to process(node). + */ + public void visitDepthFirst(Node node) { + process(node); + for (Node child : node.getChildrenNodes()) { + visitDepthFirst(child); + } + } - public abstract void process(Node node); + public abstract void process(Node node); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitor.java index 2de6f91abe..ec1d0f6a61 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.*; @@ -66,186 +66,186 @@ /** * A visitor that does not return anything. - * + * * @author Julio Vilmar Gesser */ public interface VoidVisitor { - //- Compilation Unit ---------------------------------- - - void visit(CompilationUnit n, A arg); - - void visit(PackageDeclaration n, A arg); + //- Compilation Unit ---------------------------------- - void visit(ImportDeclaration n, A arg); + void visit(CompilationUnit n, A arg); - void visit(TypeParameter n, A arg); + void visit(PackageDeclaration n, A arg); - void visit(LineComment n, A arg); + void visit(ImportDeclaration n, A arg); - void visit(BlockComment n, A arg); + void visit(TypeParameter n, A arg); - //- Body ---------------------------------------------- + void visit(LineComment n, A arg); - void visit(ClassOrInterfaceDeclaration n, A arg); + void visit(BlockComment n, A arg); - void visit(EnumDeclaration n, A arg); + //- Body ---------------------------------------------- - void visit(EmptyTypeDeclaration n, A arg); + void visit(ClassOrInterfaceDeclaration n, A arg); - void visit(EnumConstantDeclaration n, A arg); + void visit(EnumDeclaration n, A arg); - void visit(AnnotationDeclaration n, A arg); + void visit(EmptyTypeDeclaration n, A arg); - void visit(AnnotationMemberDeclaration n, A arg); + void visit(EnumConstantDeclaration n, A arg); - void visit(FieldDeclaration n, A arg); + void visit(AnnotationDeclaration n, A arg); - void visit(VariableDeclarator n, A arg); + void visit(AnnotationMemberDeclaration n, A arg); - void visit(VariableDeclaratorId n, A arg); + void visit(FieldDeclaration n, A arg); - void visit(ConstructorDeclaration n, A arg); + void visit(VariableDeclarator n, A arg); - void visit(MethodDeclaration n, A arg); + void visit(VariableDeclaratorId n, A arg); - void visit(Parameter n, A arg); + void visit(ConstructorDeclaration n, A arg); - void visit(EmptyMemberDeclaration n, A arg); + void visit(MethodDeclaration n, A arg); - void visit(InitializerDeclaration n, A arg); + void visit(Parameter n, A arg); + + void visit(EmptyMemberDeclaration n, A arg); - void visit(JavadocComment n, A arg); + void visit(InitializerDeclaration n, A arg); - //- Type ---------------------------------------------- + void visit(JavadocComment n, A arg); - void visit(ClassOrInterfaceType n, A arg); + //- Type ---------------------------------------------- - void visit(PrimitiveType n, A arg); + void visit(ClassOrInterfaceType n, A arg); - void visit(ArrayType n, A arg); + void visit(PrimitiveType n, A arg); - void visit(ArrayCreationLevel n, A arg); + void visit(ArrayType n, A arg); + + void visit(ArrayCreationLevel n, A arg); void visit(IntersectionType n, A arg); void visit(UnionType n, A arg); - void visit(VoidType n, A arg); + void visit(VoidType n, A arg); - void visit(WildcardType n, A arg); + void visit(WildcardType n, A arg); - void visit(UnknownType n, A arg); + void visit(UnknownType n, A arg); - //- Expression ---------------------------------------- + //- Expression ---------------------------------------- - void visit(ArrayAccessExpr n, A arg); + void visit(ArrayAccessExpr n, A arg); - void visit(ArrayCreationExpr n, A arg); + void visit(ArrayCreationExpr n, A arg); - void visit(ArrayInitializerExpr n, A arg); + void visit(ArrayInitializerExpr n, A arg); - void visit(AssignExpr n, A arg); + void visit(AssignExpr n, A arg); - void visit(BinaryExpr n, A arg); + void visit(BinaryExpr n, A arg); - void visit(CastExpr n, A arg); + void visit(CastExpr n, A arg); - void visit(ClassExpr n, A arg); + void visit(ClassExpr n, A arg); - void visit(ConditionalExpr n, A arg); + void visit(ConditionalExpr n, A arg); - void visit(EnclosedExpr n, A arg); + void visit(EnclosedExpr n, A arg); - void visit(FieldAccessExpr n, A arg); + void visit(FieldAccessExpr n, A arg); - void visit(InstanceOfExpr n, A arg); + void visit(InstanceOfExpr n, A arg); - void visit(StringLiteralExpr n, A arg); + void visit(StringLiteralExpr n, A arg); - void visit(IntegerLiteralExpr n, A arg); + void visit(IntegerLiteralExpr n, A arg); - void visit(LongLiteralExpr n, A arg); + void visit(LongLiteralExpr n, A arg); - void visit(IntegerLiteralMinValueExpr n, A arg); + void visit(IntegerLiteralMinValueExpr n, A arg); - void visit(LongLiteralMinValueExpr n, A arg); + void visit(LongLiteralMinValueExpr n, A arg); - void visit(CharLiteralExpr n, A arg); + void visit(CharLiteralExpr n, A arg); - void visit(DoubleLiteralExpr n, A arg); + void visit(DoubleLiteralExpr n, A arg); - void visit(BooleanLiteralExpr n, A arg); + void visit(BooleanLiteralExpr n, A arg); - void visit(NullLiteralExpr n, A arg); + void visit(NullLiteralExpr n, A arg); - void visit(MethodCallExpr n, A arg); + void visit(MethodCallExpr n, A arg); - void visit(NameExpr n, A arg); + void visit(NameExpr n, A arg); - void visit(ObjectCreationExpr n, A arg); + void visit(ObjectCreationExpr n, A arg); - void visit(QualifiedNameExpr n, A arg); + void visit(QualifiedNameExpr n, A arg); - void visit(ThisExpr n, A arg); + void visit(ThisExpr n, A arg); - void visit(SuperExpr n, A arg); + void visit(SuperExpr n, A arg); - void visit(UnaryExpr n, A arg); + void visit(UnaryExpr n, A arg); - void visit(VariableDeclarationExpr n, A arg); + void visit(VariableDeclarationExpr n, A arg); - void visit(MarkerAnnotationExpr n, A arg); + void visit(MarkerAnnotationExpr n, A arg); - void visit(SingleMemberAnnotationExpr n, A arg); + void visit(SingleMemberAnnotationExpr n, A arg); - void visit(NormalAnnotationExpr n, A arg); + void visit(NormalAnnotationExpr n, A arg); - void visit(MemberValuePair n, A arg); + void visit(MemberValuePair n, A arg); - //- Statements ---------------------------------------- + //- Statements ---------------------------------------- - void visit(ExplicitConstructorInvocationStmt n, A arg); + void visit(ExplicitConstructorInvocationStmt n, A arg); - void visit(TypeDeclarationStmt n, A arg); + void visit(TypeDeclarationStmt n, A arg); - void visit(AssertStmt n, A arg); + void visit(AssertStmt n, A arg); - void visit(BlockStmt n, A arg); + void visit(BlockStmt n, A arg); - void visit(LabeledStmt n, A arg); + void visit(LabeledStmt n, A arg); - void visit(EmptyStmt n, A arg); + void visit(EmptyStmt n, A arg); - void visit(ExpressionStmt n, A arg); + void visit(ExpressionStmt n, A arg); - void visit(SwitchStmt n, A arg); + void visit(SwitchStmt n, A arg); - void visit(SwitchEntryStmt n, A arg); + void visit(SwitchEntryStmt n, A arg); - void visit(BreakStmt n, A arg); + void visit(BreakStmt n, A arg); - void visit(ReturnStmt n, A arg); + void visit(ReturnStmt n, A arg); - void visit(IfStmt n, A arg); + void visit(IfStmt n, A arg); - void visit(WhileStmt n, A arg); + void visit(WhileStmt n, A arg); - void visit(ContinueStmt n, A arg); + void visit(ContinueStmt n, A arg); - void visit(DoStmt n, A arg); + void visit(DoStmt n, A arg); - void visit(ForeachStmt n, A arg); + void visit(ForeachStmt n, A arg); - void visit(ForStmt n, A arg); + void visit(ForStmt n, A arg); - void visit(ThrowStmt n, A arg); + void visit(ThrowStmt n, A arg); - void visit(SynchronizedStmt n, A arg); + void visit(SynchronizedStmt n, A arg); - void visit(TryStmt n, A arg); + void visit(TryStmt n, A arg); - void visit(CatchClause n, A arg); + void visit(CatchClause n, A arg); void visit(LambdaExpr n, A arg); @@ -253,5 +253,5 @@ public interface VoidVisitor { void visit(TypeExpr n, A arg); - void visit(ArrayBracketPair arrayBracketPair, A arg); + void visit(ArrayBracketPair arrayBracketPair, A arg); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java index 70c862a373..cab3ef4962 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.*; @@ -89,754 +89,673 @@ */ public abstract class VoidVisitorAdapter implements VoidVisitor { - @Override - public void visit(final AnnotationDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getNameExpr().accept(this, arg); - if (n.getMembers() != null) { + @Override public void visit(final AnnotationDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getNameExpr().accept(this, arg); + if (n.getMembers() != null) { for (final BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final AnnotationMemberDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getType().accept(this, arg); - if (n.getDefaultValue() != null) { - n.getDefaultValue().accept(this, arg); - } - } - - @Override - public void visit(final ArrayAccessExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - n.getIndex().accept(this, arg); - } - - @Override - public void visit(final ArrayCreationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getType().accept(this, arg); - for (ArrayCreationLevel level : n.getLevels()) { - level.accept(this, arg); - } - if (n.getInitializer() != null) { - n.getInitializer().accept(this, arg); - } - } - - @Override - public void visit(final ArrayInitializerExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getValues() != null) { - for (final Expression expr : n.getValues()) { - expr.accept(this, arg); - } - } - } - - @Override - public void visit(final AssertStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - n.getMessage().accept(this, arg); - } - } - - @Override - public void visit(final AssignExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getTarget().accept(this, arg); - n.getValue().accept(this, arg); - } - - @Override - public void visit(final BinaryExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getLeft().accept(this, arg); - n.getRight().accept(this, arg); - } - - @Override - public void visit(final BlockComment n, final A arg) { - } - - @Override - public void visit(final BlockStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(final BooleanLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final BreakStmt n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final CastExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getType().accept(this, arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final CatchClause n, final A arg) { - visitComment(n.getComment(), arg); - n.getParam().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final CharLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final ClassExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getType().accept(this, arg); - } - - @Override - public void visit(final ClassOrInterfaceDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getNameExpr().accept(this, arg); - for (final TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - for (final ClassOrInterfaceType c : n.getExtends()) { - c.accept(this, arg); - } - for (final ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } + member.accept(this, arg); + } + } + } + + @Override public void visit(final AnnotationMemberDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getType().accept(this, arg); + if (n.getDefaultValue() != null) { + n.getDefaultValue().accept(this, arg); + } + } + + @Override public void visit(final ArrayAccessExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + n.getIndex().accept(this, arg); + } + + @Override public void visit(final ArrayCreationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getType().accept(this, arg); + for (ArrayCreationLevel level : n.getLevels()) { + level.accept(this, arg); + } + if (n.getInitializer() != null) { + n.getInitializer().accept(this, arg); + } + } + + @Override public void visit(final ArrayInitializerExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getValues() != null) { + for (final Expression expr : n.getValues()) { + expr.accept(this, arg); + } + } + } + + @Override public void visit(final AssertStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getCheck().accept(this, arg); + if (n.getMessage() != null) { + n.getMessage().accept(this, arg); + } + } + + @Override public void visit(final AssignExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getTarget().accept(this, arg); + n.getValue().accept(this, arg); + } + + @Override public void visit(final BinaryExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getLeft().accept(this, arg); + n.getRight().accept(this, arg); + } + + @Override public void visit(final BlockComment n, final A arg) { + } + + @Override public void visit(final BlockStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + } + + @Override public void visit(final BooleanLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final BreakStmt n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final CastExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getType().accept(this, arg); + n.getExpr().accept(this, arg); + } + + @Override public void visit(final CatchClause n, final A arg) { + visitComment(n.getComment(), arg); + n.getParam().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override public void visit(final CharLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final ClassExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getType().accept(this, arg); + } + + @Override public void visit(final ClassOrInterfaceDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getNameExpr().accept(this, arg); + for (final TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + for (final ClassOrInterfaceType c : n.getExtends()) { + c.accept(this, arg); + } + for (final ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } for (final BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - - @Override - public void visit(final ClassOrInterfaceType n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArguments() != null) { - for (final Type t : n.getTypeArguments()) { - t.accept(this, arg); - } - } - } - - @Override - public void visit(final CompilationUnit n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getPackage() != null) { - n.getPackage().accept(this, arg); - } - if (n.getImports() != null) { - for (final ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - } - if (n.getTypes() != null) { + member.accept(this, arg); + } + } + + @Override public void visit(final ClassOrInterfaceType n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArguments() != null) { + for (final Type t : n.getTypeArguments()) { + t.accept(this, arg); + } + } + } + + @Override public void visit(final CompilationUnit n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getPackage() != null) { + n.getPackage().accept(this, arg); + } + if (n.getImports() != null) { + for (final ImportDeclaration i : n.getImports()) { + i.accept(this, arg); + } + } + if (n.getTypes() != null) { for (final TypeDeclaration typeDeclaration : n.getTypes()) { - typeDeclaration.accept(this, arg); - } - } - } - - @Override - public void visit(final ConditionalExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - n.getThenExpr().accept(this, arg); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(final ConstructorDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - n.getNameExpr().accept(this, arg); - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (final ReferenceType name : n.getThrows()) { - name.accept(this, arg); - } - } - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ContinueStmt n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final DoStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getBody().accept(this, arg); - n.getCondition().accept(this, arg); - } - - @Override - public void visit(final DoubleLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final EmptyMemberDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final EmptyStmt n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final EmptyTypeDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - n.getNameExpr().accept(this, arg); - } - - @Override - public void visit(final EnclosedExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getInner().accept(this, arg); - } - - @Override - public void visit(final EnumConstantDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getClassBody() != null) { + typeDeclaration.accept(this, arg); + } + } + } + + @Override public void visit(final ConditionalExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + n.getThenExpr().accept(this, arg); + n.getElseExpr().accept(this, arg); + } + + @Override public void visit(final ConstructorDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + n.getNameExpr().accept(this, arg); + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (final ReferenceType name : n.getThrows()) { + name.accept(this, arg); + } + } + n.getBody().accept(this, arg); + } + + @Override public void visit(final ContinueStmt n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final DoStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getBody().accept(this, arg); + n.getCondition().accept(this, arg); + } + + @Override public void visit(final DoubleLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final EmptyMemberDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final EmptyStmt n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final EmptyTypeDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + n.getNameExpr().accept(this, arg); + } + + @Override public void visit(final EnclosedExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getInner().accept(this, arg); + } + + @Override public void visit(final EnumConstantDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getClassBody() != null) { for (final BodyDeclaration member : n.getClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final EnumDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getNameExpr().accept(this, arg); - if (n.getImplements() != null) { - for (final ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getEntries() != null) { - for (final EnumConstantDeclaration e : n.getEntries()) { - e.accept(this, arg); - } - } - if (n.getMembers() != null) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final EnumDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getNameExpr().accept(this, arg); + if (n.getImplements() != null) { + for (final ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } + } + if (n.getEntries() != null) { + for (final EnumConstantDeclaration e : n.getEntries()) { + e.accept(this, arg); + } + } + if (n.getMembers() != null) { for (final BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (!n.isThis() && n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - if (n.getTypeArguments() != null) { - for (final Type t : n.getTypeArguments()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(final ExpressionStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpression().accept(this, arg); - } - - @Override - public void visit(final FieldAccessExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getScope().accept(this, arg); - n.getFieldExpr().accept(this, arg); - } - - @Override - public void visit(final FieldDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getElementType().accept(this, arg); - for (final VariableDeclarator var : n.getVariables()) { - var.accept(this, arg); - } - } - - @Override - public void visit(final ForeachStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getVariable().accept(this, arg); - n.getIterable().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ForStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getInit() != null) { - for (final Expression e : n.getInit()) { - e.accept(this, arg); - } - } - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - if (n.getUpdate() != null) { - for (final Expression e : n.getUpdate()) { - e.accept(this, arg); - } - } - n.getBody().accept(this, arg); - } - - @Override - public void visit(final IfStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - n.getElseStmt().accept(this, arg); - } - } - - @Override - public void visit(final ImportDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - } - - @Override - public void visit(final InitializerDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final InstanceOfExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - n.getType().accept(this, arg); - } - - @Override - public void visit(final IntegerLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final IntegerLiteralMinValueExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final JavadocComment n, final A arg) { - } - - @Override - public void visit(final LabeledStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getStmt().accept(this, arg); - } - - @Override - public void visit(final LineComment n, final A arg) { - } - - @Override - public void visit(final LongLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final LongLiteralMinValueExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final MarkerAnnotationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - } - - @Override - public void visit(final MemberValuePair n, final A arg) { - visitComment(n.getComment(), arg); - n.getValue().accept(this, arg); - } - - @Override - public void visit(final MethodCallExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArguments() != null) { - for (final Type t : n.getTypeArguments()) { - t.accept(this, arg); - } - } - n.getNameExpr().accept(this, arg); - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(final MethodDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - n.getElementType().accept(this, arg); - n.getNameExpr().accept(this, arg); - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (final ReferenceType name : n.getThrows()) { - name.accept(this, arg); - } - } - if (n.getBody() != null) { - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(final NameExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final NormalAnnotationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - if (n.getPairs() != null) { - for (final MemberValuePair m : n.getPairs()) { - m.accept(this, arg); - } - } - } - - @Override - public void visit(final NullLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final ObjectCreationExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArguments() != null) { - for (final Type t : n.getTypeArguments()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getAnonymousClassBody() != null) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (!n.isThis() && n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + if (n.getTypeArguments() != null) { + for (final Type t : n.getTypeArguments()) { + t.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + } + + @Override public void visit(final ExpressionStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpression().accept(this, arg); + } + + @Override public void visit(final FieldAccessExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getScope().accept(this, arg); + n.getFieldExpr().accept(this, arg); + } + + @Override public void visit(final FieldDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getElementType().accept(this, arg); + for (final VariableDeclarator var : n.getVariables()) { + var.accept(this, arg); + } + } + + @Override public void visit(final ForeachStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getVariable().accept(this, arg); + n.getIterable().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override public void visit(final ForStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getInit() != null) { + for (final Expression e : n.getInit()) { + e.accept(this, arg); + } + } + if (n.getCompare() != null) { + n.getCompare().accept(this, arg); + } + if (n.getUpdate() != null) { + for (final Expression e : n.getUpdate()) { + e.accept(this, arg); + } + } + n.getBody().accept(this, arg); + } + + @Override public void visit(final IfStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + n.getThenStmt().accept(this, arg); + if (n.getElseStmt() != null) { + n.getElseStmt().accept(this, arg); + } + } + + @Override public void visit(final ImportDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + } + + @Override public void visit(final InitializerDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + n.getBlock().accept(this, arg); + } + + @Override public void visit(final InstanceOfExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + n.getType().accept(this, arg); + } + + @Override public void visit(final IntegerLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final IntegerLiteralMinValueExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final JavadocComment n, final A arg) { + } + + @Override public void visit(final LabeledStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getStmt().accept(this, arg); + } + + @Override public void visit(final LineComment n, final A arg) { + } + + @Override public void visit(final LongLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final LongLiteralMinValueExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final MarkerAnnotationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + } + + @Override public void visit(final MemberValuePair n, final A arg) { + visitComment(n.getComment(), arg); + n.getValue().accept(this, arg); + } + + @Override public void visit(final MethodCallExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArguments() != null) { + for (final Type t : n.getTypeArguments()) { + t.accept(this, arg); + } + } + n.getNameExpr().accept(this, arg); + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + } + + @Override public void visit(final MethodDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + n.getElementType().accept(this, arg); + n.getNameExpr().accept(this, arg); + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (final ReferenceType name : n.getThrows()) { + name.accept(this, arg); + } + } + if (n.getBody() != null) { + n.getBody().accept(this, arg); + } + } + + @Override public void visit(final NameExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final NormalAnnotationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + if (n.getPairs() != null) { + for (final MemberValuePair m : n.getPairs()) { + m.accept(this, arg); + } + } + } + + @Override public void visit(final NullLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final ObjectCreationExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArguments() != null) { + for (final Type t : n.getTypeArguments()) { + t.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getAnonymousClassBody() != null) { for (final BodyDeclaration member : n.getAnonymousClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final PackageDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getName().accept(this, arg); - } - - @Override - public void visit(final Parameter n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getElementType().accept(this, arg); - n.getId().accept(this, arg); - } - - @Override - public void visit(final PrimitiveType n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - } - - @Override - public void visit(final QualifiedNameExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getQualifier().accept(this, arg); - } - - @Override - public void visit(ArrayType n, A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getComponentType().accept(this, arg); - } - - @Override - public void visit(ArrayCreationLevel n, A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - if (n.getDimension() != null) { - n.getDimension().accept(this, arg); - } - } - - @Override - public void visit(final IntersectionType n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - for (ReferenceType element : n.getElements()) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final PackageDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getName().accept(this, arg); + } + + @Override public void visit(final Parameter n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getElementType().accept(this, arg); + n.getId().accept(this, arg); + } + + @Override public void visit(final PrimitiveType n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + } + + @Override public void visit(final QualifiedNameExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getQualifier().accept(this, arg); + } + + @Override + public void visit(ArrayType n, A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getComponentType().accept(this, arg); + } + + @Override + public void visit(ArrayCreationLevel n, A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + if(n.getDimension()!=null) { + n.getDimension().accept(this, arg); + } + } + + @Override public void visit(final IntersectionType n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + for (ReferenceType element : n.getElements()) { element.accept(this, arg); } } - @Override - public void visit(final UnionType n, final A arg) { + @Override public void visit(final UnionType n, final A arg) { visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - for (ReferenceType element : n.getElements()) { + visitAnnotations(n, arg); + for (ReferenceType element : n.getElements()) { element.accept(this, arg); } } - @Override - public void visit(final ReturnStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - - @Override - public void visit(final SingleMemberAnnotationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - n.getMemberValue().accept(this, arg); - } - - @Override - public void visit(final StringLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final SuperExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(final SwitchEntryStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getLabel() != null) { - n.getLabel().accept(this, arg); - } - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(final SwitchStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getSelector().accept(this, arg); - if (n.getEntries() != null) { - for (final SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(final SynchronizedStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ThisExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(final ThrowStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final TryStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getResources() != null) { - for (final VariableDeclarationExpr v : n.getResources()) { - v.accept(this, arg); - } - } - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (final CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(final TypeDeclarationStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(final TypeParameter n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getTypeBound() != null) { - for (final ClassOrInterfaceType c : n.getTypeBound()) { - c.accept(this, arg); - } - } - } - - @Override - public void visit(final UnaryExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final UnknownType n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final VariableDeclarationExpr n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - n.getElementType().accept(this, arg); - for (final VariableDeclarator v : n.getVariables()) { - v.accept(this, arg); - } - } - - @Override - public void visit(final VariableDeclarator n, final A arg) { - visitComment(n.getComment(), arg); - n.getId().accept(this, arg); - if (n.getInit() != null) { - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(final VariableDeclaratorId n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final VoidType n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - - } - - @Override - public void visit(final WhileStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final WildcardType n, final A arg) { - visitComment(n.getComment(), arg); - visitAnnotations(n, arg); - if (n.getExtends() != null) { - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - n.getSuper().accept(this, arg); - } - } + @Override public void visit(final ReturnStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + } + + @Override public void visit(final SingleMemberAnnotationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + n.getMemberValue().accept(this, arg); + } + + @Override public void visit(final StringLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final SuperExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + } + + @Override public void visit(final SwitchEntryStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getLabel() != null) { + n.getLabel().accept(this, arg); + } + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + } + + @Override public void visit(final SwitchStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getSelector().accept(this, arg); + if (n.getEntries() != null) { + for (final SwitchEntryStmt e : n.getEntries()) { + e.accept(this, arg); + } + } + } + + @Override public void visit(final SynchronizedStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override public void visit(final ThisExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + } + + @Override public void visit(final ThrowStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + } + + @Override public void visit(final TryStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getResources() != null) { + for (final VariableDeclarationExpr v : n.getResources()) { + v.accept(this, arg); + } + } + n.getTryBlock().accept(this, arg); + if (n.getCatchs() != null) { + for (final CatchClause c : n.getCatchs()) { + c.accept(this, arg); + } + } + if (n.getFinallyBlock() != null) { + n.getFinallyBlock().accept(this, arg); + } + } + + @Override public void visit(final TypeDeclarationStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getTypeDeclaration().accept(this, arg); + } + + @Override public void visit(final TypeParameter n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getTypeBound() != null) { + for (final ClassOrInterfaceType c : n.getTypeBound()) { + c.accept(this, arg); + } + } + } + + @Override public void visit(final UnaryExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + } + + @Override public void visit(final UnknownType n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final VariableDeclarationExpr n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + n.getElementType().accept(this, arg); + for (final VariableDeclarator v : n.getVariables()) { + v.accept(this, arg); + } + } + + @Override public void visit(final VariableDeclarator n, final A arg) { + visitComment(n.getComment(), arg); + n.getId().accept(this, arg); + if (n.getInit() != null) { + n.getInit().accept(this, arg); + } + } + + @Override public void visit(final VariableDeclaratorId n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final VoidType n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + + } + + @Override public void visit(final WhileStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override public void visit(final WildcardType n, final A arg) { + visitComment(n.getComment(), arg); + visitAnnotations(n, arg); + if (n.getExtends() != null) { + n.getExtends().accept(this, arg); + } + if (n.getSuper() != null) { + n.getSuper().accept(this, arg); + } + } @Override public void visit(LambdaExpr n, final A arg) { - visitComment(n.getComment(), arg); + visitComment(n.getComment(), arg); if (n.getParameters() != null) { for (final Parameter a : n.getParameters()) { a.accept(this, arg); @@ -849,12 +768,12 @@ public void visit(LambdaExpr n, final A arg) { @Override public void visit(MethodReferenceExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getTypeArguments() != null) { - for (final Type t : n.getTypeArguments()) { - t.accept(this, arg); - } - } + visitComment(n.getComment(), arg); + if (n.getTypeArguments() != null) { + for (final Type t : n.getTypeArguments()) { + t.accept(this, arg); + } + } if (n.getScope() != null) { n.getScope().accept(this, arg); } @@ -862,26 +781,26 @@ public void visit(MethodReferenceExpr n, final A arg) { @Override public void visit(TypeExpr n, final A arg) { - visitComment(n.getComment(), arg); + visitComment(n.getComment(), arg); if (n.getType() != null) { n.getType().accept(this, arg); } } - @Override - public void visit(ArrayBracketPair n, A arg) { - visitAnnotations(n, arg); - } + @Override + public void visit(ArrayBracketPair n, A arg) { + visitAnnotations(n, arg); + } - private void visitComment(final Comment n, final A arg) { - if (n != null) { - n.accept(this, arg); - } - } + private void visitComment(final Comment n, final A arg) { + if (n != null) { + n.accept(this, arg); + } + } - private void visitAnnotations(NodeWithAnnotations n, A arg) { - for (AnnotationExpr annotation : n.getAnnotations()) { - annotation.accept(this, arg); - } - } + private void visitAnnotations(NodeWithAnnotations n, A arg) { + for (AnnotationExpr annotation : n.getAnnotations()) { + annotation.accept(this, arg); + } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/ClassUtils.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/ClassUtils.java index 1b2319d26f..4769868123 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/ClassUtils.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/ClassUtils.java @@ -8,7 +8,6 @@ public class ClassUtils { * Maps primitive {@code Class}es to their corresponding wrapper {@code Class}. */ private static final Map, Class> primitiveWrapperMap = new HashMap, Class>(); - static { primitiveWrapperMap.put(Boolean.TYPE, Boolean.class); primitiveWrapperMap.put(Byte.TYPE, Byte.class); @@ -25,7 +24,6 @@ public class ClassUtils { * Maps wrapper {@code Class}es to their corresponding primitive types. */ private static final Map, Class> wrapperPrimitiveMap = new HashMap, Class>(); - static { for (final Class primitiveClass : primitiveWrapperMap.keySet()) { final Class wrapperClass = primitiveWrapperMap.get(primitiveClass); @@ -40,10 +38,11 @@ public class ClassUtils { * {@link Character}, * {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}). * - * @param type The class to query or null. + * @param type + * The class to query or null. * @return true if the given {@code type} is a primitive or primitive wrapper ({@link Boolean}, {@link Byte}, - * {@link Character}, - * {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}). + * {@link Character}, + * {@link Short}, {@link Integer}, {@link Long}, {@link Double}, {@link Float}). */ public static boolean isPrimitiveOrWrapper(final Class type) { if (type == null) { @@ -57,10 +56,11 @@ public static boolean isPrimitiveOrWrapper(final Class type) { * {@link Short}, * {@link Integer}, {@link Long}, {@link Double}, {@link Float}). * - * @param type The class to query or null. + * @param type + * The class to query or null. * @return true if the given {@code type} is a primitive wrapper ({@link Boolean}, {@link Byte}, {@link Character}, - * {@link Short}, - * {@link Integer}, {@link Long}, {@link Double}, {@link Float}). + * {@link Short}, + * {@link Integer}, {@link Long}, {@link Double}, {@link Float}). * @since 3.1 */ public static boolean isPrimitiveWrapper(final Class type) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/Pair.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/Pair.java index cf459b6041..40ce85d832 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/Pair.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/Pair.java @@ -2,16 +2,15 @@ /** * Simply a pair of objects. - * * @param type of object a. * @param type of object b. */ public class Pair { - public final A a; - public final B b; + public final A a; + public final B b; - public Pair(A a, B b) { - this.a = a; - this.b = b; - } + public Pair(A a, B b) { + this.a = a; + this.b = b; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/PositionUtils.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/PositionUtils.java index 742a35b819..e1ecf190eb 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/PositionUtils.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/utils/PositionUtils.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.utils; import static java.lang.Integer.signum; @@ -42,19 +42,19 @@ private PositionUtils() { // prevent instantiation } - public static void sortByBeginPosition(List nodes) { + public static void sortByBeginPosition(List nodes){ sortByBeginPosition(nodes, false); } - public static void sortByBeginPosition(List nodes, final boolean ignoringAnnotations) { + public static void sortByBeginPosition(List nodes, final boolean ignoringAnnotations){ Collections.sort(nodes, (o1, o2) -> PositionUtils.compare(o1, o2, ignoringAnnotations)); } - public static boolean areInOrder(Node a, Node b) { + public static boolean areInOrder(Node a, Node b){ return areInOrder(a, b, false); } - public static boolean areInOrder(Node a, Node b, boolean ignoringAnnotations) { + public static boolean areInOrder(Node a, Node b, boolean ignoringAnnotations){ return compare(a, b, ignoringAnnotations) <= 0; } @@ -68,7 +68,7 @@ private static int compare(Node a, Node b, boolean ignoringAnnotations) { } } - int signLine = signum(a.getBegin().line - b.getBegin().line); + int signLine = signum( a.getBegin().line - b.getBegin().line ); if (signLine == 0) { return signum(a.getBegin().column - b.getBegin().column); } else { @@ -77,14 +77,14 @@ private static int compare(Node a, Node b, boolean ignoringAnnotations) { } public static AnnotationExpr getLastAnnotation(Node node) { - if (node instanceof NodeWithAnnotations) { + if (node instanceof NodeWithAnnotations){ List annotations = new LinkedList<>(); annotations.addAll(((NodeWithAnnotations) node).getAnnotations()); - if (annotations.isEmpty()) { + if (annotations.isEmpty()){ return null; } sortByBeginPosition(annotations); - return annotations.get(annotations.size() - 1); + return annotations.get(annotations.size()-1); } else { return null; } @@ -106,26 +106,26 @@ private static Node beginNodeWithoutConsideringAnnotations(Node node) { } else if (node instanceof ClassOrInterfaceDeclaration) { ClassOrInterfaceDeclaration casted = (ClassOrInterfaceDeclaration) node; return casted.getNameExpr(); - } else { + } else { return node; } } - public static boolean nodeContains(Node container, Node contained, boolean ignoringAnnotations) { - if (!ignoringAnnotations || PositionUtils.getLastAnnotation(container) == null) { + public static boolean nodeContains(Node container, Node contained, boolean ignoringAnnotations){ + if (!ignoringAnnotations || PositionUtils.getLastAnnotation(container)==null){ return container.contains(contained); } - if (!container.contains(contained)) { + if (!container.contains(contained)){ return false; } // if the node is contained, but it comes immediately after the annotations, // let's not consider it contained - if (container instanceof NodeWithAnnotations) { + if (container instanceof NodeWithAnnotations){ int bl = beginLineWithoutConsideringAnnotation(container); int bc = beginColumnWithoutConsideringAnnotation(container); - if (bl > contained.getBegin().line) return false; - if (bl == contained.getBegin().line && bc > contained.getBegin().column) return false; - if (container.getEnd().line < contained.getEnd().line) return false; + if (bl>contained.getBegin().line) return false; + if (bl==contained.getBegin().line && bc>contained.getBegin().column) return false; + if (container.getEnd().line List ensureNotNull(List list) { - return list == null ? new ArrayList() : list; - } - - public static boolean isNullOrEmpty(Collection collection) { - return collection == null || collection.isEmpty(); - } - - public static T assertNotNull(T o) { - if (o == null) { - throw new NullPointerException("Assertion failed."); - } - return o; - } - - /** - * @return string with ASCII characters 10 and 13 replaced by the text "\n" and "\r". - */ - public static String escapeEndOfLines(String string) { - StringBuilder escapedString = new StringBuilder(); - for (char c : string.toCharArray()) { - switch (c) { - case '\n': - escapedString.append("\\n"); - break; - case '\r': - escapedString.append("\\r"); - break; - default: - escapedString.append(c); - } - } - return escapedString.toString(); - } - - public static String readerToString(Reader reader) throws IOException { - final StringBuilder result = new StringBuilder(); - final char[] buffer = new char[8 * 1024]; - int numChars; - - while ((numChars = reader.read(buffer, 0, buffer.length)) > 0) { - result.append(buffer, 0, numChars); - } - - return result.toString(); - } - - public static String providerToString(Provider provider) throws IOException { - final StringBuilder result = new StringBuilder(); - final char[] buffer = new char[8 * 1024]; - int numChars; - - while ((numChars = provider.read(buffer, 0, buffer.length)) != -1) { - result.append(buffer, 0, numChars); - } - - return result.toString(); - } - - /** - * Puts varargs in a mutable list. - * This does not have the disadvantage of Arrays#asList that it has a static size. - */ - public static List arrayToList(T[] array) { - List list = new LinkedList<>(); - Collections.addAll(list, array); - return list; - } + public static final String EOL = System.getProperty("line.separator"); + public static List ensureNotNull(List list) { + return list == null ? new ArrayList() : list; + } + + public static boolean isNullOrEmpty(Collection collection) { + return collection == null || collection.isEmpty(); + } + + public static T assertNotNull(T o) { + if (o == null) { + throw new NullPointerException("Assertion failed."); + } + return o; + } + + /** + * @return string with ASCII characters 10 and 13 replaced by the text "\n" and "\r". + */ + public static String escapeEndOfLines(String string) { + StringBuilder escapedString = new StringBuilder(); + for (char c : string.toCharArray()) { + switch (c) { + case '\n': + escapedString.append("\\n"); + break; + case '\r': + escapedString.append("\\r"); + break; + default: + escapedString.append(c); + } + } + return escapedString.toString(); + } + + public static String readerToString(Reader reader) throws IOException { + final StringBuilder result = new StringBuilder(); + final char[] buffer = new char[8 * 1024]; + int numChars; + + while ((numChars = reader.read(buffer, 0, buffer.length)) > 0) { + result.append(buffer, 0, numChars); + } + + return result.toString(); + } + + public static String providerToString(Provider provider) throws IOException { + final StringBuilder result = new StringBuilder(); + final char[] buffer = new char[8 * 1024]; + int numChars; + + while ((numChars = provider.read(buffer, 0, buffer.length)) != -1) { + result.append(buffer, 0, numChars); + } + + return result.toString(); + } + + /** + * Puts varargs in a mutable list. + * This does not have the disadvantage of Arrays#asList that it has a static size. + */ + public static List arrayToList(T[] array){ + List list = new LinkedList<>(); + Collections.addAll(list, array); + return list; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParser.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParser.java index 5d1442b234..97ed881034 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParser.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParser.java @@ -16,7 +16,6 @@ import java.io.*; import java.util.*; - import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.comments.*; @@ -24,7 +23,6 @@ import com.github.javaparser.ast.stmt.*; import com.github.javaparser.ast.type.*; import com.github.javaparser.utils.*; - import static com.github.javaparser.ASTParser.*; import static com.github.javaparser.Range.*; import static com.github.javaparser.Position.*; @@ -44,7 +42,7 @@ void reset(InputStream in, String encoding) throws IOException { private List add(List list, T obj) { if (list == null) { - list = new LinkedList(); + list = new LinkedList(); } list.add(obj); return list; @@ -52,23 +50,23 @@ private List add(List list, T obj) { private List add(int pos, List list, T obj) { if (list == null) { - list = new LinkedList(); + list = new LinkedList(); } list.add(pos, obj); return list; } - private class ModifierHolder { - final EnumSet modifiers; - final List annotations; - final Position begin; + private class ModifierHolder { + final EnumSet modifiers; + final List annotations; + final Position begin; - public ModifierHolder(Position begin, EnumSet modifiers, List annotations) { - this.begin = begin; - this.modifiers = modifiers; - this.annotations = annotations; + public ModifierHolder(Position begin, EnumSet modifiers, List annotations) { + this.begin = begin; + this.modifiers = modifiers; + this.annotations = annotations; + } } - } public void addModifier(EnumSet modifiers, Modifier mod) { if (modifiers.contains(mod)) { @@ -78,12 +76,12 @@ public void addModifier(EnumSet modifiers, Modifier mod) { } public void addMultipleModifier(EnumSet modifiers, EnumSet mods) { - if (mods == null) + if(mods == null) return; - for (Modifier m : mods) + for(Modifier m : mods) if (modifiers.contains(m)) addProblem("Duplicated modifier"); - for (Modifier m : mods) + for(Modifier m : mods) modifiers.add(m); } @@ -106,36 +104,36 @@ private void addProblem(String message) { } private Expression generateLambda(Expression ret, Statement lambdaBody) { - if (ret instanceof EnclosedExpr) { - Expression inner = ((EnclosedExpr) ret).getInner(); - if (inner != null && inner instanceof NameExpr) { - VariableDeclaratorId id = new VariableDeclaratorId(inner.getRange(), ((NameExpr) inner).getName(), null); + if (ret instanceof EnclosedExpr) { + Expression inner = ((EnclosedExpr) ret).getInner(); + if (inner != null && inner instanceof NameExpr) { + VariableDeclaratorId id = new VariableDeclaratorId(inner.getRange(), ((NameExpr)inner).getName(), null); + List params = add(null, new Parameter(ret.getRange(), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id)); + ret = new LambdaExpr(range(ret.getBegin(), lambdaBody.getEnd()), params, lambdaBody, true); + } else { + ret = new LambdaExpr(range(ret.getBegin(), lambdaBody.getEnd()), null, lambdaBody, true); + } + } else if (ret instanceof NameExpr) { + VariableDeclaratorId id = new VariableDeclaratorId(ret.getRange(), ((NameExpr)ret).getName(), null); List params = add(null, new Parameter(ret.getRange(), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id)); - ret = new LambdaExpr(range(ret.getBegin(), lambdaBody.getEnd()), params, lambdaBody, true); - } else { - ret = new LambdaExpr(range(ret.getBegin(), lambdaBody.getEnd()), null, lambdaBody, true); - } - } else if (ret instanceof NameExpr) { - VariableDeclaratorId id = new VariableDeclaratorId(ret.getRange(), ((NameExpr) ret).getName(), null); - List params = add(null, new Parameter(ret.getRange(), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id)); - ret = new LambdaExpr(ret.getRange(), params, lambdaBody, false); - } else if (ret instanceof LambdaExpr) { - ((LambdaExpr) ret).setBody(lambdaBody); - ret.setEnd(lambdaBody.getEnd()); + ret = new LambdaExpr(ret.getRange(), params, lambdaBody, false); + } else if (ret instanceof LambdaExpr) { + ((LambdaExpr) ret).setBody(lambdaBody); + ret.setEnd(lambdaBody.getEnd()); } else if (ret instanceof CastExpr) { - CastExpr castExpr = (CastExpr) ret; + CastExpr castExpr = (CastExpr)ret; Expression inner = generateLambda(castExpr.getExpr(), lambdaBody); castExpr.setExpr(inner); - } else { - addProblem("Failed to parse lambda expression! Please create an issue at https://github.com/javaparser/javaparser/issues"); - } - return ret; + } else { + addProblem("Failed to parse lambda expression! Please create an issue at https://github.com/javaparser/javaparser/issues"); + } + return ret; } private ArrayCreationExpr juggleArrayCreation(Range range, Type type, List dimensions, List> arrayAnnotations, ArrayInitializerExpr arrayInitializerExpr) { List levels = new ArrayList(); - for (int i = 0; i < arrayAnnotations.size(); i++) { + for(int i = 0; i < arrayAnnotations.size(); i++){ levels.add(new ArrayCreationLevel(range, dimensions.get(i), arrayAnnotations.get(i))); } return new ArrayCreationExpr(range, type, levels, arrayInitializerExpr); @@ -158,19 +156,15 @@ public static Token newToken(int kind, String image) { private static class RangedList { Range range = Range.UNKNOWN; List list; - RangedList(List list) { this.list = list; } - void beginAt(Position begin) { - range = range.withBegin(begin); + range=range.withBegin(begin); } - void endAt(Position end) { - range = range.withEnd(end); + range=range.withEnd(end); } - void add(T t) { if (list == null) { list = new LinkedList(); @@ -180,11 +174,11 @@ void add(T t) { } private Position tokenBegin() { - return pos(token.beginLine, token.beginColumn); + return pos(token.beginLine,token.beginColumn); } private Position tokenEnd() { - return pos(token.endLine, token.endColumn); + return pos(token.endLine,token.endColumn); } private Range tokenRange() { @@ -195,2688 +189,2599 @@ public static Range tokenRange(Token token) { return range(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } - /***************************************** - * THE JAVA LANGUAGE GRAMMAR STARTS HERE * - *****************************************/ +/***************************************** + * THE JAVA LANGUAGE GRAMMAR STARTS HERE * + *****************************************/ - /* - * Program structuring syntax follows. - */ - final public CompilationUnit CompilationUnit() { - PackageDeclaration pakage = null; +/* + * Program structuring syntax follows. + */ + final public +CompilationUnit CompilationUnit() {PackageDeclaration pakage = null; List imports = null; ImportDeclaration in = null; List> types = null; TypeDeclaration tn = null; Position begin = INVALID; - if (jj_2_1(2147483647)) { - pakage = PackageDeclaration(); - begin = begin.orIfInvalid(pakage.getBegin()); - } else { - ; - } - label_1: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IMPORT: - case SEMICOLON: { - ; - break; - } - default: - jj_la1[0] = jj_gen; - break label_1; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IMPORT: { - in = ImportDeclaration(); - begin = begin.orIfInvalid(in.getBegin()); - imports = add(imports, in); - break; - } - case SEMICOLON: { - in = EmptyImportDeclaration(); - begin = begin.orIfInvalid(in.getBegin()); - imports = add(imports, in); - break; - } - default: - jj_la1[1] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - label_2: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case CLASS: - case ENUM: - case FINAL: - case INTERFACE: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case SEMICOLON: - case AT: { - ; - break; - } - default: - jj_la1[2] = jj_gen; - break label_2; - } - tn = TypeDeclaration(); - begin = begin.orIfInvalid(tn.getBegin()); - types = add(types, tn); - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case 0: { - jj_consume_token(0); - break; - } - case 156: { - jj_consume_token(156); - break; - } - default: - jj_la1[3] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return new CompilationUnit(begin.invalid() ? Range.UNKNOWN : range(begin, tokenEnd()), pakage, imports, types); - } - - final public ImportDeclaration EmptyImportDeclaration() { - Position begin; - jj_consume_token(SEMICOLON); - begin = tokenBegin(); - return ImportDeclaration.createEmptyDeclaration(range(begin, tokenEnd())); - } - - final public PackageDeclaration PackageDeclaration() { - List annotations = null; + if (jj_2_1(2147483647)) { + pakage = PackageDeclaration(); +begin = begin.orIfInvalid(pakage.getBegin()); + } else { + ; + } + label_1: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORT: + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[0] = jj_gen; + break label_1; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORT:{ + in = ImportDeclaration(); +begin = begin.orIfInvalid(in.getBegin()); imports = add(imports, in); + break; + } + case SEMICOLON:{ + in = EmptyImportDeclaration(); +begin = begin.orIfInvalid(in.getBegin()); imports = add(imports, in); + break; + } + default: + jj_la1[1] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case CLASS: + case ENUM: + case FINAL: + case INTERFACE: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case SEMICOLON: + case AT:{ + ; + break; + } + default: + jj_la1[2] = jj_gen; + break label_2; + } + tn = TypeDeclaration(); +begin = begin.orIfInvalid(tn.getBegin()); types = add(types, tn); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 0:{ + jj_consume_token(0); + break; + } + case 156:{ + jj_consume_token(156); + break; + } + default: + jj_la1[3] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return new CompilationUnit(begin.invalid() ? Range.UNKNOWN : range(begin, tokenEnd()), pakage, imports, types); + } + + final public ImportDeclaration EmptyImportDeclaration() {Position begin; + jj_consume_token(SEMICOLON); +begin = tokenBegin(); +return ImportDeclaration.createEmptyDeclaration(range(begin, tokenEnd())); + } + + final public PackageDeclaration PackageDeclaration() {List annotations = null; NameExpr name; Position begin; - annotations = Annotations(); - jj_consume_token(PACKAGE); - begin = tokenBegin(); - name = Name(); - jj_consume_token(SEMICOLON); - return new PackageDeclaration(range(begin, tokenEnd()), annotations, name); - } - - final public ImportDeclaration ImportDeclaration() { - NameExpr name; + annotations = Annotations(); + jj_consume_token(PACKAGE); +begin = tokenBegin(); + name = Name(); + jj_consume_token(SEMICOLON); +return new PackageDeclaration(range(begin, tokenEnd()), annotations, name); + } + + final public ImportDeclaration ImportDeclaration() {NameExpr name; boolean isStatic = false; boolean isAsterisk = false; Position begin; - jj_consume_token(IMPORT); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STATIC: { - jj_consume_token(STATIC); - isStatic = true; - break; - } - default: - jj_la1[4] = jj_gen; - ; - } - name = Name(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - jj_consume_token(STAR); - isAsterisk = true; - break; - } - default: - jj_la1[5] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - return new ImportDeclaration(range(begin, tokenEnd()), name, isStatic, isAsterisk); - } - - /* - * Modifiers. We match all modifiers in a single rule to reduce the chances of - * syntax errors for simple modifier mistakes. It will also enable us to give - * better error messages. - */ - final public ModifierHolder Modifiers() { - Position begin = INVALID; - EnumSet modifiers = EnumSet.noneOf(Modifier.class); - List annotations = null; - AnnotationExpr ann; - label_3: - while (true) { - if (jj_2_2(2)) { - ; - } else { - break label_3; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PUBLIC: { - jj_consume_token(PUBLIC); - addModifier(modifiers, Modifier.PUBLIC); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case STATIC: { - jj_consume_token(STATIC); - addModifier(modifiers, Modifier.STATIC); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case PROTECTED: { - jj_consume_token(PROTECTED); - addModifier(modifiers, Modifier.PROTECTED); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case PRIVATE: { - jj_consume_token(PRIVATE); - addModifier(modifiers, Modifier.PRIVATE); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case FINAL: { - jj_consume_token(FINAL); - addModifier(modifiers, Modifier.FINAL); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case ABSTRACT: { - jj_consume_token(ABSTRACT); - addModifier(modifiers, Modifier.ABSTRACT); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case SYNCHRONIZED: { - jj_consume_token(SYNCHRONIZED); - addModifier(modifiers, Modifier.SYNCHRONIZED); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case NATIVE: { - jj_consume_token(NATIVE); - addModifier(modifiers, Modifier.NATIVE); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case TRANSIENT: { - jj_consume_token(TRANSIENT); - addModifier(modifiers, Modifier.TRANSIENT); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case VOLATILE: { - jj_consume_token(VOLATILE); - addModifier(modifiers, Modifier.VOLATILE); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case STRICTFP: { - jj_consume_token(STRICTFP); - addModifier(modifiers, Modifier.STRICTFP); - begin = begin.orIfInvalid(tokenBegin()); - break; - } - case AT: { - ann = Annotation(); - annotations = add(annotations, ann); - begin = begin.orIfInvalid(ann.getBegin()); - break; - } - default: - jj_la1[6] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - return new ModifierHolder(begin, modifiers, annotations); - } - - /* - * Declaration syntax follows. - */ - final public TypeDeclaration TypeDeclaration() { - ModifierHolder modifier; - TypeDeclaration ret; - - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SEMICOLON: { - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(tokenRange()); - break; - } - case ABSTRACT: - case CLASS: - case ENUM: - case FINAL: - case INTERFACE: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case AT: { - modifier = Modifiers(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CLASS: - case INTERFACE: { - ret = ClassOrInterfaceDeclaration(modifier); - break; - } - case ENUM: { - ret = EnumDeclaration(modifier); - break; - } - case AT: { - ret = AnnotationTypeDeclaration(modifier); - break; - } - default: - jj_la1[7] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[8] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(ModifierHolder modifier) { - boolean isInterface = false; - NameExpr name; - RangedList typePar = new RangedList(null); - List extList = null; - List impList = null; - List> members; - Position begin = modifier.begin; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CLASS: { - jj_consume_token(CLASS); - break; - } - case INTERFACE: { - jj_consume_token(INTERFACE); - isInterface = true; - break; - } - default: - jj_la1[9] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - begin = begin.orIfInvalid(tokenBegin()); - name = Name(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typePar = TypeParameters(); - break; - } - default: - jj_la1[10] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EXTENDS: { - extList = ExtendsList(isInterface); - break; - } - default: - jj_la1[11] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IMPLEMENTS: { - impList = ImplementsList(isInterface); - break; - } - default: - jj_la1[12] = jj_gen; - ; - } - members = ClassOrInterfaceBody(isInterface); - ClassOrInterfaceDeclaration tmp = new ClassOrInterfaceDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, isInterface, null, typePar.list, extList, impList, members); - tmp.setNameExpr(name); - return tmp; - } - - final public List ExtendsList(boolean isInterface) { - boolean extendsMoreThanOne = false; - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(EXTENDS); - cit = AnnotatedClassOrInterfaceType(); - ret.add(cit); - label_4: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[13] = jj_gen; - break label_4; - } - jj_consume_token(COMMA); - cit = AnnotatedClassOrInterfaceType(); - ret.add(cit); - extendsMoreThanOne = true; - } - if (extendsMoreThanOne && !isInterface) - addProblem("A class cannot extend more than one other class"); - return ret; - } + jj_consume_token(IMPORT); +begin = tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STATIC:{ + jj_consume_token(STATIC); +isStatic = true; + break; + } + default: + jj_la1[4] = jj_gen; + ; + } + name = Name(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + jj_consume_token(DOT); + jj_consume_token(STAR); +isAsterisk = true; + break; + } + default: + jj_la1[5] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +return new ImportDeclaration(range(begin, tokenEnd()),name, isStatic, isAsterisk); + } - final public List ImplementsList(boolean isInterface) { - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(IMPLEMENTS); - cit = AnnotatedClassOrInterfaceType(); - ret.add(cit); - label_5: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[14] = jj_gen; - break label_5; - } - jj_consume_token(COMMA); - cit = AnnotatedClassOrInterfaceType(); - ret.add(cit); - } - if (isInterface) - addProblem("An interface cannot implement other interfaces"); - return ret; - } +/* + * Modifiers. We match all modifiers in a single rule to reduce the chances of + * syntax errors for simple modifier mistakes. It will also enable us to give + * better error messages. + */ + final public +ModifierHolder Modifiers() {Position begin = INVALID; + EnumSet modifiers = EnumSet.noneOf(Modifier.class); + List annotations = null; + AnnotationExpr ann; + label_3: + while (true) { + if (jj_2_2(2)) { + ; + } else { + break label_3; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PUBLIC:{ + jj_consume_token(PUBLIC); +addModifier(modifiers, Modifier.PUBLIC); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case STATIC:{ + jj_consume_token(STATIC); +addModifier(modifiers, Modifier.STATIC); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case PROTECTED:{ + jj_consume_token(PROTECTED); +addModifier(modifiers, Modifier.PROTECTED); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case PRIVATE:{ + jj_consume_token(PRIVATE); +addModifier(modifiers, Modifier.PRIVATE); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case FINAL:{ + jj_consume_token(FINAL); +addModifier(modifiers, Modifier.FINAL); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case ABSTRACT:{ + jj_consume_token(ABSTRACT); +addModifier(modifiers, Modifier.ABSTRACT); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case SYNCHRONIZED:{ + jj_consume_token(SYNCHRONIZED); +addModifier(modifiers, Modifier.SYNCHRONIZED); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case NATIVE:{ + jj_consume_token(NATIVE); +addModifier(modifiers, Modifier.NATIVE); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case TRANSIENT:{ + jj_consume_token(TRANSIENT); +addModifier(modifiers, Modifier.TRANSIENT); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case VOLATILE:{ + jj_consume_token(VOLATILE); +addModifier(modifiers, Modifier.VOLATILE); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case STRICTFP:{ + jj_consume_token(STRICTFP); +addModifier(modifiers, Modifier.STRICTFP); begin = begin.orIfInvalid(tokenBegin()); + break; + } + case AT:{ + ann = Annotation(); +annotations = add(annotations, ann); begin = begin.orIfInvalid(ann.getBegin()); + break; + } + default: + jj_la1[6] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } +return new ModifierHolder(begin, modifiers, annotations); + } - final public EnumDeclaration EnumDeclaration(ModifierHolder modifier) { - NameExpr name; +/* + * Declaration syntax follows. + */ + final public TypeDeclaration TypeDeclaration() {ModifierHolder modifier; + TypeDeclaration ret; + + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + jj_consume_token(SEMICOLON); +ret = new EmptyTypeDeclaration(tokenRange()); + break; + } + case ABSTRACT: + case CLASS: + case ENUM: + case FINAL: + case INTERFACE: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case AT:{ + modifier = Modifiers(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CLASS: + case INTERFACE:{ + ret = ClassOrInterfaceDeclaration(modifier); + break; + } + case ENUM:{ + ret = EnumDeclaration(modifier); + break; + } + case AT:{ + ret = AnnotationTypeDeclaration(modifier); + break; + } + default: + jj_la1[7] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + default: + jj_la1[8] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(ModifierHolder modifier) {boolean isInterface = false; + NameExpr name; + RangedList typePar = new RangedList(null); + List extList = null; + List impList = null; + List> members; + Position begin = modifier.begin; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CLASS:{ + jj_consume_token(CLASS); + break; + } + case INTERFACE:{ + jj_consume_token(INTERFACE); +isInterface = true; + break; + } + default: + jj_la1[9] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +begin = begin.orIfInvalid(tokenBegin()); + name = Name(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typePar = TypeParameters(); + break; + } + default: + jj_la1[10] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EXTENDS:{ + extList = ExtendsList(isInterface); + break; + } + default: + jj_la1[11] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPLEMENTS:{ + impList = ImplementsList(isInterface); + break; + } + default: + jj_la1[12] = jj_gen; + ; + } + members = ClassOrInterfaceBody(isInterface); +ClassOrInterfaceDeclaration tmp = new ClassOrInterfaceDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, isInterface, null, typePar.list, extList, impList, members); + tmp.setNameExpr(name); + return tmp; + } + + final public List ExtendsList(boolean isInterface) {boolean extendsMoreThanOne = false; + List ret = new LinkedList(); + ClassOrInterfaceType cit; + jj_consume_token(EXTENDS); + cit = AnnotatedClassOrInterfaceType(); +ret.add(cit); + label_4: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[13] = jj_gen; + break label_4; + } + jj_consume_token(COMMA); + cit = AnnotatedClassOrInterfaceType(); +ret.add(cit); extendsMoreThanOne = true; + } +if (extendsMoreThanOne && !isInterface) + addProblem("A class cannot extend more than one other class"); +return ret; + } + + final public List ImplementsList(boolean isInterface) {List ret = new LinkedList(); + ClassOrInterfaceType cit; + jj_consume_token(IMPLEMENTS); + cit = AnnotatedClassOrInterfaceType(); +ret.add(cit); + label_5: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[14] = jj_gen; + break label_5; + } + jj_consume_token(COMMA); + cit = AnnotatedClassOrInterfaceType(); +ret.add(cit); + } +if (isInterface) + addProblem("An interface cannot implement other interfaces"); +return ret; + } + + final public EnumDeclaration EnumDeclaration(ModifierHolder modifier) {NameExpr name; List impList = null; EnumConstantDeclaration entry; List entries = null; BodyDeclaration member; List> members = null; Position begin = modifier.begin; - jj_consume_token(ENUM); - begin = begin.orIfInvalid(tokenBegin()); - name = Name(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IMPLEMENTS: { - impList = ImplementsList(false); - break; - } - default: - jj_la1[15] = jj_gen; - ; - } - jj_consume_token(LBRACE); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: - case AT: { - entries = new LinkedList(); - entry = EnumConstantDeclaration(); - entries.add(entry); - label_6: - while (true) { - if (jj_2_3(2)) { - ; - } else { - break label_6; - } - jj_consume_token(COMMA); - entry = EnumConstantDeclaration(); - entries.add(entry); - } - break; - } - default: - jj_la1[16] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - jj_consume_token(COMMA); - break; - } - default: - jj_la1[17] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SEMICOLON: { - jj_consume_token(SEMICOLON); - label_7: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case _DEFAULT: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: { - ; - break; - } - default: - jj_la1[18] = jj_gen; - break label_7; - } - member = ClassOrInterfaceBodyDeclaration(false); - members = add(members, member); - } - break; - } - default: - jj_la1[19] = jj_gen; - ; + jj_consume_token(ENUM); +begin = begin.orIfInvalid(tokenBegin()); + name = Name(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPLEMENTS:{ + impList = ImplementsList(false); + break; + } + default: + jj_la1[15] = jj_gen; + ; + } + jj_consume_token(LBRACE); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER: + case AT:{ +entries = new LinkedList(); + entry = EnumConstantDeclaration(); +entries.add(entry); + label_6: + while (true) { + if (jj_2_3(2)) { + ; + } else { + break label_6; } - jj_consume_token(RBRACE); - EnumDeclaration tmp = new EnumDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, null, impList, entries, members); - tmp.setNameExpr(name); - return tmp; - } - - final public EnumConstantDeclaration EnumConstantDeclaration() { - List annotations = null; + jj_consume_token(COMMA); + entry = EnumConstantDeclaration(); +entries.add(entry); + } + break; + } + default: + jj_la1[16] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + jj_consume_token(COMMA); + break; + } + default: + jj_la1[17] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + jj_consume_token(SEMICOLON); + label_7: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case _DEFAULT: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case LBRACE: + case SEMICOLON: + case AT: + case LT:{ + ; + break; + } + default: + jj_la1[18] = jj_gen; + break label_7; + } + member = ClassOrInterfaceBodyDeclaration(false); +members = add(members, member); + } + break; + } + default: + jj_la1[19] = jj_gen; + ; + } + jj_consume_token(RBRACE); +EnumDeclaration tmp = new EnumDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, null, impList, entries, members); + tmp.setNameExpr(name); + return tmp; + } + + final public EnumConstantDeclaration EnumConstantDeclaration() {List annotations = null; AnnotationExpr ann; String name; List args = null; List> classBody = null; Position begin = INVALID; - label_8: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AT: { - ; - break; - } - default: - jj_la1[20] = jj_gen; - break label_8; - } - ann = Annotation(); - annotations = add(annotations, ann); - begin = begin.orIfInvalid(ann.getBegin()); - } - jj_consume_token(IDENTIFIER); - name = token.image; - begin = begin.orIfInvalid(tokenBegin()); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LPAREN: { - args = Arguments(); - break; - } - default: - jj_la1[21] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACE: { - classBody = ClassOrInterfaceBody(false); - break; - } - default: - jj_la1[22] = jj_gen; - ; - } - return new EnumConstantDeclaration(range(begin, tokenEnd()), annotations, name, args, classBody); - } + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case AT:{ + ; + break; + } + default: + jj_la1[20] = jj_gen; + break label_8; + } + ann = Annotation(); +annotations = add(annotations, ann); begin = begin.orIfInvalid(ann.getBegin()); + } + jj_consume_token(IDENTIFIER); +name = token.image; begin = begin.orIfInvalid(tokenBegin()); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LPAREN:{ + args = Arguments(); + break; + } + default: + jj_la1[21] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACE:{ + classBody = ClassOrInterfaceBody(false); + break; + } + default: + jj_la1[22] = jj_gen; + ; + } +return new EnumConstantDeclaration(range(begin, tokenEnd()), annotations, name, args, classBody); + } - /** - * If the list inside the returned RangedList is null, there are no brackets. - * If it is empty, there are brackets, but nothing is in them <>. - * The normal case is that it contains TypeParameters, like . - */ - final public RangedList TypeParameters() { - RangedList ret = new RangedList(new LinkedList()); +/** + * If the list inside the returned RangedList is null, there are no brackets. + * If it is empty, there are brackets, but nothing is in them <>. + * The normal case is that it contains TypeParameters, like . + */ + final public RangedList TypeParameters() {RangedList ret = new RangedList(new LinkedList()); TypeParameter tp; List annotations = null; - jj_consume_token(LT); - ret.beginAt(tokenBegin()); - annotations = Annotations(); - tp = TypeParameter(); - ret.add(tp); - tp.setAnnotations(annotations); - annotations = null; - label_9: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[23] = jj_gen; - break label_9; - } - jj_consume_token(COMMA); - annotations = Annotations(); - tp = TypeParameter(); - ret.add(tp); - tp.setAnnotations(annotations); - annotations = null; - } - jj_consume_token(GT); - ret.endAt(tokenEnd()); - return ret; - } - - final public TypeParameter TypeParameter() { - String name; + jj_consume_token(LT); +ret.beginAt(tokenBegin()); + annotations = Annotations(); + tp = TypeParameter(); +ret.add(tp); tp.setAnnotations(annotations); annotations = null; + label_9: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[23] = jj_gen; + break label_9; + } + jj_consume_token(COMMA); + annotations = Annotations(); + tp = TypeParameter(); +ret.add(tp); tp.setAnnotations(annotations); annotations = null; + } + jj_consume_token(GT); +ret.endAt(tokenEnd()); +return ret; + } + + final public TypeParameter TypeParameter() {String name; List typeBound = null; Position begin; - jj_consume_token(IDENTIFIER); - name = token.image; - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EXTENDS: { - typeBound = TypeBound(); - break; - } - default: - jj_la1[24] = jj_gen; - ; - } - return new TypeParameter(range(begin, tokenEnd()), name, typeBound); - } - - final public List TypeBound() { - List ret = new LinkedList(); + jj_consume_token(IDENTIFIER); +name = token.image; begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EXTENDS:{ + typeBound = TypeBound(); + break; + } + default: + jj_la1[24] = jj_gen; + ; + } +return new TypeParameter(range(begin, tokenEnd()),name, typeBound); + } + + final public List TypeBound() {List ret = new LinkedList(); ClassOrInterfaceType cit; - jj_consume_token(EXTENDS); - cit = AnnotatedClassOrInterfaceType(); - ret.add(cit); - label_10: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BIT_AND: { - ; - break; - } - default: - jj_la1[25] = jj_gen; - break label_10; - } - jj_consume_token(BIT_AND); - cit = AnnotatedClassOrInterfaceType(); - ret.add(cit); - } - return ret; - } - - final public List> ClassOrInterfaceBody(boolean isInterface) { - List> ret = new LinkedList>(); + jj_consume_token(EXTENDS); + cit = AnnotatedClassOrInterfaceType(); +ret.add(cit); + label_10: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BIT_AND:{ + ; + break; + } + default: + jj_la1[25] = jj_gen; + break label_10; + } + jj_consume_token(BIT_AND); + cit = AnnotatedClassOrInterfaceType(); +ret.add(cit); + } +return ret; + } + + final public List> ClassOrInterfaceBody(boolean isInterface) {List> ret = new LinkedList>(); BodyDeclaration member; - jj_consume_token(LBRACE); - label_11: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case _DEFAULT: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: { - ; - break; - } - default: - jj_la1[26] = jj_gen; - break label_11; + jj_consume_token(LBRACE); + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case _DEFAULT: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case LBRACE: + case SEMICOLON: + case AT: + case LT:{ + ; + break; + } + default: + jj_la1[26] = jj_gen; + break label_11; + } + member = ClassOrInterfaceBodyDeclaration(isInterface); +ret.add(member); + } + jj_consume_token(RBRACE); +return ret; + } + + final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) {ModifierHolder modifier; + ModifierHolder modifier2 = null; + EnumSet aux = null; + BodyDeclaration ret; + boolean isDefault = false; + + if (jj_2_6(2)) { + ret = InitializerDeclaration(); +if (isInterface) + addProblem("An interface cannot have initializers"); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case _DEFAULT: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case AT: + case LT:{ + modifier = Modifiers(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case _DEFAULT:{ + jj_consume_token(_DEFAULT); + modifier2 = Modifiers(); +if(!isInterface) + { + addProblem("A class cannot have default members"); + } + isDefault = true; + break; + } + default: + jj_la1[27] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CLASS: + case INTERFACE:{ + ret = ClassOrInterfaceDeclaration(modifier); + break; + } + case ENUM:{ + ret = EnumDeclaration(modifier); + break; + } + case AT:{ + ret = AnnotationTypeDeclaration(modifier); + break; + } + default: + jj_la1[28] = jj_gen; + if (jj_2_4(2147483647)) { + ret = ConstructorDeclaration(modifier); + } else if (jj_2_5(2147483647)) { + ret = FieldDeclaration(modifier); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case VOID: + case IDENTIFIER: + case LT:{ + ret = MethodDeclaration(modifier); +if(isDefault && ret!= null && ((MethodDeclaration)ret).getBody() == null) + { + addProblem("\"default\" methods must have a body"); + } + ((MethodDeclaration)ret).setDefault(isDefault); + if(modifier2!= null) + { + aux = modifier2.modifiers; + } + addMultipleModifier(modifier.modifiers, aux); + ((MethodDeclaration)ret).setModifiers(modifier.modifiers); + break; + } + default: + jj_la1[29] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - member = ClassOrInterfaceBodyDeclaration(isInterface); - ret.add(member); + } } - jj_consume_token(RBRACE); - return ret; - } - - final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) { - ModifierHolder modifier; - ModifierHolder modifier2 = null; - EnumSet aux = null; - BodyDeclaration ret; - boolean isDefault = false; - - if (jj_2_6(2)) { - ret = InitializerDeclaration(); - if (isInterface) - addProblem("An interface cannot have initializers"); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case _DEFAULT: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case AT: - case LT: { - modifier = Modifiers(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case _DEFAULT: { - jj_consume_token(_DEFAULT); - modifier2 = Modifiers(); - if (!isInterface) { - addProblem("A class cannot have default members"); - } - isDefault = true; - break; - } - default: - jj_la1[27] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CLASS: - case INTERFACE: { - ret = ClassOrInterfaceDeclaration(modifier); - break; - } - case ENUM: { - ret = EnumDeclaration(modifier); - break; - } - case AT: { - ret = AnnotationTypeDeclaration(modifier); - break; - } - default: - jj_la1[28] = jj_gen; - if (jj_2_4(2147483647)) { - ret = ConstructorDeclaration(modifier); - } else if (jj_2_5(2147483647)) { - ret = FieldDeclaration(modifier); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case VOID: - case IDENTIFIER: - case LT: { - ret = MethodDeclaration(modifier); - if (isDefault && ret != null && ((MethodDeclaration) ret).getBody() == null) { - addProblem("\"default\" methods must have a body"); - } - ((MethodDeclaration) ret).setDefault(isDefault); - if (modifier2 != null) { - aux = modifier2.modifiers; - } - addMultipleModifier(modifier.modifiers, aux); - ((MethodDeclaration) ret).setModifiers(modifier.modifiers); - break; - } - default: - jj_la1[29] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - if (isDefault && !(ret instanceof MethodDeclaration)) { - addProblem("Only methods can have the keyword \"default\"."); - } - break; - } - case SEMICOLON: { - jj_consume_token(SEMICOLON); - ret = new EmptyMemberDeclaration(tokenRange()); - break; - } - default: - jj_la1[30] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); +if(isDefault && ! (ret instanceof MethodDeclaration)) + { + addProblem("Only methods can have the keyword \"default\"."); } + break; + } + case SEMICOLON:{ + jj_consume_token(SEMICOLON); +ret = new EmptyMemberDeclaration(tokenRange()); + break; } - return ret; + default: + jj_la1[30] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } } +return ret; + } - final public FieldDeclaration FieldDeclaration(ModifierHolder modifier) { - Type type; + final public FieldDeclaration FieldDeclaration(ModifierHolder modifier) {Type type; List variables = new LinkedList(); VariableDeclarator val; - // Modifiers are already matched in the caller - type = Type(); - val = VariableDeclarator(); - variables.add(val); - label_12: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[31] = jj_gen; - break label_12; - } - jj_consume_token(COMMA); - val = VariableDeclarator(); - variables.add(val); - } - jj_consume_token(SEMICOLON); - Position begin = modifier.begin.orIfInvalid(type.getBegin()); + // Modifiers are already matched in the caller + type = Type(); + val = VariableDeclarator(); +variables.add(val); + label_12: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[31] = jj_gen; + break label_12; + } + jj_consume_token(COMMA); + val = VariableDeclarator(); +variables.add(val); + } + jj_consume_token(SEMICOLON); +Position begin = modifier.begin.orIfInvalid(type.getBegin()); Pair> typeListPair = unwrapArrayTypes(type); return new FieldDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, typeListPair.a, variables, typeListPair.b); - } + } - final public VariableDeclarator VariableDeclarator() { - VariableDeclaratorId id; + final public VariableDeclarator VariableDeclarator() {VariableDeclaratorId id; Expression init = null; - id = VariableDeclaratorId(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASSIGN: { - jj_consume_token(ASSIGN); - init = VariableInitializer(); - break; - } - default: - jj_la1[32] = jj_gen; - ; - } - return new VariableDeclarator(range(id.getBegin(), tokenEnd()), id, init); - } - - final public VariableDeclaratorId VariableDeclaratorId() { - String name; + id = VariableDeclaratorId(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASSIGN:{ + jj_consume_token(ASSIGN); + init = VariableInitializer(); + break; + } + default: + jj_la1[32] = jj_gen; + ; + } +return new VariableDeclarator(range(id.getBegin(), tokenEnd()), id, init); + } + + final public VariableDeclaratorId VariableDeclaratorId() {String name; Position begin; ArrayBracketPair arrayBracketPair; List arrayBracketPairs = null; - jj_consume_token(IDENTIFIER); - name = token.image; - begin = tokenBegin(); - label_13: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACKET: - case AT: { - ; - break; - } - default: - jj_la1[33] = jj_gen; - break label_13; - } - arrayBracketPair = ArrayBracketPair(); - arrayBracketPairs = add(arrayBracketPairs, arrayBracketPair); + jj_consume_token(IDENTIFIER); +name = token.image; begin=tokenBegin(); + label_13: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACKET: + case AT:{ + ; + break; + } + default: + jj_la1[33] = jj_gen; + break label_13; + } + arrayBracketPair = ArrayBracketPair(); +arrayBracketPairs=add(arrayBracketPairs, arrayBracketPair); + } +return new VariableDeclaratorId(range(begin, tokenEnd()),name, arrayBracketPairs); + } + + final public Expression VariableInitializer() {Expression ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACE:{ + ret = ArrayInitializer(); + break; + } + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + ret = Expression(); + break; + } + default: + jj_la1[34] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public ArrayInitializerExpr ArrayInitializer() {List values = null; + Expression val; + Position begin; + jj_consume_token(LBRACE); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + val = VariableInitializer(); +values = add(values, val); + label_14: + while (true) { + if (jj_2_7(2)) { + ; + } else { + break label_14; } - return new VariableDeclaratorId(range(begin, tokenEnd()), name, arrayBracketPairs); - } + jj_consume_token(COMMA); + val = VariableInitializer(); +values = add(values, val); + } + break; + } + default: + jj_la1[35] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + jj_consume_token(COMMA); + break; + } + default: + jj_la1[36] = jj_gen; + ; + } + jj_consume_token(RBRACE); +return new ArrayInitializerExpr(range(begin, tokenEnd()), values); + } + + final public MethodDeclaration MethodDeclaration(ModifierHolder modifier) {RangedList typeParameters = new RangedList(null); + Type type; + NameExpr name; + List parameters; + ArrayBracketPair arrayBracketPair; + List arrayBracketPairs = null; + List throws_ = null; + BlockStmt block = null; + Position begin = modifier.begin; + ReferenceType throwType; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeParameters = TypeParameters(); +begin = begin.orIfInvalid(typeParameters.range.begin); + break; + } + default: + jj_la1[37] = jj_gen; + ; + } + type = ResultType(); +begin = begin.orIfInvalid(type.getBegin()); + name = Name(); + parameters = FormalParameters(); + label_15: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACKET: + case AT:{ + ; + break; + } + default: + jj_la1[38] = jj_gen; + break label_15; + } + arrayBracketPair = ArrayBracketPair(); +arrayBracketPairs=add(arrayBracketPairs, arrayBracketPair); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case THROWS:{ + jj_consume_token(THROWS); + throwType = ReferenceTypeWithAnnotations(); +throws_ = add(throws_, throwType); + label_16: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[39] = jj_gen; + break label_16; + } + jj_consume_token(COMMA); + throwType = ReferenceTypeWithAnnotations(); +throws_ = add(throws_, throwType); + } + break; + } + default: + jj_la1[40] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACE:{ + block = Block(); + break; + } + case SEMICOLON:{ + jj_consume_token(SEMICOLON); + break; + } + default: + jj_la1[41] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +Pair> typeListPair = unwrapArrayTypes(type); + return new MethodDeclaration(range(begin, pos(token.endLine, token.endColumn)), modifier.modifiers, modifier.annotations, typeParameters.list, typeListPair.a, typeListPair.b, name, parameters, arrayBracketPairs, throws_, block); + } - final public Expression VariableInitializer() { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACE: { - ret = ArrayInitializer(); - break; - } - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - ret = Expression(); - break; - } - default: - jj_la1[34] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public ArrayInitializerExpr ArrayInitializer() { - List values = null; - Expression val; - Position begin; - jj_consume_token(LBRACE); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - val = VariableInitializer(); - values = add(values, val); - label_14: - while (true) { - if (jj_2_7(2)) { - ; - } else { - break label_14; - } - jj_consume_token(COMMA); - val = VariableInitializer(); - values = add(values, val); - } - break; - } - default: - jj_la1[35] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - jj_consume_token(COMMA); - break; - } - default: - jj_la1[36] = jj_gen; - ; - } - jj_consume_token(RBRACE); - return new ArrayInitializerExpr(range(begin, tokenEnd()), values); - } - - final public MethodDeclaration MethodDeclaration(ModifierHolder modifier) { - RangedList typeParameters = new RangedList(null); - Type type; - NameExpr name; - List parameters; - ArrayBracketPair arrayBracketPair; - List arrayBracketPairs = null; - List throws_ = null; - BlockStmt block = null; - Position begin = modifier.begin; - ReferenceType throwType; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeParameters = TypeParameters(); - begin = begin.orIfInvalid(typeParameters.range.begin); - break; - } - default: - jj_la1[37] = jj_gen; - ; - } - type = ResultType(); - begin = begin.orIfInvalid(type.getBegin()); - name = Name(); - parameters = FormalParameters(); - label_15: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACKET: - case AT: { - ; - break; - } - default: - jj_la1[38] = jj_gen; - break label_15; - } - arrayBracketPair = ArrayBracketPair(); - arrayBracketPairs = add(arrayBracketPairs, arrayBracketPair); - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case THROWS: { - jj_consume_token(THROWS); - throwType = ReferenceTypeWithAnnotations(); - throws_ = add(throws_, throwType); - label_16: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[39] = jj_gen; - break label_16; - } - jj_consume_token(COMMA); - throwType = ReferenceTypeWithAnnotations(); - throws_ = add(throws_, throwType); - } - break; - } - default: - jj_la1[40] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACE: { - block = Block(); - break; - } - case SEMICOLON: { - jj_consume_token(SEMICOLON); - break; - } - default: - jj_la1[41] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - Pair> typeListPair = unwrapArrayTypes(type); - return new MethodDeclaration(range(begin, pos(token.endLine, token.endColumn)), modifier.modifiers, modifier.annotations, typeParameters.list, typeListPair.a, typeListPair.b, name, parameters, arrayBracketPairs, throws_, block); - } - - final public ReferenceType ReferenceTypeWithAnnotations() { - List annotations; - ReferenceType type; - annotations = Annotations(); - type = ReferenceType(); - if (annotations != null) { - if (type.getAnnotations() != null) { - type.getAnnotations().addAll(annotations); - } else { - type.setAnnotations(annotations); + final public ReferenceType ReferenceTypeWithAnnotations() {List annotations; + ReferenceType type; + annotations = Annotations(); + type = ReferenceType(); +if(annotations != null){ + if (type.getAnnotations() != null) { + type.getAnnotations().addAll(annotations); + } else { + type.setAnnotations(annotations); } } return type; - } + } - final public List FormalParameters() { - List ret = null; + final public List FormalParameters() {List ret = null; Parameter par; - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: { - par = FormalParameter(); - ret = add(ret, par); - label_17: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[42] = jj_gen; - break label_17; - } - jj_consume_token(COMMA); - par = FormalParameter(); - ret = add(ret, par); - } - break; - } - default: - jj_la1[43] = jj_gen; - ; + jj_consume_token(LPAREN); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case AT:{ + par = FormalParameter(); +ret = add(ret, par); + label_17: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[42] = jj_gen; + break label_17; } - jj_consume_token(RPAREN); - return ret; - } - - final public List FormalLambdaParameters() { - List ret = null; - Parameter par; jj_consume_token(COMMA); par = FormalParameter(); - ret = add(ret, par); - label_18: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[44] = jj_gen; - break label_18; - } - jj_consume_token(COMMA); - par = FormalParameter(); - ret = add(ret, par); - } - return ret; - } - - final public List InferredLambdaParameters() { - List ret = null; - VariableDeclaratorId id; - jj_consume_token(COMMA); - id = VariableDeclaratorId(); - ret = add(ret, new Parameter(range(id.getBegin(), id.getEnd()), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id)); - label_19: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[45] = jj_gen; - break label_19; - } - jj_consume_token(COMMA); - id = VariableDeclaratorId(); - ret = add(ret, new Parameter(range(id.getBegin(), id.getEnd()), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id)); - } - return ret; - } - - final public Parameter FormalParameter() { - ModifierHolder modifier; +ret = add(ret, par); + } + break; + } + default: + jj_la1[43] = jj_gen; + ; + } + jj_consume_token(RPAREN); +return ret; + } + + final public List FormalLambdaParameters() {List ret = null; + Parameter par; + jj_consume_token(COMMA); + par = FormalParameter(); +ret = add(ret, par); + label_18: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[44] = jj_gen; + break label_18; + } + jj_consume_token(COMMA); + par = FormalParameter(); +ret = add(ret, par); + } +return ret; + } + + final public List InferredLambdaParameters() {List ret = null; + VariableDeclaratorId id; + jj_consume_token(COMMA); + id = VariableDeclaratorId(); +ret = add(ret, new Parameter(range(id.getBegin(), id.getEnd()), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id)); + label_19: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[45] = jj_gen; + break label_19; + } + jj_consume_token(COMMA); + id = VariableDeclaratorId(); +ret = add(ret, new Parameter(range(id.getBegin(), id.getEnd()), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id)); + } +return ret; + } + + final public Parameter FormalParameter() {ModifierHolder modifier; Type type; boolean isVarArg = false; VariableDeclaratorId id; - modifier = Modifiers(); - type = Type(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ELLIPSIS: { - jj_consume_token(ELLIPSIS); - isVarArg = true; - break; - } - default: - jj_la1[46] = jj_gen; - ; - } - id = VariableDeclaratorId(); - Position begin = modifier.begin.orIfInvalid(type.getBegin()); + modifier = Modifiers(); + type = Type(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ELLIPSIS:{ + jj_consume_token(ELLIPSIS); +isVarArg = true; + break; + } + default: + jj_la1[46] = jj_gen; + ; + } + id = VariableDeclaratorId(); +Position begin = modifier.begin.orIfInvalid(type.getBegin()); Pair> typeListPair = unwrapArrayTypes(type); return new Parameter(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, typeListPair.a, typeListPair.b, isVarArg, id); - } + } - final public ConstructorDeclaration ConstructorDeclaration(ModifierHolder modifier) { - RangedList typeParameters = new RangedList(null); + final public ConstructorDeclaration ConstructorDeclaration(ModifierHolder modifier) {RangedList typeParameters = new RangedList(null); NameExpr name; List parameters; List throws_ = null; ExplicitConstructorInvocationStmt exConsInv = null; List stmts; - Position begin = modifier.begin; + Position begin = modifier.begin; Position blockBegin = INVALID; ReferenceType throwType; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeParameters = TypeParameters(); - begin = begin.orIfInvalid(typeParameters.range.begin); - break; - } - default: - jj_la1[47] = jj_gen; - ; - } - // Modifiers matched in the caller - name = SimpleName(); - begin = begin.orIfInvalid(typeParameters.range.begin); - parameters = FormalParameters(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case THROWS: { - jj_consume_token(THROWS); - throwType = ReferenceTypeWithAnnotations(); - throws_ = add(throws_, throwType); - label_20: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[48] = jj_gen; - break label_20; - } - jj_consume_token(COMMA); - throwType = ReferenceTypeWithAnnotations(); - throws_ = add(throws_, throwType); - } - break; - } - default: - jj_la1[49] = jj_gen; - ; - } - jj_consume_token(LBRACE); - blockBegin = tokenBegin(); - if (jj_2_8(2147483647)) { - exConsInv = ExplicitConstructorInvocation(); - } else { - ; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeParameters = TypeParameters(); +begin = begin.orIfInvalid(typeParameters.range.begin); + break; + } + default: + jj_la1[47] = jj_gen; + ; + } + // Modifiers matched in the caller + name = SimpleName(); +begin = begin.orIfInvalid(typeParameters.range.begin); + parameters = FormalParameters(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case THROWS:{ + jj_consume_token(THROWS); + throwType = ReferenceTypeWithAnnotations(); +throws_ = add(throws_, throwType); + label_20: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[48] = jj_gen; + break label_20; } - stmts = Statements(); - jj_consume_token(RBRACE); - if (exConsInv != null) { - stmts = add(0, stmts, exConsInv); + jj_consume_token(COMMA); + throwType = ReferenceTypeWithAnnotations(); +throws_ = add(throws_, throwType); + } + break; + } + default: + jj_la1[49] = jj_gen; + ; + } + jj_consume_token(LBRACE); +blockBegin=tokenBegin(); + if (jj_2_8(2147483647)) { + exConsInv = ExplicitConstructorInvocation(); + } else { + ; + } + stmts = Statements(); + jj_consume_token(RBRACE); +if (exConsInv != null) { + stmts = add(0, stmts, exConsInv); } ConstructorDeclaration tmp = new ConstructorDeclaration(range(begin, pos(token.endLine, token.endColumn)), modifier.modifiers, modifier.annotations, typeParameters.list, null, parameters, throws_, new BlockStmt(range(blockBegin, tokenEnd()), stmts)); - tmp.setNameExpr(name); - return tmp; - } + tmp.setNameExpr(name); + return tmp; + } - final public ExplicitConstructorInvocationStmt ExplicitConstructorInvocation() { - boolean isThis = false; + final public ExplicitConstructorInvocationStmt ExplicitConstructorInvocation() {boolean isThis = false; List args; Expression expr = null; RangedList> typeArgs = new RangedList>(null); Position begin = INVALID; - if (jj_2_10(2147483647)) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - begin = typeArgs.range.begin; - break; - } - default: - jj_la1[50] = jj_gen; - ; - } - jj_consume_token(THIS); - begin = begin.orIfInvalid(tokenBegin()); - isThis = true; - args = Arguments(); - jj_consume_token(SEMICOLON); + if (jj_2_10(2147483647)) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); +begin=typeArgs.range.begin; + break; + } + default: + jj_la1[50] = jj_gen; + ; + } + jj_consume_token(THIS); +begin = begin.orIfInvalid(tokenBegin()); isThis = true; + args = Arguments(); + jj_consume_token(SEMICOLON); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LT:{ + if (jj_2_9(2147483647)) { + expr = PrimaryExpressionWithoutSuperSuffix(); + jj_consume_token(DOT); +begin=expr.getBegin(); } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LT: { - if (jj_2_9(2147483647)) { - expr = PrimaryExpressionWithoutSuperSuffix(); - jj_consume_token(DOT); - begin = expr.getBegin(); - } else { - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - begin = begin.orIfInvalid(typeArgs.range.begin); - break; - } - default: - jj_la1[51] = jj_gen; - ; - } - jj_consume_token(SUPER); - begin = begin.orIfInvalid(tokenBegin()); - args = Arguments(); - jj_consume_token(SEMICOLON); - break; - } - default: - jj_la1[52] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); +begin = begin.orIfInvalid(typeArgs.range.begin); + break; + } + default: + jj_la1[51] = jj_gen; + ; + } + jj_consume_token(SUPER); +begin = begin.orIfInvalid(tokenBegin()); + args = Arguments(); + jj_consume_token(SEMICOLON); + break; } - return new ExplicitConstructorInvocationStmt(range(begin, tokenEnd()), typeArgs.list, isThis, expr, args); + default: + jj_la1[52] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } } +return new ExplicitConstructorInvocationStmt(range(begin, tokenEnd()),typeArgs.list, isThis, expr, args); + } - final public List Statements() { - List ret = null; + final public List Statements() {List ret = null; Statement stmt; - label_21: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CLASS: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case FOR: - case IF: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case RETURN: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRANSIENT: - case TRUE: - case TRY: - case VOID: - case VOLATILE: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case AT: - case INCR: - case DECR: { - ; - break; - } - default: - jj_la1[53] = jj_gen; - break label_21; - } - stmt = BlockStatement(); - ret = add(ret, stmt); - } - return ret; - } - - final public InitializerDeclaration InitializerDeclaration() { - BlockStmt block; + label_21: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case ASSERT: + case BOOLEAN: + case BREAK: + case BYTE: + case CHAR: + case CLASS: + case CONTINUE: + case DO: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case FOR: + case IF: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case RETURN: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SWITCH: + case SYNCHRONIZED: + case THIS: + case THROW: + case TRANSIENT: + case TRUE: + case TRY: + case VOID: + case VOLATILE: + case WHILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case SEMICOLON: + case AT: + case INCR: + case DECR:{ + ; + break; + } + default: + jj_la1[53] = jj_gen; + break label_21; + } + stmt = BlockStatement(); +ret = add(ret, stmt); + } +return ret; + } + + final public InitializerDeclaration InitializerDeclaration() {BlockStmt block; Position begin = INVALID; boolean isStatic = false; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STATIC: { - jj_consume_token(STATIC); - isStatic = true; - begin = tokenBegin(); - break; - } - default: - jj_la1[54] = jj_gen; - ; - } - block = Block(); - begin = begin.orIfInvalid(block.getBegin()); - return new InitializerDeclaration(range(begin, tokenEnd()), isStatic, block); - } - - /* - * Type, name and expression syntax follows. - */ - final public Type Type() { - Type ret; - if (jj_2_11(2)) { - ret = ReferenceType(); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: { - ret = PrimitiveType(); - break; - } - default: - jj_la1[55] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - return ret; - } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STATIC:{ + jj_consume_token(STATIC); +isStatic = true; begin=tokenBegin(); + break; + } + default: + jj_la1[54] = jj_gen; + ; + } + block = Block(); +begin = begin.orIfInvalid(block.getBegin()); +return new InitializerDeclaration(range(begin, tokenEnd()), isStatic, block); + } - final public ReferenceType ReferenceType() { - Type type; +/* + * Type, name and expression syntax follows. + */ + final public +Type Type() {Type ret; + if (jj_2_11(2)) { + ret = ReferenceType(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT:{ + ret = PrimitiveType(); + break; + } + default: + jj_la1[55] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } +return ret; + } + + final public ReferenceType ReferenceType() {Type type; ArrayBracketPair arrayBracketPair; List arrayBracketPairs = null; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: { - type = PrimitiveType(); - label_22: - while (true) { - arrayBracketPair = ArrayBracketPair(); - arrayBracketPairs = add(arrayBracketPairs, arrayBracketPair); - if (jj_2_12(2)) { - ; - } else { - break label_22; - } - } - break; - } - case IDENTIFIER: { - type = ClassOrInterfaceType(); - label_23: - while (true) { - if (jj_2_13(2)) { - ; - } else { - break label_23; - } - arrayBracketPair = ArrayBracketPair(); - arrayBracketPairs = add(arrayBracketPairs, arrayBracketPair); - } - break; - } - default: - jj_la1[56] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return (ReferenceType) wrapInArrayTypes(type, arrayBracketPairs); - } - - final public ArrayBracketPair ArrayBracketPair() { - List annotations = null; - Position begin = INVALID; - annotations = Annotations(); - jj_consume_token(LBRACKET); - begin = begin.orIfInvalid(tokenBegin()); - jj_consume_token(RBRACKET); - return new ArrayBracketPair(range(begin, tokenEnd()), annotations); - } - - final public IntersectionType IntersectionType() { - Position begin; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT:{ + type = PrimitiveType(); + label_22: + while (true) { + arrayBracketPair = ArrayBracketPair(); +arrayBracketPairs=add(arrayBracketPairs, arrayBracketPair); + if (jj_2_12(2)) { + ; + } else { + break label_22; + } + } + break; + } + case IDENTIFIER:{ + type = ClassOrInterfaceType(); + label_23: + while (true) { + if (jj_2_13(2)) { + ; + } else { + break label_23; + } + arrayBracketPair = ArrayBracketPair(); +arrayBracketPairs=add(arrayBracketPairs, arrayBracketPair); + } + break; + } + default: + jj_la1[56] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return (ReferenceType)wrapInArrayTypes(type, arrayBracketPairs); + } + + final public ArrayBracketPair ArrayBracketPair() {List annotations = null; + Position begin = INVALID; + annotations = Annotations(); + jj_consume_token(LBRACKET); +begin = begin.orIfInvalid(tokenBegin()); + jj_consume_token(RBRACKET); +return new ArrayBracketPair(range(begin, tokenEnd()), annotations); + } + + final public IntersectionType IntersectionType() {Position begin; ReferenceType elementType; List elements = null; - elementType = ReferenceType(); - begin = elementType.getBegin(); - elements = add(elements, elementType); - jj_consume_token(BIT_AND); - label_24: - while (true) { - elementType = ReferenceType(); - elements = add(elements, elementType); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: { - ; - break; - } - default: - jj_la1[57] = jj_gen; - break label_24; - } - } - return new IntersectionType(range(begin, tokenEnd()), elements); - } - - final public ClassOrInterfaceType AnnotatedClassOrInterfaceType() { - List annotations; + elementType = ReferenceType(); +begin=elementType.getBegin(); elements = add(elements, elementType); + jj_consume_token(BIT_AND); + label_24: + while (true) { + elementType = ReferenceType(); +elements = add(elements, elementType); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER:{ + ; + break; + } + default: + jj_la1[57] = jj_gen; + break label_24; + } + } +return new IntersectionType(range(begin, tokenEnd()), elements); + } + + final public ClassOrInterfaceType AnnotatedClassOrInterfaceType() {List annotations; ClassOrInterfaceType cit; - annotations = Annotations(); - cit = ClassOrInterfaceType(); - if (cit.getScope() != null) { + annotations = Annotations(); + cit = ClassOrInterfaceType(); +if (cit.getScope()!=null) { cit.getScope().setAnnotations(annotations); } else { cit.setAnnotations(annotations); } return cit; - } + } - final public ClassOrInterfaceType ClassOrInterfaceType() { - ClassOrInterfaceType ret; + final public ClassOrInterfaceType ClassOrInterfaceType() {ClassOrInterfaceType ret; String name; RangedList> typeArgs = new RangedList>(null); Position begin; List annotations = null; - jj_consume_token(IDENTIFIER); - begin = tokenBegin(); - name = token.image; - if (jj_2_14(2)) { - typeArgs = TypeArguments(); - } else { - ; - } - ret = new ClassOrInterfaceType(range(begin, tokenEnd()), null, name, typeArgs.list); - label_25: - while (true) { - if (jj_2_15(2)) { - ; - } else { - break label_25; - } - jj_consume_token(DOT); - annotations = Annotations(); - jj_consume_token(IDENTIFIER); - name = token.image; - if (jj_2_16(2)) { - typeArgs = TypeArguments(); - } else { - ; - } - ret = new ClassOrInterfaceType(range(begin, tokenEnd()), ret, name, typeArgs.list); + jj_consume_token(IDENTIFIER); +begin=tokenBegin(); +name = token.image; + if (jj_2_14(2)) { + typeArgs = TypeArguments(); + } else { + ; + } +ret = new ClassOrInterfaceType(range(begin, tokenEnd()),null, name, typeArgs.list); + label_25: + while (true) { + if (jj_2_15(2)) { + ; + } else { + break label_25; + } + jj_consume_token(DOT); + annotations = Annotations(); + jj_consume_token(IDENTIFIER); +name = token.image; + if (jj_2_16(2)) { + typeArgs = TypeArguments(); + } else { + ; + } +ret = new ClassOrInterfaceType(range(begin, tokenEnd()),ret, name, typeArgs.list); ret.setAnnotations(annotations); annotations = null; - } - return ret; } +return ret; + } - final public RangedList> TypeArguments() { - RangedList> ret = new RangedList>(new LinkedList>()); + final public RangedList> TypeArguments() {RangedList> ret = new RangedList>(new LinkedList>()); Type type; - jj_consume_token(LT); - ret.beginAt(tokenBegin()); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - case AT: - case HOOK: { - type = TypeArgument(); - ret.add(type); - label_26: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[58] = jj_gen; - break label_26; - } - jj_consume_token(COMMA); - type = TypeArgument(); - ret.add(type); - } - break; - } - default: - jj_la1[59] = jj_gen; - ; + jj_consume_token(LT); +ret.beginAt(tokenBegin()); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + case AT: + case HOOK:{ + type = TypeArgument(); +ret.add(type); + label_26: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[58] = jj_gen; + break label_26; } - jj_consume_token(GT); - ret.endAt(tokenEnd()); - return ret; - } - - final public Type TypeArgument() { - Type ret; + jj_consume_token(COMMA); + type = TypeArgument(); +ret.add(type); + } + break; + } + default: + jj_la1[59] = jj_gen; + ; + } + jj_consume_token(GT); +ret.endAt(tokenEnd()); +return ret; + } + + final public Type TypeArgument() {Type ret; List annotations = null; - annotations = Annotations(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: { - ret = ReferenceType(); - break; - } - case HOOK: { - ret = Wildcard(); - break; - } - default: - jj_la1[60] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret.setAnnotations(annotations); - return ret; - } - - final public WildcardType Wildcard() { - ReferenceType ext = null; + annotations = Annotations(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER:{ + ret = ReferenceType(); + break; + } + case HOOK:{ + ret = Wildcard(); + break; + } + default: + jj_la1[60] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ret.setAnnotations(annotations); return ret; + } + + final public WildcardType Wildcard() {ReferenceType ext = null; ReferenceType sup = null; Position begin; List annotations = null; - jj_consume_token(HOOK); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EXTENDS: - case SUPER: { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EXTENDS: { - jj_consume_token(EXTENDS); - annotations = Annotations(); - ext = ReferenceType(); - ext.setAnnotations(annotations); - break; - } - case SUPER: { - jj_consume_token(SUPER); - annotations = Annotations(); - sup = ReferenceType(); - sup.setAnnotations(annotations); - break; - } - default: - jj_la1[61] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[62] = jj_gen; - ; + jj_consume_token(HOOK); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EXTENDS: + case SUPER:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EXTENDS:{ + jj_consume_token(EXTENDS); + annotations = Annotations(); + ext = ReferenceType(); +ext.setAnnotations(annotations); + break; } - return new WildcardType(range(begin, tokenEnd()), ext, sup); - } + case SUPER:{ + jj_consume_token(SUPER); + annotations = Annotations(); + sup = ReferenceType(); +sup.setAnnotations(annotations); + break; + } + default: + jj_la1[61] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + default: + jj_la1[62] = jj_gen; + ; + } +return new WildcardType(range(begin, tokenEnd()),ext, sup); + } + + final public PrimitiveType PrimitiveType() {PrimitiveType ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN:{ + jj_consume_token(BOOLEAN); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Boolean); + break; + } + case CHAR:{ + jj_consume_token(CHAR); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Char); + break; + } + case BYTE:{ + jj_consume_token(BYTE); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Byte); + break; + } + case SHORT:{ + jj_consume_token(SHORT); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Short); + break; + } + case INT:{ + jj_consume_token(INT); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Int); + break; + } + case LONG:{ + jj_consume_token(LONG); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Long); + break; + } + case FLOAT:{ + jj_consume_token(FLOAT); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Float); + break; + } + case DOUBLE:{ + jj_consume_token(DOUBLE); +ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Double); + break; + } + default: + jj_la1[63] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public Type ResultType() {Type ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case VOID:{ + jj_consume_token(VOID); +ret = new VoidType(tokenRange()); + break; + } + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER:{ + ret = Type(); + break; + } + default: + jj_la1[64] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public NameExpr Name() {NameExpr ret; + jj_consume_token(IDENTIFIER); +ret = new NameExpr(tokenRange(), token.image); + label_27: + while (true) { + if (jj_2_17(2)) { + ; + } else { + break label_27; + } + jj_consume_token(DOT); + jj_consume_token(IDENTIFIER); +ret = new QualifiedNameExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, token.image); + } +return ret; + } + + final public NameExpr SimpleName() {NameExpr ret; + jj_consume_token(IDENTIFIER); +ret = new NameExpr(tokenRange(), token.image); +return ret; + } - final public PrimitiveType PrimitiveType() { - PrimitiveType ret; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: { - jj_consume_token(BOOLEAN); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Boolean); - break; - } - case CHAR: { - jj_consume_token(CHAR); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Char); - break; - } - case BYTE: { - jj_consume_token(BYTE); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Byte); - break; - } - case SHORT: { - jj_consume_token(SHORT); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Short); - break; - } - case INT: { - jj_consume_token(INT); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Int); - break; - } - case LONG: { - jj_consume_token(LONG); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Long); - break; - } - case FLOAT: { - jj_consume_token(FLOAT); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Float); - break; +/* + * Expression syntax follows. + */ + final public +Expression Expression() {Expression ret; + AssignExpr.Operator op; + Expression value; + Statement lambdaBody = null; + RangedList> typeArgs = new RangedList>(null); + ret = ConditionalExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASSIGN: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN: + case ARROW: + case DOUBLECOLON:{ + if (jj_2_18(2)) { + op = AssignmentOperator(); + value = Expression(); +ret = new AssignExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, value, op); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ARROW:{ + jj_consume_token(ARROW); + lambdaBody = LambdaBody(); +if (ret instanceof CastExpr) + { + ret = generateLambda(ret, lambdaBody); + } + else if (ret instanceof ConditionalExpr){ + ConditionalExpr ce = (ConditionalExpr) ret; + if(ce.getElseExpr() != null){ + ce.setElseExpr(generateLambda(ce.getElseExpr(), lambdaBody)); + } + } + else + { + ret = generateLambda(ret, lambdaBody); + } + break; + } + case DOUBLECOLON:{ + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); + break; } - case DOUBLE: { - jj_consume_token(DOUBLE); - ret = new PrimitiveType(tokenRange(), PrimitiveType.Primitive.Double); - break; + default: + jj_la1[65] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + jj_consume_token(IDENTIFIER); + break; } - default: - jj_la1[63] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public Type ResultType() { - Type ret; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case VOID: { - jj_consume_token(VOID); - ret = new VoidType(tokenRange()); - break; + case NEW:{ + jj_consume_token(NEW); + break; } - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: { - ret = Type(); - break; - } - default: - jj_la1[64] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public NameExpr Name() { - NameExpr ret; - jj_consume_token(IDENTIFIER); - ret = new NameExpr(tokenRange(), token.image); - label_27: - while (true) { - if (jj_2_17(2)) { - ; - } else { - break label_27; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER); - ret = new QualifiedNameExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, token.image); - } - return ret; - } - - final public NameExpr SimpleName() { - NameExpr ret; - jj_consume_token(IDENTIFIER); - ret = new NameExpr(tokenRange(), token.image); - return ret; - } - - /* - * Expression syntax follows. - */ - final public Expression Expression() { - Expression ret; - AssignExpr.Operator op; - Expression value; - Statement lambdaBody = null; - RangedList> typeArgs = new RangedList>(null); - ret = ConditionalExpression(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASSIGN: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - case ARROW: - case DOUBLECOLON: { - if (jj_2_18(2)) { - op = AssignmentOperator(); - value = Expression(); - ret = new AssignExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, value, op); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ARROW: { - jj_consume_token(ARROW); - lambdaBody = LambdaBody(); - if (ret instanceof CastExpr) { - ret = generateLambda(ret, lambdaBody); - } else if (ret instanceof ConditionalExpr) { - ConditionalExpr ce = (ConditionalExpr) ret; - if (ce.getElseExpr() != null) { - ce.setElseExpr(generateLambda(ce.getElseExpr(), lambdaBody)); - } - } else { - ret = generateLambda(ret, lambdaBody); - } - break; - } - case DOUBLECOLON: { - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - break; - } - default: - jj_la1[65] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - jj_consume_token(IDENTIFIER); - break; - } - case NEW: { - jj_consume_token(NEW); - break; - } - default: - jj_la1[66] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new MethodReferenceExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, typeArgs.list, token.image); - break; - } - default: - jj_la1[67] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - } - default: - jj_la1[68] = jj_gen; - ; - } - return ret; - } - - final public AssignExpr.Operator AssignmentOperator() { - AssignExpr.Operator ret; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASSIGN: { - jj_consume_token(ASSIGN); - ret = AssignExpr.Operator.assign; - break; - } - case STARASSIGN: { - jj_consume_token(STARASSIGN); - ret = AssignExpr.Operator.star; - break; - } - case SLASHASSIGN: { - jj_consume_token(SLASHASSIGN); - ret = AssignExpr.Operator.slash; - break; - } - case REMASSIGN: { - jj_consume_token(REMASSIGN); - ret = AssignExpr.Operator.rem; - break; - } - case PLUSASSIGN: { - jj_consume_token(PLUSASSIGN); - ret = AssignExpr.Operator.plus; - break; - } - case MINUSASSIGN: { - jj_consume_token(MINUSASSIGN); - ret = AssignExpr.Operator.minus; - break; - } - case LSHIFTASSIGN: { - jj_consume_token(LSHIFTASSIGN); - ret = AssignExpr.Operator.lShift; - break; - } - case RSIGNEDSHIFTASSIGN: { - jj_consume_token(RSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rSignedShift; - break; - } - case RUNSIGNEDSHIFTASSIGN: { - jj_consume_token(RUNSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rUnsignedShift; - break; - } - case ANDASSIGN: { - jj_consume_token(ANDASSIGN); - ret = AssignExpr.Operator.and; - break; - } - case XORASSIGN: { - jj_consume_token(XORASSIGN); - ret = AssignExpr.Operator.xor; - break; - } - case ORASSIGN: { - jj_consume_token(ORASSIGN); - ret = AssignExpr.Operator.or; - break; - } - default: - jj_la1[69] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public Expression ConditionalExpression() { - Expression ret; + default: + jj_la1[66] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ret = new MethodReferenceExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, typeArgs.list, token.image); + break; + } + default: + jj_la1[67] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[68] = jj_gen; + ; + } +return ret; + } + + final public AssignExpr.Operator AssignmentOperator() {AssignExpr.Operator ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASSIGN:{ + jj_consume_token(ASSIGN); +ret = AssignExpr.Operator.assign; + break; + } + case STARASSIGN:{ + jj_consume_token(STARASSIGN); +ret = AssignExpr.Operator.star; + break; + } + case SLASHASSIGN:{ + jj_consume_token(SLASHASSIGN); +ret = AssignExpr.Operator.slash; + break; + } + case REMASSIGN:{ + jj_consume_token(REMASSIGN); +ret = AssignExpr.Operator.rem; + break; + } + case PLUSASSIGN:{ + jj_consume_token(PLUSASSIGN); +ret = AssignExpr.Operator.plus; + break; + } + case MINUSASSIGN:{ + jj_consume_token(MINUSASSIGN); +ret = AssignExpr.Operator.minus; + break; + } + case LSHIFTASSIGN:{ + jj_consume_token(LSHIFTASSIGN); +ret = AssignExpr.Operator.lShift; + break; + } + case RSIGNEDSHIFTASSIGN:{ + jj_consume_token(RSIGNEDSHIFTASSIGN); +ret = AssignExpr.Operator.rSignedShift; + break; + } + case RUNSIGNEDSHIFTASSIGN:{ + jj_consume_token(RUNSIGNEDSHIFTASSIGN); +ret = AssignExpr.Operator.rUnsignedShift; + break; + } + case ANDASSIGN:{ + jj_consume_token(ANDASSIGN); +ret = AssignExpr.Operator.and; + break; + } + case XORASSIGN:{ + jj_consume_token(XORASSIGN); +ret = AssignExpr.Operator.xor; + break; + } + case ORASSIGN:{ + jj_consume_token(ORASSIGN); +ret = AssignExpr.Operator.or; + break; + } + default: + jj_la1[69] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public Expression ConditionalExpression() {Expression ret; Expression left; Expression right; - ret = ConditionalOrExpression(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case HOOK: { - jj_consume_token(HOOK); - left = Expression(); - jj_consume_token(COLON); - right = ConditionalExpression(); - ret = new ConditionalExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, left, right); - break; - } - default: - jj_la1[70] = jj_gen; - ; - } - return ret; - } - - final public Expression ConditionalOrExpression() { - Expression ret; + ret = ConditionalOrExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HOOK:{ + jj_consume_token(HOOK); + left = Expression(); + jj_consume_token(COLON); + right = ConditionalExpression(); +ret = new ConditionalExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, left, right); + break; + } + default: + jj_la1[70] = jj_gen; + ; + } +return ret; + } + + final public Expression ConditionalOrExpression() {Expression ret; Expression right; - ret = ConditionalAndExpression(); - label_28: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SC_OR: { - ; - break; - } - default: - jj_la1[71] = jj_gen; - break label_28; - } - jj_consume_token(SC_OR); - right = ConditionalAndExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.or); - } - return ret; - } - - final public Expression ConditionalAndExpression() { - Expression ret; + ret = ConditionalAndExpression(); + label_28: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SC_OR:{ + ; + break; + } + default: + jj_la1[71] = jj_gen; + break label_28; + } + jj_consume_token(SC_OR); + right = ConditionalAndExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.or); + } +return ret; + } + + final public Expression ConditionalAndExpression() {Expression ret; Expression right; - ret = InclusiveOrExpression(); - label_29: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SC_AND: { - ; - break; - } - default: - jj_la1[72] = jj_gen; - break label_29; - } - jj_consume_token(SC_AND); - right = InclusiveOrExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.and); - } - return ret; - } - - final public Expression InclusiveOrExpression() { - Expression ret; + ret = InclusiveOrExpression(); + label_29: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SC_AND:{ + ; + break; + } + default: + jj_la1[72] = jj_gen; + break label_29; + } + jj_consume_token(SC_AND); + right = InclusiveOrExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.and); + } +return ret; + } + + final public Expression InclusiveOrExpression() {Expression ret; Expression right; - ret = ExclusiveOrExpression(); - label_30: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BIT_OR: { - ; - break; - } - default: - jj_la1[73] = jj_gen; - break label_30; - } - jj_consume_token(BIT_OR); - right = ExclusiveOrExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.binOr); - } - return ret; - } - - final public Expression ExclusiveOrExpression() { - Expression ret; + ret = ExclusiveOrExpression(); + label_30: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BIT_OR:{ + ; + break; + } + default: + jj_la1[73] = jj_gen; + break label_30; + } + jj_consume_token(BIT_OR); + right = ExclusiveOrExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.binOr); + } +return ret; + } + + final public Expression ExclusiveOrExpression() {Expression ret; Expression right; - ret = AndExpression(); - label_31: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case XOR: { - ; - break; - } - default: - jj_la1[74] = jj_gen; - break label_31; - } - jj_consume_token(XOR); - right = AndExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.xor); - } - return ret; - } - - final public Expression AndExpression() { - Expression ret; + ret = AndExpression(); + label_31: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case XOR:{ + ; + break; + } + default: + jj_la1[74] = jj_gen; + break label_31; + } + jj_consume_token(XOR); + right = AndExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.xor); + } +return ret; + } + + final public Expression AndExpression() {Expression ret; Expression right; - ret = EqualityExpression(); - label_32: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BIT_AND: { - ; - break; - } - default: - jj_la1[75] = jj_gen; - break label_32; - } - jj_consume_token(BIT_AND); - right = EqualityExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.binAnd); - } - return ret; - } - - final public Expression EqualityExpression() { - Expression ret; + ret = EqualityExpression(); + label_32: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BIT_AND:{ + ; + break; + } + default: + jj_la1[75] = jj_gen; + break label_32; + } + jj_consume_token(BIT_AND); + right = EqualityExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, BinaryExpr.Operator.binAnd); + } +return ret; + } + + final public Expression EqualityExpression() {Expression ret; Expression right; BinaryExpr.Operator op; - ret = InstanceOfExpression(); - label_33: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EQ: - case NE: { - ; - break; - } - default: - jj_la1[76] = jj_gen; - break label_33; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EQ: { - jj_consume_token(EQ); - op = BinaryExpr.Operator.equals; - break; - } - case NE: { - jj_consume_token(NE); - op = BinaryExpr.Operator.notEquals; - break; - } - default: - jj_la1[77] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = InstanceOfExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); - } - return ret; - } - - final public Expression InstanceOfExpression() { - Expression ret; + ret = InstanceOfExpression(); + label_33: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EQ: + case NE:{ + ; + break; + } + default: + jj_la1[76] = jj_gen; + break label_33; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EQ:{ + jj_consume_token(EQ); +op = BinaryExpr.Operator.equals; + break; + } + case NE:{ + jj_consume_token(NE); +op = BinaryExpr.Operator.notEquals; + break; + } + default: + jj_la1[77] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = InstanceOfExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); + } +return ret; + } + + final public Expression InstanceOfExpression() {Expression ret; Type type; - ret = RelationalExpression(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INSTANCEOF: { - jj_consume_token(INSTANCEOF); - type = Type(); - ret = new InstanceOfExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, type); - break; - } - default: - jj_la1[78] = jj_gen; - ; - } - return ret; - } - - final public Expression RelationalExpression() { - Expression ret; + ret = RelationalExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INSTANCEOF:{ + jj_consume_token(INSTANCEOF); + type = Type(); +ret = new InstanceOfExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, type); + break; + } + default: + jj_la1[78] = jj_gen; + ; + } +return ret; + } + + final public Expression RelationalExpression() {Expression ret; Expression right; BinaryExpr.Operator op; - ret = ShiftExpression(); - label_34: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: - case LE: - case GE: - case GT: { - ; - break; - } - default: - jj_la1[79] = jj_gen; - break label_34; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - jj_consume_token(LT); - op = BinaryExpr.Operator.less; - break; - } - case GT: { - jj_consume_token(GT); - op = BinaryExpr.Operator.greater; - break; - } - case LE: { - jj_consume_token(LE); - op = BinaryExpr.Operator.lessEquals; - break; - } - case GE: { - jj_consume_token(GE); - op = BinaryExpr.Operator.greaterEquals; - break; - } - default: - jj_la1[80] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = ShiftExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); + ret = ShiftExpression(); + label_34: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT: + case LE: + case GE: + case GT:{ + ; + break; + } + default: + jj_la1[79] = jj_gen; + break label_34; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + jj_consume_token(LT); +op = BinaryExpr.Operator.less; + break; } - return ret; - } - - final public Expression ShiftExpression() { - Expression ret; + case GT:{ + jj_consume_token(GT); +op = BinaryExpr.Operator.greater; + break; + } + case LE:{ + jj_consume_token(LE); +op = BinaryExpr.Operator.lessEquals; + break; + } + case GE:{ + jj_consume_token(GE); +op = BinaryExpr.Operator.greaterEquals; + break; + } + default: + jj_la1[80] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = ShiftExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); + } +return ret; + } + + final public Expression ShiftExpression() {Expression ret; Expression right; BinaryExpr.Operator op; - ret = AdditiveExpression(); - label_35: - while (true) { - if (jj_2_19(1)) { - ; - } else { - break label_35; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LSHIFT: { - jj_consume_token(LSHIFT); - op = BinaryExpr.Operator.lShift; - break; - } - default: - jj_la1[81] = jj_gen; - if (jj_2_20(1)) { - RSIGNEDSHIFT(); - op = BinaryExpr.Operator.rSignedShift; - } else if (jj_2_21(1)) { - RUNSIGNEDSHIFT(); - op = BinaryExpr.Operator.rUnsignedShift; - } else { - jj_consume_token(-1); - throw new ParseException(); - } - } - right = AdditiveExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); + ret = AdditiveExpression(); + label_35: + while (true) { + if (jj_2_19(1)) { + ; + } else { + break label_35; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LSHIFT:{ + jj_consume_token(LSHIFT); +op = BinaryExpr.Operator.lShift; + break; + } + default: + jj_la1[81] = jj_gen; + if (jj_2_20(1)) { + RSIGNEDSHIFT(); +op = BinaryExpr.Operator.rSignedShift; + } else if (jj_2_21(1)) { + RUNSIGNEDSHIFT(); +op = BinaryExpr.Operator.rUnsignedShift; + } else { + jj_consume_token(-1); + throw new ParseException(); } - return ret; + } + right = AdditiveExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); } +return ret; + } - final public Expression AdditiveExpression() { - Expression ret; + final public Expression AdditiveExpression() {Expression ret; Expression right; BinaryExpr.Operator op; - ret = MultiplicativeExpression(); - label_36: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: - case MINUS: { - ; - break; - } - default: - jj_la1[82] = jj_gen; - break label_36; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - jj_consume_token(PLUS); - op = BinaryExpr.Operator.plus; - break; - } - case MINUS: { - jj_consume_token(MINUS); - op = BinaryExpr.Operator.minus; - break; - } - default: - jj_la1[83] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = MultiplicativeExpression(); - ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); - } - return ret; - } - - final public Expression MultiplicativeExpression() { - Expression ret; + ret = MultiplicativeExpression(); + label_36: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS: + case MINUS:{ + ; + break; + } + default: + jj_la1[82] = jj_gen; + break label_36; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +op = BinaryExpr.Operator.plus; + break; + } + case MINUS:{ + jj_consume_token(MINUS); +op = BinaryExpr.Operator.minus; + break; + } + default: + jj_la1[83] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = MultiplicativeExpression(); +ret = new BinaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, right, op); + } +return ret; + } + + final public Expression MultiplicativeExpression() {Expression ret; Expression right; BinaryExpr.Operator op; - ret = UnaryExpression(); - label_37: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STAR: - case SLASH: - case REM: { - ; - break; - } - default: - jj_la1[84] = jj_gen; - break label_37; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STAR: { - jj_consume_token(STAR); - op = BinaryExpr.Operator.times; - break; - } - case SLASH: { - jj_consume_token(SLASH); - op = BinaryExpr.Operator.divide; - break; - } - case REM: { - jj_consume_token(REM); - op = BinaryExpr.Operator.remainder; - break; - } - default: - jj_la1[85] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = UnaryExpression(); - ret = new BinaryExpr(range(ret.getBegin(), tokenEnd()), ret, right, op); - } - return ret; - } - - final public Expression UnaryExpression() { - Expression ret; + ret = UnaryExpression(); + label_37: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STAR: + case SLASH: + case REM:{ + ; + break; + } + default: + jj_la1[84] = jj_gen; + break label_37; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STAR:{ + jj_consume_token(STAR); +op = BinaryExpr.Operator.times; + break; + } + case SLASH:{ + jj_consume_token(SLASH); +op = BinaryExpr.Operator.divide; + break; + } + case REM:{ + jj_consume_token(REM); +op = BinaryExpr.Operator.remainder; + break; + } + default: + jj_la1[85] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = UnaryExpression(); +ret = new BinaryExpr(range(ret.getBegin(), tokenEnd()), ret, right, op); + } +return ret; + } + + final public Expression UnaryExpression() {Expression ret; UnaryExpr.Operator op; Position begin = INVALID; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INCR: { - ret = PreIncrementExpression(); - break; - } - case DECR: { - ret = PreDecrementExpression(); - break; - } - case PLUS: - case MINUS: { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - jj_consume_token(PLUS); - op = UnaryExpr.Operator.positive; - begin = tokenBegin(); - break; - } - case MINUS: { - jj_consume_token(MINUS); - op = UnaryExpr.Operator.negative; - begin = tokenBegin(); - break; - } - default: - jj_la1[86] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - if (op == UnaryExpr.Operator.negative) { - if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr) ret).isMinValue()) { - ret = new IntegerLiteralMinValueExpr(range(begin, tokenEnd())); - } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr) ret).isMinValue()) { - ret = new LongLiteralMinValueExpr(range(begin, tokenEnd())); - } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INCR:{ + ret = PreIncrementExpression(); + break; + } + case DECR:{ + ret = PreDecrementExpression(); + break; + } + case PLUS: + case MINUS:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +op = UnaryExpr.Operator.positive; begin=tokenBegin(); + break; + } + case MINUS:{ + jj_consume_token(MINUS); +op = UnaryExpr.Operator.negative; begin=tokenBegin(); + break; + } + default: + jj_la1[86] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = UnaryExpression(); +if(op == UnaryExpr.Operator.negative) { + if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr)ret).isMinValue()) { + ret = new IntegerLiteralMinValueExpr(range(begin, tokenEnd())); + } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr)ret).isMinValue()) { + ret = new LongLiteralMinValueExpr(range(begin, tokenEnd())); + } else { + ret = new UnaryExpr(range(begin, tokenEnd()), ret, op); + } + } else { ret = new UnaryExpr(range(begin, tokenEnd()), ret, op); - } - } else { - ret = new UnaryExpr(range(begin, tokenEnd()), ret, op); - } - break; - } - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: { - ret = UnaryExpressionNotPlusMinus(); - break; - } - default: - jj_la1[87] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public Expression PreIncrementExpression() { - Expression ret; + } + break; + } + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE:{ + ret = UnaryExpressionNotPlusMinus(); + break; + } + default: + jj_la1[87] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public Expression PreIncrementExpression() {Expression ret; Position begin = INVALID; - jj_consume_token(INCR); - begin = tokenBegin(); - ret = UnaryExpression(); - ret = new UnaryExpr(range(begin, tokenEnd()), ret, UnaryExpr.Operator.preIncrement); - return ret; - } - - final public Expression PreDecrementExpression() { - Expression ret; + jj_consume_token(INCR); +begin=tokenBegin(); + ret = UnaryExpression(); +ret = new UnaryExpr(range(begin, tokenEnd()), ret, UnaryExpr.Operator.preIncrement); +return ret; + } + + final public Expression PreDecrementExpression() {Expression ret; Position begin; - jj_consume_token(DECR); - begin = tokenBegin(); - ret = UnaryExpression(); - ret = new UnaryExpr(range(begin, tokenEnd()), ret, UnaryExpr.Operator.preDecrement); - return ret; - } - - final public Expression UnaryExpressionNotPlusMinus() { - Expression ret; + jj_consume_token(DECR); +begin=tokenBegin(); + ret = UnaryExpression(); +ret = new UnaryExpr(range(begin, tokenEnd()), ret, UnaryExpr.Operator.preDecrement); +return ret; + } + + final public Expression UnaryExpressionNotPlusMinus() {Expression ret; UnaryExpr.Operator op; Position begin = INVALID; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BANG: - case TILDE: { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case TILDE: { - jj_consume_token(TILDE); - op = UnaryExpr.Operator.inverse; - begin = tokenBegin(); - break; - } - case BANG: { - jj_consume_token(BANG); - op = UnaryExpr.Operator.not; - begin = tokenBegin(); - break; - } - default: - jj_la1[88] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - ret = new UnaryExpr(range(begin, tokenEnd()), ret, op); - break; - } - default: - jj_la1[89] = jj_gen; - if (jj_2_22(2147483647)) { - ret = CastExpression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: { - ret = PostfixExpression(); - break; - } - default: - jj_la1[90] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - return ret; - } - - final public Expression PostfixExpression() { - Expression ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BANG: + case TILDE:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case TILDE:{ + jj_consume_token(TILDE); +op = UnaryExpr.Operator.inverse; begin=tokenBegin(); + break; + } + case BANG:{ + jj_consume_token(BANG); +op = UnaryExpr.Operator.not; begin=tokenBegin(); + break; + } + default: + jj_la1[88] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = UnaryExpression(); +ret = new UnaryExpr(range(begin, tokenEnd()), ret, op); + break; + } + default: + jj_la1[89] = jj_gen; + if (jj_2_22(2147483647)) { + ret = CastExpression(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN:{ + ret = PostfixExpression(); + break; + } + default: + jj_la1[90] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } +return ret; + } + + final public Expression PostfixExpression() {Expression ret; UnaryExpr.Operator op; - ret = PrimaryExpression(); - if (jj_2_23(2)) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INCR: { - jj_consume_token(INCR); - op = UnaryExpr.Operator.posIncrement; - break; - } - case DECR: { - jj_consume_token(DECR); - op = UnaryExpr.Operator.posDecrement; - break; - } - default: - jj_la1[91] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new UnaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, op); - } else { - ; + ret = PrimaryExpression(); + if (jj_2_23(2)) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INCR:{ + jj_consume_token(INCR); +op = UnaryExpr.Operator.posIncrement; + break; } - return ret; - } - - final public Expression CastExpression() { - Expression ret; + case DECR:{ + jj_consume_token(DECR); +op = UnaryExpr.Operator.posDecrement; + break; + } + default: + jj_la1[91] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ret = new UnaryExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, op); + } else { + ; + } +return ret; + } + + final public Expression CastExpression() {Expression ret; ReferenceType referenceType; PrimitiveType primitiveType; Position begin = INVALID; List annotations = null; List typesOfMultiCast = null; - jj_consume_token(LPAREN); - begin = tokenBegin(); - annotations = Annotations(); - if (jj_2_24(2)) { - primitiveType = PrimitiveType(); - jj_consume_token(RPAREN); - ret = UnaryExpression(); - primitiveType.setAnnotations(annotations); - ret = new CastExpr(range(begin, tokenEnd()), primitiveType, ret); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: { - referenceType = ReferenceType(); - typesOfMultiCast = add(typesOfMultiCast, referenceType); - referenceType.setAnnotations(annotations); - label_38: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BIT_AND: { - ; - break; - } - default: - jj_la1[92] = jj_gen; - break label_38; - } - jj_consume_token(BIT_AND); - referenceType = ReferenceType(); - typesOfMultiCast = add(typesOfMultiCast, referenceType); - } - jj_consume_token(RPAREN); - ret = UnaryExpressionNotPlusMinus(); - if (typesOfMultiCast.size() > 1) { - ret = new CastExpr(range(begin, tokenEnd()), new IntersectionType(range(begin, tokenEnd()), typesOfMultiCast), ret); - } - ret = new CastExpr(range(begin, tokenEnd()), referenceType, ret); - break; - } - default: - jj_la1[93] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - return ret; - } - - final public Expression PrimaryExpression() { - Expression ret; - ret = PrimaryPrefix(); - label_39: - while (true) { - if (jj_2_25(2)) { - ; - } else { - break label_39; - } - ret = PrimarySuffix(ret); - } - return ret; - } - - final public Expression PrimaryExpressionWithoutSuperSuffix() { - Expression ret; - ret = PrimaryPrefix(); - label_40: + jj_consume_token(LPAREN); +begin=tokenBegin(); + annotations = Annotations(); + if (jj_2_24(2)) { + primitiveType = PrimitiveType(); + jj_consume_token(RPAREN); + ret = UnaryExpression(); +primitiveType.setAnnotations(annotations); ret = new CastExpr(range(begin, tokenEnd()), primitiveType, ret); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER:{ + referenceType = ReferenceType(); +typesOfMultiCast = add(typesOfMultiCast, referenceType); referenceType.setAnnotations(annotations); + label_38: while (true) { - if (jj_2_26(2147483647)) { - ; - } else { - break label_40; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BIT_AND:{ + ; + break; } - ret = PrimarySuffixWithoutSuper(ret); + default: + jj_la1[92] = jj_gen; + break label_38; + } + jj_consume_token(BIT_AND); + referenceType = ReferenceType(); +typesOfMultiCast = add(typesOfMultiCast, referenceType); } - return ret; - } - - final public Expression PrimaryPrefix() { - Expression ret = null; + jj_consume_token(RPAREN); + ret = UnaryExpressionNotPlusMinus(); +if (typesOfMultiCast.size() > 1) { + ret = new CastExpr(range(begin, tokenEnd()), new IntersectionType(range(begin, tokenEnd()), typesOfMultiCast), ret); + } + ret = new CastExpr(range(begin, tokenEnd()), referenceType, ret); + break; + } + default: + jj_la1[93] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } +return ret; + } + + final public Expression PrimaryExpression() {Expression ret; + ret = PrimaryPrefix(); + label_39: + while (true) { + if (jj_2_25(2)) { + ; + } else { + break label_39; + } + ret = PrimarySuffix(ret); + } +return ret; + } + + final public Expression PrimaryExpressionWithoutSuperSuffix() {Expression ret; + ret = PrimaryPrefix(); + label_40: + while (true) { + if (jj_2_26(2147483647)) { + ; + } else { + break label_40; + } + ret = PrimarySuffixWithoutSuper(ret); + } +return ret; + } + + final public Expression PrimaryPrefix() {Expression ret = null; NameExpr name; RangedList> typeArgs = new RangedList>(null); List args = null; @@ -2887,1613 +2792,1575 @@ final public Expression PrimaryPrefix() { Position begin; Parameter p = null; VariableDeclaratorId id = null; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case FALSE: - case NULL: - case TRUE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: { - ret = Literal(); - break; - } - case THIS: { - jj_consume_token(THIS); - ret = new ThisExpr(tokenRange(), null); - break; - } - case SUPER: { - jj_consume_token(SUPER); - ret = new SuperExpr(tokenRange(), null); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - break; - } - default: - jj_la1[94] = jj_gen; - ; - } - name = SimpleName(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LPAREN: { - args = Arguments(); - hasArgs = true; - break; - } - default: - jj_la1[95] = jj_gen; - ; - } - if (hasArgs) { - MethodCallExpr m = new MethodCallExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, typeArgs.list, null, args); - m.setNameExpr(name); - ret = m; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case FALSE: + case NULL: + case TRUE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL:{ + ret = Literal(); + break; + } + case THIS:{ + jj_consume_token(THIS); +ret = new ThisExpr(tokenRange(), null); + break; + } + case SUPER:{ + jj_consume_token(SUPER); +ret = new SuperExpr(tokenRange(), null); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + jj_consume_token(DOT); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); + break; + } + default: + jj_la1[94] = jj_gen; + ; + } + name = SimpleName(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LPAREN:{ + args = Arguments(); +hasArgs=true; + break; + } + default: + jj_la1[95] = jj_gen; + ; + } +if (hasArgs) { + MethodCallExpr m = new MethodCallExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, typeArgs.list, null, args); + m.setNameExpr(name); + ret = m; } else { - FieldAccessExpr f = new FieldAccessExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, null, null); - f.setFieldExpr(name); - ret = f; - } - break; - } - case DOUBLECOLON: { - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - break; - } - default: - jj_la1[96] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - jj_consume_token(IDENTIFIER); - break; - } - case NEW: { - jj_consume_token(NEW); - break; - } - default: - jj_la1[97] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + FieldAccessExpr f = new FieldAccessExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, null, null); + f.setFieldExpr(name); + ret = f; } - ret = new MethodReferenceExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, typeArgs.list, token.image); - break; - } - default: - jj_la1[98] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; + break; + } + case DOUBLECOLON:{ + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); + break; + } + default: + jj_la1[96] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + jj_consume_token(IDENTIFIER); + break; + } + case NEW:{ + jj_consume_token(NEW); + break; + } + default: + jj_la1[97] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ret = new MethodReferenceExpr(range(ret.getBegin(), pos(token.endLine, token.endColumn)), ret, typeArgs.list, token.image); + break; + } + default: + jj_la1[98] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + case LPAREN:{ + jj_consume_token(LPAREN); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + if (jj_2_27(2147483647)) { + p = FormalParameter(); +isLambda = true; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + params = FormalLambdaParameters(); + break; + } + default: + jj_la1[99] = jj_gen; + ; + } + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + ret = Expression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + params = InferredLambdaParameters(); +isLambda = true; + break; + } + default: + jj_la1[100] = jj_gen; + ; } - case LPAREN: { - jj_consume_token(LPAREN); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - if (jj_2_27(2147483647)) { - p = FormalParameter(); - isLambda = true; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - params = FormalLambdaParameters(); - break; - } - default: - jj_la1[99] = jj_gen; - ; - } - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - ret = Expression(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - params = InferredLambdaParameters(); - isLambda = true; - break; + break; + } + default: + jj_la1[101] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[102] = jj_gen; + ; + } + jj_consume_token(RPAREN); +if(!isLambda) { ret = new EnclosedExpr(range(begin, tokenEnd()), ret);} + else{ + if(ret != null){ + if(ret instanceof NameExpr) + { + id = new VariableDeclaratorId(range(ret.getBegin(), ret.getEnd()), ((NameExpr)ret).getName(), null); + p = new Parameter(range(ret.getBegin(), ret.getEnd()), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id); + } + } - default: - jj_la1[100] = jj_gen; - ; - } - break; + params = add(0, params, p); + // TODO p may be null here + ret = new LambdaExpr(range(p.getBegin(), tokenEnd()), params, null, true); } - default: - jj_la1[101] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - } - default: - jj_la1[102] = jj_gen; - ; - } - jj_consume_token(RPAREN); - if (!isLambda) { - ret = new EnclosedExpr(range(begin, tokenEnd()), ret); - } else { - if (ret != null) { - if (ret instanceof NameExpr) { - id = new VariableDeclaratorId(range(ret.getBegin(), ret.getEnd()), ((NameExpr) ret).getName(), null); - p = new Parameter(range(ret.getBegin(), ret.getEnd()), EnumSet.noneOf(Modifier.class), null, new UnknownType(), null, false, id); - } - - } - params = add(0, params, p); - // TODO p may be null here - ret = new LambdaExpr(range(p.getBegin(), tokenEnd()), params, null, true); - } - break; - } - case NEW: { - ret = AllocationExpression(null); - break; + break; + } + case NEW:{ + ret = AllocationExpression(null); + break; + } + default: + jj_la1[106] = jj_gen; + if (jj_2_28(2147483647)) { + type = ResultType(); + jj_consume_token(DOT); + jj_consume_token(CLASS); +ret = new ClassExpr(range(type.getBegin(), tokenEnd()), type); + } else if (jj_2_29(2147483647)) { + type = ResultType(); + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); + break; + } + default: + jj_la1[103] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + jj_consume_token(IDENTIFIER); + break; + } + case NEW:{ + jj_consume_token(NEW); + break; + } + default: + jj_la1[104] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ret = new TypeExpr(type.getRange(), type); + ret = new MethodReferenceExpr(ret.getRange(), ret, typeArgs.list, token.image); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + name = SimpleName(); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LPAREN:{ + args = Arguments(); +hasArgs=true; + break; } - default: - jj_la1[106] = jj_gen; - if (jj_2_28(2147483647)) { - type = ResultType(); - jj_consume_token(DOT); - jj_consume_token(CLASS); - ret = new ClassExpr(range(type.getBegin(), tokenEnd()), type); - } else if (jj_2_29(2147483647)) { - type = ResultType(); - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - break; - } - default: - jj_la1[103] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - jj_consume_token(IDENTIFIER); - break; - } - case NEW: { - jj_consume_token(NEW); - break; - } - default: - jj_la1[104] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new TypeExpr(type.getRange(), type); - ret = new MethodReferenceExpr(ret.getRange(), ret, typeArgs.list, token.image); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - name = SimpleName(); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LPAREN: { - args = Arguments(); - hasArgs = true; - break; - } - default: - jj_la1[105] = jj_gen; - ; - } - if (hasArgs) { + default: + jj_la1[105] = jj_gen; + ; + } +if (hasArgs) { MethodCallExpr m = new MethodCallExpr(range(begin, tokenEnd()), null, null, null, args); m.setNameExpr(name); ret = m; - } else { + } else { ret = name; - } - break; } - default: - jj_la1[107] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - return ret; - } - - final public Expression PrimarySuffix(Expression scope) { - Expression ret; - if (jj_2_30(2)) { - ret = PrimarySuffixWithoutSuper(scope); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - jj_consume_token(SUPER); - ret = new SuperExpr(range(scope.getBegin(), tokenEnd()), scope); - break; - } - default: - jj_la1[108] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - return ret; - } - - final public Expression PrimarySuffixWithoutSuper(Expression scope) { - Expression ret; + break; + } + default: + jj_la1[107] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } +return ret; + } + + final public Expression PrimarySuffix(Expression scope) {Expression ret; + if (jj_2_30(2)) { + ret = PrimarySuffixWithoutSuper(scope); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + jj_consume_token(DOT); + jj_consume_token(SUPER); +ret = new SuperExpr(range(scope.getBegin(), tokenEnd()), scope); + break; + } + default: + jj_la1[108] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } +return ret; + } + + final public Expression PrimarySuffixWithoutSuper(Expression scope) {Expression ret; RangedList> typeArgs = new RangedList>(null); List args = null; boolean hasArgs = false; NameExpr name; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case THIS: { - jj_consume_token(THIS); - ret = new ThisExpr(range(scope.getBegin(), tokenEnd()), scope); - break; - } - case NEW: { - ret = AllocationExpression(scope); - break; - } - default: - jj_la1[111] = jj_gen; - if (jj_2_31(2147483647)) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - break; - } - default: - jj_la1[109] = jj_gen; - ; - } - name = SimpleName(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LPAREN: { - args = Arguments(); - hasArgs = true; - break; - } - default: - jj_la1[110] = jj_gen; - ; - } - if (hasArgs) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + jj_consume_token(DOT); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case THIS:{ + jj_consume_token(THIS); +ret = new ThisExpr(range(scope.getBegin(), tokenEnd()), scope); + break; + } + case NEW:{ + ret = AllocationExpression(scope); + break; + } + default: + jj_la1[111] = jj_gen; + if (jj_2_31(2147483647)) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); + break; + } + default: + jj_la1[109] = jj_gen; + ; + } + name = SimpleName(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LPAREN:{ + args = Arguments(); +hasArgs=true; + break; + } + default: + jj_la1[110] = jj_gen; + ; + } +if (hasArgs) { MethodCallExpr m = new MethodCallExpr(range(scope.getBegin(), tokenEnd()), scope, typeArgs.list, null, args); m.setNameExpr(name); ret = m; - } else { - FieldAccessExpr f = new FieldAccessExpr(range(scope.getBegin(), tokenEnd()), scope, typeArgs.list, null); + } else { + FieldAccessExpr f = new FieldAccessExpr(range(scope.getBegin(), tokenEnd()), scope, typeArgs.list, null); f.setFieldExpr(name); ret = f; - } - } else { - jj_consume_token(-1); - throw new ParseException(); } - } - break; - } - case LBRACKET: { - jj_consume_token(LBRACKET); - ret = Expression(); - jj_consume_token(RBRACKET); - ret = new ArrayAccessExpr(range(scope.getBegin(), tokenEnd()), scope, ret); - break; - } - default: - jj_la1[112] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public Expression Literal() { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INTEGER_LITERAL: { - jj_consume_token(INTEGER_LITERAL); - ret = new IntegerLiteralExpr(tokenRange(), token.image); - break; - } - case LONG_LITERAL: { - jj_consume_token(LONG_LITERAL); - ret = new LongLiteralExpr(tokenRange(), token.image); - break; - } - case FLOATING_POINT_LITERAL: { - jj_consume_token(FLOATING_POINT_LITERAL); - ret = new DoubleLiteralExpr(tokenRange(), token.image); - break; - } - case CHARACTER_LITERAL: { - jj_consume_token(CHARACTER_LITERAL); - ret = new CharLiteralExpr(tokenRange(), token.image.substring(1, token.image.length() - 1)); - break; - } - case STRING_LITERAL: { - jj_consume_token(STRING_LITERAL); - ret = new StringLiteralExpr(tokenRange(), token.image.substring(1, token.image.length() - 1)); - break; - } - case FALSE: - case TRUE: { - ret = BooleanLiteral(); - break; - } - case NULL: { - ret = NullLiteral(); - break; - } - default: - jj_la1[113] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public Expression BooleanLiteral() { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case TRUE: { - jj_consume_token(TRUE); - ret = new BooleanLiteralExpr(tokenRange(), true); - break; - } - case FALSE: { - jj_consume_token(FALSE); - ret = new BooleanLiteralExpr(tokenRange(), false); - break; - } - default: - jj_la1[114] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public Expression NullLiteral() { - jj_consume_token(NULL); - return new NullLiteralExpr(tokenRange()); - } - - final public List Arguments() { - List ret = null; - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - ret = ArgumentList(); - break; - } - default: - jj_la1[115] = jj_gen; - ; - } - jj_consume_token(RPAREN); - return ret; - } - - final public List ArgumentList() { - List ret = new LinkedList(); + } else { + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + case LBRACKET:{ + jj_consume_token(LBRACKET); + ret = Expression(); + jj_consume_token(RBRACKET); +ret = new ArrayAccessExpr(range(scope.getBegin(), tokenEnd()), scope, ret); + break; + } + default: + jj_la1[112] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public Expression Literal() {Expression ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL:{ + jj_consume_token(INTEGER_LITERAL); +ret = new IntegerLiteralExpr(tokenRange(), token.image); + break; + } + case LONG_LITERAL:{ + jj_consume_token(LONG_LITERAL); +ret = new LongLiteralExpr(tokenRange(), token.image); + break; + } + case FLOATING_POINT_LITERAL:{ + jj_consume_token(FLOATING_POINT_LITERAL); +ret = new DoubleLiteralExpr(tokenRange(), token.image); + break; + } + case CHARACTER_LITERAL:{ + jj_consume_token(CHARACTER_LITERAL); +ret = new CharLiteralExpr(tokenRange(), token.image.substring(1, token.image.length()-1)); + break; + } + case STRING_LITERAL:{ + jj_consume_token(STRING_LITERAL); +ret = new StringLiteralExpr(tokenRange(), token.image.substring(1, token.image.length()-1)); + break; + } + case FALSE: + case TRUE:{ + ret = BooleanLiteral(); + break; + } + case NULL:{ + ret = NullLiteral(); + break; + } + default: + jj_la1[113] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public Expression BooleanLiteral() {Expression ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case TRUE:{ + jj_consume_token(TRUE); +ret = new BooleanLiteralExpr(tokenRange(), true); + break; + } + case FALSE:{ + jj_consume_token(FALSE); +ret = new BooleanLiteralExpr(tokenRange(), false); + break; + } + default: + jj_la1[114] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public Expression NullLiteral() { + jj_consume_token(NULL); +return new NullLiteralExpr(tokenRange()); + } + + final public List Arguments() {List ret = null; + jj_consume_token(LPAREN); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + ret = ArgumentList(); + break; + } + default: + jj_la1[115] = jj_gen; + ; + } + jj_consume_token(RPAREN); +return ret; + } + + final public List ArgumentList() {List ret = new LinkedList(); Expression expr; - expr = Expression(); - ret.add(expr); - label_41: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[116] = jj_gen; - break label_41; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - return ret; - } - - final public Expression AllocationExpression(Expression scope) { - Expression ret; + expr = Expression(); +ret.add(expr); + label_41: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[116] = jj_gen; + break label_41; + } + jj_consume_token(COMMA); + expr = Expression(); +ret.add(expr); + } +return ret; + } + + final public Expression AllocationExpression(Expression scope) {Expression ret; Type type; RangedList> typeArgs = new RangedList>(null); List> anonymousBody = null; List args; Position begin; List annotations = null; - jj_consume_token(NEW); - if (scope == null) { - begin = tokenBegin(); - } else { - begin = scope.getBegin(); - } + jj_consume_token(NEW); +if(scope==null) {begin=tokenBegin();} else {begin=scope.getBegin();} + annotations = Annotations(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT:{ + type = PrimitiveType(); +type.setAnnotations(annotations); + ret = ArrayCreation(begin, type); + break; + } + case IDENTIFIER: + case AT: + case LT:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); annotations = Annotations(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: { - type = PrimitiveType(); - type.setAnnotations(annotations); - ret = ArrayCreation(begin, type); - break; - } - case IDENTIFIER: - case AT: - case LT: { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - annotations = Annotations(); - break; - } - default: - jj_la1[117] = jj_gen; - ; - } - type = AnnotatedClassOrInterfaceType(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACKET: - case AT: { - ret = ArrayCreation(begin, type); - break; - } - case LPAREN: { - args = Arguments(); - if (jj_2_32(2)) { - anonymousBody = ClassOrInterfaceBody(false); - } else { - ; - } - ret = new ObjectCreationExpr(range(begin, tokenEnd()), scope, (ClassOrInterfaceType) type, typeArgs.list, args, anonymousBody); - break; - } - default: - jj_la1[118] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[119] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } + break; + } + default: + jj_la1[117] = jj_gen; + ; + } + type = AnnotatedClassOrInterfaceType(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACKET: + case AT:{ + ret = ArrayCreation(begin, type); + break; + } + case LPAREN:{ + args = Arguments(); + if (jj_2_32(2)) { + anonymousBody = ClassOrInterfaceBody(false); + } else { + ; + } +ret = new ObjectCreationExpr(range(begin, tokenEnd()), scope, (ClassOrInterfaceType) type, typeArgs.list, args, anonymousBody); + break; + } + default: + jj_la1[118] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + default: + jj_la1[119] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } - /* - * The third LOOKAHEAD specification below is to parse to PrimarySuffix - * if there is an expression between the "[...]". - */ - final public ArrayCreationExpr ArrayCreation(Position begin, Type type) { - Expression expr = null; +/* + * The third LOOKAHEAD specification below is to parse to PrimarySuffix + * if there is an expression between the "[...]". + */ + final public ArrayCreationExpr ArrayCreation(Position begin, Type type) {Expression expr = null; ArrayInitializerExpr arrayInitializerExpr = null; List inits = null; List> accum = null; List annotations = null; - label_42: - while (true) { - annotations = Annotations(); - jj_consume_token(LBRACKET); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - expr = Expression(); - break; - } - default: - jj_la1[120] = jj_gen; - ; - } - accum = add(accum, annotations); - inits = add(inits, expr); - annotations = null; - expr = null; - jj_consume_token(RBRACKET); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACKET: - case AT: { - ; - break; - } - default: - jj_la1[121] = jj_gen; - break label_42; - } - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LBRACE: { - arrayInitializerExpr = ArrayInitializer(); - break; - } - default: - jj_la1[122] = jj_gen; - ; - } - return juggleArrayCreation(range(begin, tokenEnd()), type, inits, accum, arrayInitializerExpr); - } - - /* - * Statement syntax follows. - */ - final public Statement Statement() { - Statement ret; - if (jj_2_33(2)) { - ret = LabeledStatement(); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASSERT: { - ret = AssertStatement(); - break; - } - case LBRACE: { - ret = Block(); - break; - } - case SEMICOLON: { - ret = EmptyStatement(); - break; - } - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case INCR: - case DECR: { - ret = StatementExpression(); - break; - } - case SWITCH: { - ret = SwitchStatement(); - break; - } - case IF: { - ret = IfStatement(); - break; - } - case WHILE: { - ret = WhileStatement(); - break; - } - case DO: { - ret = DoStatement(); - break; - } - case FOR: { - ret = ForStatement(); - break; - } - case BREAK: { - ret = BreakStatement(); - break; - } - case CONTINUE: { - ret = ContinueStatement(); - break; - } - case RETURN: { - ret = ReturnStatement(); - break; - } - case THROW: { - ret = ThrowStatement(); - break; - } - case SYNCHRONIZED: { - ret = SynchronizedStatement(); - break; - } - case TRY: { - ret = TryStatement(); - break; - } - default: - jj_la1[123] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - return ret; - } + label_42: + while (true) { + annotations = Annotations(); + jj_consume_token(LBRACKET); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + expr = Expression(); + break; + } + default: + jj_la1[120] = jj_gen; + ; + } +accum = add(accum, annotations); inits = add(inits, expr); annotations=null; expr=null; + jj_consume_token(RBRACKET); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACKET: + case AT:{ + ; + break; + } + default: + jj_la1[121] = jj_gen; + break label_42; + } + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LBRACE:{ + arrayInitializerExpr = ArrayInitializer(); + break; + } + default: + jj_la1[122] = jj_gen; + ; + } +return juggleArrayCreation(range(begin, tokenEnd()), type, inits, accum, arrayInitializerExpr); + } - final public AssertStmt AssertStatement() { - Expression check; +/* + * Statement syntax follows. + */ + final public +Statement Statement() {Statement ret; + if (jj_2_33(2)) { + ret = LabeledStatement(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASSERT:{ + ret = AssertStatement(); + break; + } + case LBRACE:{ + ret = Block(); + break; + } + case SEMICOLON:{ + ret = EmptyStatement(); + break; + } + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case INCR: + case DECR:{ + ret = StatementExpression(); + break; + } + case SWITCH:{ + ret = SwitchStatement(); + break; + } + case IF:{ + ret = IfStatement(); + break; + } + case WHILE:{ + ret = WhileStatement(); + break; + } + case DO:{ + ret = DoStatement(); + break; + } + case FOR:{ + ret = ForStatement(); + break; + } + case BREAK:{ + ret = BreakStatement(); + break; + } + case CONTINUE:{ + ret = ContinueStatement(); + break; + } + case RETURN:{ + ret = ReturnStatement(); + break; + } + case THROW:{ + ret = ThrowStatement(); + break; + } + case SYNCHRONIZED:{ + ret = SynchronizedStatement(); + break; + } + case TRY:{ + ret = TryStatement(); + break; + } + default: + jj_la1[123] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } +return ret; + } + + final public AssertStmt AssertStatement() {Expression check; Expression msg = null; Position begin; - jj_consume_token(ASSERT); - begin = tokenBegin(); - check = Expression(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COLON: { - jj_consume_token(COLON); - msg = Expression(); - break; - } - default: - jj_la1[124] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - return new AssertStmt(range(begin, tokenEnd()), check, msg); - } - - final public LabeledStmt LabeledStatement() { - String label; + jj_consume_token(ASSERT); +begin=tokenBegin(); + check = Expression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON:{ + jj_consume_token(COLON); + msg = Expression(); + break; + } + default: + jj_la1[124] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +return new AssertStmt(range(begin, tokenEnd()),check, msg); + } + + final public LabeledStmt LabeledStatement() {String label; Statement stmt; Position begin; - jj_consume_token(IDENTIFIER); - begin = tokenBegin(); - label = token.image; - jj_consume_token(COLON); - stmt = Statement(); - return new LabeledStmt(range(begin, tokenEnd()), label, stmt); - } - - final public BlockStmt Block() { - List stmts; + jj_consume_token(IDENTIFIER); +begin=tokenBegin(); +label = token.image; + jj_consume_token(COLON); + stmt = Statement(); +return new LabeledStmt(range(begin, tokenEnd()),label, stmt); + } + + final public BlockStmt Block() {List stmts; Position begin; - jj_consume_token(LBRACE); - begin = tokenBegin(); - stmts = Statements(); - jj_consume_token(RBRACE); - return new BlockStmt(range(begin, tokenEnd()), stmts); - } + jj_consume_token(LBRACE); +begin=tokenBegin(); + stmts = Statements(); + jj_consume_token(RBRACE); +return new BlockStmt(range(begin, tokenEnd()), stmts); + } - /* - * Classes inside block stametents can only be abstract or final. The semantic must check it. - */ - final public Statement BlockStatement() { - Statement ret; +/* + * Classes inside block stametents can only be abstract or final. The semantic must check it. + */ + final public Statement BlockStatement() {Statement ret; Expression expr; ClassOrInterfaceDeclaration typeDecl; ModifierHolder modifier; - if (jj_2_34(2147483647)) { - - modifier = Modifiers(); - typeDecl = ClassOrInterfaceDeclaration(modifier); - ret = new TypeDeclarationStmt(range(typeDecl.getBegin().line, typeDecl.getBegin().column, token.endLine, token.endColumn), typeDecl); - } else if (jj_2_35(2147483647)) { - expr = VariableDeclarationExpression(); - jj_consume_token(SEMICOLON); - ret = new ExpressionStmt(range(expr.getBegin().line, expr.getBegin().column, token.endLine, token.endColumn), expr); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FLOAT: - case FOR: - case IF: - case INT: - case LONG: - case NEW: - case NULL: - case RETURN: - case SHORT: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRUE: - case TRY: - case VOID: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case INCR: - case DECR: { - ret = Statement(); - break; - } - default: - jj_la1[125] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - return ret; - } - - final public VariableDeclarationExpr VariableDeclarationExpression() { - ModifierHolder modifier; + if (jj_2_34(2147483647)) { + + modifier = Modifiers(); + typeDecl = ClassOrInterfaceDeclaration(modifier); +ret = new TypeDeclarationStmt(range(typeDecl.getBegin().line, typeDecl.getBegin().column, token.endLine, token.endColumn), typeDecl); + } else if (jj_2_35(2147483647)) { + expr = VariableDeclarationExpression(); + jj_consume_token(SEMICOLON); +ret = new ExpressionStmt(range(expr.getBegin().line, expr.getBegin().column, token.endLine, token.endColumn), expr); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASSERT: + case BOOLEAN: + case BREAK: + case BYTE: + case CHAR: + case CONTINUE: + case DO: + case DOUBLE: + case FALSE: + case FLOAT: + case FOR: + case IF: + case INT: + case LONG: + case NEW: + case NULL: + case RETURN: + case SHORT: + case SUPER: + case SWITCH: + case SYNCHRONIZED: + case THIS: + case THROW: + case TRUE: + case TRY: + case VOID: + case WHILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case SEMICOLON: + case INCR: + case DECR:{ + ret = Statement(); + break; + } + default: + jj_la1[125] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } +return ret; + } + + final public VariableDeclarationExpr VariableDeclarationExpression() {ModifierHolder modifier; Type type; List variables = new LinkedList(); VariableDeclarator var; - modifier = Modifiers(); - type = Type(); - var = VariableDeclarator(); - variables.add(var); - label_43: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[126] = jj_gen; - break label_43; - } - jj_consume_token(COMMA); - var = VariableDeclarator(); - variables.add(var); - } - Position begin = modifier.begin.orIfInvalid(type.getBegin()); + modifier = Modifiers(); + type = Type(); + var = VariableDeclarator(); +variables.add(var); + label_43: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[126] = jj_gen; + break label_43; + } + jj_consume_token(COMMA); + var = VariableDeclarator(); +variables.add(var); + } +Position begin=modifier.begin.orIfInvalid(type.getBegin()); Pair> typeListPair = unwrapArrayTypes(type); return new VariableDeclarationExpr(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, typeListPair.a, variables, typeListPair.b); - } - - final public EmptyStmt EmptyStatement() { - jj_consume_token(SEMICOLON); - return new EmptyStmt(tokenRange()); - } - - final public Statement LambdaBody() { - Expression expr; - Statement n = null; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - expr = Expression(); - n = new ExpressionStmt(range(expr.getBegin(), tokenEnd()), expr); - break; - } - case LBRACE: { - n = Block(); - break; - } - default: - jj_la1[127] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return n; - } - - final public ExpressionStmt StatementExpression() { - Expression expr; + } + + final public EmptyStmt EmptyStatement() { + jj_consume_token(SEMICOLON); +return new EmptyStmt(tokenRange()); + } + + final public Statement LambdaBody() {Expression expr; + Statement n = null; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + expr = Expression(); +n = new ExpressionStmt(range(expr.getBegin(), tokenEnd()), expr); + break; + } + case LBRACE:{ + n = Block(); + break; + } + default: + jj_la1[127] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return n; + } + + final public ExpressionStmt StatementExpression() {Expression expr; AssignExpr.Operator op; Expression value; RangedList> typeArgs = new RangedList>(null); Statement lambdaBody; - if (jj_2_36(2)) { - expr = PreIncrementExpression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DECR: { - expr = PreDecrementExpression(); - break; - } - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: { - expr = PrimaryExpression(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASSIGN: - case INCR: - case DECR: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - case ARROW: - case DOUBLECOLON: { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INCR: { - jj_consume_token(INCR); - expr = new UnaryExpr(range(expr.getBegin(), tokenEnd()), expr, UnaryExpr.Operator.posIncrement); - break; - } - case DECR: { - jj_consume_token(DECR); - expr = new UnaryExpr(range(expr.getBegin(), tokenEnd()), expr, UnaryExpr.Operator.posDecrement); - break; - } - case ASSIGN: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: { - op = AssignmentOperator(); - value = Expression(); - expr = new AssignExpr(range(expr.getBegin(), tokenEnd()), expr, value, op); - break; - } - case DOUBLECOLON: { - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LT: { - typeArgs = TypeArguments(); - break; - } - default: - jj_la1[128] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - jj_consume_token(IDENTIFIER); - break; - } - case NEW: { - jj_consume_token(NEW); - break; - } - default: - jj_la1[129] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - expr = new MethodReferenceExpr(range(expr.getBegin(), tokenEnd()), expr, typeArgs.list, token.image); - break; - } - case ARROW: { - jj_consume_token(ARROW); - lambdaBody = LambdaBody(); - expr = generateLambda(expr, lambdaBody); - break; - } - default: - jj_la1[130] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[131] = jj_gen; - ; - } - break; - } - default: - jj_la1[132] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + if (jj_2_36(2)) { + expr = PreIncrementExpression(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DECR:{ + expr = PreDecrementExpression(); + break; + } + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN:{ + expr = PrimaryExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASSIGN: + case INCR: + case DECR: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN: + case ARROW: + case DOUBLECOLON:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INCR:{ + jj_consume_token(INCR); +expr = new UnaryExpr(range(expr.getBegin(), tokenEnd()), expr, UnaryExpr.Operator.posIncrement); + break; + } + case DECR:{ + jj_consume_token(DECR); +expr = new UnaryExpr(range(expr.getBegin(), tokenEnd()), expr, UnaryExpr.Operator.posDecrement); + break; + } + case ASSIGN: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN:{ + op = AssignmentOperator(); + value = Expression(); +expr = new AssignExpr(range(expr.getBegin(), tokenEnd()), expr, value, op); + break; + } + case DOUBLECOLON:{ + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LT:{ + typeArgs = TypeArguments(); + break; + } + default: + jj_la1[128] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + jj_consume_token(IDENTIFIER); + break; + } + case NEW:{ + jj_consume_token(NEW); + break; + } + default: + jj_la1[129] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - } - jj_consume_token(SEMICOLON); - return new ExpressionStmt(range(expr.getBegin(), tokenEnd()), expr); - } - - final public SwitchStmt SwitchStatement() { - Expression selector; +expr = new MethodReferenceExpr(range(expr.getBegin(), tokenEnd()), expr, typeArgs.list, token.image); + break; + } + case ARROW:{ + jj_consume_token(ARROW); + lambdaBody = LambdaBody(); +expr = generateLambda(expr, lambdaBody); + break; + } + default: + jj_la1[130] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + default: + jj_la1[131] = jj_gen; + ; + } + break; + } + default: + jj_la1[132] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + jj_consume_token(SEMICOLON); +return new ExpressionStmt(range(expr.getBegin(), tokenEnd()), expr); + } + + final public SwitchStmt SwitchStatement() {Expression selector; SwitchEntryStmt entry; List entries = null; Position begin; - jj_consume_token(SWITCH); - begin = tokenBegin(); - jj_consume_token(LPAREN); - selector = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(LBRACE); - label_44: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CASE: - case _DEFAULT: { - ; - break; - } - default: - jj_la1[133] = jj_gen; - break label_44; - } - entry = SwitchEntry(); - entries = add(entries, entry); - } - jj_consume_token(RBRACE); - return new SwitchStmt(range(begin, tokenEnd()), selector, entries); - } - - final public SwitchEntryStmt SwitchEntry() { - Expression label = null; + jj_consume_token(SWITCH); +begin=tokenBegin(); + jj_consume_token(LPAREN); + selector = Expression(); + jj_consume_token(RPAREN); + jj_consume_token(LBRACE); + label_44: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CASE: + case _DEFAULT:{ + ; + break; + } + default: + jj_la1[133] = jj_gen; + break label_44; + } + entry = SwitchEntry(); +entries = add(entries, entry); + } + jj_consume_token(RBRACE); +return new SwitchStmt(range(begin, tokenEnd()), selector, entries); + } + + final public SwitchEntryStmt SwitchEntry() {Expression label = null; List stmts; Position begin; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CASE: { - jj_consume_token(CASE); - begin = tokenBegin(); - label = Expression(); - break; - } - case _DEFAULT: { - jj_consume_token(_DEFAULT); - begin = tokenBegin(); - break; - } - default: - jj_la1[134] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(COLON); - stmts = Statements(); - return new SwitchEntryStmt(range(begin, tokenEnd()), label, stmts); - } - - final public IfStmt IfStatement() { - Expression condition; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CASE:{ + jj_consume_token(CASE); +begin=tokenBegin(); + label = Expression(); + break; + } + case _DEFAULT:{ + jj_consume_token(_DEFAULT); +begin=tokenBegin(); + break; + } + default: + jj_la1[134] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(COLON); + stmts = Statements(); +return new SwitchEntryStmt(range(begin, tokenEnd()),label, stmts); + } + + final public IfStmt IfStatement() {Expression condition; Statement thenStmt; Statement elseStmt = null; Position begin; - Comment thenCmmt = null; - Comment elseCmmt = null; - jj_consume_token(IF); - begin = tokenBegin(); - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - - thenStmt = Statement(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ELSE: { - jj_consume_token(ELSE); - - elseStmt = Statement(); - break; - } - default: - jj_la1[135] = jj_gen; - ; - } - IfStmt tmp = new IfStmt(range(begin, tokenEnd()), condition, thenStmt, elseStmt); - - // TODO comment is always null - thenStmt.setComment(thenCmmt); - if (elseStmt != null) - // TODO comment is always null - elseStmt.setComment(elseCmmt); - return tmp; - } - - final public WhileStmt WhileStatement() { - Expression condition; + Comment thenCmmt = null; + Comment elseCmmt = null; + jj_consume_token(IF); +begin=tokenBegin(); + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + + thenStmt = Statement(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ELSE:{ + jj_consume_token(ELSE); + + elseStmt = Statement(); + break; + } + default: + jj_la1[135] = jj_gen; + ; + } +IfStmt tmp = new IfStmt(range(begin, tokenEnd()),condition, thenStmt, elseStmt); + + // TODO comment is always null + thenStmt.setComment(thenCmmt); + if (elseStmt != null) + // TODO comment is always null + elseStmt.setComment(elseCmmt); + return tmp; + } + + final public WhileStmt WhileStatement() {Expression condition; Statement body; Position begin; - jj_consume_token(WHILE); - begin = tokenBegin(); - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - body = Statement(); - return new WhileStmt(range(begin, tokenEnd()), condition, body); - } - - final public DoStmt DoStatement() { - Expression condition; + jj_consume_token(WHILE); +begin=tokenBegin(); + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + body = Statement(); +return new WhileStmt(range(begin, tokenEnd()),condition, body); + } + + final public DoStmt DoStatement() {Expression condition; Statement body; Position begin; - jj_consume_token(DO); - begin = tokenBegin(); - body = Statement(); - jj_consume_token(WHILE); - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(SEMICOLON); - return new DoStmt(range(begin, tokenEnd()), body, condition); - } - - final public Statement ForStatement() { - VariableDeclarationExpr varExpr = null; + jj_consume_token(DO); +begin=tokenBegin(); + body = Statement(); + jj_consume_token(WHILE); + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + jj_consume_token(SEMICOLON); +return new DoStmt(range(begin, tokenEnd()),body, condition); + } + + final public Statement ForStatement() {VariableDeclarationExpr varExpr = null; Expression expr = null; List init = null; List update = null; Statement body; Position begin; - jj_consume_token(FOR); - begin = tokenBegin(); - jj_consume_token(LPAREN); - if (jj_2_37(2147483647)) { - varExpr = VariableDeclarationExpression(); - jj_consume_token(COLON); - expr = Expression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case SEMICOLON: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - init = ForInit(); - break; - } - default: - jj_la1[136] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - expr = Expression(); - break; - } - default: - jj_la1[137] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - update = ForUpdate(); - break; - } - default: - jj_la1[138] = jj_gen; - ; - } - break; - } - default: - jj_la1[139] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + jj_consume_token(FOR); +begin=tokenBegin(); + jj_consume_token(LPAREN); + if (jj_2_37(2147483647)) { + varExpr = VariableDeclarationExpression(); + jj_consume_token(COLON); + expr = Expression(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case SEMICOLON: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + init = ForInit(); + break; + } + default: + jj_la1[136] = jj_gen; + ; } - jj_consume_token(RPAREN); - body = Statement(); - if (varExpr != null) { - return new ForeachStmt(range(begin, tokenEnd()), varExpr, expr, body); + jj_consume_token(SEMICOLON); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + expr = Expression(); + break; + } + default: + jj_la1[137] = jj_gen; + ; } - return new ForStmt(range(begin, tokenEnd()), init, expr, update, body); - } - - final public List ForInit() { - List ret; + jj_consume_token(SEMICOLON); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + update = ForUpdate(); + break; + } + default: + jj_la1[138] = jj_gen; + ; + } + break; + } + default: + jj_la1[139] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + jj_consume_token(RPAREN); + body = Statement(); +if (varExpr != null) { + return new ForeachStmt(range(begin, tokenEnd()),varExpr, expr, body); + } + return new ForStmt(range(begin, tokenEnd()),init, expr, update, body); + } + + final public List ForInit() {List ret; Expression expr; - if (jj_2_38(2147483647)) { - expr = VariableDeclarationExpression(); - ret = new LinkedList(); - ret.add(expr); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - ret = ExpressionList(); - break; - } - default: - jj_la1[140] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + if (jj_2_38(2147483647)) { + expr = VariableDeclarationExpression(); +ret = new LinkedList(); ret.add(expr); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + ret = ExpressionList(); + break; } - return ret; + default: + jj_la1[140] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } } +return ret; + } - final public List ExpressionList() { - List ret = new LinkedList(); + final public List ExpressionList() {List ret = new LinkedList(); Expression expr; - expr = Expression(); - ret.add(expr); - label_45: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[141] = jj_gen; - break label_45; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - return ret; - } - - final public List ForUpdate() { - List ret; - ret = ExpressionList(); - return ret; - } - - final public BreakStmt BreakStatement() { - String id = null; + expr = Expression(); +ret.add(expr); + label_45: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[141] = jj_gen; + break label_45; + } + jj_consume_token(COMMA); + expr = Expression(); +ret.add(expr); + } +return ret; + } + + final public List ForUpdate() {List ret; + ret = ExpressionList(); +return ret; + } + + final public BreakStmt BreakStatement() {String id = null; Position begin; - jj_consume_token(BREAK); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - jj_consume_token(IDENTIFIER); - id = token.image; - break; - } - default: - jj_la1[142] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - return new BreakStmt(range(begin, tokenEnd()), id); - } - - final public ContinueStmt ContinueStatement() { - String id = null; + jj_consume_token(BREAK); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + jj_consume_token(IDENTIFIER); +id = token.image; + break; + } + default: + jj_la1[142] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +return new BreakStmt(range(begin, tokenEnd()),id); + } + + final public ContinueStmt ContinueStatement() {String id = null; Position begin; - jj_consume_token(CONTINUE); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - jj_consume_token(IDENTIFIER); - id = token.image; - break; - } - default: - jj_la1[143] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - return new ContinueStmt(range(begin, tokenEnd()), id); - } - - final public ReturnStmt ReturnStatement() { - Expression expr = null; + jj_consume_token(CONTINUE); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + jj_consume_token(IDENTIFIER); +id = token.image; + break; + } + default: + jj_la1[143] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +return new ContinueStmt(range(begin, tokenEnd()),id); + } + + final public ReturnStmt ReturnStatement() {Expression expr = null; Position begin; - jj_consume_token(RETURN); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - expr = Expression(); - break; - } - default: - jj_la1[144] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - return new ReturnStmt(range(begin, tokenEnd()), expr); - } - - final public ThrowStmt ThrowStatement() { - Expression expr; + jj_consume_token(RETURN); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + expr = Expression(); + break; + } + default: + jj_la1[144] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +return new ReturnStmt(range(begin, tokenEnd()),expr); + } + + final public ThrowStmt ThrowStatement() {Expression expr; Position begin; - jj_consume_token(THROW); - begin = tokenBegin(); - expr = Expression(); - jj_consume_token(SEMICOLON); - return new ThrowStmt(range(begin, tokenEnd()), expr); - } - - final public SynchronizedStmt SynchronizedStatement() { - Expression expr; + jj_consume_token(THROW); +begin=tokenBegin(); + expr = Expression(); + jj_consume_token(SEMICOLON); +return new ThrowStmt(range(begin, tokenEnd()),expr); + } + + final public SynchronizedStmt SynchronizedStatement() {Expression expr; BlockStmt block; Position begin; - jj_consume_token(SYNCHRONIZED); - begin = tokenBegin(); - jj_consume_token(LPAREN); - expr = Expression(); - jj_consume_token(RPAREN); - block = Block(); - return new SynchronizedStmt(range(begin, tokenEnd()), expr, block); - } - - final public TryStmt TryStatement() { - List resources = null; + jj_consume_token(SYNCHRONIZED); +begin=tokenBegin(); + jj_consume_token(LPAREN); + expr = Expression(); + jj_consume_token(RPAREN); + block = Block(); +return new SynchronizedStmt(range(begin, tokenEnd()),expr, block); + } + + final public TryStmt TryStatement() {List resources = null; BlockStmt tryBlock; BlockStmt finallyBlock = null; List catchs = null; @@ -4505,5001 +4372,4947 @@ final public TryStmt TryStatement() { Position begin; Position catchBegin; Type type; - jj_consume_token(TRY); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LPAREN: { - resources = ResourceSpecification(); - break; - } - default: - jj_la1[145] = jj_gen; - ; - } - tryBlock = Block(); - label_46: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CATCH: { - ; - break; - } - default: - jj_la1[146] = jj_gen; - break label_46; - } - jj_consume_token(CATCH); - catchBegin = tokenBegin(); - jj_consume_token(LPAREN); - exceptModifier = Modifiers(); - exceptionType = ReferenceType(); - exceptionTypes.add(exceptionType); - label_47: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BIT_OR: { - ; - break; - } - default: - jj_la1[147] = jj_gen; - break label_47; - } - jj_consume_token(BIT_OR); - exceptionType = ReferenceTypeWithAnnotations(); - exceptionTypes.add(exceptionType); - } - exceptId = VariableDeclaratorId(); - jj_consume_token(RPAREN); - catchBlock = Block(); - if (exceptionTypes.size() > 1) { - type = new UnionType(exceptionTypes); - } else { - type = (Type) exceptionTypes.get(0); - } - catchs = add(catchs, new CatchClause(range(catchBegin, tokenEnd()), exceptModifier.modifiers, exceptModifier.annotations, type, exceptId, catchBlock)); - exceptionTypes = new LinkedList(); - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case FINALLY: { - jj_consume_token(FINALLY); - finallyBlock = Block(); - break; - } - default: - jj_la1[148] = jj_gen; - ; - } - if (finallyBlock == null && catchs == null && resources == null) { - addProblem("Try has no finally, no catch, and no resources"); - } - return new TryStmt(range(begin, tokenEnd()), resources, tryBlock, catchs, finallyBlock); - } - - final public List ResourceSpecification() { - List variables; - jj_consume_token(LPAREN); - variables = Resources(); - if (jj_2_39(2)) { - jj_consume_token(SEMICOLON); - } else { - ; - } - jj_consume_token(RPAREN); - return variables; - } - - final public List Resources() { - List variables = new LinkedList(); + jj_consume_token(TRY); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LPAREN:{ + resources = ResourceSpecification(); + break; + } + default: + jj_la1[145] = jj_gen; + ; + } + tryBlock = Block(); + label_46: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CATCH:{ + ; + break; + } + default: + jj_la1[146] = jj_gen; + break label_46; + } + jj_consume_token(CATCH); +catchBegin=tokenBegin(); + jj_consume_token(LPAREN); + exceptModifier = Modifiers(); + exceptionType = ReferenceType(); +exceptionTypes.add(exceptionType); + label_47: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BIT_OR:{ + ; + break; + } + default: + jj_la1[147] = jj_gen; + break label_47; + } + jj_consume_token(BIT_OR); + exceptionType = ReferenceTypeWithAnnotations(); +exceptionTypes.add(exceptionType); + } + exceptId = VariableDeclaratorId(); + jj_consume_token(RPAREN); + catchBlock = Block(); +if (exceptionTypes.size() > 1) { + type = new UnionType(exceptionTypes); + } else { + type = (Type)exceptionTypes.get(0); + } + catchs = add(catchs, new CatchClause(range(catchBegin, tokenEnd()), exceptModifier.modifiers, exceptModifier.annotations, type, exceptId, catchBlock)); + exceptionTypes = new LinkedList(); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case FINALLY:{ + jj_consume_token(FINALLY); + finallyBlock = Block(); + break; + } + default: + jj_la1[148] = jj_gen; + ; + } +if (finallyBlock==null && catchs==null && resources==null) { + addProblem("Try has no finally, no catch, and no resources"); + } + return new TryStmt(range(begin, tokenEnd()), resources, tryBlock, catchs, finallyBlock); + } + + final public List ResourceSpecification() {List variables; + jj_consume_token(LPAREN); + variables = Resources(); + if (jj_2_39(2)) { + jj_consume_token(SEMICOLON); + } else { + ; + } + jj_consume_token(RPAREN); +return variables; + } + + final public List Resources() {List variables = new LinkedList(); VariableDeclarationExpr var; - /*this is a bit more lenient than we need to be, eg allowing access modifiers like private*/ - var = VariableDeclarationExpression(); - variables.add(var); - label_48: - while (true) { - if (jj_2_40(2)) { - ; - } else { - break label_48; - } - jj_consume_token(SEMICOLON); - var = VariableDeclarationExpression(); - variables.add(var); - } - return variables; - } - - /* We use productions to match >>>, >> and > so that we can keep the - * type declaration syntax with generics clean - */ - final public void RUNSIGNEDSHIFT() { - if (getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT) { - - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); - jj_consume_token(GT); - } - - final public void RSIGNEDSHIFT() { - if (getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT) { - - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); - } - - /* Annotation syntax follows. */ - final public List Annotations() { - List annotations = null; + /*this is a bit more lenient than we need to be, eg allowing access modifiers like private*/ + var = VariableDeclarationExpression(); +variables.add(var); + label_48: + while (true) { + if (jj_2_40(2)) { + ; + } else { + break label_48; + } + jj_consume_token(SEMICOLON); + var = VariableDeclarationExpression(); +variables.add(var); + } +return variables; + } + +/* We use productions to match >>>, >> and > so that we can keep the + * type declaration syntax with generics clean + */ + final public +void RUNSIGNEDSHIFT() { + if (getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT) { + + } else { + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(GT); + jj_consume_token(GT); + jj_consume_token(GT); + } + + final public void RSIGNEDSHIFT() { + if (getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT) { + + } else { + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(GT); + jj_consume_token(GT); + } + +/* Annotation syntax follows. */ + final public +List Annotations() {List annotations = null; AnnotationExpr annotation; - label_49: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AT: { - ; - break; - } - default: - jj_la1[149] = jj_gen; - break label_49; - } - annotation = Annotation(); - annotations = add(annotations, annotation); - } - return annotations; - } - - final public AnnotationExpr Annotation() { - AnnotationExpr ret; - if (jj_2_41(2147483647)) { - ret = NormalAnnotation(); - } else if (jj_2_42(2147483647)) { - ret = SingleMemberAnnotation(); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AT: { - ret = MarkerAnnotation(); - break; - } - default: - jj_la1[150] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - return ret; - } - - final public NormalAnnotationExpr NormalAnnotation() { - NameExpr name; + label_49: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case AT:{ + ; + break; + } + default: + jj_la1[149] = jj_gen; + break label_49; + } + annotation = Annotation(); +annotations = add(annotations, annotation); + } +return annotations; + } + + final public AnnotationExpr Annotation() {AnnotationExpr ret; + if (jj_2_41(2147483647)) { + ret = NormalAnnotation(); + } else if (jj_2_42(2147483647)) { + ret = SingleMemberAnnotation(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case AT:{ + ret = MarkerAnnotation(); + break; + } + default: + jj_la1[150] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } +return ret; + } + + final public NormalAnnotationExpr NormalAnnotation() {NameExpr name; List pairs = null; Position begin; - jj_consume_token(AT); - begin = tokenBegin(); - name = Name(); - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case IDENTIFIER: { - pairs = MemberValuePairs(); - break; - } - default: - jj_la1[151] = jj_gen; - ; - } - jj_consume_token(RPAREN); - return new NormalAnnotationExpr(range(begin, tokenEnd()), name, pairs); - } - - final public MarkerAnnotationExpr MarkerAnnotation() { - NameExpr name; + jj_consume_token(AT); +begin=tokenBegin(); + name = Name(); + jj_consume_token(LPAREN); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + pairs = MemberValuePairs(); + break; + } + default: + jj_la1[151] = jj_gen; + ; + } + jj_consume_token(RPAREN); +return new NormalAnnotationExpr(range(begin, tokenEnd()),name, pairs); + } + + final public MarkerAnnotationExpr MarkerAnnotation() {NameExpr name; Position begin; - jj_consume_token(AT); - begin = tokenBegin(); - name = Name(); - return new MarkerAnnotationExpr(range(begin, tokenEnd()), name); - } + jj_consume_token(AT); +begin=tokenBegin(); + name = Name(); +return new MarkerAnnotationExpr(range(begin, tokenEnd()),name); + } - final public SingleMemberAnnotationExpr SingleMemberAnnotation() { - NameExpr name; + final public SingleMemberAnnotationExpr SingleMemberAnnotation() {NameExpr name; Expression memberVal; Position begin; - jj_consume_token(AT); - begin = tokenBegin(); - name = Name(); - jj_consume_token(LPAREN); - memberVal = MemberValue(); - jj_consume_token(RPAREN); - return new SingleMemberAnnotationExpr(range(begin, tokenEnd()), name, memberVal); - } - - final public List MemberValuePairs() { - List ret = new LinkedList(); + jj_consume_token(AT); +begin=tokenBegin(); + name = Name(); + jj_consume_token(LPAREN); + memberVal = MemberValue(); + jj_consume_token(RPAREN); +return new SingleMemberAnnotationExpr(range(begin, tokenEnd()),name, memberVal); + } + + final public List MemberValuePairs() {List ret = new LinkedList(); MemberValuePair pair; - pair = MemberValuePair(); - ret.add(pair); - label_50: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[152] = jj_gen; - break label_50; - } - jj_consume_token(COMMA); - pair = MemberValuePair(); - ret.add(pair); - } - return ret; - } - - final public MemberValuePair MemberValuePair() { - String name; + pair = MemberValuePair(); +ret.add(pair); + label_50: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[152] = jj_gen; + break label_50; + } + jj_consume_token(COMMA); + pair = MemberValuePair(); +ret.add(pair); + } +return ret; + } + + final public MemberValuePair MemberValuePair() {String name; Expression value; Position begin; - jj_consume_token(IDENTIFIER); - name = token.image; - begin = tokenBegin(); - jj_consume_token(ASSIGN); - value = MemberValue(); - return new MemberValuePair(range(begin, tokenEnd()), name, value); - } - - final public Expression MemberValue() { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AT: { - ret = Annotation(); - break; - } - case LBRACE: { - ret = MemberValueArrayInitializer(); - break; - } - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - ret = ConditionalExpression(); - break; - } - default: - jj_la1[153] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public Expression MemberValueArrayInitializer() { - List ret = new LinkedList(); + jj_consume_token(IDENTIFIER); +name = token.image; begin=tokenBegin(); + jj_consume_token(ASSIGN); + value = MemberValue(); +return new MemberValuePair(range(begin, tokenEnd()),name, value); + } + + final public Expression MemberValue() {Expression ret; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case AT:{ + ret = Annotation(); + break; + } + case LBRACE:{ + ret = MemberValueArrayInitializer(); + break; + } + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + ret = ConditionalExpression(); + break; + } + default: + jj_la1[153] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public Expression MemberValueArrayInitializer() {List ret = new LinkedList(); Expression member; Position begin; - jj_consume_token(LBRACE); - begin = tokenBegin(); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: { - member = MemberValue(); - ret.add(member); - label_51: - while (true) { - if (jj_2_43(2)) { - ; - } else { - break label_51; - } - jj_consume_token(COMMA); - member = MemberValue(); - ret.add(member); - } - break; - } - default: - jj_la1[154] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - jj_consume_token(COMMA); - break; - } - default: - jj_la1[155] = jj_gen; - ; + jj_consume_token(LBRACE); +begin=tokenBegin(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS:{ + member = MemberValue(); +ret.add(member); + label_51: + while (true) { + if (jj_2_43(2)) { + ; + } else { + break label_51; } - jj_consume_token(RBRACE); - return new ArrayInitializerExpr(range(begin, tokenEnd()), ret); - } - - /* Annotation Types. */ - final public AnnotationDeclaration AnnotationTypeDeclaration(ModifierHolder modifier) { - NameExpr name; + jj_consume_token(COMMA); + member = MemberValue(); +ret.add(member); + } + break; + } + default: + jj_la1[154] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + jj_consume_token(COMMA); + break; + } + default: + jj_la1[155] = jj_gen; + ; + } + jj_consume_token(RBRACE); +return new ArrayInitializerExpr(range(begin, tokenEnd()),ret); + } + +/* Annotation Types. */ + final public +AnnotationDeclaration AnnotationTypeDeclaration(ModifierHolder modifier) {NameExpr name; List> members; Position begin = modifier.begin; - jj_consume_token(AT); - begin = begin.orIfInvalid(tokenBegin()); - jj_consume_token(INTERFACE); - name = Name(); - members = AnnotationTypeBody(); - AnnotationDeclaration tmp = new AnnotationDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, null, members); - tmp.setNameExpr(name); - return tmp; - } - - final public List> AnnotationTypeBody() { - List> ret = null; + jj_consume_token(AT); +begin=begin.orIfInvalid(tokenBegin()); + jj_consume_token(INTERFACE); + name = Name(); + members = AnnotationTypeBody(); +AnnotationDeclaration tmp = new AnnotationDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, null, members); + tmp.setNameExpr(name); + return tmp; + } + + final public List> AnnotationTypeBody() {List> ret = null; BodyDeclaration member; - jj_consume_token(LBRACE); - label_52: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case SEMICOLON: - case AT: { - ; - break; - } - default: - jj_la1[156] = jj_gen; - break label_52; - } - member = AnnotationBodyDeclaration(); - ret = add(ret, member); - } - jj_consume_token(RBRACE); - return ret; - } - - final public BodyDeclaration AnnotationBodyDeclaration() { - ModifierHolder modifier; - BodyDeclaration ret; - - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SEMICOLON: { - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(tokenRange()); - break; - } - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: { - modifier = Modifiers(); - if (jj_2_44(2147483647)) { - ret = AnnotationTypeMemberDeclaration(modifier); - } else { - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CLASS: - case INTERFACE: { - ret = ClassOrInterfaceDeclaration(modifier); - break; - } - case ENUM: { - ret = EnumDeclaration(modifier); - break; - } - case AT: { - ret = AnnotationTypeDeclaration(modifier); - break; - } - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: { - ret = FieldDeclaration(modifier); - break; - } - default: - jj_la1[157] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - } - default: - jj_la1[158] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - return ret; - } - - final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(ModifierHolder modifier) { - Type type; + jj_consume_token(LBRACE); + label_52: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case SEMICOLON: + case AT:{ + ; + break; + } + default: + jj_la1[156] = jj_gen; + break label_52; + } + member = AnnotationBodyDeclaration(); +ret = add(ret, member); + } + jj_consume_token(RBRACE); +return ret; + } + + final public BodyDeclaration AnnotationBodyDeclaration() {ModifierHolder modifier; + BodyDeclaration ret; + + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + jj_consume_token(SEMICOLON); +ret = new EmptyTypeDeclaration(tokenRange()); + break; + } + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case AT:{ + modifier = Modifiers(); + if (jj_2_44(2147483647)) { + ret = AnnotationTypeMemberDeclaration(modifier); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CLASS: + case INTERFACE:{ + ret = ClassOrInterfaceDeclaration(modifier); + break; + } + case ENUM:{ + ret = EnumDeclaration(modifier); + break; + } + case AT:{ + ret = AnnotationTypeDeclaration(modifier); + break; + } + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER:{ + ret = FieldDeclaration(modifier); + break; + } + default: + jj_la1[157] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[158] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return ret; + } + + final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(ModifierHolder modifier) {Type type; String name; Expression defaultVal = null; - type = Type(); - jj_consume_token(IDENTIFIER); - name = token.image; - jj_consume_token(LPAREN); - jj_consume_token(RPAREN); - switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case _DEFAULT: { - defaultVal = DefaultValue(); - break; - } - default: - jj_la1[159] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - Position begin = modifier.begin.orIfInvalid(tokenBegin()); - return new AnnotationMemberDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, type, name, defaultVal); - } - - final public Expression DefaultValue() { - Expression ret; - jj_consume_token(_DEFAULT); - ret = MemberValue(); - return ret; - } - - private boolean jj_2_1(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_1(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(0, xla); - } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_2(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(1, xla); - } - } - - private boolean jj_2_3(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_3(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(2, xla); - } - } - - private boolean jj_2_4(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_4(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(3, xla); - } - } - - private boolean jj_2_5(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_5(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(4, xla); - } - } - - private boolean jj_2_6(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_6(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(5, xla); - } - } - - private boolean jj_2_7(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_7(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(6, xla); - } - } - - private boolean jj_2_8(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_8(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(7, xla); - } - } - - private boolean jj_2_9(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_9(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(8, xla); - } - } - - private boolean jj_2_10(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_10(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(9, xla); - } - } - - private boolean jj_2_11(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_11(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(10, xla); - } - } - - private boolean jj_2_12(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_12(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(11, xla); - } - } - - private boolean jj_2_13(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_13(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(12, xla); - } - } - - private boolean jj_2_14(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_14(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(13, xla); - } - } - - private boolean jj_2_15(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_15(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(14, xla); - } - } - - private boolean jj_2_16(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_16(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(15, xla); - } - } - - private boolean jj_2_17(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_17(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(16, xla); - } - } - - private boolean jj_2_18(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_18(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(17, xla); - } - } - - private boolean jj_2_19(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_19(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(18, xla); - } - } - - private boolean jj_2_20(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_20(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(19, xla); - } - } - - private boolean jj_2_21(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_21(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(20, xla); - } - } - - private boolean jj_2_22(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_22(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(21, xla); - } - } - - private boolean jj_2_23(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_23(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(22, xla); - } - } - - private boolean jj_2_24(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_24(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(23, xla); - } - } - - private boolean jj_2_25(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_25(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(24, xla); - } - } - - private boolean jj_2_26(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_26(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(25, xla); - } - } - - private boolean jj_2_27(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_27(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(26, xla); - } - } - - private boolean jj_2_28(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_28(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(27, xla); - } - } - - private boolean jj_2_29(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_29(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(28, xla); - } - } - - private boolean jj_2_30(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_30(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(29, xla); - } - } - - private boolean jj_2_31(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_31(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(30, xla); - } - } - - private boolean jj_2_32(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_32(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(31, xla); - } - } - - private boolean jj_2_33(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_33(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(32, xla); - } - } - - private boolean jj_2_34(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_34(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(33, xla); - } - } - - private boolean jj_2_35(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_35(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(34, xla); - } - } - - private boolean jj_2_36(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_36(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(35, xla); - } - } - - private boolean jj_2_37(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_37(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(36, xla); - } - } - - private boolean jj_2_38(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_38(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(37, xla); - } - } - - private boolean jj_2_39(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_39(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(38, xla); - } - } - - private boolean jj_2_40(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_40(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(39, xla); - } - } - - private boolean jj_2_41(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_41(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(40, xla); - } - } - - private boolean jj_2_42(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_42(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(41, xla); - } - } - - private boolean jj_2_43(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_43(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(42, xla); - } - } - - private boolean jj_2_44(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_44(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(43, xla); - } - } - - private boolean jj_3_38() { - if (jj_3R_95()) return true; - if (jj_3R_68()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_341() { - if (jj_3R_345()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_373()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_385() { - if (jj_scan_token(ELSE)) return true; - if (jj_3R_277()) return true; - return false; - } - - private boolean jj_3R_377() { - if (jj_3R_93()) return true; - return false; - } - - private boolean jj_3R_427() { - if (jj_3R_80()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_429()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_159() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_78()) return true; - if (jj_3R_158()) return true; - return false; - } - - private boolean jj_3_21() { - if (jj_3R_83()) return true; - return false; - } - - private boolean jj_3_20() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_426() { - if (jj_3R_427()) return true; - return false; - } - - private boolean jj_3R_81() { - if (jj_scan_token(LSHIFT)) return true; - return false; - } - - private boolean jj_3R_402() { - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_103() { - if (jj_scan_token(LT)) return true; - if (jj_3R_78()) return true; - if (jj_3R_158()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_159()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3_19() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_81()) { - jj_scanpos = xsp; - if (jj_3_20()) { - jj_scanpos = xsp; - if (jj_3_21()) return true; - } - } - if (jj_3R_341()) return true; - return false; - } - - private boolean jj_3R_425() { - if (jj_3R_96()) return true; - return false; - } - - private boolean jj_3R_342() { - if (jj_scan_token(INSTANCEOF)) return true; - if (jj_3R_68()) return true; - return false; - } - - private boolean jj_3R_339() { - if (jj_3R_341()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_19()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_419() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_425()) { - jj_scanpos = xsp; - if (jj_3R_426()) return true; - } - return false; - } - - private boolean jj_3R_364() { - if (jj_scan_token(GE)) return true; - return false; - } - - private boolean jj_3R_363() { - if (jj_scan_token(LE)) return true; - return false; - } - - private boolean jj_3R_362() { - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_361() { - if (jj_scan_token(LT)) return true; - return false; - } - - private boolean jj_3R_376() { - if (jj_3R_163()) return true; - return false; - } - - private boolean jj_3R_346() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_361()) { - jj_scanpos = xsp; - if (jj_3R_362()) { - jj_scanpos = xsp; - if (jj_3R_363()) { - jj_scanpos = xsp; - if (jj_3R_364()) return true; - } - } - } - if (jj_3R_339()) return true; - return false; - } - - private boolean jj_3_37() { - if (jj_3R_96()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_102() { - if (jj_3R_101()) return true; - return false; - } - - private boolean jj_3R_367() { - if (jj_3R_183()) return true; - return false; - } - - private boolean jj_3R_66() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_102()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(IDENTIFIER)) return true; - xsp = jj_scanpos; - if (jj_3R_376()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_377()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_401() { - if (jj_3R_419()) return true; - return false; - } - - private boolean jj_3R_387() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_401()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_402()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_403()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_337() { - if (jj_3R_339()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_346()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_386() { - if (jj_3R_96()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_352() { - if (jj_scan_token(SEMICOLON)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_367()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_338() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_3R_314()) return true; - return false; - } - - private boolean jj_3R_325() { - if (jj_scan_token(FOR)) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_386()) { - jj_scanpos = xsp; - if (jj_3R_387()) return true; - } - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_277()) return true; - return false; - } - - private boolean jj_3R_332() { - if (jj_3R_337()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_342()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_351() { - if (jj_3R_66()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_3()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_344() { - if (jj_scan_token(NE)) return true; - return false; - } - - private boolean jj_3R_343() { - if (jj_scan_token(EQ)) return true; - return false; - } - - private boolean jj_3R_340() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_343()) { - jj_scanpos = xsp; - if (jj_3R_344()) return true; - } - if (jj_3R_332()) return true; - return false; - } - - private boolean jj_3R_333() { - if (jj_scan_token(XOR)) return true; - if (jj_3R_285()) return true; - return false; - } - - private boolean jj_3R_324() { - if (jj_scan_token(DO)) return true; - if (jj_3R_277()) return true; - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_350() { - if (jj_3R_366()) return true; - return false; - } - - private boolean jj_3R_315() { - if (jj_scan_token(BIT_OR)) return true; - if (jj_3R_265()) return true; - return false; - } - - private boolean jj_3R_314() { - if (jj_3R_332()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_340()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_271() { - if (jj_scan_token(ENUM)) return true; - if (jj_3R_98()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_350()) jj_scanpos = xsp; - if (jj_scan_token(LBRACE)) return true; - xsp = jj_scanpos; - if (jj_3R_351()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(113)) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_352()) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_323() { - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_277()) return true; - return false; - } - - private boolean jj_3R_286() { - if (jj_scan_token(SC_AND)) return true; - if (jj_3R_237()) return true; - return false; - } - - private boolean jj_3R_285() { - if (jj_3R_314()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_338()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_267() { - if (jj_scan_token(SC_OR)) return true; - if (jj_3R_207()) return true; - return false; - } - - private boolean jj_3R_375() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_251()) return true; - return false; - } - - private boolean jj_3R_366() { - if (jj_scan_token(IMPLEMENTS)) return true; - if (jj_3R_251()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_375()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_265() { - if (jj_3R_285()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_333()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_322() { - if (jj_scan_token(IF)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_277()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_385()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_237() { - if (jj_3R_265()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_315()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_374() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_251()) return true; - return false; - } - - private boolean jj_3R_365() { - if (jj_scan_token(EXTENDS)) return true; - if (jj_3R_251()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_374()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_207() { - if (jj_3R_237()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_286()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_418() { - if (jj_scan_token(_DEFAULT)) return true; - return false; - } - - private boolean jj_3R_417() { - if (jj_scan_token(CASE)) return true; - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_289() { - if (jj_scan_token(INTERFACE)) return true; - return false; - } - - private boolean jj_3R_349() { - if (jj_3R_366()) return true; - return false; - } - - private boolean jj_3R_176() { - if (jj_3R_207()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_267()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_348() { - if (jj_3R_365()) return true; - return false; - } - - private boolean jj_3R_400() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_417()) { - jj_scanpos = xsp; - if (jj_3R_418()) return true; - } - if (jj_scan_token(COLON)) return true; - if (jj_3R_160()) return true; - return false; - } - - private boolean jj_3R_347() { - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3R_270() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(45)) { - jj_scanpos = xsp; - if (jj_3R_289()) return true; - } - if (jj_3R_98()) return true; - xsp = jj_scanpos; - if (jj_3R_347()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_348()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_349()) jj_scanpos = xsp; - if (jj_3R_93()) return true; - return false; - } - - private boolean jj_3R_150() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_149()) return true; - return false; - } - - private boolean jj_3R_241() { - if (jj_scan_token(HOOK)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_129()) return true; - return false; - } - - private boolean jj_3R_384() { - if (jj_3R_400()) return true; - return false; - } - - private boolean jj_3R_129() { - if (jj_3R_176()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_241()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_321() { - if (jj_scan_token(SWITCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_384()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_128() { - if (jj_scan_token(ORASSIGN)) return true; - return false; - } - - private boolean jj_3R_424() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_127() { - if (jj_scan_token(XORASSIGN)) return true; - return false; - } - - private boolean jj_3R_126() { - if (jj_scan_token(ANDASSIGN)) return true; - return false; - } - - private boolean jj_3R_125() { - if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_124() { - if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_123() { - if (jj_scan_token(LSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_416() { - if (jj_scan_token(ARROW)) return true; - if (jj_3R_268()) return true; - return false; - } - - private boolean jj_3R_122() { - if (jj_scan_token(MINUSASSIGN)) return true; - return false; - } - - private boolean jj_3R_121() { - if (jj_scan_token(PLUSASSIGN)) return true; - return false; - } - - private boolean jj_3R_415() { - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_424()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(103)) { - jj_scanpos = xsp; - if (jj_scan_token(68)) return true; - } - return false; - } - - private boolean jj_3R_120() { - if (jj_scan_token(REMASSIGN)) return true; - return false; - } - - private boolean jj_3R_414() { - if (jj_3R_79()) return true; - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_119() { - if (jj_scan_token(SLASHASSIGN)) return true; - return false; - } - - private boolean jj_3R_118() { - if (jj_scan_token(STARASSIGN)) return true; - return false; - } - - private boolean jj_3R_413() { - if (jj_scan_token(DECR)) return true; - return false; - } - - private boolean jj_3R_117() { - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_412() { - if (jj_scan_token(INCR)) return true; - return false; - } - - private boolean jj_3R_399() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_412()) { - jj_scanpos = xsp; - if (jj_3R_413()) { - jj_scanpos = xsp; - if (jj_3R_414()) { - jj_scanpos = xsp; - if (jj_3R_415()) { - jj_scanpos = xsp; - if (jj_3R_416()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_79() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_117()) { - jj_scanpos = xsp; - if (jj_3R_118()) { - jj_scanpos = xsp; - if (jj_3R_119()) { - jj_scanpos = xsp; - if (jj_3R_120()) { - jj_scanpos = xsp; - if (jj_3R_121()) { - jj_scanpos = xsp; - if (jj_3R_122()) { - jj_scanpos = xsp; - if (jj_3R_123()) { - jj_scanpos = xsp; - if (jj_3R_124()) { - jj_scanpos = xsp; - if (jj_3R_125()) { - jj_scanpos = xsp; - if (jj_3R_126()) { - jj_scanpos = xsp; - if (jj_3R_127()) { - jj_scanpos = xsp; - if (jj_3R_128()) return true; - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_336() { - if (jj_3R_266()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_399()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_335() { - if (jj_3R_216()) return true; - return false; - } - - private boolean jj_3R_269() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3_36() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_243() { - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_269()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(103)) { - jj_scanpos = xsp; - if (jj_scan_token(68)) return true; - } - return false; - } - - private boolean jj_3R_320() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_36()) { - jj_scanpos = xsp; - if (jj_3R_335()) { - jj_scanpos = xsp; - if (jj_3R_336()) return true; - } - } - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_65() { - if (jj_3R_101()) return true; - return false; - } - - private boolean jj_3R_64() { - if (jj_scan_token(STRICTFP)) return true; - return false; - } - - private boolean jj_3R_63() { - if (jj_scan_token(VOLATILE)) return true; - return false; - } - - private boolean jj_3R_62() { - if (jj_scan_token(TRANSIENT)) return true; - return false; - } - - private boolean jj_3R_61() { - if (jj_scan_token(NATIVE)) return true; - return false; - } - - private boolean jj_3R_60() { - if (jj_scan_token(SYNCHRONIZED)) return true; - return false; - } - - private boolean jj_3R_288() { - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_59() { - if (jj_scan_token(ABSTRACT)) return true; - return false; - } - - private boolean jj_3R_58() { - if (jj_scan_token(FINAL)) return true; - return false; - } - - private boolean jj_3_18() { - if (jj_3R_79()) return true; - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_242() { - if (jj_scan_token(ARROW)) return true; - if (jj_3R_268()) return true; - return false; - } - - private boolean jj_3R_57() { - if (jj_scan_token(PRIVATE)) return true; - return false; - } - - private boolean jj_3R_56() { - if (jj_scan_token(PROTECTED)) return true; - return false; - } - - private boolean jj_3R_213() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_18()) { - jj_scanpos = xsp; - if (jj_3R_242()) { - jj_scanpos = xsp; - if (jj_3R_243()) return true; - } - } - return false; - } - - private boolean jj_3R_287() { - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_55() { - if (jj_scan_token(STATIC)) return true; - return false; - } - - private boolean jj_3R_54() { - if (jj_scan_token(PUBLIC)) return true; - return false; - } - - private boolean jj_3R_80() { - if (jj_3R_129()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_213()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_2() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_54()) { - jj_scanpos = xsp; - if (jj_3R_55()) { - jj_scanpos = xsp; - if (jj_3R_56()) { - jj_scanpos = xsp; - if (jj_3R_57()) { - jj_scanpos = xsp; - if (jj_3R_58()) { - jj_scanpos = xsp; - if (jj_3R_59()) { - jj_scanpos = xsp; - if (jj_3R_60()) { - jj_scanpos = xsp; - if (jj_3R_61()) { - jj_scanpos = xsp; - if (jj_3R_62()) { - jj_scanpos = xsp; - if (jj_3R_63()) { - jj_scanpos = xsp; - if (jj_3R_64()) { - jj_scanpos = xsp; - if (jj_3R_65()) return true; - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_268() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_287()) { - jj_scanpos = xsp; - if (jj_3R_288()) return true; - } - return false; - } - - private boolean jj_3R_95() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_2()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_319() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_35() { - if (jj_3R_96()) return true; - return false; - } - - private boolean jj_3R_96() { - if (jj_3R_95()) return true; - if (jj_3R_68()) return true; - if (jj_3R_149()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_150()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_202() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3_34() { - if (jj_3R_95()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(45)) { - jj_scanpos = xsp; - if (jj_scan_token(65)) return true; - } - return false; - } - - private boolean jj_3R_255() { - if (jj_3R_277()) return true; - return false; - } - - private boolean jj_3R_383() { - if (jj_scan_token(COLON)) return true; - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3_17() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_254() { - if (jj_3R_96()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_98() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_17()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_53() { - if (jj_3R_78()) return true; - if (jj_scan_token(PACKAGE)) return true; - if (jj_3R_98()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_253() { - if (jj_3R_95()) return true; - if (jj_3R_270()) return true; - return false; - } - - private boolean jj_3R_147() { - if (jj_3R_68()) return true; - return false; - } - - private boolean jj_3R_146() { - if (jj_scan_token(VOID)) return true; - return false; - } - - private boolean jj_3R_220() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_253()) { - jj_scanpos = xsp; - if (jj_3R_254()) { - jj_scanpos = xsp; - if (jj_3R_255()) return true; - } - } - return false; - } - - private boolean jj_3_1() { - if (jj_3R_53()) return true; - return false; - } - - private boolean jj_3R_91() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_146()) { - jj_scanpos = xsp; - if (jj_3R_147()) return true; - } - return false; - } - - private boolean jj_3R_140() { - if (jj_scan_token(DOUBLE)) return true; - return false; - } - - private boolean jj_3R_106() { - if (jj_scan_token(LBRACE)) return true; - if (jj_3R_160()) return true; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_139() { - if (jj_scan_token(FLOAT)) return true; - return false; - } - - private boolean jj_3R_138() { - if (jj_scan_token(LONG)) return true; - return false; - } - - private boolean jj_3R_137() { - if (jj_scan_token(INT)) return true; - return false; - } - - private boolean jj_3R_136() { - if (jj_scan_token(SHORT)) return true; - return false; - } - - private boolean jj_3R_135() { - if (jj_scan_token(BYTE)) return true; - return false; - } - - private boolean jj_3R_94() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_277()) return true; - return false; - } - - private boolean jj_3R_134() { - if (jj_scan_token(CHAR)) return true; - return false; - } - - private boolean jj_3R_133() { - if (jj_scan_token(BOOLEAN)) return true; - return false; - } - - private boolean jj_3R_313() { - if (jj_scan_token(SUPER)) return true; - if (jj_3R_78()) return true; - if (jj_3R_75()) return true; - return false; - } - - private boolean jj_3R_87() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_133()) { - jj_scanpos = xsp; - if (jj_3R_134()) { - jj_scanpos = xsp; - if (jj_3R_135()) { - jj_scanpos = xsp; - if (jj_3R_136()) { - jj_scanpos = xsp; - if (jj_3R_137()) { - jj_scanpos = xsp; - if (jj_3R_138()) { - jj_scanpos = xsp; - if (jj_3R_139()) { - jj_scanpos = xsp; - if (jj_3R_140()) return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_204() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_175()) return true; - return false; - } - - private boolean jj_3R_312() { - if (jj_scan_token(EXTENDS)) return true; - if (jj_3R_78()) return true; - if (jj_3R_75()) return true; - return false; - } - - private boolean jj_3R_284() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_312()) { - jj_scanpos = xsp; - if (jj_3R_313()) return true; - } - return false; - } - - private boolean jj_3R_318() { - if (jj_scan_token(ASSERT)) return true; - if (jj_3R_80()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_383()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_308() { - if (jj_3R_331()) return true; - return false; - } - - private boolean jj_3R_307() { - if (jj_3R_330()) return true; - return false; - } - - private boolean jj_3R_306() { - if (jj_3R_329()) return true; - return false; - } - - private boolean jj_3R_305() { - if (jj_3R_328()) return true; - return false; - } - - private boolean jj_3R_304() { - if (jj_3R_327()) return true; - return false; - } - - private boolean jj_3R_303() { - if (jj_3R_326()) return true; - return false; - } - - private boolean jj_3R_236() { - if (jj_scan_token(HOOK)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_284()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_302() { - if (jj_3R_325()) return true; - return false; - } - - private boolean jj_3R_301() { - if (jj_3R_324()) return true; - return false; - } - - private boolean jj_3R_300() { - if (jj_3R_323()) return true; - return false; - } - - private boolean jj_3R_299() { - if (jj_3R_322()) return true; - return false; - } - - private boolean jj_3R_298() { - if (jj_3R_321()) return true; - return false; - } - - private boolean jj_3R_297() { - if (jj_3R_320()) return true; - return false; - } - - private boolean jj_3R_206() { - if (jj_3R_236()) return true; - return false; - } - - private boolean jj_3R_296() { - if (jj_3R_319()) return true; - return false; - } - - private boolean jj_3R_205() { - if (jj_3R_75()) return true; - return false; - } - - private boolean jj_3R_295() { - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_294() { - if (jj_3R_318()) return true; - return false; - } - - private boolean jj_3R_175() { - if (jj_3R_78()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_205()) { - jj_scanpos = xsp; - if (jj_3R_206()) return true; - } - return false; - } - - private boolean jj_3_33() { - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_115() { - if (jj_3R_175()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_204()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_277() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_33()) { - jj_scanpos = xsp; - if (jj_3R_294()) { - jj_scanpos = xsp; - if (jj_3R_295()) { - jj_scanpos = xsp; - if (jj_3R_296()) { - jj_scanpos = xsp; - if (jj_3R_297()) { - jj_scanpos = xsp; - if (jj_3R_298()) { - jj_scanpos = xsp; - if (jj_3R_299()) { - jj_scanpos = xsp; - if (jj_3R_300()) { - jj_scanpos = xsp; - if (jj_3R_301()) { - jj_scanpos = xsp; - if (jj_3R_302()) { - jj_scanpos = xsp; - if (jj_3R_303()) { - jj_scanpos = xsp; - if (jj_3R_304()) { - jj_scanpos = xsp; - if (jj_3R_305()) { - jj_scanpos = xsp; - if (jj_3R_306()) { - jj_scanpos = xsp; - if (jj_3R_307()) { - jj_scanpos = xsp; - if (jj_3R_308()) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_77() { - if (jj_scan_token(LT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_115()) jj_scanpos = xsp; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3_16() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3_32() { - if (jj_3R_93()) return true; - return false; - } - - private boolean jj_3_15() { - if (jj_scan_token(DOT)) return true; - if (jj_3R_78()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_16()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_311() { - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_283() { - if (jj_3R_161()) return true; - return false; - } - - private boolean jj_3R_282() { - if (jj_3R_78()) return true; - if (jj_scan_token(LBRACKET)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_311()) jj_scanpos = xsp; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_261() { - Token xsp; - if (jj_3R_282()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_282()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_283()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_14() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_174() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_14()) jj_scanpos = xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_15()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_256() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_264() { - if (jj_3R_163()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_32()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_263() { - if (jj_3R_261()) return true; - return false; - } - - private boolean jj_3R_262() { - if (jj_3R_77()) return true; - if (jj_3R_78()) return true; - return false; - } - - private boolean jj_3R_235() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_262()) jj_scanpos = xsp; - if (jj_3R_251()) return true; - xsp = jj_scanpos; - if (jj_3R_263()) { - jj_scanpos = xsp; - if (jj_3R_264()) return true; - } - return false; - } - - private boolean jj_3R_234() { - if (jj_3R_87()) return true; - if (jj_3R_261()) return true; - return false; - } - - private boolean jj_3R_251() { - if (jj_3R_78()) return true; - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3_13() { - if (jj_3R_76()) return true; - return false; - } - - private boolean jj_3R_428() { - if (jj_3R_430()) return true; - return false; - } - - private boolean jj_3R_200() { - if (jj_scan_token(NEW)) return true; - if (jj_3R_78()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_234()) { - jj_scanpos = xsp; - if (jj_3R_235()) return true; - } - return false; - } - - private boolean jj_3_12() { - if (jj_3R_76()) return true; - return false; - } - - private boolean jj_3R_355() { - if (jj_scan_token(THROWS)) return true; - if (jj_3R_370()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_371()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_76() { - if (jj_3R_78()) return true; - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_221() { - if (jj_3R_80()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_256()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_195() { - if (jj_3R_221()) return true; - return false; - } - - private boolean jj_3R_114() { - if (jj_3R_174()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_13()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_163() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_195()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_113() { - if (jj_3R_87()) return true; - Token xsp; - if (jj_3_12()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3_12()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_75() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_113()) { - jj_scanpos = xsp; - if (jj_3R_114()) return true; - } - return false; - } - - private boolean jj_3R_258() { - if (jj_scan_token(NULL)) return true; - return false; - } - - private boolean jj_3R_279() { - if (jj_scan_token(FALSE)) return true; - return false; - } - - private boolean jj_3R_278() { - if (jj_scan_token(TRUE)) return true; - return false; - } - - private boolean jj_3R_104() { - if (jj_3R_87()) return true; - return false; - } - - private boolean jj_3_11() { - if (jj_3R_75()) return true; - return false; - } - - private boolean jj_3R_68() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_11()) { - jj_scanpos = xsp; - if (jj_3R_104()) return true; - } - return false; - } - - private boolean jj_3R_257() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_278()) { - jj_scanpos = xsp; - if (jj_3R_279()) return true; - } - return false; - } - - private boolean jj_3R_430() { - if (jj_scan_token(_DEFAULT)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_228() { - if (jj_3R_258()) return true; - return false; - } - - private boolean jj_3R_227() { - if (jj_3R_257()) return true; - return false; - } - - private boolean jj_3R_226() { - if (jj_scan_token(STRING_LITERAL)) return true; - return false; - } - - private boolean jj_3R_105() { - if (jj_scan_token(STATIC)) return true; - return false; - } - - private boolean jj_3R_225() { - if (jj_scan_token(CHARACTER_LITERAL)) return true; - return false; - } - - private boolean jj_3R_423() { - if (jj_3R_68()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_scan_token(RPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_428()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_70() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_105()) jj_scanpos = xsp; - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_224() { - if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; - return false; - } - - private boolean jj_3R_194() { - if (jj_3R_220()) return true; - return false; - } - - private boolean jj_3_44() { - if (jj_3R_68()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_411() { - if (jj_3R_274()) return true; - return false; - } - - private boolean jj_3R_160() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_194()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_410() { - if (jj_3R_272()) return true; - return false; - } - - private boolean jj_3R_223() { - if (jj_scan_token(LONG_LITERAL)) return true; - return false; - } - - private boolean jj_3_9() { - if (jj_3R_73()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3R_409() { - if (jj_3R_271()) return true; - return false; - } - - private boolean jj_3R_408() { - if (jj_3R_270()) return true; - return false; - } - - private boolean jj_3R_222() { - if (jj_scan_token(INTEGER_LITERAL)) return true; - return false; - } - - private boolean jj_3R_407() { - if (jj_3R_423()) return true; - return false; - } - - private boolean jj_3R_74() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_165() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3_10() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_74()) jj_scanpos = xsp; - if (jj_scan_token(THIS)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_164() { - if (jj_3R_73()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3_43() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_92() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_196() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_222()) { - jj_scanpos = xsp; - if (jj_3R_223()) { - jj_scanpos = xsp; - if (jj_3R_224()) { - jj_scanpos = xsp; - if (jj_3R_225()) { - jj_scanpos = xsp; - if (jj_3R_226()) { - jj_scanpos = xsp; - if (jj_3R_227()) { - jj_scanpos = xsp; - if (jj_3R_228()) return true; - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_394() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_110() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_164()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_165()) jj_scanpos = xsp; - if (jj_scan_token(SUPER)) return true; - if (jj_3R_163()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_143() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_31() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_92()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_395() { - if (jj_3R_95()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_407()) { - jj_scanpos = xsp; - if (jj_3R_408()) { - jj_scanpos = xsp; - if (jj_3R_409()) { - jj_scanpos = xsp; - if (jj_3R_410()) { - jj_scanpos = xsp; - if (jj_3R_411()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_162() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_109() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_162()) jj_scanpos = xsp; - if (jj_scan_token(THIS)) return true; - if (jj_3R_163()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_212() { - if (jj_3R_163()) return true; - return false; - } - - private boolean jj_3R_378() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_394()) { - jj_scanpos = xsp; - if (jj_3R_395()) return true; - } - return false; - } - - private boolean jj_3R_211() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_181() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_211()) jj_scanpos = xsp; - if (jj_3R_202()) return true; - xsp = jj_scanpos; - if (jj_3R_212()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_368() { - if (jj_3R_378()) return true; - return false; - } - - private boolean jj_3R_180() { - if (jj_3R_200()) return true; - return false; - } - - private boolean jj_3R_72() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_109()) { - jj_scanpos = xsp; - if (jj_3R_110()) return true; - } - return false; - } - - private boolean jj_3R_179() { - if (jj_scan_token(THIS)) return true; - return false; - } - - private boolean jj_3R_353() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_368()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_259() { - if (jj_3R_280()) return true; - return false; - } - - private boolean jj_3_8() { - if (jj_3R_72()) return true; - return false; - } - - private boolean jj_3R_144() { - if (jj_scan_token(ELLIPSIS)) return true; - return false; - } - - private boolean jj_3R_142() { - if (jj_scan_token(DOT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_179()) { - jj_scanpos = xsp; - if (jj_3R_180()) { - jj_scanpos = xsp; - if (jj_3R_181()) return true; - } - } - return false; - } - - private boolean jj_3R_309() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_90()) return true; - return false; - } - - private boolean jj_3R_89() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_142()) { - jj_scanpos = xsp; - if (jj_3R_143()) return true; - } - return false; - } - - private boolean jj_3R_356() { - if (jj_3R_72()) return true; - return false; - } - - private boolean jj_3R_272() { - if (jj_scan_token(AT)) return true; - if (jj_scan_token(INTERFACE)) return true; - if (jj_3R_98()) return true; - if (jj_3R_353()) return true; - return false; - } - - private boolean jj_3R_371() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_370()) return true; - return false; - } - - private boolean jj_3R_317() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_316()) return true; - return false; - } - - private boolean jj_3R_290() { - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3R_141() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(SUPER)) return true; - return false; - } - - private boolean jj_3R_273() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_290()) jj_scanpos = xsp; - if (jj_3R_202()) return true; - if (jj_3R_354()) return true; - xsp = jj_scanpos; - if (jj_3R_355()) jj_scanpos = xsp; - if (jj_scan_token(LBRACE)) return true; - xsp = jj_scanpos; - if (jj_3R_356()) jj_scanpos = xsp; - if (jj_3R_160()) return true; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_334() { - if (jj_3R_100()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_43()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_30() { - if (jj_3R_89()) return true; - return false; - } - - private boolean jj_3R_201() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_379() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_90()) return true; - return false; - } - - private boolean jj_3R_88() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_30()) { - jj_scanpos = xsp; - if (jj_3R_141()) return true; - } - return false; - } - - private boolean jj_3R_189() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_334()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(113)) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_203() { - if (jj_3R_163()) return true; - return false; - } - - private boolean jj_3R_154() { - if (jj_3R_129()) return true; - return false; - } - - private boolean jj_3R_153() { - if (jj_3R_189()) return true; - return false; - } - - private boolean jj_3R_173() { - if (jj_3R_202()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_203()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_152() { - if (jj_3R_101()) return true; - return false; - } - - private boolean jj_3_29() { - if (jj_3R_91()) return true; - if (jj_scan_token(DOUBLECOLON)) return true; - return false; - } - - private boolean jj_3_28() { - if (jj_3R_91()) return true; - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(CLASS)) return true; - return false; - } - - private boolean jj_3R_90() { - if (jj_3R_95()) return true; - if (jj_3R_68()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_144()) jj_scanpos = xsp; - if (jj_3R_145()) return true; - return false; - } - - private boolean jj_3R_100() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_152()) { - jj_scanpos = xsp; - if (jj_3R_153()) { - jj_scanpos = xsp; - if (jj_3R_154()) return true; - } - } - return false; - } - - private boolean jj_3_7() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_71()) return true; - return false; - } - - private boolean jj_3R_260() { - if (jj_3R_281()) return true; - return false; - } - - private boolean jj_3R_172() { - if (jj_3R_91()) return true; - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_201()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(103)) { - jj_scanpos = xsp; - if (jj_scan_token(68)) return true; - } - return false; - } - - private boolean jj_3R_276() { - if (jj_3R_293()) return true; - return false; - } - - private boolean jj_3R_171() { - if (jj_3R_91()) return true; - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(CLASS)) return true; - return false; - } - - private boolean jj_3R_316() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_310() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_145()) return true; - return false; - } - - private boolean jj_3R_170() { - if (jj_3R_200()) return true; - return false; - } - - private boolean jj_3R_281() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_145()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_310()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_27() { - if (jj_3R_90()) return true; - return false; - } - - private boolean jj_3R_293() { - if (jj_3R_316()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_317()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_358() { - if (jj_3R_76()) return true; - return false; - } - - private boolean jj_3R_233() { - if (jj_3R_80()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_260()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_280() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_90()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_309()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_232() { - if (jj_3R_90()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_259()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_199() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_232()) { - jj_scanpos = xsp; - if (jj_3R_233()) return true; - } - return false; - } - - private boolean jj_3R_231() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3R_369() { - if (jj_3R_90()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_379()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_191() { - if (jj_scan_token(AT)) return true; - if (jj_3R_98()) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_99() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_169() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_199()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_198() { - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_231()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(103)) { - jj_scanpos = xsp; - if (jj_scan_token(68)) return true; - } - return false; - } - - private boolean jj_3R_354() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_369()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_192() { - if (jj_scan_token(AT)) return true; - if (jj_3R_98()) return true; - return false; - } - - private boolean jj_3_42() { - if (jj_scan_token(AT)) return true; - if (jj_3R_98()) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3_41() { - if (jj_scan_token(AT)) return true; - if (jj_3R_98()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_99()) { - jj_scanpos = xsp; - if (jj_scan_token(107)) return true; - } - return false; - } - - private boolean jj_3R_230() { - if (jj_3R_163()) return true; - return false; - } - - private boolean jj_3R_190() { - if (jj_scan_token(AT)) return true; - if (jj_3R_98()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_276()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_370() { - if (jj_3R_78()) return true; - if (jj_3R_75()) return true; - return false; - } - - private boolean jj_3R_197() { - if (jj_scan_token(DOT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_229()) jj_scanpos = xsp; - if (jj_3R_202()) return true; - xsp = jj_scanpos; - if (jj_3R_230()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_229() { - if (jj_3R_77()) return true; - return false; - } - - private boolean jj_3_40() { - if (jj_scan_token(SEMICOLON)) return true; - if (jj_3R_96()) return true; - return false; - } - - private boolean jj_3_26() { - if (jj_3R_89()) return true; - return false; - } - - private boolean jj_3R_157() { - if (jj_3R_192()) return true; - return false; - } - - private boolean jj_3R_182() { - if (jj_3R_76()) return true; - return false; - } - - private boolean jj_3R_168() { - if (jj_scan_token(SUPER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_197()) { - jj_scanpos = xsp; - if (jj_3R_198()) return true; - } - return false; - } - - private boolean jj_3R_156() { - if (jj_3R_191()) return true; - return false; - } - - private boolean jj_3R_167() { - if (jj_scan_token(THIS)) return true; - return false; - } - - private boolean jj_3R_155() { - if (jj_3R_190()) return true; - return false; - } - - private boolean jj_3R_166() { - if (jj_3R_196()) return true; - return false; - } - - private boolean jj_3R_292() { - if (jj_3R_71()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_7()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_372() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_370()) return true; - return false; - } - - private boolean jj_3R_360() { - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_112() { - if (jj_3R_89()) return true; - return false; - } - - private boolean jj_3R_359() { - if (jj_scan_token(THROWS)) return true; - if (jj_3R_370()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_372()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_291() { - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3R_111() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_166()) { - jj_scanpos = xsp; - if (jj_3R_167()) { - jj_scanpos = xsp; - if (jj_3R_168()) { - jj_scanpos = xsp; - if (jj_3R_169()) { - jj_scanpos = xsp; - if (jj_3R_170()) { - jj_scanpos = xsp; - if (jj_3R_171()) { - jj_scanpos = xsp; - if (jj_3R_172()) { - jj_scanpos = xsp; - if (jj_3R_173()) return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_101() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_155()) { - jj_scanpos = xsp; - if (jj_3R_156()) { - jj_scanpos = xsp; - if (jj_3R_157()) return true; - } - } - return false; - } - - private boolean jj_3R_275() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_291()) jj_scanpos = xsp; - if (jj_3R_91()) return true; - if (jj_3R_98()) return true; - if (jj_3R_354()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_358()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_359()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_360()) { - jj_scanpos = xsp; - if (jj_scan_token(112)) return true; - } - return false; - } - - private boolean jj_3_25() { - if (jj_3R_88()) return true; - return false; - } - - private boolean jj_3R_116() { - if (jj_3R_101()) return true; - return false; - } - - private boolean jj_3R_78() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_116()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_130() { - return false; - } - - private boolean jj_3R_73() { - if (jj_3R_111()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_112()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_131() { - return false; - } - - private boolean jj_3R_161() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_292()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(113)) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_82() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_130()) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_108() { - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_107() { - if (jj_3R_161()) return true; - return false; - } - - private boolean jj_3R_184() { - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_71()) return true; - return false; - } - - private boolean jj_3R_266() { - if (jj_3R_111()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_25()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_83() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_131()) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_71() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_107()) { - jj_scanpos = xsp; - if (jj_3R_108()) return true; - } - return false; - } - - private boolean jj_3R_177() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_3R_75()) return true; - return false; - } - - private boolean jj_3R_132() { - if (jj_3R_75()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_177()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_178()) return true; - return false; - } - - private boolean jj_3R_421() { - if (jj_3R_96()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_40()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_145() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_182()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_24() { - if (jj_3R_87()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3R_84() { - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_78()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_24()) { - jj_scanpos = xsp; - if (jj_3R_132()) return true; - } - return false; - } - - private boolean jj_3_39() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_149() { - if (jj_3R_145()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_184()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_404() { - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_421()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_39()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_406() { - if (jj_scan_token(FINALLY)) return true; - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_393() { - if (jj_scan_token(FINALLY)) return true; - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_422() { - if (jj_scan_token(BIT_OR)) return true; - if (jj_3R_370()) return true; - return false; - } - - private boolean jj_3R_69() { - if (jj_3R_76()) return true; - return false; - } - - private boolean jj_3R_86() { - if (jj_scan_token(DECR)) return true; - return false; - } - - private boolean jj_3_23() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_85()) { - jj_scanpos = xsp; - if (jj_3R_86()) return true; - } - return false; - } - - private boolean jj_3R_85() { - if (jj_scan_token(INCR)) return true; - return false; - } - - private boolean jj_3R_357() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_149()) return true; - return false; - } - - private boolean jj_3_22() { - if (jj_3R_84()) return true; - return false; - } - - private boolean jj_3R_405() { - if (jj_scan_token(CATCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_95()) return true; - if (jj_3R_75()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_422()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_145()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_274() { - if (jj_3R_68()) return true; - if (jj_3R_149()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_357()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_240() { - if (jj_3R_266()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_23()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_215() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_209() { - if (jj_3R_84()) return true; - return false; - } - - private boolean jj_3R_210() { - if (jj_3R_240()) return true; - return false; - } - - private boolean jj_3R_239() { - if (jj_scan_token(BANG)) return true; - return false; - } - - private boolean jj_3R_238() { - if (jj_scan_token(TILDE)) return true; - return false; - } - - private boolean jj_3R_208() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_238()) { - jj_scanpos = xsp; - if (jj_3R_239()) return true; - } - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3_5() { - if (jj_3R_68()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_69()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_scan_token(113)) { - jj_scanpos = xsp; - if (jj_scan_token(116)) { - jj_scanpos = xsp; - if (jj_scan_token(112)) return true; - } - } - return false; - } - - private boolean jj_3R_392() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_405()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_406()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_67() { - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3_4() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_67()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_178() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_208()) { - jj_scanpos = xsp; - if (jj_3R_209()) { - jj_scanpos = xsp; - if (jj_3R_210()) return true; - } - } - return false; - } - - private boolean jj_3R_250() { - if (jj_3R_275()) return true; - return false; - } - - private boolean jj_3R_391() { - if (jj_3R_404()) return true; - return false; - } - - private boolean jj_3R_331() { - if (jj_scan_token(TRY)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_391()) jj_scanpos = xsp; - if (jj_3R_106()) return true; - xsp = jj_scanpos; - if (jj_3R_392()) { - jj_scanpos = xsp; - if (jj_3R_393()) return true; - } - return false; - } - - private boolean jj_3R_244() { - if (jj_scan_token(_DEFAULT)) return true; - if (jj_3R_95()) return true; - return false; - } - - private boolean jj_3R_249() { - if (jj_3R_274()) return true; - return false; - } - - private boolean jj_3R_248() { - if (jj_3R_273()) return true; - return false; - } - - private boolean jj_3R_247() { - if (jj_3R_272()) return true; - return false; - } - - private boolean jj_3R_216() { - if (jj_scan_token(DECR)) return true; - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3R_246() { - if (jj_3R_271()) return true; - return false; - } - - private boolean jj_3R_245() { - if (jj_3R_270()) return true; - return false; - } - - private boolean jj_3R_390() { - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_193() { - if (jj_3R_219()) return true; - return false; - } - - private boolean jj_3R_97() { - if (jj_scan_token(INCR)) return true; - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3R_188() { - if (jj_3R_178()) return true; - return false; - } - - private boolean jj_3R_389() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_330() { - if (jj_scan_token(SYNCHRONIZED)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_106()) return true; - return false; - } - - private boolean jj_3R_214() { - if (jj_3R_95()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_244()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_245()) { - jj_scanpos = xsp; - if (jj_3R_246()) { - jj_scanpos = xsp; - if (jj_3R_247()) { - jj_scanpos = xsp; - if (jj_3R_248()) { - jj_scanpos = xsp; - if (jj_3R_249()) { - jj_scanpos = xsp; - if (jj_3R_250()) return true; - } - } - } - } - } - return false; - } - - private boolean jj_3_6() { - if (jj_3R_70()) return true; - return false; - } - - private boolean jj_3R_388() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_218() { - if (jj_scan_token(MINUS)) return true; - return false; - } - - private boolean jj_3R_217() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3R_329() { - if (jj_scan_token(THROW)) return true; - if (jj_3R_80()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_187() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_217()) { - jj_scanpos = xsp; - if (jj_3R_218()) return true; - } - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3R_186() { - if (jj_3R_216()) return true; - return false; - } - - private boolean jj_3R_185() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_183() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_6()) { - jj_scanpos = xsp; - if (jj_3R_214()) { - jj_scanpos = xsp; - if (jj_3R_215()) return true; - } - } - return false; - } - - private boolean jj_3R_429() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_80()) return true; - return false; - } - - private boolean jj_3R_328() { - if (jj_scan_token(RETURN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_390()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_148() { - if (jj_3R_183()) return true; - return false; - } - - private boolean jj_3R_151() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_185()) { - jj_scanpos = xsp; - if (jj_3R_186()) { - jj_scanpos = xsp; - if (jj_3R_187()) { - jj_scanpos = xsp; - if (jj_3R_188()) return true; - } - } - } - return false; - } - - private boolean jj_3R_398() { - if (jj_scan_token(REM)) return true; - return false; - } - - private boolean jj_3R_397() { - if (jj_scan_token(SLASH)) return true; - return false; - } - - private boolean jj_3R_327() { - if (jj_scan_token(CONTINUE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_389()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_93() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_148()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_396() { - if (jj_scan_token(STAR)) return true; - return false; - } - - private boolean jj_3R_380() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_396()) { - jj_scanpos = xsp; - if (jj_3R_397()) { - jj_scanpos = xsp; - if (jj_3R_398()) return true; - } - } - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3R_403() { - if (jj_3R_420()) return true; - return false; - } - - private boolean jj_3R_252() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_3R_251()) return true; - return false; - } - - private boolean jj_3R_326() { - if (jj_scan_token(BREAK)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_388()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_219() { - if (jj_scan_token(EXTENDS)) return true; - if (jj_3R_251()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_252()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_345() { - if (jj_3R_151()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_380()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_382() { - if (jj_scan_token(MINUS)) return true; - return false; - } - - private boolean jj_3R_381() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3_3() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_66()) return true; - return false; - } - - private boolean jj_3R_373() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_381()) { - jj_scanpos = xsp; - if (jj_3R_382()) return true; - } - if (jj_3R_345()) return true; - return false; - } - - private boolean jj_3R_158() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_193()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_420() { - if (jj_3R_427()) return true; - return false; - } - - /** - * Generated Token Manager. - */ - public ASTParserTokenManager token_source; - JavaCharStream jj_input_stream; - /** - * Current token. - */ - public Token token; - /** - * Next token. - */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - /** - * Whether we are looking ahead. - */ - private boolean jj_lookingAhead = false; - private boolean jj_semLA; - private int jj_gen; - final private int[] jj_la1 = new int[160]; - static private int[] jj_la1_0; - static private int[] jj_la1_1; - static private int[] jj_la1_2; - static private int[] jj_la1_3; - static private int[] jj_la1_4; - - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - jj_la1_init_4(); - } - - private static void jj_la1_init_0() { - jj_la1_0 = new int[]{0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,}; - } - - private static void jj_la1_init_1() { - jj_la1_1 = new int[]{0x40000000, 0x40000000, 0x902020, 0x0, 0x0, 0x0, 0x800020, 0x102000, 0x902020, 0x2000, 0x0, 0x200000, 0x20000000, 0x0, 0x0, 0x20000000, 0x0, 0x0, 0x29532a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200000, 0x0, 0x29532a0, 0x10000, 0x102000, 0x2041280, 0x29532a0, 0x0, 0x0, 0x0, 0x2441280, 0x2441280, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x28412a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2441280, 0x16c6b3e0, 0x0, 0x2041280, 0x2041280, 0x2041280, 0x0, 0x2041280, 0x2041280, 0x200000, 0x200000, 0x2041280, 0x2041280, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2441280, 0x0, 0x0, 0x2441280, 0x0, 0x0, 0x2041280, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2441280, 0x2c412a0, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x400000, 0x400000, 0x2441280, 0x0, 0x0, 0x0, 0x2041280, 0x2441280, 0x0, 0x0, 0x164693c0, 0x0, 0x164693c0, 0x0, 0x2441280, 0x0, 0x0, 0x0, 0x0, 0x2441280, 0x10400, 0x10400, 0x80000, 0x2c412a0, 0x2441280, 0x2441280, 0x2c412a0, 0x2441280, 0x0, 0x0, 0x0, 0x2441280, 0x0, 0x800, 0x0, 0x1000000, 0x0, 0x0, 0x0, 0x0, 0x2441280, 0x2441280, 0x0, 0x29432a0, 0x2143280, 0x29432a0, 0x10000,}; - } - - private static void jj_la1_init_2() { - jj_la1_2 = new int[]{0x0, 0x0, 0x111338a, 0x0, 0x1000, 0x0, 0x1113388, 0x2, 0x111338a, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1913b8f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1913b8f, 0x0, 0x2, 0x800805, 0x1913b8f, 0x0, 0x0, 0x0, 0xca24835, 0xca24835, 0x0, 0x0, 0x0, 0x0, 0x80000, 0x0, 0x0, 0x1113b8d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000, 0x0, 0x0, 0xca24835, 0xff7ffbf, 0x1000, 0x805, 0x805, 0x805, 0x0, 0x805, 0x805, 0x4000, 0x4000, 0x805, 0x800805, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xca24835, 0x0, 0x0, 0xca24835, 0x0, 0x0, 0x805, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0xca24835, 0xdb37bbd, 0x0, 0x10, 0x0, 0xc224030, 0x0, 0x0, 0x0, 0x0, 0x20010, 0x0, 0xc200020, 0x200000, 0xca24835, 0x0, 0x0, 0x0, 0x805, 0xca24835, 0x0, 0x0, 0xee7cc35, 0x0, 0xee7cc35, 0x0, 0xca24835, 0x0, 0x10, 0x0, 0x0, 0xca24835, 0x0, 0x0, 0x0, 0xdb37bbd, 0xca24835, 0xca24835, 0xdb37bbd, 0xca24835, 0x0, 0x0, 0x0, 0xca24835, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xca24835, 0xca24835, 0x0, 0x1113b8f, 0x807, 0x1113b8f, 0x0,}; - } - - private static void jj_la1_init_3() { - jj_la1_3 = new int[]{0x10000, 0x10000, 0x90000, 0x0, 0x0, 0x40000, 0x80000, 0x80000, 0x90000, 0x0, 0x200000, 0x0, 0x0, 0x20000, 0x20000, 0x0, 0x80080, 0x20000, 0x291080, 0x10000, 0x80000, 0x400, 0x1000, 0x20000, 0x0, 0x0, 0x291080, 0x0, 0x80000, 0x200080, 0x290080, 0x20000, 0x100000, 0x84000, 0xc014e1, 0xc014e1, 0x20000, 0x200000, 0x84000, 0x20000, 0x0, 0x11000, 0x20000, 0x80080, 0x20000, 0x20000, 0x0, 0x200000, 0x20000, 0x0, 0x200000, 0x200000, 0x2004e1, 0x914e1, 0x0, 0x0, 0x80, 0x80, 0x20000, 0x1080080, 0x1000080, 0x0, 0x0, 0x0, 0x80, 0x200000, 0x80, 0x0, 0x100000, 0x100000, 0x1000000, 0x40000000, 0x80000000, 0x0, 0x0, 0x0, 0x24000000, 0x24000000, 0x0, 0x18200000, 0x18200000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc004e1, 0xc00000, 0xc00000, 0x4e1, 0x0, 0x0, 0x80, 0x200000, 0x400, 0x200000, 0x80, 0x40000, 0x20000, 0x20000, 0xc004e1, 0xc804e1, 0x200000, 0x80, 0x400, 0x461, 0x80, 0x40000, 0x200000, 0x400, 0x0, 0x44000, 0x61, 0x0, 0xc004e1, 0x20000, 0x200000, 0x84400, 0x280080, 0xc004e1, 0x84000, 0x1000, 0x114e1, 0x2000000, 0x114e1, 0x20000, 0xc014e1, 0x200000, 0x80, 0x100000, 0x100000, 0x4e1, 0x0, 0x0, 0x0, 0xc804e1, 0xc004e1, 0xc004e1, 0xc904e1, 0xc004e1, 0x20000, 0x80, 0x80, 0xc004e1, 0x400, 0x0, 0x0, 0x0, 0x80000, 0x80000, 0x80, 0x20000, 0xc814e1, 0xc814e1, 0x20000, 0x90080, 0x80080, 0x90080, 0x0,}; - } - - private static void jj_la1_init_4() { - jj_la1_4 = new int[]{0x0, 0x0, 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1800000, 0x1bff800, 0x3ff800, 0x0, 0x0, 0x0, 0x80, 0x100, 0x40, 0x0, 0x0, 0x0, 0x8000000, 0x8000000, 0x400, 0xc, 0xc, 0x230, 0x230, 0xc, 0xf, 0x0, 0x0, 0x0, 0x3, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x0, 0xf, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x0, 0x0, 0x0, 0x0, 0xf, 0x0, 0x0, 0x3, 0x0, 0x3, 0x0, 0xf, 0x0, 0x0, 0x1bff803, 0x1bff803, 0x2, 0x0, 0x0, 0x0, 0xf, 0xf, 0xf, 0xf, 0xf, 0x0, 0x0, 0x0, 0xf, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0,}; - } - - final private JJCalls[] jj_2_rtns = new JJCalls[44]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** - * Constructor. - */ - public ASTParser(Provider stream) { - jj_input_stream = new JavaCharStream(stream, 1, 1); - token_source = new ASTParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 160; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Constructor. - */ - public ASTParser(String dsl) throws ParseException, TokenMgrException { - this(new StringProvider(dsl)); - } - - public void ReInit(String s) { - ReInit(new StringProvider(s)); - } - - /** - * Reinitialise. - */ - public void ReInit(Provider stream) { - if (jj_input_stream == null) { - jj_input_stream = new JavaCharStream(stream, 1, 1); - } else { - jj_input_stream.ReInit(stream, 1, 1); - } - if (token_source == null) { - token_source = new ASTParserTokenManager(jj_input_stream); - } - - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 160; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Constructor with generated Token Manager. - */ - public ASTParser(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 160; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Reinitialise. - */ - public void ReInit(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 160; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - @SuppressWarnings("serial") - static private final class LookaheadSuccess extends java.lang.RuntimeException { - } - - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; - Token tok = token; - while (tok != null && tok != jj_scanpos) { - i++; - tok = tok.next; - } - if (tok != null) jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; - return false; - } - - - /** - * Get the next Token. - */ - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - - /** - * Get the specific Token. - */ - final public Token getToken(int index) { - Token t = jj_lookingAhead ? jj_scanpos : token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk_f() { - if ((jj_nt = token.next) == null) - return (jj_ntk = (token.next = token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List jj_expentries = new java.util.ArrayList(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) { - return; - } - - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - - for (int[] oldentry : jj_expentries) { - if (oldentry.length == jj_expentry.length) { - boolean isMatched = true; - - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - isMatched = false; - break; - } - - } - if (isMatched) { - jj_expentries.add(jj_expentry); - break; - } - } - } - - if (pos != 0) { - jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - } - - /** - * Generate ParseException. - */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[157]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 160; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1 << j)) != 0) { - la1tokens[j] = true; - } - if ((jj_la1_1[i] & (1 << j)) != 0) { - la1tokens[32 + j] = true; - } - if ((jj_la1_2[i] & (1 << j)) != 0) { - la1tokens[64 + j] = true; - } - if ((jj_la1_3[i] & (1 << j)) != 0) { - la1tokens[96 + j] = true; - } - if ((jj_la1_4[i] & (1 << j)) != 0) { - la1tokens[128 + j] = true; - } - } - } - } - for (int i = 0; i < 157; i++) { - if (la1tokens[i]) { - jj_expentry = new int[1]; - jj_expentry[0] = i; - jj_expentries.add(jj_expentry); - } - } - jj_endpos = 0; - jj_rescan_token(); - jj_add_error_token(0, 0); - int[][] exptokseq = new int[jj_expentries.size()][]; - for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.get(i); - } - return new ParseException(token, exptokseq, tokenImage, token_source == null ? null : ASTParserTokenManager.lexStateNames[token_source.curLexState]); - } - - /** - * Enable tracing. - */ - final public void enable_tracing() { - } - - /** - * Disable tracing. - */ - final public void disable_tracing() { - } - - private void jj_rescan_token() { - jj_rescan = true; - for (int i = 0; i < 44; i++) { - try { - JJCalls p = jj_2_rtns[i]; - - do { - if (p.gen > jj_gen) { - jj_la = p.arg; - jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: - jj_3_1(); - break; - case 1: - jj_3_2(); - break; - case 2: - jj_3_3(); - break; - case 3: - jj_3_4(); - break; - case 4: - jj_3_5(); - break; - case 5: - jj_3_6(); - break; - case 6: - jj_3_7(); - break; - case 7: - jj_3_8(); - break; - case 8: - jj_3_9(); - break; - case 9: - jj_3_10(); - break; - case 10: - jj_3_11(); - break; - case 11: - jj_3_12(); - break; - case 12: - jj_3_13(); - break; - case 13: - jj_3_14(); - break; - case 14: - jj_3_15(); - break; - case 15: - jj_3_16(); - break; - case 16: - jj_3_17(); - break; - case 17: - jj_3_18(); - break; - case 18: - jj_3_19(); - break; - case 19: - jj_3_20(); - break; - case 20: - jj_3_21(); - break; - case 21: - jj_3_22(); - break; - case 22: - jj_3_23(); - break; - case 23: - jj_3_24(); - break; - case 24: - jj_3_25(); - break; - case 25: - jj_3_26(); - break; - case 26: - jj_3_27(); - break; - case 27: - jj_3_28(); - break; - case 28: - jj_3_29(); - break; - case 29: - jj_3_30(); - break; - case 30: - jj_3_31(); - break; - case 31: - jj_3_32(); - break; - case 32: - jj_3_33(); - break; - case 33: - jj_3_34(); - break; - case 34: - jj_3_35(); - break; - case 35: - jj_3_36(); - break; - case 36: - jj_3_37(); - break; - case 37: - jj_3_38(); - break; - case 38: - jj_3_39(); - break; - case 39: - jj_3_40(); - break; - case 40: - jj_3_41(); - break; - case 41: - jj_3_42(); - break; - case 42: - jj_3_43(); - break; - case 43: - jj_3_44(); - break; - } - } - p = p.next; - } while (p != null); - - } catch (LookaheadSuccess ls) { - } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { - p = p.next = new JJCalls(); - break; - } - p = p.next; - } - - p.gen = jj_gen + xla - jj_la; - p.first = token; - p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } + type = Type(); + jj_consume_token(IDENTIFIER); +name = token.image; + jj_consume_token(LPAREN); + jj_consume_token(RPAREN); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case _DEFAULT:{ + defaultVal = DefaultValue(); + break; + } + default: + jj_la1[159] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +Position begin = modifier.begin.orIfInvalid(tokenBegin()); + return new AnnotationMemberDeclaration(range(begin, tokenEnd()), modifier.modifiers, modifier.annotations, type, name, defaultVal); + } + + final public Expression DefaultValue() {Expression ret; + jj_consume_token(_DEFAULT); + ret = MemberValue(); +return ret; + } + + private boolean jj_2_1(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_1(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(0, xla); } + } + + private boolean jj_2_2(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_2(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(1, xla); } + } + + private boolean jj_2_3(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_3(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(2, xla); } + } + + private boolean jj_2_4(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_4(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(3, xla); } + } + + private boolean jj_2_5(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_5(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(4, xla); } + } + + private boolean jj_2_6(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_6(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(5, xla); } + } + + private boolean jj_2_7(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_7(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(6, xla); } + } + + private boolean jj_2_8(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_8(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(7, xla); } + } + + private boolean jj_2_9(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_9(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(8, xla); } + } + + private boolean jj_2_10(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_10(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(9, xla); } + } + + private boolean jj_2_11(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_11(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(10, xla); } + } + + private boolean jj_2_12(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_12(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(11, xla); } + } + + private boolean jj_2_13(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_13(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(12, xla); } + } + + private boolean jj_2_14(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_14(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(13, xla); } + } + + private boolean jj_2_15(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_15(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(14, xla); } + } + + private boolean jj_2_16(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_16(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(15, xla); } + } + + private boolean jj_2_17(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_17(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(16, xla); } + } + + private boolean jj_2_18(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_18(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(17, xla); } + } + + private boolean jj_2_19(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_19(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(18, xla); } + } + + private boolean jj_2_20(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_20(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(19, xla); } + } + + private boolean jj_2_21(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_21(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(20, xla); } + } + + private boolean jj_2_22(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_22(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(21, xla); } + } + + private boolean jj_2_23(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_23(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(22, xla); } + } + + private boolean jj_2_24(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_24(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(23, xla); } + } + + private boolean jj_2_25(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_25(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(24, xla); } + } + + private boolean jj_2_26(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_26(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(25, xla); } + } + + private boolean jj_2_27(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_27(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(26, xla); } + } + + private boolean jj_2_28(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_28(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(27, xla); } + } + + private boolean jj_2_29(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_29(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(28, xla); } + } + + private boolean jj_2_30(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_30(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(29, xla); } + } + + private boolean jj_2_31(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_31(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(30, xla); } + } + + private boolean jj_2_32(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_32(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(31, xla); } + } + + private boolean jj_2_33(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_33(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(32, xla); } + } + + private boolean jj_2_34(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_34(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(33, xla); } + } + + private boolean jj_2_35(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_35(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(34, xla); } + } + + private boolean jj_2_36(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_36(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(35, xla); } + } + + private boolean jj_2_37(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_37(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(36, xla); } + } + + private boolean jj_2_38(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_38(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(37, xla); } + } + + private boolean jj_2_39(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_39(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(38, xla); } + } + + private boolean jj_2_40(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_40(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(39, xla); } + } + + private boolean jj_2_41(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_41(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(40, xla); } + } + + private boolean jj_2_42(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_42(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(41, xla); } + } + + private boolean jj_2_43(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_43(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(42, xla); } + } + + private boolean jj_2_44(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_44(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(43, xla); } + } + + private boolean jj_3_38() + { + if (jj_3R_95()) return true; + if (jj_3R_68()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_341() + { + if (jj_3R_345()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_373()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_385() + { + if (jj_scan_token(ELSE)) return true; + if (jj_3R_277()) return true; + return false; + } + + private boolean jj_3R_377() + { + if (jj_3R_93()) return true; + return false; + } + + private boolean jj_3R_427() + { + if (jj_3R_80()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_429()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_159() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_78()) return true; + if (jj_3R_158()) return true; + return false; + } + + private boolean jj_3_21() + { + if (jj_3R_83()) return true; + return false; + } + + private boolean jj_3_20() + { + if (jj_3R_82()) return true; + return false; + } + + private boolean jj_3R_426() + { + if (jj_3R_427()) return true; + return false; + } + + private boolean jj_3R_81() + { + if (jj_scan_token(LSHIFT)) return true; + return false; + } + + private boolean jj_3R_402() + { + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_103() + { + if (jj_scan_token(LT)) return true; + if (jj_3R_78()) return true; + if (jj_3R_158()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_159()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3_19() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_81()) { + jj_scanpos = xsp; + if (jj_3_20()) { + jj_scanpos = xsp; + if (jj_3_21()) return true; + } + } + if (jj_3R_341()) return true; + return false; + } + + private boolean jj_3R_425() + { + if (jj_3R_96()) return true; + return false; + } + + private boolean jj_3R_342() + { + if (jj_scan_token(INSTANCEOF)) return true; + if (jj_3R_68()) return true; + return false; + } + + private boolean jj_3R_339() + { + if (jj_3R_341()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_19()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_419() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_425()) { + jj_scanpos = xsp; + if (jj_3R_426()) return true; + } + return false; + } + + private boolean jj_3R_364() + { + if (jj_scan_token(GE)) return true; + return false; + } + + private boolean jj_3R_363() + { + if (jj_scan_token(LE)) return true; + return false; + } + + private boolean jj_3R_362() + { + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_361() + { + if (jj_scan_token(LT)) return true; + return false; + } + + private boolean jj_3R_376() + { + if (jj_3R_163()) return true; + return false; + } + + private boolean jj_3R_346() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_361()) { + jj_scanpos = xsp; + if (jj_3R_362()) { + jj_scanpos = xsp; + if (jj_3R_363()) { + jj_scanpos = xsp; + if (jj_3R_364()) return true; + } + } + } + if (jj_3R_339()) return true; + return false; + } + + private boolean jj_3_37() + { + if (jj_3R_96()) return true; + if (jj_scan_token(COLON)) return true; + return false; + } + + private boolean jj_3R_102() + { + if (jj_3R_101()) return true; + return false; + } + + private boolean jj_3R_367() + { + if (jj_3R_183()) return true; + return false; + } + + private boolean jj_3R_66() + { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_102()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(IDENTIFIER)) return true; + xsp = jj_scanpos; + if (jj_3R_376()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_377()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_401() + { + if (jj_3R_419()) return true; + return false; + } + + private boolean jj_3R_387() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_401()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + xsp = jj_scanpos; + if (jj_3R_402()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + xsp = jj_scanpos; + if (jj_3R_403()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_337() + { + if (jj_3R_339()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_346()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_386() + { + if (jj_3R_96()) return true; + if (jj_scan_token(COLON)) return true; + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_352() + { + if (jj_scan_token(SEMICOLON)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_367()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_338() + { + if (jj_scan_token(BIT_AND)) return true; + if (jj_3R_314()) return true; + return false; + } + + private boolean jj_3R_325() + { + if (jj_scan_token(FOR)) return true; + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_386()) { + jj_scanpos = xsp; + if (jj_3R_387()) return true; + } + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_277()) return true; + return false; + } + + private boolean jj_3R_332() + { + if (jj_3R_337()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_342()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_351() + { + if (jj_3R_66()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_3()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_344() + { + if (jj_scan_token(NE)) return true; + return false; + } + + private boolean jj_3R_343() + { + if (jj_scan_token(EQ)) return true; + return false; + } + + private boolean jj_3R_340() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_343()) { + jj_scanpos = xsp; + if (jj_3R_344()) return true; + } + if (jj_3R_332()) return true; + return false; + } + + private boolean jj_3R_333() + { + if (jj_scan_token(XOR)) return true; + if (jj_3R_285()) return true; + return false; + } + + private boolean jj_3R_324() + { + if (jj_scan_token(DO)) return true; + if (jj_3R_277()) return true; + if (jj_scan_token(WHILE)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_350() + { + if (jj_3R_366()) return true; + return false; + } + + private boolean jj_3R_315() + { + if (jj_scan_token(BIT_OR)) return true; + if (jj_3R_265()) return true; + return false; + } + + private boolean jj_3R_314() + { + if (jj_3R_332()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_340()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_271() + { + if (jj_scan_token(ENUM)) return true; + if (jj_3R_98()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_350()) jj_scanpos = xsp; + if (jj_scan_token(LBRACE)) return true; + xsp = jj_scanpos; + if (jj_3R_351()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(113)) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_352()) jj_scanpos = xsp; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_323() + { + if (jj_scan_token(WHILE)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_277()) return true; + return false; + } + + private boolean jj_3R_286() + { + if (jj_scan_token(SC_AND)) return true; + if (jj_3R_237()) return true; + return false; + } + + private boolean jj_3R_285() + { + if (jj_3R_314()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_338()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_267() + { + if (jj_scan_token(SC_OR)) return true; + if (jj_3R_207()) return true; + return false; + } + + private boolean jj_3R_375() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_251()) return true; + return false; + } + + private boolean jj_3R_366() + { + if (jj_scan_token(IMPLEMENTS)) return true; + if (jj_3R_251()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_375()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_265() + { + if (jj_3R_285()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_333()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_322() + { + if (jj_scan_token(IF)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_277()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_385()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_237() + { + if (jj_3R_265()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_315()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_374() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_251()) return true; + return false; + } + + private boolean jj_3R_365() + { + if (jj_scan_token(EXTENDS)) return true; + if (jj_3R_251()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_374()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_207() + { + if (jj_3R_237()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_286()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_418() + { + if (jj_scan_token(_DEFAULT)) return true; + return false; + } + + private boolean jj_3R_417() + { + if (jj_scan_token(CASE)) return true; + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_289() + { + if (jj_scan_token(INTERFACE)) return true; + return false; + } + + private boolean jj_3R_349() + { + if (jj_3R_366()) return true; + return false; + } + + private boolean jj_3R_176() + { + if (jj_3R_207()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_267()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_348() + { + if (jj_3R_365()) return true; + return false; + } + + private boolean jj_3R_400() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_417()) { + jj_scanpos = xsp; + if (jj_3R_418()) return true; + } + if (jj_scan_token(COLON)) return true; + if (jj_3R_160()) return true; + return false; + } + + private boolean jj_3R_347() + { + if (jj_3R_103()) return true; + return false; + } + + private boolean jj_3R_270() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(45)) { + jj_scanpos = xsp; + if (jj_3R_289()) return true; + } + if (jj_3R_98()) return true; + xsp = jj_scanpos; + if (jj_3R_347()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_348()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_349()) jj_scanpos = xsp; + if (jj_3R_93()) return true; + return false; + } + + private boolean jj_3R_150() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_149()) return true; + return false; + } + + private boolean jj_3R_241() + { + if (jj_scan_token(HOOK)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(COLON)) return true; + if (jj_3R_129()) return true; + return false; + } + + private boolean jj_3R_384() + { + if (jj_3R_400()) return true; + return false; + } + + private boolean jj_3R_129() + { + if (jj_3R_176()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_241()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_321() + { + if (jj_scan_token(SWITCH)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_scan_token(LBRACE)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_384()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_128() + { + if (jj_scan_token(ORASSIGN)) return true; + return false; + } + + private boolean jj_3R_424() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_127() + { + if (jj_scan_token(XORASSIGN)) return true; + return false; + } + + private boolean jj_3R_126() + { + if (jj_scan_token(ANDASSIGN)) return true; + return false; + } + + private boolean jj_3R_125() + { + if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; + return false; + } + + private boolean jj_3R_124() + { + if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true; + return false; + } + + private boolean jj_3R_123() + { + if (jj_scan_token(LSHIFTASSIGN)) return true; + return false; + } + + private boolean jj_3R_416() + { + if (jj_scan_token(ARROW)) return true; + if (jj_3R_268()) return true; + return false; + } + + private boolean jj_3R_122() + { + if (jj_scan_token(MINUSASSIGN)) return true; + return false; + } + + private boolean jj_3R_121() + { + if (jj_scan_token(PLUSASSIGN)) return true; + return false; + } + + private boolean jj_3R_415() + { + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_424()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(103)) { + jj_scanpos = xsp; + if (jj_scan_token(68)) return true; + } + return false; + } + + private boolean jj_3R_120() + { + if (jj_scan_token(REMASSIGN)) return true; + return false; + } + + private boolean jj_3R_414() + { + if (jj_3R_79()) return true; + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_119() + { + if (jj_scan_token(SLASHASSIGN)) return true; + return false; + } + + private boolean jj_3R_118() + { + if (jj_scan_token(STARASSIGN)) return true; + return false; + } + + private boolean jj_3R_413() + { + if (jj_scan_token(DECR)) return true; + return false; + } + + private boolean jj_3R_117() + { + if (jj_scan_token(ASSIGN)) return true; + return false; + } + + private boolean jj_3R_412() + { + if (jj_scan_token(INCR)) return true; + return false; + } + + private boolean jj_3R_399() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_412()) { + jj_scanpos = xsp; + if (jj_3R_413()) { + jj_scanpos = xsp; + if (jj_3R_414()) { + jj_scanpos = xsp; + if (jj_3R_415()) { + jj_scanpos = xsp; + if (jj_3R_416()) return true; + } + } + } + } + return false; + } + + private boolean jj_3R_79() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_117()) { + jj_scanpos = xsp; + if (jj_3R_118()) { + jj_scanpos = xsp; + if (jj_3R_119()) { + jj_scanpos = xsp; + if (jj_3R_120()) { + jj_scanpos = xsp; + if (jj_3R_121()) { + jj_scanpos = xsp; + if (jj_3R_122()) { + jj_scanpos = xsp; + if (jj_3R_123()) { + jj_scanpos = xsp; + if (jj_3R_124()) { + jj_scanpos = xsp; + if (jj_3R_125()) { + jj_scanpos = xsp; + if (jj_3R_126()) { + jj_scanpos = xsp; + if (jj_3R_127()) { + jj_scanpos = xsp; + if (jj_3R_128()) return true; + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_336() + { + if (jj_3R_266()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_399()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_335() + { + if (jj_3R_216()) return true; + return false; + } + + private boolean jj_3R_269() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3_36() + { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3R_243() + { + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_269()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(103)) { + jj_scanpos = xsp; + if (jj_scan_token(68)) return true; + } + return false; + } + + private boolean jj_3R_320() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_36()) { + jj_scanpos = xsp; + if (jj_3R_335()) { + jj_scanpos = xsp; + if (jj_3R_336()) return true; + } + } + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_65() + { + if (jj_3R_101()) return true; + return false; + } + + private boolean jj_3R_64() + { + if (jj_scan_token(STRICTFP)) return true; + return false; + } + + private boolean jj_3R_63() + { + if (jj_scan_token(VOLATILE)) return true; + return false; + } + + private boolean jj_3R_62() + { + if (jj_scan_token(TRANSIENT)) return true; + return false; + } + + private boolean jj_3R_61() + { + if (jj_scan_token(NATIVE)) return true; + return false; + } + + private boolean jj_3R_60() + { + if (jj_scan_token(SYNCHRONIZED)) return true; + return false; + } + + private boolean jj_3R_288() + { + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_59() + { + if (jj_scan_token(ABSTRACT)) return true; + return false; + } + + private boolean jj_3R_58() + { + if (jj_scan_token(FINAL)) return true; + return false; + } + + private boolean jj_3_18() + { + if (jj_3R_79()) return true; + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_242() + { + if (jj_scan_token(ARROW)) return true; + if (jj_3R_268()) return true; + return false; + } + + private boolean jj_3R_57() + { + if (jj_scan_token(PRIVATE)) return true; + return false; + } + + private boolean jj_3R_56() + { + if (jj_scan_token(PROTECTED)) return true; + return false; + } + + private boolean jj_3R_213() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_18()) { + jj_scanpos = xsp; + if (jj_3R_242()) { + jj_scanpos = xsp; + if (jj_3R_243()) return true; + } + } + return false; + } + + private boolean jj_3R_287() + { + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_55() + { + if (jj_scan_token(STATIC)) return true; + return false; + } + + private boolean jj_3R_54() + { + if (jj_scan_token(PUBLIC)) return true; + return false; + } + + private boolean jj_3R_80() + { + if (jj_3R_129()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_213()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3_2() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_54()) { + jj_scanpos = xsp; + if (jj_3R_55()) { + jj_scanpos = xsp; + if (jj_3R_56()) { + jj_scanpos = xsp; + if (jj_3R_57()) { + jj_scanpos = xsp; + if (jj_3R_58()) { + jj_scanpos = xsp; + if (jj_3R_59()) { + jj_scanpos = xsp; + if (jj_3R_60()) { + jj_scanpos = xsp; + if (jj_3R_61()) { + jj_scanpos = xsp; + if (jj_3R_62()) { + jj_scanpos = xsp; + if (jj_3R_63()) { + jj_scanpos = xsp; + if (jj_3R_64()) { + jj_scanpos = xsp; + if (jj_3R_65()) return true; + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_268() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_287()) { + jj_scanpos = xsp; + if (jj_3R_288()) return true; + } + return false; + } + + private boolean jj_3R_95() + { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_2()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_319() + { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3_35() + { + if (jj_3R_96()) return true; + return false; + } + + private boolean jj_3R_96() + { + if (jj_3R_95()) return true; + if (jj_3R_68()) return true; + if (jj_3R_149()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_150()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_202() + { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3_34() + { + if (jj_3R_95()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(45)) { + jj_scanpos = xsp; + if (jj_scan_token(65)) return true; + } + return false; + } + + private boolean jj_3R_255() + { + if (jj_3R_277()) return true; + return false; + } + + private boolean jj_3R_383() + { + if (jj_scan_token(COLON)) return true; + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3_17() + { + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_254() + { + if (jj_3R_96()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_98() + { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_17()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_53() + { + if (jj_3R_78()) return true; + if (jj_scan_token(PACKAGE)) return true; + if (jj_3R_98()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_253() + { + if (jj_3R_95()) return true; + if (jj_3R_270()) return true; + return false; + } + + private boolean jj_3R_147() + { + if (jj_3R_68()) return true; + return false; + } + + private boolean jj_3R_146() + { + if (jj_scan_token(VOID)) return true; + return false; + } + + private boolean jj_3R_220() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_253()) { + jj_scanpos = xsp; + if (jj_3R_254()) { + jj_scanpos = xsp; + if (jj_3R_255()) return true; + } + } + return false; + } + + private boolean jj_3_1() + { + if (jj_3R_53()) return true; + return false; + } + + private boolean jj_3R_91() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_146()) { + jj_scanpos = xsp; + if (jj_3R_147()) return true; + } + return false; + } + + private boolean jj_3R_140() + { + if (jj_scan_token(DOUBLE)) return true; + return false; + } + + private boolean jj_3R_106() + { + if (jj_scan_token(LBRACE)) return true; + if (jj_3R_160()) return true; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_139() + { + if (jj_scan_token(FLOAT)) return true; + return false; + } + + private boolean jj_3R_138() + { + if (jj_scan_token(LONG)) return true; + return false; + } + + private boolean jj_3R_137() + { + if (jj_scan_token(INT)) return true; + return false; + } + + private boolean jj_3R_136() + { + if (jj_scan_token(SHORT)) return true; + return false; + } + + private boolean jj_3R_135() + { + if (jj_scan_token(BYTE)) return true; + return false; + } + + private boolean jj_3R_94() + { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(COLON)) return true; + if (jj_3R_277()) return true; + return false; + } + + private boolean jj_3R_134() + { + if (jj_scan_token(CHAR)) return true; + return false; + } + + private boolean jj_3R_133() + { + if (jj_scan_token(BOOLEAN)) return true; + return false; + } + + private boolean jj_3R_313() + { + if (jj_scan_token(SUPER)) return true; + if (jj_3R_78()) return true; + if (jj_3R_75()) return true; + return false; + } + + private boolean jj_3R_87() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_133()) { + jj_scanpos = xsp; + if (jj_3R_134()) { + jj_scanpos = xsp; + if (jj_3R_135()) { + jj_scanpos = xsp; + if (jj_3R_136()) { + jj_scanpos = xsp; + if (jj_3R_137()) { + jj_scanpos = xsp; + if (jj_3R_138()) { + jj_scanpos = xsp; + if (jj_3R_139()) { + jj_scanpos = xsp; + if (jj_3R_140()) return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_204() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_175()) return true; + return false; + } + + private boolean jj_3R_312() + { + if (jj_scan_token(EXTENDS)) return true; + if (jj_3R_78()) return true; + if (jj_3R_75()) return true; + return false; + } + + private boolean jj_3R_284() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_312()) { + jj_scanpos = xsp; + if (jj_3R_313()) return true; + } + return false; + } + + private boolean jj_3R_318() + { + if (jj_scan_token(ASSERT)) return true; + if (jj_3R_80()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_383()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_308() + { + if (jj_3R_331()) return true; + return false; + } + + private boolean jj_3R_307() + { + if (jj_3R_330()) return true; + return false; + } + + private boolean jj_3R_306() + { + if (jj_3R_329()) return true; + return false; + } + + private boolean jj_3R_305() + { + if (jj_3R_328()) return true; + return false; + } + + private boolean jj_3R_304() + { + if (jj_3R_327()) return true; + return false; + } + + private boolean jj_3R_303() + { + if (jj_3R_326()) return true; + return false; + } + + private boolean jj_3R_236() + { + if (jj_scan_token(HOOK)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_284()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_302() + { + if (jj_3R_325()) return true; + return false; + } + + private boolean jj_3R_301() + { + if (jj_3R_324()) return true; + return false; + } + + private boolean jj_3R_300() + { + if (jj_3R_323()) return true; + return false; + } + + private boolean jj_3R_299() + { + if (jj_3R_322()) return true; + return false; + } + + private boolean jj_3R_298() + { + if (jj_3R_321()) return true; + return false; + } + + private boolean jj_3R_297() + { + if (jj_3R_320()) return true; + return false; + } + + private boolean jj_3R_206() + { + if (jj_3R_236()) return true; + return false; + } + + private boolean jj_3R_296() + { + if (jj_3R_319()) return true; + return false; + } + + private boolean jj_3R_205() + { + if (jj_3R_75()) return true; + return false; + } + + private boolean jj_3R_295() + { + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_294() + { + if (jj_3R_318()) return true; + return false; + } + + private boolean jj_3R_175() + { + if (jj_3R_78()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_205()) { + jj_scanpos = xsp; + if (jj_3R_206()) return true; + } + return false; + } + + private boolean jj_3_33() + { + if (jj_3R_94()) return true; + return false; + } + + private boolean jj_3R_115() + { + if (jj_3R_175()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_204()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_277() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_33()) { + jj_scanpos = xsp; + if (jj_3R_294()) { + jj_scanpos = xsp; + if (jj_3R_295()) { + jj_scanpos = xsp; + if (jj_3R_296()) { + jj_scanpos = xsp; + if (jj_3R_297()) { + jj_scanpos = xsp; + if (jj_3R_298()) { + jj_scanpos = xsp; + if (jj_3R_299()) { + jj_scanpos = xsp; + if (jj_3R_300()) { + jj_scanpos = xsp; + if (jj_3R_301()) { + jj_scanpos = xsp; + if (jj_3R_302()) { + jj_scanpos = xsp; + if (jj_3R_303()) { + jj_scanpos = xsp; + if (jj_3R_304()) { + jj_scanpos = xsp; + if (jj_3R_305()) { + jj_scanpos = xsp; + if (jj_3R_306()) { + jj_scanpos = xsp; + if (jj_3R_307()) { + jj_scanpos = xsp; + if (jj_3R_308()) return true; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_77() + { + if (jj_scan_token(LT)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_115()) jj_scanpos = xsp; + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3_16() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3_32() + { + if (jj_3R_93()) return true; + return false; + } + + private boolean jj_3_15() + { + if (jj_scan_token(DOT)) return true; + if (jj_3R_78()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_16()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_311() + { + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_283() + { + if (jj_3R_161()) return true; + return false; + } + + private boolean jj_3R_282() + { + if (jj_3R_78()) return true; + if (jj_scan_token(LBRACKET)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_311()) jj_scanpos = xsp; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_261() + { + Token xsp; + if (jj_3R_282()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_282()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_283()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3_14() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_174() + { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_14()) jj_scanpos = xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_15()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_256() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_264() + { + if (jj_3R_163()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_32()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_263() + { + if (jj_3R_261()) return true; + return false; + } + + private boolean jj_3R_262() + { + if (jj_3R_77()) return true; + if (jj_3R_78()) return true; + return false; + } + + private boolean jj_3R_235() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_262()) jj_scanpos = xsp; + if (jj_3R_251()) return true; + xsp = jj_scanpos; + if (jj_3R_263()) { + jj_scanpos = xsp; + if (jj_3R_264()) return true; + } + return false; + } + + private boolean jj_3R_234() + { + if (jj_3R_87()) return true; + if (jj_3R_261()) return true; + return false; + } + + private boolean jj_3R_251() + { + if (jj_3R_78()) return true; + if (jj_3R_174()) return true; + return false; + } + + private boolean jj_3_13() + { + if (jj_3R_76()) return true; + return false; + } + + private boolean jj_3R_428() + { + if (jj_3R_430()) return true; + return false; + } + + private boolean jj_3R_200() + { + if (jj_scan_token(NEW)) return true; + if (jj_3R_78()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_234()) { + jj_scanpos = xsp; + if (jj_3R_235()) return true; + } + return false; + } + + private boolean jj_3_12() + { + if (jj_3R_76()) return true; + return false; + } + + private boolean jj_3R_355() + { + if (jj_scan_token(THROWS)) return true; + if (jj_3R_370()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_371()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_76() + { + if (jj_3R_78()) return true; + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_221() + { + if (jj_3R_80()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_256()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_195() + { + if (jj_3R_221()) return true; + return false; + } + + private boolean jj_3R_114() + { + if (jj_3R_174()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_13()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_163() + { + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_195()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_113() + { + if (jj_3R_87()) return true; + Token xsp; + if (jj_3_12()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3_12()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_75() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_113()) { + jj_scanpos = xsp; + if (jj_3R_114()) return true; + } + return false; + } + + private boolean jj_3R_258() + { + if (jj_scan_token(NULL)) return true; + return false; + } + + private boolean jj_3R_279() + { + if (jj_scan_token(FALSE)) return true; + return false; + } + + private boolean jj_3R_278() + { + if (jj_scan_token(TRUE)) return true; + return false; + } + + private boolean jj_3R_104() + { + if (jj_3R_87()) return true; + return false; + } + + private boolean jj_3_11() + { + if (jj_3R_75()) return true; + return false; + } + + private boolean jj_3R_68() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_11()) { + jj_scanpos = xsp; + if (jj_3R_104()) return true; + } + return false; + } + + private boolean jj_3R_257() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_278()) { + jj_scanpos = xsp; + if (jj_3R_279()) return true; + } + return false; + } + + private boolean jj_3R_430() + { + if (jj_scan_token(_DEFAULT)) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_228() + { + if (jj_3R_258()) return true; + return false; + } + + private boolean jj_3R_227() + { + if (jj_3R_257()) return true; + return false; + } + + private boolean jj_3R_226() + { + if (jj_scan_token(STRING_LITERAL)) return true; + return false; + } + + private boolean jj_3R_105() + { + if (jj_scan_token(STATIC)) return true; + return false; + } + + private boolean jj_3R_225() + { + if (jj_scan_token(CHARACTER_LITERAL)) return true; + return false; + } + + private boolean jj_3R_423() + { + if (jj_3R_68()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_scan_token(RPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_428()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_70() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_105()) jj_scanpos = xsp; + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_224() + { + if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; + return false; + } + + private boolean jj_3R_194() + { + if (jj_3R_220()) return true; + return false; + } + + private boolean jj_3_44() + { + if (jj_3R_68()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3R_411() + { + if (jj_3R_274()) return true; + return false; + } + + private boolean jj_3R_160() + { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_194()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_410() + { + if (jj_3R_272()) return true; + return false; + } + + private boolean jj_3R_223() + { + if (jj_scan_token(LONG_LITERAL)) return true; + return false; + } + + private boolean jj_3_9() + { + if (jj_3R_73()) return true; + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_409() + { + if (jj_3R_271()) return true; + return false; + } + + private boolean jj_3R_408() + { + if (jj_3R_270()) return true; + return false; + } + + private boolean jj_3R_222() + { + if (jj_scan_token(INTEGER_LITERAL)) return true; + return false; + } + + private boolean jj_3R_407() + { + if (jj_3R_423()) return true; + return false; + } + + private boolean jj_3R_74() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_165() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3_10() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_74()) jj_scanpos = xsp; + if (jj_scan_token(THIS)) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3R_164() + { + if (jj_3R_73()) return true; + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3_43() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_92() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_196() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_222()) { + jj_scanpos = xsp; + if (jj_3R_223()) { + jj_scanpos = xsp; + if (jj_3R_224()) { + jj_scanpos = xsp; + if (jj_3R_225()) { + jj_scanpos = xsp; + if (jj_3R_226()) { + jj_scanpos = xsp; + if (jj_3R_227()) { + jj_scanpos = xsp; + if (jj_3R_228()) return true; + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_394() + { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_110() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_164()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_165()) jj_scanpos = xsp; + if (jj_scan_token(SUPER)) return true; + if (jj_3R_163()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_143() + { + if (jj_scan_token(LBRACKET)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3_31() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_92()) jj_scanpos = xsp; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_395() + { + if (jj_3R_95()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_407()) { + jj_scanpos = xsp; + if (jj_3R_408()) { + jj_scanpos = xsp; + if (jj_3R_409()) { + jj_scanpos = xsp; + if (jj_3R_410()) { + jj_scanpos = xsp; + if (jj_3R_411()) return true; + } + } + } + } + return false; + } + + private boolean jj_3R_162() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_109() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_162()) jj_scanpos = xsp; + if (jj_scan_token(THIS)) return true; + if (jj_3R_163()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_212() + { + if (jj_3R_163()) return true; + return false; + } + + private boolean jj_3R_378() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_394()) { + jj_scanpos = xsp; + if (jj_3R_395()) return true; + } + return false; + } + + private boolean jj_3R_211() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_181() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_211()) jj_scanpos = xsp; + if (jj_3R_202()) return true; + xsp = jj_scanpos; + if (jj_3R_212()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_368() + { + if (jj_3R_378()) return true; + return false; + } + + private boolean jj_3R_180() + { + if (jj_3R_200()) return true; + return false; + } + + private boolean jj_3R_72() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_109()) { + jj_scanpos = xsp; + if (jj_3R_110()) return true; + } + return false; + } + + private boolean jj_3R_179() + { + if (jj_scan_token(THIS)) return true; + return false; + } + + private boolean jj_3R_353() + { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_368()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_259() + { + if (jj_3R_280()) return true; + return false; + } + + private boolean jj_3_8() + { + if (jj_3R_72()) return true; + return false; + } + + private boolean jj_3R_144() + { + if (jj_scan_token(ELLIPSIS)) return true; + return false; + } + + private boolean jj_3R_142() + { + if (jj_scan_token(DOT)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_179()) { + jj_scanpos = xsp; + if (jj_3R_180()) { + jj_scanpos = xsp; + if (jj_3R_181()) return true; + } + } + return false; + } + + private boolean jj_3R_309() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_90()) return true; + return false; + } + + private boolean jj_3R_89() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_142()) { + jj_scanpos = xsp; + if (jj_3R_143()) return true; + } + return false; + } + + private boolean jj_3R_356() + { + if (jj_3R_72()) return true; + return false; + } + + private boolean jj_3R_272() + { + if (jj_scan_token(AT)) return true; + if (jj_scan_token(INTERFACE)) return true; + if (jj_3R_98()) return true; + if (jj_3R_353()) return true; + return false; + } + + private boolean jj_3R_371() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_370()) return true; + return false; + } + + private boolean jj_3R_317() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_316()) return true; + return false; + } + + private boolean jj_3R_290() + { + if (jj_3R_103()) return true; + return false; + } + + private boolean jj_3R_141() + { + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(SUPER)) return true; + return false; + } + + private boolean jj_3R_273() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_290()) jj_scanpos = xsp; + if (jj_3R_202()) return true; + if (jj_3R_354()) return true; + xsp = jj_scanpos; + if (jj_3R_355()) jj_scanpos = xsp; + if (jj_scan_token(LBRACE)) return true; + xsp = jj_scanpos; + if (jj_3R_356()) jj_scanpos = xsp; + if (jj_3R_160()) return true; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_334() + { + if (jj_3R_100()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_43()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3_30() + { + if (jj_3R_89()) return true; + return false; + } + + private boolean jj_3R_201() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_379() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_90()) return true; + return false; + } + + private boolean jj_3R_88() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_30()) { + jj_scanpos = xsp; + if (jj_3R_141()) return true; + } + return false; + } + + private boolean jj_3R_189() + { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_334()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(113)) jj_scanpos = xsp; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_203() + { + if (jj_3R_163()) return true; + return false; + } + + private boolean jj_3R_154() + { + if (jj_3R_129()) return true; + return false; + } + + private boolean jj_3R_153() + { + if (jj_3R_189()) return true; + return false; + } + + private boolean jj_3R_173() + { + if (jj_3R_202()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_203()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_152() + { + if (jj_3R_101()) return true; + return false; + } + + private boolean jj_3_29() + { + if (jj_3R_91()) return true; + if (jj_scan_token(DOUBLECOLON)) return true; + return false; + } + + private boolean jj_3_28() + { + if (jj_3R_91()) return true; + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(CLASS)) return true; + return false; + } + + private boolean jj_3R_90() + { + if (jj_3R_95()) return true; + if (jj_3R_68()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_144()) jj_scanpos = xsp; + if (jj_3R_145()) return true; + return false; + } + + private boolean jj_3R_100() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_152()) { + jj_scanpos = xsp; + if (jj_3R_153()) { + jj_scanpos = xsp; + if (jj_3R_154()) return true; + } + } + return false; + } + + private boolean jj_3_7() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_71()) return true; + return false; + } + + private boolean jj_3R_260() + { + if (jj_3R_281()) return true; + return false; + } + + private boolean jj_3R_172() + { + if (jj_3R_91()) return true; + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_201()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(103)) { + jj_scanpos = xsp; + if (jj_scan_token(68)) return true; + } + return false; + } + + private boolean jj_3R_276() + { + if (jj_3R_293()) return true; + return false; + } + + private boolean jj_3R_171() + { + if (jj_3R_91()) return true; + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(CLASS)) return true; + return false; + } + + private boolean jj_3R_316() + { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(ASSIGN)) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_310() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_145()) return true; + return false; + } + + private boolean jj_3R_170() + { + if (jj_3R_200()) return true; + return false; + } + + private boolean jj_3R_281() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_145()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_310()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3_27() + { + if (jj_3R_90()) return true; + return false; + } + + private boolean jj_3R_293() + { + if (jj_3R_316()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_317()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_358() + { + if (jj_3R_76()) return true; + return false; + } + + private boolean jj_3R_233() + { + if (jj_3R_80()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_260()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_280() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_90()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_309()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_232() + { + if (jj_3R_90()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_259()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_199() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_232()) { + jj_scanpos = xsp; + if (jj_3R_233()) return true; + } + return false; + } + + private boolean jj_3R_231() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_369() + { + if (jj_3R_90()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_379()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_191() + { + if (jj_scan_token(AT)) return true; + if (jj_3R_98()) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_99() + { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(ASSIGN)) return true; + return false; + } + + private boolean jj_3R_169() + { + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_199()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_198() + { + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_231()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(103)) { + jj_scanpos = xsp; + if (jj_scan_token(68)) return true; + } + return false; + } + + private boolean jj_3R_354() + { + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_369()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_192() + { + if (jj_scan_token(AT)) return true; + if (jj_3R_98()) return true; + return false; + } + + private boolean jj_3_42() + { + if (jj_scan_token(AT)) return true; + if (jj_3R_98()) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3_41() + { + if (jj_scan_token(AT)) return true; + if (jj_3R_98()) return true; + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_99()) { + jj_scanpos = xsp; + if (jj_scan_token(107)) return true; + } + return false; + } + + private boolean jj_3R_230() + { + if (jj_3R_163()) return true; + return false; + } + + private boolean jj_3R_190() + { + if (jj_scan_token(AT)) return true; + if (jj_3R_98()) return true; + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_276()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_370() + { + if (jj_3R_78()) return true; + if (jj_3R_75()) return true; + return false; + } + + private boolean jj_3R_197() + { + if (jj_scan_token(DOT)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_229()) jj_scanpos = xsp; + if (jj_3R_202()) return true; + xsp = jj_scanpos; + if (jj_3R_230()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_229() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3_40() + { + if (jj_scan_token(SEMICOLON)) return true; + if (jj_3R_96()) return true; + return false; + } + + private boolean jj_3_26() + { + if (jj_3R_89()) return true; + return false; + } + + private boolean jj_3R_157() + { + if (jj_3R_192()) return true; + return false; + } + + private boolean jj_3R_182() + { + if (jj_3R_76()) return true; + return false; + } + + private boolean jj_3R_168() + { + if (jj_scan_token(SUPER)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_197()) { + jj_scanpos = xsp; + if (jj_3R_198()) return true; + } + return false; + } + + private boolean jj_3R_156() + { + if (jj_3R_191()) return true; + return false; + } + + private boolean jj_3R_167() + { + if (jj_scan_token(THIS)) return true; + return false; + } + + private boolean jj_3R_155() + { + if (jj_3R_190()) return true; + return false; + } + + private boolean jj_3R_166() + { + if (jj_3R_196()) return true; + return false; + } + + private boolean jj_3R_292() + { + if (jj_3R_71()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_7()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_372() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_370()) return true; + return false; + } + + private boolean jj_3R_360() + { + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_112() + { + if (jj_3R_89()) return true; + return false; + } + + private boolean jj_3R_359() + { + if (jj_scan_token(THROWS)) return true; + if (jj_3R_370()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_372()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_291() + { + if (jj_3R_103()) return true; + return false; + } + + private boolean jj_3R_111() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_166()) { + jj_scanpos = xsp; + if (jj_3R_167()) { + jj_scanpos = xsp; + if (jj_3R_168()) { + jj_scanpos = xsp; + if (jj_3R_169()) { + jj_scanpos = xsp; + if (jj_3R_170()) { + jj_scanpos = xsp; + if (jj_3R_171()) { + jj_scanpos = xsp; + if (jj_3R_172()) { + jj_scanpos = xsp; + if (jj_3R_173()) return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_101() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_155()) { + jj_scanpos = xsp; + if (jj_3R_156()) { + jj_scanpos = xsp; + if (jj_3R_157()) return true; + } + } + return false; + } + + private boolean jj_3R_275() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_291()) jj_scanpos = xsp; + if (jj_3R_91()) return true; + if (jj_3R_98()) return true; + if (jj_3R_354()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_358()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_359()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_360()) { + jj_scanpos = xsp; + if (jj_scan_token(112)) return true; + } + return false; + } + + private boolean jj_3_25() + { + if (jj_3R_88()) return true; + return false; + } + + private boolean jj_3R_116() + { + if (jj_3R_101()) return true; + return false; + } + + private boolean jj_3R_78() + { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_116()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_130() + { + return false; + } + + private boolean jj_3R_73() + { + if (jj_3R_111()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_112()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_131() + { + return false; + } + + private boolean jj_3R_161() + { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_292()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(113)) jj_scanpos = xsp; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_82() + { + jj_lookingAhead = true; + jj_semLA = getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT; + jj_lookingAhead = false; + if (!jj_semLA || jj_3R_130()) return true; + if (jj_scan_token(GT)) return true; + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_108() + { + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_107() + { + if (jj_3R_161()) return true; + return false; + } + + private boolean jj_3R_184() + { + if (jj_scan_token(ASSIGN)) return true; + if (jj_3R_71()) return true; + return false; + } + + private boolean jj_3R_266() + { + if (jj_3R_111()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_25()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_83() + { + jj_lookingAhead = true; + jj_semLA = getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT; + jj_lookingAhead = false; + if (!jj_semLA || jj_3R_131()) return true; + if (jj_scan_token(GT)) return true; + if (jj_scan_token(GT)) return true; + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_71() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_107()) { + jj_scanpos = xsp; + if (jj_3R_108()) return true; + } + return false; + } + + private boolean jj_3R_177() + { + if (jj_scan_token(BIT_AND)) return true; + if (jj_3R_75()) return true; + return false; + } + + private boolean jj_3R_132() + { + if (jj_3R_75()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_177()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_178()) return true; + return false; + } + + private boolean jj_3R_421() + { + if (jj_3R_96()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_40()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_145() + { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_182()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3_24() + { + if (jj_3R_87()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3R_84() + { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_78()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_24()) { + jj_scanpos = xsp; + if (jj_3R_132()) return true; + } + return false; + } + + private boolean jj_3_39() + { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_149() + { + if (jj_3R_145()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_184()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_404() + { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_421()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_39()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_406() + { + if (jj_scan_token(FINALLY)) return true; + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_393() + { + if (jj_scan_token(FINALLY)) return true; + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_422() + { + if (jj_scan_token(BIT_OR)) return true; + if (jj_3R_370()) return true; + return false; + } + + private boolean jj_3R_69() + { + if (jj_3R_76()) return true; + return false; + } + + private boolean jj_3R_86() + { + if (jj_scan_token(DECR)) return true; + return false; + } + + private boolean jj_3_23() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_85()) { + jj_scanpos = xsp; + if (jj_3R_86()) return true; + } + return false; + } + + private boolean jj_3R_85() + { + if (jj_scan_token(INCR)) return true; + return false; + } + + private boolean jj_3R_357() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_149()) return true; + return false; + } + + private boolean jj_3_22() + { + if (jj_3R_84()) return true; + return false; + } + + private boolean jj_3R_405() + { + if (jj_scan_token(CATCH)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_95()) return true; + if (jj_3R_75()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_422()) { jj_scanpos = xsp; break; } + } + if (jj_3R_145()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_274() + { + if (jj_3R_68()) return true; + if (jj_3R_149()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_357()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_240() + { + if (jj_3R_266()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_23()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_215() + { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_209() + { + if (jj_3R_84()) return true; + return false; + } + + private boolean jj_3R_210() + { + if (jj_3R_240()) return true; + return false; + } + + private boolean jj_3R_239() + { + if (jj_scan_token(BANG)) return true; + return false; + } + + private boolean jj_3R_238() + { + if (jj_scan_token(TILDE)) return true; + return false; + } + + private boolean jj_3R_208() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_238()) { + jj_scanpos = xsp; + if (jj_3R_239()) return true; + } + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3_5() + { + if (jj_3R_68()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_69()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_scan_token(113)) { + jj_scanpos = xsp; + if (jj_scan_token(116)) { + jj_scanpos = xsp; + if (jj_scan_token(112)) return true; + } + } + return false; + } + + private boolean jj_3R_392() + { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_405()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_406()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_67() + { + if (jj_3R_103()) return true; + return false; + } + + private boolean jj_3_4() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_67()) jj_scanpos = xsp; + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3R_178() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_208()) { + jj_scanpos = xsp; + if (jj_3R_209()) { + jj_scanpos = xsp; + if (jj_3R_210()) return true; + } + } + return false; + } + + private boolean jj_3R_250() + { + if (jj_3R_275()) return true; + return false; + } + + private boolean jj_3R_391() + { + if (jj_3R_404()) return true; + return false; + } + + private boolean jj_3R_331() + { + if (jj_scan_token(TRY)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_391()) jj_scanpos = xsp; + if (jj_3R_106()) return true; + xsp = jj_scanpos; + if (jj_3R_392()) { + jj_scanpos = xsp; + if (jj_3R_393()) return true; + } + return false; + } + + private boolean jj_3R_244() + { + if (jj_scan_token(_DEFAULT)) return true; + if (jj_3R_95()) return true; + return false; + } + + private boolean jj_3R_249() + { + if (jj_3R_274()) return true; + return false; + } + + private boolean jj_3R_248() + { + if (jj_3R_273()) return true; + return false; + } + + private boolean jj_3R_247() + { + if (jj_3R_272()) return true; + return false; + } + + private boolean jj_3R_216() + { + if (jj_scan_token(DECR)) return true; + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3R_246() + { + if (jj_3R_271()) return true; + return false; + } + + private boolean jj_3R_245() + { + if (jj_3R_270()) return true; + return false; + } + + private boolean jj_3R_390() + { + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_193() + { + if (jj_3R_219()) return true; + return false; + } + + private boolean jj_3R_97() + { + if (jj_scan_token(INCR)) return true; + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3R_188() + { + if (jj_3R_178()) return true; + return false; + } + + private boolean jj_3R_389() + { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_330() + { + if (jj_scan_token(SYNCHRONIZED)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_106()) return true; + return false; + } + + private boolean jj_3R_214() + { + if (jj_3R_95()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_244()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_245()) { + jj_scanpos = xsp; + if (jj_3R_246()) { + jj_scanpos = xsp; + if (jj_3R_247()) { + jj_scanpos = xsp; + if (jj_3R_248()) { + jj_scanpos = xsp; + if (jj_3R_249()) { + jj_scanpos = xsp; + if (jj_3R_250()) return true; + } + } + } + } + } + return false; + } + + private boolean jj_3_6() + { + if (jj_3R_70()) return true; + return false; + } + + private boolean jj_3R_388() + { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_218() + { + if (jj_scan_token(MINUS)) return true; + return false; + } + + private boolean jj_3R_217() + { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3R_329() + { + if (jj_scan_token(THROW)) return true; + if (jj_3R_80()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_187() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_217()) { + jj_scanpos = xsp; + if (jj_3R_218()) return true; + } + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3R_186() + { + if (jj_3R_216()) return true; + return false; + } + + private boolean jj_3R_185() + { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3R_183() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_6()) { + jj_scanpos = xsp; + if (jj_3R_214()) { + jj_scanpos = xsp; + if (jj_3R_215()) return true; + } + } + return false; + } + + private boolean jj_3R_429() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_328() + { + if (jj_scan_token(RETURN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_390()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_148() + { + if (jj_3R_183()) return true; + return false; + } + + private boolean jj_3R_151() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_185()) { + jj_scanpos = xsp; + if (jj_3R_186()) { + jj_scanpos = xsp; + if (jj_3R_187()) { + jj_scanpos = xsp; + if (jj_3R_188()) return true; + } + } + } + return false; + } + + private boolean jj_3R_398() + { + if (jj_scan_token(REM)) return true; + return false; + } + + private boolean jj_3R_397() + { + if (jj_scan_token(SLASH)) return true; + return false; + } + + private boolean jj_3R_327() + { + if (jj_scan_token(CONTINUE)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_389()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_93() + { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_148()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_396() + { + if (jj_scan_token(STAR)) return true; + return false; + } + + private boolean jj_3R_380() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_396()) { + jj_scanpos = xsp; + if (jj_3R_397()) { + jj_scanpos = xsp; + if (jj_3R_398()) return true; + } + } + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3R_403() + { + if (jj_3R_420()) return true; + return false; + } + + private boolean jj_3R_252() + { + if (jj_scan_token(BIT_AND)) return true; + if (jj_3R_251()) return true; + return false; + } + + private boolean jj_3R_326() + { + if (jj_scan_token(BREAK)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_388()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_219() + { + if (jj_scan_token(EXTENDS)) return true; + if (jj_3R_251()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_252()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_345() + { + if (jj_3R_151()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_380()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_382() + { + if (jj_scan_token(MINUS)) return true; + return false; + } + + private boolean jj_3R_381() + { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3_3() + { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_66()) return true; + return false; + } + + private boolean jj_3R_373() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_381()) { + jj_scanpos = xsp; + if (jj_3R_382()) return true; + } + if (jj_3R_345()) return true; + return false; + } + + private boolean jj_3R_158() + { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_193()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_420() + { + if (jj_3R_427()) return true; + return false; + } + + /** Generated Token Manager. */ + public ASTParserTokenManager token_source; + JavaCharStream jj_input_stream; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; + private int jj_ntk; + private Token jj_scanpos, jj_lastpos; + private int jj_la; + /** Whether we are looking ahead. */ + private boolean jj_lookingAhead = false; + private boolean jj_semLA; + private int jj_gen; + final private int[] jj_la1 = new int[160]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static private int[] jj_la1_3; + static private int[] jj_la1_4; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + jj_la1_init_3(); + jj_la1_init_4(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0x40000000,0x40000000,0x902020,0x0,0x0,0x0,0x800020,0x102000,0x902020,0x2000,0x0,0x200000,0x20000000,0x0,0x0,0x20000000,0x0,0x0,0x29532a0,0x0,0x0,0x0,0x0,0x0,0x200000,0x0,0x29532a0,0x10000,0x102000,0x2041280,0x29532a0,0x0,0x0,0x0,0x2441280,0x2441280,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x28412a0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2441280,0x16c6b3e0,0x0,0x2041280,0x2041280,0x2041280,0x0,0x2041280,0x2041280,0x200000,0x200000,0x2041280,0x2041280,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2441280,0x0,0x0,0x2441280,0x0,0x0,0x2041280,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2441280,0x2c412a0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x400000,0x2441280,0x0,0x0,0x0,0x2041280,0x2441280,0x0,0x0,0x164693c0,0x0,0x164693c0,0x0,0x2441280,0x0,0x0,0x0,0x0,0x2441280,0x10400,0x10400,0x80000,0x2c412a0,0x2441280,0x2441280,0x2c412a0,0x2441280,0x0,0x0,0x0,0x2441280,0x0,0x800,0x0,0x1000000,0x0,0x0,0x0,0x0,0x2441280,0x2441280,0x0,0x29432a0,0x2143280,0x29432a0,0x10000,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x0,0x0,0x111338a,0x0,0x1000,0x0,0x1113388,0x2,0x111338a,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1913b8f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1913b8f,0x0,0x2,0x800805,0x1913b8f,0x0,0x0,0x0,0xca24835,0xca24835,0x0,0x0,0x0,0x0,0x80000,0x0,0x0,0x1113b8d,0x0,0x0,0x0,0x0,0x0,0x80000,0x0,0x0,0xca24835,0xff7ffbf,0x1000,0x805,0x805,0x805,0x0,0x805,0x805,0x4000,0x4000,0x805,0x800805,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xca24835,0x0,0x0,0xca24835,0x0,0x0,0x805,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0xca24835,0xdb37bbd,0x0,0x10,0x0,0xc224030,0x0,0x0,0x0,0x0,0x20010,0x0,0xc200020,0x200000,0xca24835,0x0,0x0,0x0,0x805,0xca24835,0x0,0x0,0xee7cc35,0x0,0xee7cc35,0x0,0xca24835,0x0,0x10,0x0,0x0,0xca24835,0x0,0x0,0x0,0xdb37bbd,0xca24835,0xca24835,0xdb37bbd,0xca24835,0x0,0x0,0x0,0xca24835,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xca24835,0xca24835,0x0,0x1113b8f,0x807,0x1113b8f,0x0,}; + } + private static void jj_la1_init_3() { + jj_la1_3 = new int[] {0x10000,0x10000,0x90000,0x0,0x0,0x40000,0x80000,0x80000,0x90000,0x0,0x200000,0x0,0x0,0x20000,0x20000,0x0,0x80080,0x20000,0x291080,0x10000,0x80000,0x400,0x1000,0x20000,0x0,0x0,0x291080,0x0,0x80000,0x200080,0x290080,0x20000,0x100000,0x84000,0xc014e1,0xc014e1,0x20000,0x200000,0x84000,0x20000,0x0,0x11000,0x20000,0x80080,0x20000,0x20000,0x0,0x200000,0x20000,0x0,0x200000,0x200000,0x2004e1,0x914e1,0x0,0x0,0x80,0x80,0x20000,0x1080080,0x1000080,0x0,0x0,0x0,0x80,0x200000,0x80,0x0,0x100000,0x100000,0x1000000,0x40000000,0x80000000,0x0,0x0,0x0,0x24000000,0x24000000,0x0,0x18200000,0x18200000,0x0,0x0,0x0,0x0,0x0,0x0,0xc004e1,0xc00000,0xc00000,0x4e1,0x0,0x0,0x80,0x200000,0x400,0x200000,0x80,0x40000,0x20000,0x20000,0xc004e1,0xc804e1,0x200000,0x80,0x400,0x461,0x80,0x40000,0x200000,0x400,0x0,0x44000,0x61,0x0,0xc004e1,0x20000,0x200000,0x84400,0x280080,0xc004e1,0x84000,0x1000,0x114e1,0x2000000,0x114e1,0x20000,0xc014e1,0x200000,0x80,0x100000,0x100000,0x4e1,0x0,0x0,0x0,0xc804e1,0xc004e1,0xc004e1,0xc904e1,0xc004e1,0x20000,0x80,0x80,0xc004e1,0x400,0x0,0x0,0x0,0x80000,0x80000,0x80,0x20000,0xc814e1,0xc814e1,0x20000,0x90080,0x80080,0x90080,0x0,}; + } + private static void jj_la1_init_4() { + jj_la1_4 = new int[] {0x0,0x0,0x0,0x10000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0xf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1800000,0x1bff800,0x3ff800,0x0,0x0,0x0,0x80,0x100,0x40,0x0,0x0,0x0,0x8000000,0x8000000,0x400,0xc,0xc,0x230,0x230,0xc,0xf,0x0,0x0,0x0,0x3,0x40,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0xf,0xf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0x0,0x0,0x0,0x0,0xf,0x0,0x0,0x3,0x0,0x3,0x0,0xf,0x0,0x0,0x1bff803,0x1bff803,0x2,0x0,0x0,0x0,0xf,0xf,0xf,0xf,0xf,0x0,0x0,0x0,0xf,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0xf,0xf,0x0,0x0,0x0,0x0,0x0,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[44]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor. */ + public ASTParser(Provider stream) { + jj_input_stream = new JavaCharStream(stream, 1, 1); + token_source = new ASTParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 160; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor. */ + public ASTParser(String dsl) throws ParseException, TokenMgrException { + this(new StringProvider(dsl)); + } + + public void ReInit(String s) { + ReInit(new StringProvider(s)); + } + /** Reinitialise. */ + public void ReInit(Provider stream) { + if (jj_input_stream == null) { + jj_input_stream = new JavaCharStream(stream, 1, 1); + } else { + jj_input_stream.ReInit(stream, 1, 1); + } + if (token_source == null) { + token_source = new ASTParserTokenManager(jj_input_stream); + } + + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 160; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor with generated Token Manager. */ + public ASTParser(ASTParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 160; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(ASTParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 160; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + private Token jj_consume_token(int kind) { + Token oldToken; + if ((oldToken = token).next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) c.first = null; + c = c.next; + } + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + @SuppressWarnings("serial") + static private final class LookaheadSuccess extends java.lang.RuntimeException { } + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; Token tok = token; + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } + if (tok != null) jj_add_error_token(kind, i); + } + if (jj_scanpos.kind != kind) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + return false; + } + + +/** Get the next Token. */ + final public Token getNextToken() { + if (token.next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + jj_gen++; + return token; + } + +/** Get the specific Token. */ + final public Token getToken(int index) { + Token t = jj_lookingAhead ? jj_scanpos : token; + for (int i = 0; i < index; i++) { + if (t.next != null) t = t.next; + else t = t.next = token_source.getNextToken(); + } + return t; + } + + private int jj_ntk_f() { + if ((jj_nt=token.next) == null) + return (jj_ntk = (token.next=token_source.getNextToken()).kind); + else + return (jj_ntk = jj_nt.kind); + } + + private java.util.List jj_expentries = new java.util.ArrayList(); + private int[] jj_expentry; + private int jj_kind = -1; + private int[] jj_lasttokens = new int[100]; + private int jj_endpos; + + private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) { + return; + } + + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + + for (int[] oldentry : jj_expentries) { + if (oldentry.length == jj_expentry.length) { + boolean isMatched = true; + + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + isMatched = false; + break; + } + + } + if (isMatched) { + jj_expentries.add(jj_expentry); + break; + } + } + } + + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[157]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 160; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1< jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); break; + case 1: jj_3_2(); break; + case 2: jj_3_3(); break; + case 3: jj_3_4(); break; + case 4: jj_3_5(); break; + case 5: jj_3_6(); break; + case 6: jj_3_7(); break; + case 7: jj_3_8(); break; + case 8: jj_3_9(); break; + case 9: jj_3_10(); break; + case 10: jj_3_11(); break; + case 11: jj_3_12(); break; + case 12: jj_3_13(); break; + case 13: jj_3_14(); break; + case 14: jj_3_15(); break; + case 15: jj_3_16(); break; + case 16: jj_3_17(); break; + case 17: jj_3_18(); break; + case 18: jj_3_19(); break; + case 19: jj_3_20(); break; + case 20: jj_3_21(); break; + case 21: jj_3_22(); break; + case 22: jj_3_23(); break; + case 23: jj_3_24(); break; + case 24: jj_3_25(); break; + case 25: jj_3_26(); break; + case 26: jj_3_27(); break; + case 27: jj_3_28(); break; + case 28: jj_3_29(); break; + case 29: jj_3_30(); break; + case 30: jj_3_31(); break; + case 31: jj_3_32(); break; + case 32: jj_3_33(); break; + case 33: jj_3_34(); break; + case 34: jj_3_35(); break; + case 35: jj_3_36(); break; + case 36: jj_3_37(); break; + case 37: jj_3_38(); break; + case 38: jj_3_39(); break; + case 39: jj_3_40(); break; + case 40: jj_3_41(); break; + case 41: jj_3_42(); break; + case 42: jj_3_43(); break; + case 43: jj_3_44(); break; + } + } + p = p.next; + } while (p != null); + + } catch(LookaheadSuccess ls) { } + } + jj_rescan = false; + } + + private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { p = p.next = new JJCalls(); break; } + p = p.next; + } + + p.gen = jj_gen + xla - jj_la; + p.first = token; + p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserConstants.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserConstants.java index eab016e814..b256848a99 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserConstants.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserConstants.java @@ -20,673 +20,419 @@ */ public interface ASTParserConstants { - /** - * End of File. - */ - int EOF = 0; - /** - * RegularExpression Id. - */ - int SINGLE_LINE_COMMENT = 31; - /** - * RegularExpression Id. - */ - int JAVA_DOC_COMMENT = 34; - /** - * RegularExpression Id. - */ - int MULTI_LINE_COMMENT = 35; - /** - * RegularExpression Id. - */ - int ABSTRACT = 37; - /** - * RegularExpression Id. - */ - int ASSERT = 38; - /** - * RegularExpression Id. - */ - int BOOLEAN = 39; - /** - * RegularExpression Id. - */ - int BREAK = 40; - /** - * RegularExpression Id. - */ - int BYTE = 41; - /** - * RegularExpression Id. - */ - int CASE = 42; - /** - * RegularExpression Id. - */ - int CATCH = 43; - /** - * RegularExpression Id. - */ - int CHAR = 44; - /** - * RegularExpression Id. - */ - int CLASS = 45; - /** - * RegularExpression Id. - */ - int CONST = 46; - /** - * RegularExpression Id. - */ - int CONTINUE = 47; - /** - * RegularExpression Id. - */ - int _DEFAULT = 48; - /** - * RegularExpression Id. - */ - int DO = 49; - /** - * RegularExpression Id. - */ - int DOUBLE = 50; - /** - * RegularExpression Id. - */ - int ELSE = 51; - /** - * RegularExpression Id. - */ - int ENUM = 52; - /** - * RegularExpression Id. - */ - int EXTENDS = 53; - /** - * RegularExpression Id. - */ - int FALSE = 54; - /** - * RegularExpression Id. - */ - int FINAL = 55; - /** - * RegularExpression Id. - */ - int FINALLY = 56; - /** - * RegularExpression Id. - */ - int FLOAT = 57; - /** - * RegularExpression Id. - */ - int FOR = 58; - /** - * RegularExpression Id. - */ - int GOTO = 59; - /** - * RegularExpression Id. - */ - int IF = 60; - /** - * RegularExpression Id. - */ - int IMPLEMENTS = 61; - /** - * RegularExpression Id. - */ - int IMPORT = 62; - /** - * RegularExpression Id. - */ - int INSTANCEOF = 63; - /** - * RegularExpression Id. - */ - int INT = 64; - /** - * RegularExpression Id. - */ - int INTERFACE = 65; - /** - * RegularExpression Id. - */ - int LONG = 66; - /** - * RegularExpression Id. - */ - int NATIVE = 67; - /** - * RegularExpression Id. - */ - int NEW = 68; - /** - * RegularExpression Id. - */ - int NULL = 69; - /** - * RegularExpression Id. - */ - int PACKAGE = 70; - /** - * RegularExpression Id. - */ - int PRIVATE = 71; - /** - * RegularExpression Id. - */ - int PROTECTED = 72; - /** - * RegularExpression Id. - */ - int PUBLIC = 73; - /** - * RegularExpression Id. - */ - int RETURN = 74; - /** - * RegularExpression Id. - */ - int SHORT = 75; - /** - * RegularExpression Id. - */ - int STATIC = 76; - /** - * RegularExpression Id. - */ - int STRICTFP = 77; - /** - * RegularExpression Id. - */ - int SUPER = 78; - /** - * RegularExpression Id. - */ - int SWITCH = 79; - /** - * RegularExpression Id. - */ - int SYNCHRONIZED = 80; - /** - * RegularExpression Id. - */ - int THIS = 81; - /** - * RegularExpression Id. - */ - int THROW = 82; - /** - * RegularExpression Id. - */ - int THROWS = 83; - /** - * RegularExpression Id. - */ - int TRANSIENT = 84; - /** - * RegularExpression Id. - */ - int TRUE = 85; - /** - * RegularExpression Id. - */ - int TRY = 86; - /** - * RegularExpression Id. - */ - int VOID = 87; - /** - * RegularExpression Id. - */ - int VOLATILE = 88; - /** - * RegularExpression Id. - */ - int WHILE = 89; - /** - * RegularExpression Id. - */ - int LONG_LITERAL = 90; - /** - * RegularExpression Id. - */ - int INTEGER_LITERAL = 91; - /** - * RegularExpression Id. - */ - int DECIMAL_LITERAL = 92; - /** - * RegularExpression Id. - */ - int HEX_LITERAL = 93; - /** - * RegularExpression Id. - */ - int OCTAL_LITERAL = 94; - /** - * RegularExpression Id. - */ - int BINARY_LITERAL = 95; - /** - * RegularExpression Id. - */ - int FLOATING_POINT_LITERAL = 96; - /** - * RegularExpression Id. - */ - int DECIMAL_FLOATING_POINT_LITERAL = 97; - /** - * RegularExpression Id. - */ - int DECIMAL_EXPONENT = 98; - /** - * RegularExpression Id. - */ - int HEXADECIMAL_FLOATING_POINT_LITERAL = 99; - /** - * RegularExpression Id. - */ - int HEXADECIMAL_EXPONENT = 100; - /** - * RegularExpression Id. - */ - int CHARACTER_LITERAL = 101; - /** - * RegularExpression Id. - */ - int STRING_LITERAL = 102; - /** - * RegularExpression Id. - */ - int IDENTIFIER = 103; - /** - * RegularExpression Id. - */ - int LETTER = 104; - /** - * RegularExpression Id. - */ - int PART_LETTER = 105; - /** - * RegularExpression Id. - */ - int LPAREN = 106; - /** - * RegularExpression Id. - */ - int RPAREN = 107; - /** - * RegularExpression Id. - */ - int LBRACE = 108; - /** - * RegularExpression Id. - */ - int RBRACE = 109; - /** - * RegularExpression Id. - */ - int LBRACKET = 110; - /** - * RegularExpression Id. - */ - int RBRACKET = 111; - /** - * RegularExpression Id. - */ - int SEMICOLON = 112; - /** - * RegularExpression Id. - */ - int COMMA = 113; - /** - * RegularExpression Id. - */ - int DOT = 114; - /** - * RegularExpression Id. - */ - int AT = 115; - /** - * RegularExpression Id. - */ - int ASSIGN = 116; - /** - * RegularExpression Id. - */ - int LT = 117; - /** - * RegularExpression Id. - */ - int BANG = 118; - /** - * RegularExpression Id. - */ - int TILDE = 119; - /** - * RegularExpression Id. - */ - int HOOK = 120; - /** - * RegularExpression Id. - */ - int COLON = 121; - /** - * RegularExpression Id. - */ - int EQ = 122; - /** - * RegularExpression Id. - */ - int LE = 123; - /** - * RegularExpression Id. - */ - int GE = 124; - /** - * RegularExpression Id. - */ - int NE = 125; - /** - * RegularExpression Id. - */ - int SC_OR = 126; - /** - * RegularExpression Id. - */ - int SC_AND = 127; - /** - * RegularExpression Id. - */ - int INCR = 128; - /** - * RegularExpression Id. - */ - int DECR = 129; - /** - * RegularExpression Id. - */ - int PLUS = 130; - /** - * RegularExpression Id. - */ - int MINUS = 131; - /** - * RegularExpression Id. - */ - int STAR = 132; - /** - * RegularExpression Id. - */ - int SLASH = 133; - /** - * RegularExpression Id. - */ - int BIT_AND = 134; - /** - * RegularExpression Id. - */ - int BIT_OR = 135; - /** - * RegularExpression Id. - */ - int XOR = 136; - /** - * RegularExpression Id. - */ - int REM = 137; - /** - * RegularExpression Id. - */ - int LSHIFT = 138; - /** - * RegularExpression Id. - */ - int PLUSASSIGN = 139; - /** - * RegularExpression Id. - */ - int MINUSASSIGN = 140; - /** - * RegularExpression Id. - */ - int STARASSIGN = 141; - /** - * RegularExpression Id. - */ - int SLASHASSIGN = 142; - /** - * RegularExpression Id. - */ - int ANDASSIGN = 143; - /** - * RegularExpression Id. - */ - int ORASSIGN = 144; - /** - * RegularExpression Id. - */ - int XORASSIGN = 145; - /** - * RegularExpression Id. - */ - int REMASSIGN = 146; - /** - * RegularExpression Id. - */ - int LSHIFTASSIGN = 147; - /** - * RegularExpression Id. - */ - int RSIGNEDSHIFTASSIGN = 148; - /** - * RegularExpression Id. - */ - int RUNSIGNEDSHIFTASSIGN = 149; - /** - * RegularExpression Id. - */ - int ELLIPSIS = 150; - /** - * RegularExpression Id. - */ - int ARROW = 151; - /** - * RegularExpression Id. - */ - int DOUBLECOLON = 152; - /** - * RegularExpression Id. - */ - int RUNSIGNEDSHIFT = 153; - /** - * RegularExpression Id. - */ - int RSIGNEDSHIFT = 154; - /** - * RegularExpression Id. - */ - int GT = 155; + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int SINGLE_LINE_COMMENT = 31; + /** RegularExpression Id. */ + int JAVA_DOC_COMMENT = 34; + /** RegularExpression Id. */ + int MULTI_LINE_COMMENT = 35; + /** RegularExpression Id. */ + int ABSTRACT = 37; + /** RegularExpression Id. */ + int ASSERT = 38; + /** RegularExpression Id. */ + int BOOLEAN = 39; + /** RegularExpression Id. */ + int BREAK = 40; + /** RegularExpression Id. */ + int BYTE = 41; + /** RegularExpression Id. */ + int CASE = 42; + /** RegularExpression Id. */ + int CATCH = 43; + /** RegularExpression Id. */ + int CHAR = 44; + /** RegularExpression Id. */ + int CLASS = 45; + /** RegularExpression Id. */ + int CONST = 46; + /** RegularExpression Id. */ + int CONTINUE = 47; + /** RegularExpression Id. */ + int _DEFAULT = 48; + /** RegularExpression Id. */ + int DO = 49; + /** RegularExpression Id. */ + int DOUBLE = 50; + /** RegularExpression Id. */ + int ELSE = 51; + /** RegularExpression Id. */ + int ENUM = 52; + /** RegularExpression Id. */ + int EXTENDS = 53; + /** RegularExpression Id. */ + int FALSE = 54; + /** RegularExpression Id. */ + int FINAL = 55; + /** RegularExpression Id. */ + int FINALLY = 56; + /** RegularExpression Id. */ + int FLOAT = 57; + /** RegularExpression Id. */ + int FOR = 58; + /** RegularExpression Id. */ + int GOTO = 59; + /** RegularExpression Id. */ + int IF = 60; + /** RegularExpression Id. */ + int IMPLEMENTS = 61; + /** RegularExpression Id. */ + int IMPORT = 62; + /** RegularExpression Id. */ + int INSTANCEOF = 63; + /** RegularExpression Id. */ + int INT = 64; + /** RegularExpression Id. */ + int INTERFACE = 65; + /** RegularExpression Id. */ + int LONG = 66; + /** RegularExpression Id. */ + int NATIVE = 67; + /** RegularExpression Id. */ + int NEW = 68; + /** RegularExpression Id. */ + int NULL = 69; + /** RegularExpression Id. */ + int PACKAGE = 70; + /** RegularExpression Id. */ + int PRIVATE = 71; + /** RegularExpression Id. */ + int PROTECTED = 72; + /** RegularExpression Id. */ + int PUBLIC = 73; + /** RegularExpression Id. */ + int RETURN = 74; + /** RegularExpression Id. */ + int SHORT = 75; + /** RegularExpression Id. */ + int STATIC = 76; + /** RegularExpression Id. */ + int STRICTFP = 77; + /** RegularExpression Id. */ + int SUPER = 78; + /** RegularExpression Id. */ + int SWITCH = 79; + /** RegularExpression Id. */ + int SYNCHRONIZED = 80; + /** RegularExpression Id. */ + int THIS = 81; + /** RegularExpression Id. */ + int THROW = 82; + /** RegularExpression Id. */ + int THROWS = 83; + /** RegularExpression Id. */ + int TRANSIENT = 84; + /** RegularExpression Id. */ + int TRUE = 85; + /** RegularExpression Id. */ + int TRY = 86; + /** RegularExpression Id. */ + int VOID = 87; + /** RegularExpression Id. */ + int VOLATILE = 88; + /** RegularExpression Id. */ + int WHILE = 89; + /** RegularExpression Id. */ + int LONG_LITERAL = 90; + /** RegularExpression Id. */ + int INTEGER_LITERAL = 91; + /** RegularExpression Id. */ + int DECIMAL_LITERAL = 92; + /** RegularExpression Id. */ + int HEX_LITERAL = 93; + /** RegularExpression Id. */ + int OCTAL_LITERAL = 94; + /** RegularExpression Id. */ + int BINARY_LITERAL = 95; + /** RegularExpression Id. */ + int FLOATING_POINT_LITERAL = 96; + /** RegularExpression Id. */ + int DECIMAL_FLOATING_POINT_LITERAL = 97; + /** RegularExpression Id. */ + int DECIMAL_EXPONENT = 98; + /** RegularExpression Id. */ + int HEXADECIMAL_FLOATING_POINT_LITERAL = 99; + /** RegularExpression Id. */ + int HEXADECIMAL_EXPONENT = 100; + /** RegularExpression Id. */ + int CHARACTER_LITERAL = 101; + /** RegularExpression Id. */ + int STRING_LITERAL = 102; + /** RegularExpression Id. */ + int IDENTIFIER = 103; + /** RegularExpression Id. */ + int LETTER = 104; + /** RegularExpression Id. */ + int PART_LETTER = 105; + /** RegularExpression Id. */ + int LPAREN = 106; + /** RegularExpression Id. */ + int RPAREN = 107; + /** RegularExpression Id. */ + int LBRACE = 108; + /** RegularExpression Id. */ + int RBRACE = 109; + /** RegularExpression Id. */ + int LBRACKET = 110; + /** RegularExpression Id. */ + int RBRACKET = 111; + /** RegularExpression Id. */ + int SEMICOLON = 112; + /** RegularExpression Id. */ + int COMMA = 113; + /** RegularExpression Id. */ + int DOT = 114; + /** RegularExpression Id. */ + int AT = 115; + /** RegularExpression Id. */ + int ASSIGN = 116; + /** RegularExpression Id. */ + int LT = 117; + /** RegularExpression Id. */ + int BANG = 118; + /** RegularExpression Id. */ + int TILDE = 119; + /** RegularExpression Id. */ + int HOOK = 120; + /** RegularExpression Id. */ + int COLON = 121; + /** RegularExpression Id. */ + int EQ = 122; + /** RegularExpression Id. */ + int LE = 123; + /** RegularExpression Id. */ + int GE = 124; + /** RegularExpression Id. */ + int NE = 125; + /** RegularExpression Id. */ + int SC_OR = 126; + /** RegularExpression Id. */ + int SC_AND = 127; + /** RegularExpression Id. */ + int INCR = 128; + /** RegularExpression Id. */ + int DECR = 129; + /** RegularExpression Id. */ + int PLUS = 130; + /** RegularExpression Id. */ + int MINUS = 131; + /** RegularExpression Id. */ + int STAR = 132; + /** RegularExpression Id. */ + int SLASH = 133; + /** RegularExpression Id. */ + int BIT_AND = 134; + /** RegularExpression Id. */ + int BIT_OR = 135; + /** RegularExpression Id. */ + int XOR = 136; + /** RegularExpression Id. */ + int REM = 137; + /** RegularExpression Id. */ + int LSHIFT = 138; + /** RegularExpression Id. */ + int PLUSASSIGN = 139; + /** RegularExpression Id. */ + int MINUSASSIGN = 140; + /** RegularExpression Id. */ + int STARASSIGN = 141; + /** RegularExpression Id. */ + int SLASHASSIGN = 142; + /** RegularExpression Id. */ + int ANDASSIGN = 143; + /** RegularExpression Id. */ + int ORASSIGN = 144; + /** RegularExpression Id. */ + int XORASSIGN = 145; + /** RegularExpression Id. */ + int REMASSIGN = 146; + /** RegularExpression Id. */ + int LSHIFTASSIGN = 147; + /** RegularExpression Id. */ + int RSIGNEDSHIFTASSIGN = 148; + /** RegularExpression Id. */ + int RUNSIGNEDSHIFTASSIGN = 149; + /** RegularExpression Id. */ + int ELLIPSIS = 150; + /** RegularExpression Id. */ + int ARROW = 151; + /** RegularExpression Id. */ + int DOUBLECOLON = 152; + /** RegularExpression Id. */ + int RUNSIGNEDSHIFT = 153; + /** RegularExpression Id. */ + int RSIGNEDSHIFT = 154; + /** RegularExpression Id. */ + int GT = 155; - /** - * Lexical state. - */ - int DEFAULT = 0; - /** - * Lexical state. - */ - int IN_JAVA_DOC_COMMENT = 1; - /** - * Lexical state. - */ - int IN_MULTI_LINE_COMMENT = 2; + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int IN_JAVA_DOC_COMMENT = 1; + /** Lexical state. */ + int IN_MULTI_LINE_COMMENT = 2; - /** - * Literal token values. - */ - String[] tokenImage = { - "", - "\" \"", - "\"\\t\"", - "\"\\n\"", - "\"\\r\"", - "\"\\f\"", - "\"\\u0085\"", - "\"\\u00a0\"", - "\"\\u1680\"", - "\"\\u180e\"", - "\"\\u2000\"", - "\"\\u2001\"", - "\"\\u2002\"", - "\"\\u2003\"", - "\"\\u2004\"", - "\"\\u2005\"", - "\"\\u2006\"", - "\"\\u2007\"", - "\"\\u2008\"", - "\"\\u2009\"", - "\"\\u200a\"", - "\"\\u200b\"", - "\"\\u200c\"", - "\"\\u200d\"", - "\"\\u2028\"", - "\"\\u2029\"", - "\"\\u202f\"", - "\"\\u205f\"", - "\"\\u2060\"", - "\"\\u3000\"", - "\"\\ufeff\"", - "", - "", - "\"/*\"", - "\"*/\"", - "\"*/\"", - "", - "\"abstract\"", - "\"assert\"", - "\"boolean\"", - "\"break\"", - "\"byte\"", - "\"case\"", - "\"catch\"", - "\"char\"", - "\"class\"", - "\"const\"", - "\"continue\"", - "\"default\"", - "\"do\"", - "\"double\"", - "\"else\"", - "\"enum\"", - "\"extends\"", - "\"false\"", - "\"final\"", - "\"finally\"", - "\"float\"", - "\"for\"", - "\"goto\"", - "\"if\"", - "\"implements\"", - "\"import\"", - "\"instanceof\"", - "\"int\"", - "\"interface\"", - "\"long\"", - "\"native\"", - "\"new\"", - "\"null\"", - "\"package\"", - "\"private\"", - "\"protected\"", - "\"public\"", - "\"return\"", - "\"short\"", - "\"static\"", - "\"strictfp\"", - "\"super\"", - "\"switch\"", - "\"synchronized\"", - "\"this\"", - "\"throw\"", - "\"throws\"", - "\"transient\"", - "\"true\"", - "\"try\"", - "\"void\"", - "\"volatile\"", - "\"while\"", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "\"(\"", - "\")\"", - "\"{\"", - "\"}\"", - "\"[\"", - "\"]\"", - "\";\"", - "\",\"", - "\".\"", - "\"@\"", - "\"=\"", - "\"<\"", - "\"!\"", - "\"~\"", - "\"?\"", - "\":\"", - "\"==\"", - "\"<=\"", - "\">=\"", - "\"!=\"", - "\"||\"", - "\"&&\"", - "\"++\"", - "\"--\"", - "\"+\"", - "\"-\"", - "\"*\"", - "\"/\"", - "\"&\"", - "\"|\"", - "\"^\"", - "\"%\"", - "\"<<\"", - "\"+=\"", - "\"-=\"", - "\"*=\"", - "\"/=\"", - "\"&=\"", - "\"|=\"", - "\"^=\"", - "\"%=\"", - "\"<<=\"", - "\">>=\"", - "\">>>=\"", - "\"...\"", - "\"->\"", - "\"::\"", - "\">>>\"", - "\">>\"", - "\">\"", - "\"\\u001a\"", - }; + /** Literal token values. */ + String[] tokenImage = { + "", + "\" \"", + "\"\\t\"", + "\"\\n\"", + "\"\\r\"", + "\"\\f\"", + "\"\\u0085\"", + "\"\\u00a0\"", + "\"\\u1680\"", + "\"\\u180e\"", + "\"\\u2000\"", + "\"\\u2001\"", + "\"\\u2002\"", + "\"\\u2003\"", + "\"\\u2004\"", + "\"\\u2005\"", + "\"\\u2006\"", + "\"\\u2007\"", + "\"\\u2008\"", + "\"\\u2009\"", + "\"\\u200a\"", + "\"\\u200b\"", + "\"\\u200c\"", + "\"\\u200d\"", + "\"\\u2028\"", + "\"\\u2029\"", + "\"\\u202f\"", + "\"\\u205f\"", + "\"\\u2060\"", + "\"\\u3000\"", + "\"\\ufeff\"", + "", + "", + "\"/*\"", + "\"*/\"", + "\"*/\"", + "", + "\"abstract\"", + "\"assert\"", + "\"boolean\"", + "\"break\"", + "\"byte\"", + "\"case\"", + "\"catch\"", + "\"char\"", + "\"class\"", + "\"const\"", + "\"continue\"", + "\"default\"", + "\"do\"", + "\"double\"", + "\"else\"", + "\"enum\"", + "\"extends\"", + "\"false\"", + "\"final\"", + "\"finally\"", + "\"float\"", + "\"for\"", + "\"goto\"", + "\"if\"", + "\"implements\"", + "\"import\"", + "\"instanceof\"", + "\"int\"", + "\"interface\"", + "\"long\"", + "\"native\"", + "\"new\"", + "\"null\"", + "\"package\"", + "\"private\"", + "\"protected\"", + "\"public\"", + "\"return\"", + "\"short\"", + "\"static\"", + "\"strictfp\"", + "\"super\"", + "\"switch\"", + "\"synchronized\"", + "\"this\"", + "\"throw\"", + "\"throws\"", + "\"transient\"", + "\"true\"", + "\"try\"", + "\"void\"", + "\"volatile\"", + "\"while\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"(\"", + "\")\"", + "\"{\"", + "\"}\"", + "\"[\"", + "\"]\"", + "\";\"", + "\",\"", + "\".\"", + "\"@\"", + "\"=\"", + "\"<\"", + "\"!\"", + "\"~\"", + "\"?\"", + "\":\"", + "\"==\"", + "\"<=\"", + "\">=\"", + "\"!=\"", + "\"||\"", + "\"&&\"", + "\"++\"", + "\"--\"", + "\"+\"", + "\"-\"", + "\"*\"", + "\"/\"", + "\"&\"", + "\"|\"", + "\"^\"", + "\"%\"", + "\"<<\"", + "\"+=\"", + "\"-=\"", + "\"*=\"", + "\"/=\"", + "\"&=\"", + "\"|=\"", + "\"^=\"", + "\"%=\"", + "\"<<=\"", + "\">>=\"", + "\">>>=\"", + "\"...\"", + "\"->\"", + "\"::\"", + "\">>>\"", + "\">>\"", + "\">\"", + "\"\\u001a\"", + }; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserTokenManager.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserTokenManager.java index 8ff4d69ed0..fe6c0c668a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserTokenManager.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ASTParserTokenManager.java @@ -13,10 +13,8 @@ * along with Java 1.8 parser and Abstract Syntax Tree. If not, see . */ package com.github.javaparser; - import java.io.*; import java.util.*; - import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.comments.*; @@ -24,17 +22,13 @@ import com.github.javaparser.ast.stmt.*; import com.github.javaparser.ast.type.*; import com.github.javaparser.utils.*; - import static com.github.javaparser.ASTParser.*; import static com.github.javaparser.Range.*; import static com.github.javaparser.Position.*; import static com.github.javaparser.ast.type.ArrayType.*; -/** - * Token Manager. - */ -@SuppressWarnings("unused") -public class ASTParserTokenManager implements ASTParserConstants { +/** Token Manager. */ +@SuppressWarnings("unused")public class ASTParserTokenManager implements ASTParserConstants { private List tokens = new ArrayList(); private CommentsCollection commentsCollection = new CommentsCollection(); @@ -73,2728 +67,2569 @@ private void CommonTokenAction(Token token) { } } - /** - * Debug output. - */ - public java.io.PrintStream debugStream = System.out; - - /** - * Set debug output. - */ - public void setDebugStream(java.io.PrintStream ds) { - debugStream = ds; - } - - private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2) { - switch (pos) { - case 0: - if ((active0 & 0xffffffe000000000L) != 0L || (active1 & 0x3ffffffL) != 0L) { - jjmatchedKind = 103; - return 43; - } - if ((active0 & 0x200000000L) != 0L || (active2 & 0x4020L) != 0L) - return 45; - if ((active1 & 0x4000000000000L) != 0L || (active2 & 0x400000L) != 0L) - return 1; - return -1; - case 1: - if ((active0 & 0xeff9ffe000000000L) != 0L || (active1 & 0x3ffffffL) != 0L) { - if (jjmatchedPos != 1) { - jjmatchedKind = 103; - jjmatchedPos = 1; - } - return 43; - } - if ((active0 & 0x1006000000000000L) != 0L) - return 43; - if ((active0 & 0x200000000L) != 0L) - return 50; - return -1; - case 2: - if ((active0 & 0x400000000000000L) != 0L || (active1 & 0x400013L) != 0L) - return 43; - if ((active0 & 0xebfdffe000000000L) != 0L || (active1 & 0x3bfffecL) != 0L) { - if (jjmatchedPos != 2) { - jjmatchedKind = 103; - jjmatchedPos = 2; - } - return 43; - } - return -1; - case 3: - if ((active0 & 0xe3e5e9e000000000L) != 0L || (active1 & 0x31dffcaL) != 0L) { - jjmatchedKind = 103; - jjmatchedPos = 3; - return 43; - } - if ((active0 & 0x818160000000000L) != 0L || (active1 & 0xa20024L) != 0L) - return 43; - return -1; - case 4: - if ((active0 & 0xe02580e000000000L) != 0L || (active1 & 0x111b7caL) != 0L) { - if (jjmatchedPos != 4) { - jjmatchedKind = 103; - jjmatchedPos = 4; - } - return 43; - } - if ((active0 & 0x3c0690000000000L) != 0L || (active1 & 0x20c4800L) != 0L) - return 43; - return -1; - case 5: - if ((active0 & 0x4004004000000000L) != 0L || (active1 & 0x89608L) != 0L) - return 43; - if ((active0 & 0xa12180a000000000L) != 0L || (active1 & 0x11121c2L) != 0L) { - jjmatchedKind = 103; - jjmatchedPos = 5; - return 43; - } - return -1; - case 6: - if ((active0 & 0x121008000000000L) != 0L || (active1 & 0xc0L) != 0L) - return 43; - if ((active0 & 0xa000802000000000L) != 0L || (active1 & 0x1112102L) != 0L) { - jjmatchedKind = 103; - jjmatchedPos = 6; - return 43; - } - return -1; - case 7: - if ((active0 & 0xa000000000000000L) != 0L || (active1 & 0x110102L) != 0L) { - jjmatchedKind = 103; - jjmatchedPos = 7; - return 43; - } - if ((active0 & 0x802000000000L) != 0L || (active1 & 0x1002000L) != 0L) - return 43; - return -1; - case 8: - if ((active1 & 0x100102L) != 0L) - return 43; - if ((active0 & 0xa000000000000000L) != 0L || (active1 & 0x10000L) != 0L) { - jjmatchedKind = 103; - jjmatchedPos = 8; - return 43; - } - return -1; - case 9: - if ((active0 & 0xa000000000000000L) != 0L) - return 43; - if ((active1 & 0x10000L) != 0L) { - jjmatchedKind = 103; - jjmatchedPos = 9; - return 43; - } - return -1; - case 10: - if ((active1 & 0x10000L) != 0L) { - jjmatchedKind = 103; - jjmatchedPos = 10; - return 43; - } - return -1; - default: - return -1; - } - } - - private final int jjStartNfa_0(int pos, long active0, long active1, long active2) { - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); - } - - private int jjStopAtPos(int pos, int kind) { - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; - } - - private int jjMoveStringLiteralDfa0_0() { - switch (curChar) { - case 26: - return jjStopAtPos(0, 156); - case 33: - jjmatchedKind = 118; - return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000000000000L, 0x0L); - case 37: - jjmatchedKind = 137; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x40000L); - case 38: - jjmatchedKind = 134; - return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000000L, 0x8000L); - case 40: - return jjStopAtPos(0, 106); - case 41: - return jjStopAtPos(0, 107); - case 42: - jjmatchedKind = 132; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x2000L); - case 43: - jjmatchedKind = 130; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x801L); - case 44: - return jjStopAtPos(0, 113); - case 45: - jjmatchedKind = 131; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x801002L); - case 46: - jjmatchedKind = 114; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x400000L); - case 47: - jjmatchedKind = 133; - return jjMoveStringLiteralDfa1_0(0x200000000L, 0x0L, 0x4000L); - case 58: - jjmatchedKind = 121; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x1000000L); - case 59: - return jjStopAtPos(0, 112); - case 60: - jjmatchedKind = 117; - return jjMoveStringLiteralDfa1_0(0x0L, 0x800000000000000L, 0x80400L); - case 61: - jjmatchedKind = 116; - return jjMoveStringLiteralDfa1_0(0x0L, 0x400000000000000L, 0x0L); - case 62: - jjmatchedKind = 155; - return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000000L, 0x6300000L); - case 63: - return jjStopAtPos(0, 120); - case 64: - return jjStopAtPos(0, 115); - case 91: - return jjStopAtPos(0, 110); - case 93: - return jjStopAtPos(0, 111); - case 94: - jjmatchedKind = 136; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x20000L); - case 97: - return jjMoveStringLiteralDfa1_0(0x6000000000L, 0x0L, 0x0L); - case 98: - return jjMoveStringLiteralDfa1_0(0x38000000000L, 0x0L, 0x0L); - case 99: - return jjMoveStringLiteralDfa1_0(0xfc0000000000L, 0x0L, 0x0L); - case 100: - return jjMoveStringLiteralDfa1_0(0x7000000000000L, 0x0L, 0x0L); - case 101: - return jjMoveStringLiteralDfa1_0(0x38000000000000L, 0x0L, 0x0L); - case 102: - return jjMoveStringLiteralDfa1_0(0x7c0000000000000L, 0x0L, 0x0L); - case 103: - return jjMoveStringLiteralDfa1_0(0x800000000000000L, 0x0L, 0x0L); - case 105: - return jjMoveStringLiteralDfa1_0(0xf000000000000000L, 0x3L, 0x0L); - case 108: - return jjMoveStringLiteralDfa1_0(0x0L, 0x4L, 0x0L); - case 110: - return jjMoveStringLiteralDfa1_0(0x0L, 0x38L, 0x0L); - case 112: - return jjMoveStringLiteralDfa1_0(0x0L, 0x3c0L, 0x0L); - case 114: - return jjMoveStringLiteralDfa1_0(0x0L, 0x400L, 0x0L); - case 115: - return jjMoveStringLiteralDfa1_0(0x0L, 0x1f800L, 0x0L); - case 116: - return jjMoveStringLiteralDfa1_0(0x0L, 0x7e0000L, 0x0L); - case 118: - return jjMoveStringLiteralDfa1_0(0x0L, 0x1800000L, 0x0L); - case 119: - return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L, 0x0L); - case 123: - return jjStopAtPos(0, 108); - case 124: - jjmatchedKind = 135; - return jjMoveStringLiteralDfa1_0(0x0L, 0x4000000000000000L, 0x10000L); - case 125: - return jjStopAtPos(0, 109); - case 126: - return jjStopAtPos(0, 119); - case 133: - return jjStopAtPos(0, 6); - case 160: - return jjStopAtPos(0, 7); - case 5760: - return jjStopAtPos(0, 8); - case 6158: - return jjStopAtPos(0, 9); - case 8192: - return jjStopAtPos(0, 10); - case 8193: - return jjStopAtPos(0, 11); - case 8194: - return jjStopAtPos(0, 12); - case 8195: - return jjStopAtPos(0, 13); - case 8196: - return jjStopAtPos(0, 14); - case 8197: - return jjStopAtPos(0, 15); - case 8198: - return jjStopAtPos(0, 16); - case 8199: - return jjStopAtPos(0, 17); - case 8200: - return jjStopAtPos(0, 18); - case 8201: - return jjStopAtPos(0, 19); - case 8202: - return jjStopAtPos(0, 20); - case 8203: - return jjStopAtPos(0, 21); - case 8204: - return jjStopAtPos(0, 22); - case 8205: - return jjStopAtPos(0, 23); - case 8232: - return jjStopAtPos(0, 24); - case 8233: - return jjStopAtPos(0, 25); - case 8239: - return jjStopAtPos(0, 26); - case 8287: - return jjStopAtPos(0, 27); - case 8288: - return jjStopAtPos(0, 28); - case 12288: - return jjStopAtPos(0, 29); - case 65279: - return jjStopAtPos(0, 30); - default: - return jjMoveNfa_0(0, 0); - } - } - - private int jjMoveStringLiteralDfa1_0(long active0, long active1, long active2) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0, active1, active2); + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2){ + switch (pos) + { + case 0: + if ((active0 & 0xffffffe000000000L) != 0L || (active1 & 0x3ffffffL) != 0L) + { + jjmatchedKind = 103; + return 43; + } + if ((active0 & 0x200000000L) != 0L || (active2 & 0x4020L) != 0L) + return 45; + if ((active1 & 0x4000000000000L) != 0L || (active2 & 0x400000L) != 0L) return 1; - } - switch (curChar) { - case 38: - if ((active1 & 0x8000000000000000L) != 0L) - return jjStopAtPos(1, 127); - break; - case 42: - if ((active0 & 0x200000000L) != 0L) - return jjStartNfaWithStates_0(1, 33, 50); - break; - case 43: - if ((active2 & 0x1L) != 0L) - return jjStopAtPos(1, 128); - break; - case 45: - if ((active2 & 0x2L) != 0L) - return jjStopAtPos(1, 129); - break; - case 46: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0x400000L); - case 58: - if ((active2 & 0x1000000L) != 0L) - return jjStopAtPos(1, 152); - break; - case 60: - if ((active2 & 0x400L) != 0L) { - jjmatchedKind = 138; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0x80000L); - case 61: - if ((active1 & 0x400000000000000L) != 0L) - return jjStopAtPos(1, 122); - else if ((active1 & 0x800000000000000L) != 0L) - return jjStopAtPos(1, 123); - else if ((active1 & 0x1000000000000000L) != 0L) - return jjStopAtPos(1, 124); - else if ((active1 & 0x2000000000000000L) != 0L) - return jjStopAtPos(1, 125); - else if ((active2 & 0x800L) != 0L) - return jjStopAtPos(1, 139); - else if ((active2 & 0x1000L) != 0L) - return jjStopAtPos(1, 140); - else if ((active2 & 0x2000L) != 0L) - return jjStopAtPos(1, 141); - else if ((active2 & 0x4000L) != 0L) - return jjStopAtPos(1, 142); - else if ((active2 & 0x8000L) != 0L) - return jjStopAtPos(1, 143); - else if ((active2 & 0x10000L) != 0L) - return jjStopAtPos(1, 144); - else if ((active2 & 0x20000L) != 0L) - return jjStopAtPos(1, 145); - else if ((active2 & 0x40000L) != 0L) - return jjStopAtPos(1, 146); - break; - case 62: - if ((active2 & 0x800000L) != 0L) - return jjStopAtPos(1, 151); - else if ((active2 & 0x4000000L) != 0L) { - jjmatchedKind = 154; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0x2300000L); - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x400c0000000000L, active1, 0x48L, active2, 0L); - case 98: - return jjMoveStringLiteralDfa2_0(active0, 0x2000000000L, active1, 0L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000L, active1, 0x410L, active2, 0L); - case 102: - if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(1, 60, 43); - break; - case 104: - return jjMoveStringLiteralDfa2_0(active0, 0x100000000000L, active1, 0x20e0800L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa2_0(active0, 0x180000000000000L, active1, 0L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa2_0(active0, 0x208200000000000L, active1, 0L, active2, 0L); - case 109: - return jjMoveStringLiteralDfa2_0(active0, 0x6000000000000000L, active1, 0L, active2, 0L); - case 110: - return jjMoveStringLiteralDfa2_0(active0, 0x8010000000000000L, active1, 0x3L, active2, 0L); - case 111: - if ((active0 & 0x2000000000000L) != 0L) { - jjmatchedKind = 49; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0xc04c08000000000L, active1, 0x1800004L, active2, 0L); - case 114: - return jjMoveStringLiteralDfa2_0(active0, 0x10000000000L, active1, 0x700180L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa2_0(active0, 0x4000000000L, active1, 0L, active2, 0L); - case 116: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x3000L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x4220L, active2, 0L); - case 119: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x8000L, active2, 0L); - case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x20000000000000L, active1, 0L, active2, 0L); - case 121: - return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L, active1, 0x10000L, active2, 0L); - case 124: - if ((active1 & 0x4000000000000000L) != 0L) - return jjStopAtPos(1, 126); - break; - default: - break; - } - return jjStartNfa_0(0, active0, active1, active2); - } - - private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1, long old2, long active2) { - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(0, old0, old1, old2); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0, active1, active2); - return 2; - } - switch (curChar) { - case 46: - if ((active2 & 0x400000L) != 0L) - return jjStopAtPos(2, 150); - break; - case 61: - if ((active2 & 0x80000L) != 0L) - return jjStopAtPos(2, 147); - else if ((active2 & 0x100000L) != 0L) - return jjStopAtPos(2, 148); - break; - case 62: - if ((active2 & 0x2000000L) != 0L) { - jjmatchedKind = 153; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0L, active2, 0x200000L); - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0x300000000000L, active1, 0x101000L, active2, 0L); - case 98: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x200L, active2, 0L); - case 99: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x40L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x10000000000L, active1, 0L, active2, 0L); - case 102: - return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x2828080L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x40000000000000L, active1, 0x1000020L, active2, 0L); - case 110: - return jjMoveStringLiteralDfa3_0(active0, 0x180c00000000000L, active1, 0x10004L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x200008000000000L, active1, 0x900L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa3_0(active0, 0x6000000000000000L, active1, 0x4000L, active2, 0L); - case 114: - if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 58, 43); - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0xc2000L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa3_0(active0, 0x8008046000000000L, active1, 0L, active2, 0L); - case 116: - if ((active1 & 0x1L) != 0L) { - jjmatchedKind = 64; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x8200a0000000000L, active1, 0x40aL, active2, 0L); - case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x14000000000000L, active1, 0x200000L, active2, 0L); - case 119: - if ((active1 & 0x10L) != 0L) - return jjStartNfaWithStates_0(2, 68, 43); - break; - case 121: - if ((active1 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(2, 86, 43); - break; - default: - break; - } - return jjStartNfa_0(1, active0, active1, active2); - } - - private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1, long old2, long active2) { - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(1, old0, old1, old2); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0, active1, active2); - return 3; - } - switch (curChar) { - case 61: - if ((active2 & 0x200000L) != 0L) - return jjStopAtPos(3, 149); - break; - case 97: - return jjMoveStringLiteralDfa4_0(active0, 0x381010000000000L, active1, 0x1000000L, active2, 0L); - case 98: - return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L, active2, 0L); - case 99: - return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0x10000L, active2, 0L); - case 100: - if ((active1 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(3, 87, 43); - break; - case 101: - if ((active0 & 0x20000000000L) != 0L) - return jjStartNfaWithStates_0(3, 41, 43); - else if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_0(3, 42, 43); - else if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 51, 43); - else if ((active1 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(3, 85, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x20004000000000L, active1, 0x4002L, active2, 0L); - case 103: - if ((active1 & 0x4L) != 0L) - return jjStartNfaWithStates_0(3, 66, 43); - break; - case 105: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x2008L, active2, 0L); - case 107: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x40L, active2, 0L); - case 108: - if ((active1 & 0x20L) != 0L) - return jjStartNfaWithStates_0(3, 69, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x2000008000000000L, active1, 0x2000200L, active2, 0L); - case 109: - if ((active0 & 0x10000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 52, 43); - break; - case 110: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x100000L, active2, 0L); - case 111: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 59, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000000L, active1, 0xc0000L, active2, 0L); - case 114: - if ((active0 & 0x100000000000L) != 0L) - return jjStartNfaWithStates_0(3, 44, 43); - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x800L, active2, 0L); - case 115: - if ((active1 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(3, 81, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x40600000000000L, active1, 0L, active2, 0L); - case 116: - return jjMoveStringLiteralDfa4_0(active0, 0x8000802000000000L, active1, 0x9100L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x400L, active2, 0L); - case 118: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x80L, active2, 0L); - default: - break; - } - return jjStartNfa_0(2, active0, active1, active2); - } - - private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1, long old2, long active2) { - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(2, old0, old1, old2); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0, active1, 0L); - return 4; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0xc0L); - case 99: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0xa000L); - case 101: - if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 54, 43); - else if ((active1 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(4, 89, 43); - return jjMoveStringLiteralDfa5_0(active0, 0x2000008000000000L, active1, 0x100L); - case 104: - if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_0(4, 43, 43); - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10000L); - case 105: - return jjMoveStringLiteralDfa5_0(active0, 0x800000000000L, active1, 0x1200L); - case 107: - if ((active0 & 0x10000000000L) != 0L) - return jjStartNfaWithStates_0(4, 40, 43); - break; - case 108: - if ((active0 & 0x80000000000000L) != 0L) { - jjmatchedKind = 55; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0x104000000000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L, active1, 0L); - case 114: - if ((active1 & 0x4000L) != 0L) - return jjStartNfaWithStates_0(4, 78, 43); - return jjMoveStringLiteralDfa5_0(active0, 0x4000006000000000L, active1, 0x402L); - case 115: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_0(4, 45, 43); - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x100000L); - case 116: - if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(4, 46, 43); - else if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 57, 43); - else if ((active1 & 0x800L) != 0L) - return jjStartNfaWithStates_0(4, 75, 43); - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x1000000L); - case 117: - return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000L, active1, 0L); - case 118: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8L); - case 119: - if ((active1 & 0x40000L) != 0L) { - jjmatchedKind = 82; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x80000L); - default: - break; - } - return jjStartNfa_0(3, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(3, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0, active1, 0L); - return 5; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa6_0(active0, 0xa000000000L, active1, 0L); - case 99: - if ((active1 & 0x200L) != 0L) - return jjStartNfaWithStates_0(5, 73, 43); - else if ((active1 & 0x1000L) != 0L) - return jjStartNfaWithStates_0(5, 76, 43); - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x100L); - case 100: - return jjMoveStringLiteralDfa6_0(active0, 0x20000000000000L, active1, 0L); - case 101: - if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 50, 43); - else if ((active1 & 0x8L) != 0L) - return jjStartNfaWithStates_0(5, 67, 43); - break; - case 102: - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x2L); - case 103: - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x40L); - case 104: - if ((active1 & 0x8000L) != 0L) - return jjStartNfaWithStates_0(5, 79, 43); - break; - case 105: - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x1100000L); - case 108: - return jjMoveStringLiteralDfa6_0(active0, 0x101000000000000L, active1, 0L); - case 109: - return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0L); - case 110: - if ((active1 & 0x400L) != 0L) - return jjStartNfaWithStates_0(5, 74, 43); - return jjMoveStringLiteralDfa6_0(active0, 0x8000800000000000L, active1, 0L); - case 114: - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x10000L); - case 115: - if ((active1 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(5, 83, 43); - break; - case 116: - if ((active0 & 0x4000000000L) != 0L) - return jjStartNfaWithStates_0(5, 38, 43); - else if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 62, 43); - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x2080L); - default: - break; - } - return jjStartNfa_0(4, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(4, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0, active1, 0L); - return 6; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2L); - case 99: - return jjMoveStringLiteralDfa7_0(active0, 0x8000002000000000L, active1, 0L); - case 101: - if ((active1 & 0x40L) != 0L) - return jjStartNfaWithStates_0(6, 70, 43); - else if ((active1 & 0x80L) != 0L) - return jjStartNfaWithStates_0(6, 71, 43); - return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000000L, active1, 0x100000L); - case 102: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2000L); - case 108: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1000000L); - case 110: - if ((active0 & 0x8000000000L) != 0L) - return jjStartNfaWithStates_0(6, 39, 43); - break; - case 111: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x10000L); - case 115: - if ((active0 & 0x20000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 53, 43); - break; - case 116: - if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 48, 43); - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x100L); - case 117: - return jjMoveStringLiteralDfa7_0(active0, 0x800000000000L, active1, 0L); - case 121: - if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 56, 43); - break; - default: - break; - } - return jjStartNfa_0(5, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(5, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0, active1, 0L); - return 7; - } - switch (curChar) { - case 99: - return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x2L); - case 101: - if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(7, 47, 43); - else if ((active1 & 0x1000000L) != 0L) - return jjStartNfaWithStates_0(7, 88, 43); - return jjMoveStringLiteralDfa8_0(active0, 0x8000000000000000L, active1, 0x100L); - case 110: - return jjMoveStringLiteralDfa8_0(active0, 0x2000000000000000L, active1, 0x110000L); - case 112: - if ((active1 & 0x2000L) != 0L) - return jjStartNfaWithStates_0(7, 77, 43); - break; - case 116: - if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_0(7, 37, 43); - break; - default: - break; - } - return jjStartNfa_0(6, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(6, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0, active1, 0L); - return 8; - } - switch (curChar) { - case 100: - if ((active1 & 0x100L) != 0L) - return jjStartNfaWithStates_0(8, 72, 43); - break; - case 101: - if ((active1 & 0x2L) != 0L) - return jjStartNfaWithStates_0(8, 65, 43); - break; - case 105: - return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x10000L); - case 111: - return jjMoveStringLiteralDfa9_0(active0, 0x8000000000000000L, active1, 0L); - case 116: - if ((active1 & 0x100000L) != 0L) - return jjStartNfaWithStates_0(8, 84, 43); - return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000000L, active1, 0L); - default: - break; - } - return jjStartNfa_0(7, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(7, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0, active1, 0L); - return 9; - } - switch (curChar) { - case 102: - if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(9, 63, 43); - break; - case 115: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(9, 61, 43); - break; - case 122: - return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x10000L); - default: - break; - } - return jjStartNfa_0(8, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa10_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(8, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(9, 0L, active1, 0L); - return 10; - } - switch (curChar) { - case 101: - return jjMoveStringLiteralDfa11_0(active1, 0x10000L); - default: - break; - } - return jjStartNfa_0(9, 0L, active1, 0L); - } - - private int jjMoveStringLiteralDfa11_0(long old1, long active1) { - if (((active1 &= old1)) == 0L) - return jjStartNfa_0(9, 0L, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(10, 0L, active1, 0L); - return 11; - } - switch (curChar) { - case 100: - if ((active1 & 0x10000L) != 0L) - return jjStartNfaWithStates_0(11, 80, 43); - break; - default: - break; - } - return jjStartNfa_0(10, 0L, active1, 0L); - } - - private int jjStartNfaWithStates_0(int pos, int kind, int state) { - jjmatchedKind = kind; - jjmatchedPos = pos; - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return pos + 1; - } - return jjMoveNfa_0(state, pos + 1); - } - - static final long[] jjbitVec0 = { - 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec2 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec3 = { - 0xfff0000000200002L, 0xffffffffffffdfffL, 0xfffff00f7fffffffL, 0x12000000007fffffL - }; - static final long[] jjbitVec4 = { - 0x0L, 0x0L, 0x420043c00000000L, 0xff7fffffff7fffffL - }; - static final long[] jjbitVec5 = { - 0x7fffffffffffffL, 0xffffffffffff0000L, 0xffffffffffffffffL, 0x401f0003ffc3L - }; - static final long[] jjbitVec6 = { - 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xfbfffffffff7fffL - }; - static final long[] jjbitVec7 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc03L, 0x33fffffffff7fffL - }; - static final long[] jjbitVec8 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L - }; - static final long[] jjbitVec9 = { - 0x7fffffe00000000L, 0xfffec000000007ffL, 0xffffffffffffffffL, 0x9c00c060002fffffL - }; - static final long[] jjbitVec10 = { - 0xfffffffd0000L, 0xe000L, 0x2003fffffffffL, 0x0L - }; - static final long[] jjbitVec11 = { - 0x23fffffffffffff0L, 0x3ff010000L, 0x23c5fdfffff99fe0L, 0xf0003b0000000L - }; - static final long[] jjbitVec12 = { - 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbbfe0L, 0x2000300010000L - }; - static final long[] jjbitVec13 = { - 0x23edfdfffff99fe0L, 0x20003b0000000L, 0x3bfc718d63dc7e8L, 0x200000000000000L - }; - static final long[] jjbitVec14 = { - 0x3effdfffffddfe0L, 0x300000000L, 0x23effdfffffddfe0L, 0x340000000L - }; - static final long[] jjbitVec15 = { - 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL - }; - static final long[] jjbitVec16 = { - 0x800dfffffffffffeL, 0x7fL, 0x200decaefef02596L, 0x3000005fL - }; - static final long[] jjbitVec17 = { - 0x1L, 0x7fffffffeffL, 0xf00L, 0x0L - }; - static final long[] jjbitVec18 = { - 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x1ffffffffff003fL - }; - static final long[] jjbitVec19 = { - 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL - }; - static final long[] jjbitVec20 = { - 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL - }; - static final long[] jjbitVec21 = { - 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL - }; - static final long[] jjbitVec22 = { - 0xffffffffffffffffL, 0x7f9fffffffffffL, 0xffffffff07fffffeL, 0x1c7ffffffffffL - }; - static final long[] jjbitVec23 = { - 0x3ffff0003dfffL, 0x1dfff0003ffffL, 0xfffffffffffffL, 0x18800000L - }; - static final long[] jjbitVec24 = { - 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L - }; - static final long[] jjbitVec25 = { - 0x1fffffffL, 0x1f3fffffff0000L, 0x0L, 0x0L - }; - static final long[] jjbitVec26 = { - 0xffffffffffffffffL, 0xfffffffffffL, 0x0L, 0x0L - }; - static final long[] jjbitVec27 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL - }; - static final long[] jjbitVec28 = { - 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL - }; - static final long[] jjbitVec29 = { - 0x8000000000000000L, 0x8002000000100001L, 0x3ffff00000000L, 0x0L - }; - static final long[] jjbitVec30 = { - 0xe3fbbd503e2ffc84L, 0xffffffff000003e0L, 0xfL, 0x0L - }; - static final long[] jjbitVec31 = { - 0x1f3e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffee07fffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec32 = { - 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0xffff000000000000L - }; - static final long[] jjbitVec33 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffL, 0x0L - }; - static final long[] jjbitVec34 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L - }; - static final long[] jjbitVec35 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L - }; - static final long[] jjbitVec36 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L - }; - static final long[] jjbitVec37 = { - 0x6L, 0x0L, 0x0L, 0x0L - }; - static final long[] jjbitVec38 = { - 0xffff3fffffffffffL, 0x7ffffffffffL, 0x0L, 0x0L - }; - static final long[] jjbitVec39 = { - 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L - }; - static final long[] jjbitVec40 = { - 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0x1fff0000000000ffL - }; - static final long[] jjbitVec41 = { - 0x18000000000000L, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL - }; - static final long[] jjbitVec42 = { - 0x87fffffe00000010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x631cfcfcfcL - }; - static final long[] jjbitVec43 = { - 0x0L, 0x0L, 0x420243cffffffffL, 0xff7fffffff7fffffL - }; - static final long[] jjbitVec44 = { - 0xffffffffffffffffL, 0x400ffffe0ffffffL, 0xfffffffbffffd740L, 0xfbfffffffff7fffL - }; - static final long[] jjbitVec45 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc7bL, 0x33fffffffff7fffL - }; - static final long[] jjbitVec46 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L - }; - static final long[] jjbitVec47 = { - 0x7fffffe003f000fL, 0xffffc3ff01ffffffL, 0xffffffffffffffffL, 0x9ffffdffbfefffffL - }; - static final long[] jjbitVec48 = { - 0xffffffffffff8000L, 0xe7ffL, 0x3ffffffffffffL, 0x0L - }; - static final long[] jjbitVec49 = { - 0xf3fffffffffffffeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0xfffcfb080399fL - }; - static final long[] jjbitVec50 = { - 0xd36dfdfffff987eeL, 0x1fffc05e003987L, 0xf3edfdfffffbbfeeL, 0x2ffcf00013bbfL - }; - static final long[] jjbitVec51 = { - 0xf3edfdfffff99feeL, 0x2ffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0x200ff8000803dc7L - }; - static final long[] jjbitVec52 = { - 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xf3effdfffffddfecL, 0xffc340603ddfL - }; - static final long[] jjbitVec53 = { - 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL - }; - static final long[] jjbitVec54 = { - 0x87fffffffffffffeL, 0x3ff7fffL, 0x3bffecaefef02596L, 0x33ff3f5fL - }; - static final long[] jjbitVec55 = { - 0xc2a003ff03000001L, 0xfffe07fffffffeffL, 0x1ffffffffeff0fdfL, 0x40L - }; - static final long[] jjbitVec56 = { - 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x1ffffffffff003fL - }; - static final long[] jjbitVec57 = { - 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL - }; - static final long[] jjbitVec58 = { - 0x1fffff001fdfffL, 0xddfff000fffffL, 0xffffffffffffffffL, 0x3ff388fffffL - }; - static final long[] jjbitVec59 = { - 0xffffffff03ff3800L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L - }; - static final long[] jjbitVec60 = { - 0xfff0fff1fffffffL, 0x1f3fffffffffc0L, 0x0L, 0x0L - }; - static final long[] jjbitVec61 = { - 0x80007c000000f000L, 0x8002fc0f00100001L, 0x3ffff00000000L, 0x7e21fff0000L - }; - static final long[] jjbitVec62 = { - 0x1f3efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffee67fffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec63 = { - 0x10000000000006L, 0x0L, 0x0L, 0x0L - }; - static final long[] jjbitVec64 = { - 0x3L, 0x0L, 0x0L, 0x0L - }; - static final long[] jjbitVec65 = { - 0x0L, 0x800000000000000L, 0x0L, 0x0L - }; - static final long[] jjbitVec66 = { - 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L - }; - static final long[] jjbitVec67 = { - 0x18000f0000ffffL, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x9fffffffffffffffL - }; - static final long[] jjbitVec68 = { - 0x87fffffe03ff0010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0xe0000631cfcfcfcL - }; - - private int jjMoveNfa_0(int startState, int curPos) { - int startsAt = 0; - jjnewStateCnt = 130; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (; ; ) { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) { - long l = 1L << curChar; - do { - switch (jjstateSet[--i]) { - case 45: - if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 50; - else if (curChar == 47) { - if (kind > 31) - kind = 31; - { - jjCheckNAddStates(0, 2); - } - } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) { - if (kind > 91) - kind = 91; - { - jjCheckNAddStates(3, 17); - } - } else if (curChar == 47) { - jjAddStates(18, 19); - } else if (curChar == 36) { - if (kind > 103) - kind = 103; - { - jjCheckNAdd(43); - } - } else if (curChar == 34) { - jjCheckNAddStates(20, 23); - } else if (curChar == 39) { - jjAddStates(24, 26); - } else if (curChar == 46) { - jjCheckNAdd(1); - } - if (curChar == 48) { - jjAddStates(27, 34); - } - break; - case 1: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(35, 38); - } - break; - case 2: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(2, 3); - } - break; - case 3: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(39, 41); - } - break; - case 5: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(6); - } - break; - case 6: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(42, 44); - } - break; - case 7: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(7, 8); - } - break; - case 8: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddTwoStates(6, 9); - } - break; - case 10: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(45, 48); - } - break; - case 11: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(49, 53); - } - break; - case 12: - if (curChar == 39) { - jjAddStates(24, 26); - } - break; - case 13: - if ((0xffffff7fffffdbffL & l) != 0L) { - jjCheckNAdd(14); - } - break; - case 14: - if (curChar == 39 && kind > 101) - kind = 101; - break; - case 16: - if ((0x8400000000L & l) != 0L) { - jjCheckNAdd(14); - } - break; - case 17: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(18, 14); - } - break; - case 18: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(14); - } - break; - case 19: - if ((0xf000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 20; - break; - case 20: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(18); - } - break; - case 22: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 23; - break; - case 23: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 24; - break; - case 24: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 25: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAdd(14); - } - break; - case 27: - if (curChar == 34) { - jjCheckNAddStates(20, 23); - } - break; - case 28: - if ((0xfffffffbffffdbffL & l) != 0L) { - jjCheckNAddStates(20, 23); - } - break; - case 30: - if ((0x8400000000L & l) != 0L) { - jjCheckNAddStates(20, 23); - } - break; - case 32: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 33; - break; - case 33: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 34; - break; - case 34: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 35; - break; - case 35: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(20, 23); - } - break; - case 37: - if (curChar == 34 && kind > 102) - kind = 102; - break; - case 38: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(54, 58); - } - break; - case 39: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(20, 23); - } - break; - case 40: - if ((0xf000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 41; - break; - case 41: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(39); - } - break; - case 42: - if (curChar != 36) - break; - if (kind > 103) - kind = 103; - { - jjCheckNAdd(43); - } - break; - case 43: - if ((0x3ff00100fffc1ffL & l) == 0L) - break; - if (kind > 103) - kind = 103; - { - jjCheckNAdd(43); - } - break; - case 44: - if (curChar == 47) { - jjAddStates(18, 19); - } - break; - case 46: - if ((0xffffffffffffdbffL & l) == 0L) - break; - if (kind > 31) - kind = 31; - { - jjCheckNAddStates(0, 2); - } - break; - case 47: - if ((0x2400L & l) != 0L && kind > 31) - kind = 31; - break; - case 48: - if (curChar == 10 && kind > 31) - kind = 31; - break; - case 49: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 48; - break; - case 50: - if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 51; - break; - case 51: - if ((0xffff7fffffffffffL & l) != 0L && kind > 32) - kind = 32; - break; - case 52: - if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 50; - break; - case 53: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 91) - kind = 91; - { - jjCheckNAddStates(3, 17); - } - break; - case 54: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(54, 55); - } - break; - case 55: - case 98: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAdd(56); - } - break; - case 57: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(57, 58); - } - break; - case 58: - case 109: - if ((0x3ff000000000000L & l) != 0L && kind > 91) - kind = 91; - break; - case 59: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(59, 60); - } - break; - case 60: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(59, 61); - } - break; - case 61: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(62, 65); - } - break; - case 63: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(64); - } - break; - case 64: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(66, 68); - } - break; - case 65: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(65, 66); - } - break; - case 66: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(64, 9); - } - break; - case 67: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(69, 72); - } - break; - case 68: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(73, 77); - } - break; - case 69: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(69, 70); - } - break; - case 70: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(71, 72); - } - break; - case 71: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(78, 80); - } - break; - case 73: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(74); - } - break; - case 74: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(81, 83); - } - break; - case 75: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(75, 76); - } - break; - case 76: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddTwoStates(74, 9); - } - break; - case 77: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(84, 87); - } - break; - case 78: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(88, 91); - } - break; - case 79: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(79, 80); - } - break; - case 80: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(81, 82); - } - break; - case 81: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(92, 94); - } - break; - case 82: - if (curChar != 46) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(95, 97); - } - break; - case 83: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(98, 101); - } - break; - case 84: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(84, 85); - } - break; - case 85: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(95, 97); - } - break; - case 87: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(88); - } - break; - case 88: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(102, 104); - } - break; - case 89: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(89, 90); - } - break; - case 90: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddTwoStates(88, 9); - } - break; - case 91: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(105, 108); - } - break; - case 92: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddStates(109, 113); - } - break; - case 93: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(114, 117); - } - break; - case 94: - if (curChar == 48) { - jjAddStates(27, 34); - } - break; - case 96: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(118, 120); - } - break; - case 97: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(97, 98); - } - break; - case 99: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(121, 123); - } - break; - case 100: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(100, 101); - } - break; - case 101: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(56); - } - break; - case 103: - if ((0x3000000000000L & l) != 0L) { - jjCheckNAddStates(124, 126); - } - break; - case 104: - if ((0x3000000000000L & l) != 0L) { - jjCheckNAddTwoStates(104, 105); - } - break; - case 105: - if ((0x3000000000000L & l) != 0L) { - jjCheckNAdd(56); - } - break; - case 107: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 91) - kind = 91; - { - jjCheckNAddTwoStates(108, 109); - } - break; - case 108: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(108, 109); - } - break; - case 110: - if ((0xff000000000000L & l) == 0L) - break; - if (kind > 91) - kind = 91; - { - jjCheckNAddTwoStates(111, 112); - } - break; - case 111: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(111, 112); - } - break; - case 112: - if ((0xff000000000000L & l) != 0L && kind > 91) - kind = 91; - break; - case 114: - if ((0x3000000000000L & l) == 0L) - break; - if (kind > 91) - kind = 91; - { - jjCheckNAddTwoStates(115, 116); - } - break; - case 115: - if ((0x3000000000000L & l) != 0L) { - jjCheckNAddTwoStates(115, 116); - } - break; - case 116: - if ((0x3000000000000L & l) != 0L && kind > 91) - kind = 91; - break; - case 118: - if ((0x3ff000000000000L & l) != 0L) { - jjAddStates(127, 128); - } - break; - case 119: - if (curChar == 46) { - jjCheckNAdd(120); - } - break; - case 120: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(120, 121); - } - break; - case 122: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(123); - } - break; - case 123: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddTwoStates(123, 9); - } - break; - case 125: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(129, 131); - } - break; - case 126: - if (curChar == 46) { - jjCheckNAdd(127); - } - break; - case 128: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(129); - } - break; - case 129: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { - jjCheckNAddTwoStates(129, 9); - } - break; - default: - break; - } - } while (i != startsAt); - } else if (curChar < 128) { - long l = 1L << (curChar & 077); - do { - switch (jjstateSet[--i]) { - case 0: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 103) - kind = 103; - { - jjCheckNAdd(43); - } - break; - case 2: - if (curChar == 95) { - jjAddStates(132, 133); - } - break; - case 4: - if ((0x2000000020L & l) != 0L) { - jjAddStates(134, 135); - } - break; - case 7: - if (curChar == 95) { - jjAddStates(136, 137); - } - break; - case 9: - if ((0x5000000050L & l) != 0L && kind > 96) - kind = 96; - break; - case 13: - if ((0xffffffffefffffffL & l) != 0L) { - jjCheckNAdd(14); - } - break; - case 15: - if (curChar == 92) { - jjAddStates(138, 140); - } - break; - case 16: - if ((0x14404410000000L & l) != 0L) { - jjCheckNAdd(14); - } - break; - case 21: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 22; - break; - case 22: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 23; - break; - case 23: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 24; - break; - case 24: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 25: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAdd(14); - } - break; - case 26: - if (curChar == 92) - jjstateSet[jjnewStateCnt++] = 21; - break; - case 28: - if ((0xffffffffefffffffL & l) != 0L) { - jjCheckNAddStates(20, 23); - } - break; - case 29: - if (curChar == 92) { - jjAddStates(141, 143); - } - break; - case 30: - if ((0x14404410000000L & l) != 0L) { - jjCheckNAddStates(20, 23); - } - break; - case 31: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 32; - break; - case 32: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 33; - break; - case 33: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 34; - break; - case 34: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 35; - break; - case 35: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddStates(20, 23); - } - break; - case 36: - if (curChar == 92) - jjstateSet[jjnewStateCnt++] = 31; - break; - case 43: - if ((0x87fffffe87fffffeL & l) == 0L) - break; - if (kind > 103) - kind = 103; - { - jjCheckNAdd(43); - } - break; - case 46: - if (kind > 31) - kind = 31; - { - jjAddStates(0, 2); - } - break; - case 51: - if (kind > 32) - kind = 32; - break; - case 54: - if (curChar == 95) { - jjAddStates(144, 145); - } - break; - case 56: - if ((0x100000001000L & l) != 0L && kind > 90) - kind = 90; - break; - case 57: - if (curChar == 95) { - jjAddStates(146, 147); - } - break; - case 59: - if (curChar == 95) { - jjAddStates(148, 149); - } - break; - case 62: - if ((0x2000000020L & l) != 0L) { - jjAddStates(150, 151); - } - break; - case 65: - if (curChar == 95) { - jjAddStates(152, 153); - } - break; - case 69: - if (curChar == 95) { - jjAddStates(154, 155); - } - break; - case 72: - if ((0x2000000020L & l) != 0L) { - jjAddStates(156, 157); - } - break; - case 75: - if (curChar == 95) { - jjAddStates(158, 159); - } - break; - case 79: - if (curChar == 95) { - jjAddStates(160, 161); - } - break; - case 84: - if (curChar == 95) { - jjAddStates(162, 163); - } - break; - case 86: - if ((0x2000000020L & l) != 0L) { - jjAddStates(164, 165); - } - break; - case 89: - if (curChar == 95) { - jjAddStates(166, 167); - } - break; - case 95: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; - break; - case 96: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddStates(118, 120); - } - break; - case 97: - if ((0x7e8000007eL & l) != 0L) { - jjCheckNAddTwoStates(97, 98); - } - break; - case 98: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAdd(56); - } - break; - case 100: - if (curChar == 95) { - jjAddStates(168, 169); - } - break; - case 102: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 103; - break; - case 104: - if (curChar == 95) { - jjAddStates(170, 171); - } - break; - case 106: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 107; - break; - case 107: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 91) - kind = 91; - { - jjCheckNAddTwoStates(108, 109); - } - break; - case 108: - if ((0x7e8000007eL & l) != 0L) { - jjCheckNAddTwoStates(108, 109); - } - break; - case 109: - if ((0x7e0000007eL & l) != 0L && kind > 91) - kind = 91; - break; - case 111: - if (curChar == 95) { - jjAddStates(172, 173); - } - break; - case 113: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 114; - break; - case 115: - if (curChar == 95) { - jjAddStates(174, 175); - } - break; - case 117: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAddTwoStates(118, 119); - } - break; - case 118: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddTwoStates(118, 119); - } - break; - case 120: - if ((0x7e0000007eL & l) != 0L) { - jjAddStates(176, 177); - } - break; - case 121: - if ((0x1000000010000L & l) != 0L) { - jjAddStates(178, 179); - } - break; - case 124: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAdd(125); - } - break; - case 125: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddStates(129, 131); - } - break; - case 127: - if ((0x1000000010000L & l) != 0L) { - jjAddStates(180, 181); - } - break; - default: - break; - } - } while (i != startsAt); - } else { - int hiByte = (curChar >> 8); - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do { - switch (jjstateSet[--i]) { - case 0: - if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) - break; - if (kind > 103) - kind = 103; - { - jjCheckNAdd(43); - } - break; - case 13: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - jjstateSet[jjnewStateCnt++] = 14; - break; - case 28: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - jjAddStates(20, 23); - } - break; - case 43: - if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) - break; - if (kind > 103) - kind = 103; - { - jjCheckNAdd(43); - } - break; - case 46: - if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) - break; - if (kind > 31) - kind = 31; - { - jjAddStates(0, 2); - } - break; - case 51: - if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 32) - kind = 32; - break; - default: - if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; - else break; - } - } while (i != startsAt); + return -1; + case 1: + if ((active0 & 0xeff9ffe000000000L) != 0L || (active1 & 0x3ffffffL) != 0L) + { + if (jjmatchedPos != 1) + { + jjmatchedKind = 103; + jjmatchedPos = 1; } - if (kind != 0x7fffffff) { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; + return 43; + } + if ((active0 & 0x1006000000000000L) != 0L) + return 43; + if ((active0 & 0x200000000L) != 0L) + return 50; + return -1; + case 2: + if ((active0 & 0x400000000000000L) != 0L || (active1 & 0x400013L) != 0L) + return 43; + if ((active0 & 0xebfdffe000000000L) != 0L || (active1 & 0x3bfffecL) != 0L) + { + if (jjmatchedPos != 2) + { + jjmatchedKind = 103; + jjmatchedPos = 2; } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 130 - (jjnewStateCnt = startsAt))) - return curPos; - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return curPos; + return 43; + } + return -1; + case 3: + if ((active0 & 0xe3e5e9e000000000L) != 0L || (active1 & 0x31dffcaL) != 0L) + { + jjmatchedKind = 103; + jjmatchedPos = 3; + return 43; + } + if ((active0 & 0x818160000000000L) != 0L || (active1 & 0xa20024L) != 0L) + return 43; + return -1; + case 4: + if ((active0 & 0xe02580e000000000L) != 0L || (active1 & 0x111b7caL) != 0L) + { + if (jjmatchedPos != 4) + { + jjmatchedKind = 103; + jjmatchedPos = 4; } - } - } - - private int jjMoveStringLiteralDfa0_2() { - switch (curChar) { - case 42: - return jjMoveStringLiteralDfa1_2(0x800000000L); - default: - return 1; - } - } - - private int jjMoveStringLiteralDfa1_2(long active0) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return 1; - } - switch (curChar) { - case 47: - if ((active0 & 0x800000000L) != 0L) - return jjStopAtPos(1, 35); - break; - default: - return 2; - } - return 2; - } - - private int jjMoveStringLiteralDfa0_1() { - switch (curChar) { - case 42: - return jjMoveStringLiteralDfa1_1(0x400000000L); - default: - return 1; - } - } - - private int jjMoveStringLiteralDfa1_1(long active0) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return 1; - } - switch (curChar) { - case 47: - if ((active0 & 0x400000000L) != 0L) - return jjStopAtPos(1, 34); - break; - default: - return 2; - } - return 2; - } - - static final int[] jjnextStates = { - 46, 47, 49, 54, 55, 56, 57, 58, 59, 62, 9, 69, 72, 79, 82, 93, - 78, 68, 45, 52, 28, 29, 36, 37, 13, 15, 26, 95, 99, 102, 106, 110, - 113, 117, 124, 2, 4, 9, 11, 1, 4, 9, 7, 9, 10, 6, 7, 9, - 10, 1, 2, 4, 9, 11, 28, 29, 39, 36, 37, 61, 62, 9, 59, 62, - 9, 68, 65, 9, 67, 64, 65, 9, 67, 61, 59, 62, 9, 68, 69, 72, - 78, 75, 9, 77, 74, 75, 9, 77, 71, 69, 72, 78, 79, 82, 93, 83, - 86, 9, 84, 86, 9, 92, 89, 9, 91, 88, 89, 9, 91, 83, 84, 86, - 9, 92, 81, 79, 82, 93, 97, 98, 56, 100, 101, 56, 104, 105, 56, 118, - 119, 125, 126, 127, 2, 3, 5, 6, 7, 8, 16, 17, 19, 30, 38, 40, - 54, 55, 57, 58, 59, 60, 63, 64, 65, 66, 69, 70, 73, 74, 75, 76, - 79, 80, 84, 85, 87, 88, 89, 90, 100, 101, 104, 105, 111, 112, 115, 116, - 120, 121, 122, 123, 128, 129, - }; - - private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec2[i2] & l2) != 0L); - default: - if ((jjbitVec0[i1] & l1) != 0L) - return true; - return false; - } - } - - private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec4[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec6[i2] & l2) != 0L); - case 4: - return ((jjbitVec7[i2] & l2) != 0L); - case 5: - return ((jjbitVec8[i2] & l2) != 0L); - case 6: - return ((jjbitVec9[i2] & l2) != 0L); - case 7: - return ((jjbitVec10[i2] & l2) != 0L); - case 9: - return ((jjbitVec11[i2] & l2) != 0L); - case 10: - return ((jjbitVec12[i2] & l2) != 0L); - case 11: - return ((jjbitVec13[i2] & l2) != 0L); - case 12: - return ((jjbitVec14[i2] & l2) != 0L); - case 13: - return ((jjbitVec15[i2] & l2) != 0L); - case 14: - return ((jjbitVec16[i2] & l2) != 0L); - case 15: - return ((jjbitVec17[i2] & l2) != 0L); - case 16: - return ((jjbitVec18[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec21[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec23[i2] & l2) != 0L); - case 24: - return ((jjbitVec24[i2] & l2) != 0L); - case 25: - return ((jjbitVec25[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec29[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec31[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec37[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec39[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec41[i2] & l2) != 0L); - case 255: - return ((jjbitVec42[i2] & l2) != 0L); - default: - if ((jjbitVec3[i1] & l1) != 0L) - return true; - return false; - } - } - - private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec43[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec44[i2] & l2) != 0L); - case 4: - return ((jjbitVec45[i2] & l2) != 0L); - case 5: - return ((jjbitVec46[i2] & l2) != 0L); - case 6: - return ((jjbitVec47[i2] & l2) != 0L); - case 7: - return ((jjbitVec48[i2] & l2) != 0L); - case 9: - return ((jjbitVec49[i2] & l2) != 0L); - case 10: - return ((jjbitVec50[i2] & l2) != 0L); - case 11: - return ((jjbitVec51[i2] & l2) != 0L); - case 12: - return ((jjbitVec52[i2] & l2) != 0L); - case 13: - return ((jjbitVec53[i2] & l2) != 0L); - case 14: - return ((jjbitVec54[i2] & l2) != 0L); - case 15: - return ((jjbitVec55[i2] & l2) != 0L); - case 16: - return ((jjbitVec56[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec57[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec58[i2] & l2) != 0L); - case 24: - return ((jjbitVec59[i2] & l2) != 0L); - case 25: - return ((jjbitVec60[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec61[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec62[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec63[i2] & l2) != 0L); - case 220: - return ((jjbitVec64[i2] & l2) != 0L); - case 221: - return ((jjbitVec65[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec66[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec67[i2] & l2) != 0L); - case 255: - return ((jjbitVec68[i2] & l2) != 0L); - default: - if ((jjbitVec3[i1] & l1) != 0L) - return true; - return false; - } - } - - /** - * Token literal values. - */ - public static final String[] jjstrLiteralImages = { - "", null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, - "\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156", - "\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150", - "\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164", - "\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145", - "\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145", - "\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162", - "\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163", - "\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164", - "\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167", - "\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145", - "\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156", - "\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160", - "\163\165\160\145\162", "\163\167\151\164\143\150", - "\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163", - "\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144", - "\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, "\50", "\51", "\173", "\175", "\133", - "\135", "\73", "\54", "\56", "\100", "\75", "\74", "\41", "\176", "\77", "\72", - "\75\75", "\74\75", "\76\75", "\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", - "\55", "\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\53\75", "\55\75", - "\52\75", "\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", - "\76\76\76\75", "\56\56\56", "\55\76", "\72\72", "\76\76\76", "\76\76", "\76", "\32",}; - - protected Token jjFillToken() { - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = ASTParser.GTToken.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; - } - - int curLexState = 0; - int defaultLexState = 0; - int jjnewStateCnt; - int jjround; - int jjmatchedPos; - int jjmatchedKind; - - /** - * Get the next Token. - */ - public Token getNextToken() { - Token specialToken = null; - Token matchedToken; - int curPos = 0; - - EOFLoop: - for (; ; ) { - try { - curChar = input_stream.BeginToken(); - } catch (Exception e) { - jjmatchedKind = 0; - jjmatchedPos = -1; - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - CommonTokenAction(matchedToken); - return matchedToken; + return 43; + } + if ((active0 & 0x3c0690000000000L) != 0L || (active1 & 0x20c4800L) != 0L) + return 43; + return -1; + case 5: + if ((active0 & 0x4004004000000000L) != 0L || (active1 & 0x89608L) != 0L) + return 43; + if ((active0 & 0xa12180a000000000L) != 0L || (active1 & 0x11121c2L) != 0L) + { + jjmatchedKind = 103; + jjmatchedPos = 5; + return 43; + } + return -1; + case 6: + if ((active0 & 0x121008000000000L) != 0L || (active1 & 0xc0L) != 0L) + return 43; + if ((active0 & 0xa000802000000000L) != 0L || (active1 & 0x1112102L) != 0L) + { + jjmatchedKind = 103; + jjmatchedPos = 6; + return 43; + } + return -1; + case 7: + if ((active0 & 0xa000000000000000L) != 0L || (active1 & 0x110102L) != 0L) + { + jjmatchedKind = 103; + jjmatchedPos = 7; + return 43; + } + if ((active0 & 0x802000000000L) != 0L || (active1 & 0x1002000L) != 0L) + return 43; + return -1; + case 8: + if ((active1 & 0x100102L) != 0L) + return 43; + if ((active0 & 0xa000000000000000L) != 0L || (active1 & 0x10000L) != 0L) + { + jjmatchedKind = 103; + jjmatchedPos = 8; + return 43; + } + return -1; + case 9: + if ((active0 & 0xa000000000000000L) != 0L) + return 43; + if ((active1 & 0x10000L) != 0L) + { + jjmatchedKind = 103; + jjmatchedPos = 9; + return 43; + } + return -1; + case 10: + if ((active1 & 0x10000L) != 0L) + { + jjmatchedKind = 103; + jjmatchedPos = 10; + return 43; + } + return -1; + default : + return -1; + } +} +private final int jjStartNfa_0(int pos, long active0, long active1, long active2){ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); +} +private int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +private int jjMoveStringLiteralDfa0_0(){ + switch(curChar) + { + case 26: + return jjStopAtPos(0, 156); + case 33: + jjmatchedKind = 118; + return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000000000000L, 0x0L); + case 37: + jjmatchedKind = 137; + return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x40000L); + case 38: + jjmatchedKind = 134; + return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000000L, 0x8000L); + case 40: + return jjStopAtPos(0, 106); + case 41: + return jjStopAtPos(0, 107); + case 42: + jjmatchedKind = 132; + return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x2000L); + case 43: + jjmatchedKind = 130; + return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x801L); + case 44: + return jjStopAtPos(0, 113); + case 45: + jjmatchedKind = 131; + return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x801002L); + case 46: + jjmatchedKind = 114; + return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x400000L); + case 47: + jjmatchedKind = 133; + return jjMoveStringLiteralDfa1_0(0x200000000L, 0x0L, 0x4000L); + case 58: + jjmatchedKind = 121; + return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x1000000L); + case 59: + return jjStopAtPos(0, 112); + case 60: + jjmatchedKind = 117; + return jjMoveStringLiteralDfa1_0(0x0L, 0x800000000000000L, 0x80400L); + case 61: + jjmatchedKind = 116; + return jjMoveStringLiteralDfa1_0(0x0L, 0x400000000000000L, 0x0L); + case 62: + jjmatchedKind = 155; + return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000000L, 0x6300000L); + case 63: + return jjStopAtPos(0, 120); + case 64: + return jjStopAtPos(0, 115); + case 91: + return jjStopAtPos(0, 110); + case 93: + return jjStopAtPos(0, 111); + case 94: + jjmatchedKind = 136; + return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x20000L); + case 97: + return jjMoveStringLiteralDfa1_0(0x6000000000L, 0x0L, 0x0L); + case 98: + return jjMoveStringLiteralDfa1_0(0x38000000000L, 0x0L, 0x0L); + case 99: + return jjMoveStringLiteralDfa1_0(0xfc0000000000L, 0x0L, 0x0L); + case 100: + return jjMoveStringLiteralDfa1_0(0x7000000000000L, 0x0L, 0x0L); + case 101: + return jjMoveStringLiteralDfa1_0(0x38000000000000L, 0x0L, 0x0L); + case 102: + return jjMoveStringLiteralDfa1_0(0x7c0000000000000L, 0x0L, 0x0L); + case 103: + return jjMoveStringLiteralDfa1_0(0x800000000000000L, 0x0L, 0x0L); + case 105: + return jjMoveStringLiteralDfa1_0(0xf000000000000000L, 0x3L, 0x0L); + case 108: + return jjMoveStringLiteralDfa1_0(0x0L, 0x4L, 0x0L); + case 110: + return jjMoveStringLiteralDfa1_0(0x0L, 0x38L, 0x0L); + case 112: + return jjMoveStringLiteralDfa1_0(0x0L, 0x3c0L, 0x0L); + case 114: + return jjMoveStringLiteralDfa1_0(0x0L, 0x400L, 0x0L); + case 115: + return jjMoveStringLiteralDfa1_0(0x0L, 0x1f800L, 0x0L); + case 116: + return jjMoveStringLiteralDfa1_0(0x0L, 0x7e0000L, 0x0L); + case 118: + return jjMoveStringLiteralDfa1_0(0x0L, 0x1800000L, 0x0L); + case 119: + return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L, 0x0L); + case 123: + return jjStopAtPos(0, 108); + case 124: + jjmatchedKind = 135; + return jjMoveStringLiteralDfa1_0(0x0L, 0x4000000000000000L, 0x10000L); + case 125: + return jjStopAtPos(0, 109); + case 126: + return jjStopAtPos(0, 119); + case 133: + return jjStopAtPos(0, 6); + case 160: + return jjStopAtPos(0, 7); + case 5760: + return jjStopAtPos(0, 8); + case 6158: + return jjStopAtPos(0, 9); + case 8192: + return jjStopAtPos(0, 10); + case 8193: + return jjStopAtPos(0, 11); + case 8194: + return jjStopAtPos(0, 12); + case 8195: + return jjStopAtPos(0, 13); + case 8196: + return jjStopAtPos(0, 14); + case 8197: + return jjStopAtPos(0, 15); + case 8198: + return jjStopAtPos(0, 16); + case 8199: + return jjStopAtPos(0, 17); + case 8200: + return jjStopAtPos(0, 18); + case 8201: + return jjStopAtPos(0, 19); + case 8202: + return jjStopAtPos(0, 20); + case 8203: + return jjStopAtPos(0, 21); + case 8204: + return jjStopAtPos(0, 22); + case 8205: + return jjStopAtPos(0, 23); + case 8232: + return jjStopAtPos(0, 24); + case 8233: + return jjStopAtPos(0, 25); + case 8239: + return jjStopAtPos(0, 26); + case 8287: + return jjStopAtPos(0, 27); + case 8288: + return jjStopAtPos(0, 28); + case 12288: + return jjStopAtPos(0, 29); + case 65279: + return jjStopAtPos(0, 30); + default : + return jjMoveNfa_0(0, 0); + } +} +private int jjMoveStringLiteralDfa1_0(long active0, long active1, long active2){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0, active1, active2); + return 1; + } + switch(curChar) + { + case 38: + if ((active1 & 0x8000000000000000L) != 0L) + return jjStopAtPos(1, 127); + break; + case 42: + if ((active0 & 0x200000000L) != 0L) + return jjStartNfaWithStates_0(1, 33, 50); + break; + case 43: + if ((active2 & 0x1L) != 0L) + return jjStopAtPos(1, 128); + break; + case 45: + if ((active2 & 0x2L) != 0L) + return jjStopAtPos(1, 129); + break; + case 46: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0x400000L); + case 58: + if ((active2 & 0x1000000L) != 0L) + return jjStopAtPos(1, 152); + break; + case 60: + if ((active2 & 0x400L) != 0L) + { + jjmatchedKind = 138; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0x80000L); + case 61: + if ((active1 & 0x400000000000000L) != 0L) + return jjStopAtPos(1, 122); + else if ((active1 & 0x800000000000000L) != 0L) + return jjStopAtPos(1, 123); + else if ((active1 & 0x1000000000000000L) != 0L) + return jjStopAtPos(1, 124); + else if ((active1 & 0x2000000000000000L) != 0L) + return jjStopAtPos(1, 125); + else if ((active2 & 0x800L) != 0L) + return jjStopAtPos(1, 139); + else if ((active2 & 0x1000L) != 0L) + return jjStopAtPos(1, 140); + else if ((active2 & 0x2000L) != 0L) + return jjStopAtPos(1, 141); + else if ((active2 & 0x4000L) != 0L) + return jjStopAtPos(1, 142); + else if ((active2 & 0x8000L) != 0L) + return jjStopAtPos(1, 143); + else if ((active2 & 0x10000L) != 0L) + return jjStopAtPos(1, 144); + else if ((active2 & 0x20000L) != 0L) + return jjStopAtPos(1, 145); + else if ((active2 & 0x40000L) != 0L) + return jjStopAtPos(1, 146); + break; + case 62: + if ((active2 & 0x800000L) != 0L) + return jjStopAtPos(1, 151); + else if ((active2 & 0x4000000L) != 0L) + { + jjmatchedKind = 154; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0x2300000L); + case 97: + return jjMoveStringLiteralDfa2_0(active0, 0x400c0000000000L, active1, 0x48L, active2, 0L); + case 98: + return jjMoveStringLiteralDfa2_0(active0, 0x2000000000L, active1, 0L, active2, 0L); + case 101: + return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000L, active1, 0x410L, active2, 0L); + case 102: + if ((active0 & 0x1000000000000000L) != 0L) + return jjStartNfaWithStates_0(1, 60, 43); + break; + case 104: + return jjMoveStringLiteralDfa2_0(active0, 0x100000000000L, active1, 0x20e0800L, active2, 0L); + case 105: + return jjMoveStringLiteralDfa2_0(active0, 0x180000000000000L, active1, 0L, active2, 0L); + case 108: + return jjMoveStringLiteralDfa2_0(active0, 0x208200000000000L, active1, 0L, active2, 0L); + case 109: + return jjMoveStringLiteralDfa2_0(active0, 0x6000000000000000L, active1, 0L, active2, 0L); + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x8010000000000000L, active1, 0x3L, active2, 0L); + case 111: + if ((active0 & 0x2000000000000L) != 0L) + { + jjmatchedKind = 49; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0xc04c08000000000L, active1, 0x1800004L, active2, 0L); + case 114: + return jjMoveStringLiteralDfa2_0(active0, 0x10000000000L, active1, 0x700180L, active2, 0L); + case 115: + return jjMoveStringLiteralDfa2_0(active0, 0x4000000000L, active1, 0L, active2, 0L); + case 116: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x3000L, active2, 0L); + case 117: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x4220L, active2, 0L); + case 119: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x8000L, active2, 0L); + case 120: + return jjMoveStringLiteralDfa2_0(active0, 0x20000000000000L, active1, 0L, active2, 0L); + case 121: + return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L, active1, 0x10000L, active2, 0L); + case 124: + if ((active1 & 0x4000000000000000L) != 0L) + return jjStopAtPos(1, 126); + break; + default : + break; + } + return jjStartNfa_0(0, active0, active1, active2); +} +private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1, long old2, long active2){ + if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) + return jjStartNfa_0(0, old0, old1, old2); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0, active1, active2); + return 2; + } + switch(curChar) + { + case 46: + if ((active2 & 0x400000L) != 0L) + return jjStopAtPos(2, 150); + break; + case 61: + if ((active2 & 0x80000L) != 0L) + return jjStopAtPos(2, 147); + else if ((active2 & 0x100000L) != 0L) + return jjStopAtPos(2, 148); + break; + case 62: + if ((active2 & 0x2000000L) != 0L) + { + jjmatchedKind = 153; + jjmatchedPos = 2; + } + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0L, active2, 0x200000L); + case 97: + return jjMoveStringLiteralDfa3_0(active0, 0x300000000000L, active1, 0x101000L, active2, 0L); + case 98: + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x200L, active2, 0L); + case 99: + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x40L, active2, 0L); + case 101: + return jjMoveStringLiteralDfa3_0(active0, 0x10000000000L, active1, 0L, active2, 0L); + case 102: + return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0L, active2, 0L); + case 105: + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x2828080L, active2, 0L); + case 108: + return jjMoveStringLiteralDfa3_0(active0, 0x40000000000000L, active1, 0x1000020L, active2, 0L); + case 110: + return jjMoveStringLiteralDfa3_0(active0, 0x180c00000000000L, active1, 0x10004L, active2, 0L); + case 111: + return jjMoveStringLiteralDfa3_0(active0, 0x200008000000000L, active1, 0x900L, active2, 0L); + case 112: + return jjMoveStringLiteralDfa3_0(active0, 0x6000000000000000L, active1, 0x4000L, active2, 0L); + case 114: + if ((active0 & 0x400000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 58, 43); + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0xc2000L, active2, 0L); + case 115: + return jjMoveStringLiteralDfa3_0(active0, 0x8008046000000000L, active1, 0L, active2, 0L); + case 116: + if ((active1 & 0x1L) != 0L) + { + jjmatchedKind = 64; + jjmatchedPos = 2; + } + return jjMoveStringLiteralDfa3_0(active0, 0x8200a0000000000L, active1, 0x40aL, active2, 0L); + case 117: + return jjMoveStringLiteralDfa3_0(active0, 0x14000000000000L, active1, 0x200000L, active2, 0L); + case 119: + if ((active1 & 0x10L) != 0L) + return jjStartNfaWithStates_0(2, 68, 43); + break; + case 121: + if ((active1 & 0x400000L) != 0L) + return jjStartNfaWithStates_0(2, 86, 43); + break; + default : + break; + } + return jjStartNfa_0(1, active0, active1, active2); +} +private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1, long old2, long active2){ + if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) + return jjStartNfa_0(1, old0, old1, old2); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0, active1, active2); + return 3; + } + switch(curChar) + { + case 61: + if ((active2 & 0x200000L) != 0L) + return jjStopAtPos(3, 149); + break; + case 97: + return jjMoveStringLiteralDfa4_0(active0, 0x381010000000000L, active1, 0x1000000L, active2, 0L); + case 98: + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L, active2, 0L); + case 99: + return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0x10000L, active2, 0L); + case 100: + if ((active1 & 0x800000L) != 0L) + return jjStartNfaWithStates_0(3, 87, 43); + break; + case 101: + if ((active0 & 0x20000000000L) != 0L) + return jjStartNfaWithStates_0(3, 41, 43); + else if ((active0 & 0x40000000000L) != 0L) + return jjStartNfaWithStates_0(3, 42, 43); + else if ((active0 & 0x8000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 51, 43); + else if ((active1 & 0x200000L) != 0L) + return jjStartNfaWithStates_0(3, 85, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x20004000000000L, active1, 0x4002L, active2, 0L); + case 103: + if ((active1 & 0x4L) != 0L) + return jjStartNfaWithStates_0(3, 66, 43); + break; + case 105: + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x2008L, active2, 0L); + case 107: + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x40L, active2, 0L); + case 108: + if ((active1 & 0x20L) != 0L) + return jjStartNfaWithStates_0(3, 69, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x2000008000000000L, active1, 0x2000200L, active2, 0L); + case 109: + if ((active0 & 0x10000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 52, 43); + break; + case 110: + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x100000L, active2, 0L); + case 111: + if ((active0 & 0x800000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 59, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000000L, active1, 0xc0000L, active2, 0L); + case 114: + if ((active0 & 0x100000000000L) != 0L) + return jjStartNfaWithStates_0(3, 44, 43); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x800L, active2, 0L); + case 115: + if ((active1 & 0x20000L) != 0L) + return jjStartNfaWithStates_0(3, 81, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x40600000000000L, active1, 0L, active2, 0L); + case 116: + return jjMoveStringLiteralDfa4_0(active0, 0x8000802000000000L, active1, 0x9100L, active2, 0L); + case 117: + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x400L, active2, 0L); + case 118: + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x80L, active2, 0L); + default : + break; + } + return jjStartNfa_0(2, active0, active1, active2); +} +private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1, long old2, long active2){ + if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) + return jjStartNfa_0(2, old0, old1, old2); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0, active1, 0L); + return 4; + } + switch(curChar) + { + case 97: + return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0xc0L); + case 99: + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0xa000L); + case 101: + if ((active0 & 0x40000000000000L) != 0L) + return jjStartNfaWithStates_0(4, 54, 43); + else if ((active1 & 0x2000000L) != 0L) + return jjStartNfaWithStates_0(4, 89, 43); + return jjMoveStringLiteralDfa5_0(active0, 0x2000008000000000L, active1, 0x100L); + case 104: + if ((active0 & 0x80000000000L) != 0L) + return jjStartNfaWithStates_0(4, 43, 43); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10000L); + case 105: + return jjMoveStringLiteralDfa5_0(active0, 0x800000000000L, active1, 0x1200L); + case 107: + if ((active0 & 0x10000000000L) != 0L) + return jjStartNfaWithStates_0(4, 40, 43); + break; + case 108: + if ((active0 & 0x80000000000000L) != 0L) + { + jjmatchedKind = 55; + jjmatchedPos = 4; + } + return jjMoveStringLiteralDfa5_0(active0, 0x104000000000000L, active1, 0L); + case 110: + return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L, active1, 0L); + case 114: + if ((active1 & 0x4000L) != 0L) + return jjStartNfaWithStates_0(4, 78, 43); + return jjMoveStringLiteralDfa5_0(active0, 0x4000006000000000L, active1, 0x402L); + case 115: + if ((active0 & 0x200000000000L) != 0L) + return jjStartNfaWithStates_0(4, 45, 43); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x100000L); + case 116: + if ((active0 & 0x400000000000L) != 0L) + return jjStartNfaWithStates_0(4, 46, 43); + else if ((active0 & 0x200000000000000L) != 0L) + return jjStartNfaWithStates_0(4, 57, 43); + else if ((active1 & 0x800L) != 0L) + return jjStartNfaWithStates_0(4, 75, 43); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x1000000L); + case 117: + return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000L, active1, 0L); + case 118: + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8L); + case 119: + if ((active1 & 0x40000L) != 0L) + { + jjmatchedKind = 82; + jjmatchedPos = 4; + } + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x80000L); + default : + break; + } + return jjStartNfa_0(3, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(3, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0, active1, 0L); + return 5; + } + switch(curChar) + { + case 97: + return jjMoveStringLiteralDfa6_0(active0, 0xa000000000L, active1, 0L); + case 99: + if ((active1 & 0x200L) != 0L) + return jjStartNfaWithStates_0(5, 73, 43); + else if ((active1 & 0x1000L) != 0L) + return jjStartNfaWithStates_0(5, 76, 43); + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x100L); + case 100: + return jjMoveStringLiteralDfa6_0(active0, 0x20000000000000L, active1, 0L); + case 101: + if ((active0 & 0x4000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 50, 43); + else if ((active1 & 0x8L) != 0L) + return jjStartNfaWithStates_0(5, 67, 43); + break; + case 102: + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x2L); + case 103: + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x40L); + case 104: + if ((active1 & 0x8000L) != 0L) + return jjStartNfaWithStates_0(5, 79, 43); + break; + case 105: + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x1100000L); + case 108: + return jjMoveStringLiteralDfa6_0(active0, 0x101000000000000L, active1, 0L); + case 109: + return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0L); + case 110: + if ((active1 & 0x400L) != 0L) + return jjStartNfaWithStates_0(5, 74, 43); + return jjMoveStringLiteralDfa6_0(active0, 0x8000800000000000L, active1, 0L); + case 114: + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x10000L); + case 115: + if ((active1 & 0x80000L) != 0L) + return jjStartNfaWithStates_0(5, 83, 43); + break; + case 116: + if ((active0 & 0x4000000000L) != 0L) + return jjStartNfaWithStates_0(5, 38, 43); + else if ((active0 & 0x4000000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 62, 43); + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x2080L); + default : + break; + } + return jjStartNfa_0(4, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(4, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(5, active0, active1, 0L); + return 6; + } + switch(curChar) + { + case 97: + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2L); + case 99: + return jjMoveStringLiteralDfa7_0(active0, 0x8000002000000000L, active1, 0L); + case 101: + if ((active1 & 0x40L) != 0L) + return jjStartNfaWithStates_0(6, 70, 43); + else if ((active1 & 0x80L) != 0L) + return jjStartNfaWithStates_0(6, 71, 43); + return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000000L, active1, 0x100000L); + case 102: + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2000L); + case 108: + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1000000L); + case 110: + if ((active0 & 0x8000000000L) != 0L) + return jjStartNfaWithStates_0(6, 39, 43); + break; + case 111: + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x10000L); + case 115: + if ((active0 & 0x20000000000000L) != 0L) + return jjStartNfaWithStates_0(6, 53, 43); + break; + case 116: + if ((active0 & 0x1000000000000L) != 0L) + return jjStartNfaWithStates_0(6, 48, 43); + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x100L); + case 117: + return jjMoveStringLiteralDfa7_0(active0, 0x800000000000L, active1, 0L); + case 121: + if ((active0 & 0x100000000000000L) != 0L) + return jjStartNfaWithStates_0(6, 56, 43); + break; + default : + break; + } + return jjStartNfa_0(5, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(5, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(6, active0, active1, 0L); + return 7; + } + switch(curChar) + { + case 99: + return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x2L); + case 101: + if ((active0 & 0x800000000000L) != 0L) + return jjStartNfaWithStates_0(7, 47, 43); + else if ((active1 & 0x1000000L) != 0L) + return jjStartNfaWithStates_0(7, 88, 43); + return jjMoveStringLiteralDfa8_0(active0, 0x8000000000000000L, active1, 0x100L); + case 110: + return jjMoveStringLiteralDfa8_0(active0, 0x2000000000000000L, active1, 0x110000L); + case 112: + if ((active1 & 0x2000L) != 0L) + return jjStartNfaWithStates_0(7, 77, 43); + break; + case 116: + if ((active0 & 0x2000000000L) != 0L) + return jjStartNfaWithStates_0(7, 37, 43); + break; + default : + break; + } + return jjStartNfa_0(6, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(6, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(7, active0, active1, 0L); + return 8; + } + switch(curChar) + { + case 100: + if ((active1 & 0x100L) != 0L) + return jjStartNfaWithStates_0(8, 72, 43); + break; + case 101: + if ((active1 & 0x2L) != 0L) + return jjStartNfaWithStates_0(8, 65, 43); + break; + case 105: + return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x10000L); + case 111: + return jjMoveStringLiteralDfa9_0(active0, 0x8000000000000000L, active1, 0L); + case 116: + if ((active1 & 0x100000L) != 0L) + return jjStartNfaWithStates_0(8, 84, 43); + return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000000L, active1, 0L); + default : + break; + } + return jjStartNfa_0(7, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(7, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(8, active0, active1, 0L); + return 9; + } + switch(curChar) + { + case 102: + if ((active0 & 0x8000000000000000L) != 0L) + return jjStartNfaWithStates_0(9, 63, 43); + break; + case 115: + if ((active0 & 0x2000000000000000L) != 0L) + return jjStartNfaWithStates_0(9, 61, 43); + break; + case 122: + return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x10000L); + default : + break; + } + return jjStartNfa_0(8, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa10_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(8, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(9, 0L, active1, 0L); + return 10; + } + switch(curChar) + { + case 101: + return jjMoveStringLiteralDfa11_0(active1, 0x10000L); + default : + break; + } + return jjStartNfa_0(9, 0L, active1, 0L); +} +private int jjMoveStringLiteralDfa11_0(long old1, long active1){ + if (((active1 &= old1)) == 0L) + return jjStartNfa_0(9, 0L, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(10, 0L, active1, 0L); + return 11; + } + switch(curChar) + { + case 100: + if ((active1 & 0x10000L) != 0L) + return jjStartNfaWithStates_0(11, 80, 43); + break; + default : + break; + } + return jjStartNfa_0(10, 0L, active1, 0L); +} +private int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +static final long[] jjbitVec0 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec2 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec3 = { + 0xfff0000000200002L, 0xffffffffffffdfffL, 0xfffff00f7fffffffL, 0x12000000007fffffL +}; +static final long[] jjbitVec4 = { + 0x0L, 0x0L, 0x420043c00000000L, 0xff7fffffff7fffffL +}; +static final long[] jjbitVec5 = { + 0x7fffffffffffffL, 0xffffffffffff0000L, 0xffffffffffffffffL, 0x401f0003ffc3L +}; +static final long[] jjbitVec6 = { + 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xfbfffffffff7fffL +}; +static final long[] jjbitVec7 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc03L, 0x33fffffffff7fffL +}; +static final long[] jjbitVec8 = { + 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L +}; +static final long[] jjbitVec9 = { + 0x7fffffe00000000L, 0xfffec000000007ffL, 0xffffffffffffffffL, 0x9c00c060002fffffL +}; +static final long[] jjbitVec10 = { + 0xfffffffd0000L, 0xe000L, 0x2003fffffffffL, 0x0L +}; +static final long[] jjbitVec11 = { + 0x23fffffffffffff0L, 0x3ff010000L, 0x23c5fdfffff99fe0L, 0xf0003b0000000L +}; +static final long[] jjbitVec12 = { + 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbbfe0L, 0x2000300010000L +}; +static final long[] jjbitVec13 = { + 0x23edfdfffff99fe0L, 0x20003b0000000L, 0x3bfc718d63dc7e8L, 0x200000000000000L +}; +static final long[] jjbitVec14 = { + 0x3effdfffffddfe0L, 0x300000000L, 0x23effdfffffddfe0L, 0x340000000L +}; +static final long[] jjbitVec15 = { + 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL +}; +static final long[] jjbitVec16 = { + 0x800dfffffffffffeL, 0x7fL, 0x200decaefef02596L, 0x3000005fL +}; +static final long[] jjbitVec17 = { + 0x1L, 0x7fffffffeffL, 0xf00L, 0x0L +}; +static final long[] jjbitVec18 = { + 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x1ffffffffff003fL +}; +static final long[] jjbitVec19 = { + 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL +}; +static final long[] jjbitVec20 = { + 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL +}; +static final long[] jjbitVec21 = { + 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL +}; +static final long[] jjbitVec22 = { + 0xffffffffffffffffL, 0x7f9fffffffffffL, 0xffffffff07fffffeL, 0x1c7ffffffffffL +}; +static final long[] jjbitVec23 = { + 0x3ffff0003dfffL, 0x1dfff0003ffffL, 0xfffffffffffffL, 0x18800000L +}; +static final long[] jjbitVec24 = { + 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L +}; +static final long[] jjbitVec25 = { + 0x1fffffffL, 0x1f3fffffff0000L, 0x0L, 0x0L +}; +static final long[] jjbitVec26 = { + 0xffffffffffffffffL, 0xfffffffffffL, 0x0L, 0x0L +}; +static final long[] jjbitVec27 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL +}; +static final long[] jjbitVec28 = { + 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL +}; +static final long[] jjbitVec29 = { + 0x8000000000000000L, 0x8002000000100001L, 0x3ffff00000000L, 0x0L +}; +static final long[] jjbitVec30 = { + 0xe3fbbd503e2ffc84L, 0xffffffff000003e0L, 0xfL, 0x0L +}; +static final long[] jjbitVec31 = { + 0x1f3e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffee07fffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec32 = { + 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0xffff000000000000L +}; +static final long[] jjbitVec33 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffL, 0x0L +}; +static final long[] jjbitVec34 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L +}; +static final long[] jjbitVec35 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L +}; +static final long[] jjbitVec36 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L +}; +static final long[] jjbitVec37 = { + 0x6L, 0x0L, 0x0L, 0x0L +}; +static final long[] jjbitVec38 = { + 0xffff3fffffffffffL, 0x7ffffffffffL, 0x0L, 0x0L +}; +static final long[] jjbitVec39 = { + 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L +}; +static final long[] jjbitVec40 = { + 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0x1fff0000000000ffL +}; +static final long[] jjbitVec41 = { + 0x18000000000000L, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL +}; +static final long[] jjbitVec42 = { + 0x87fffffe00000010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x631cfcfcfcL +}; +static final long[] jjbitVec43 = { + 0x0L, 0x0L, 0x420243cffffffffL, 0xff7fffffff7fffffL +}; +static final long[] jjbitVec44 = { + 0xffffffffffffffffL, 0x400ffffe0ffffffL, 0xfffffffbffffd740L, 0xfbfffffffff7fffL +}; +static final long[] jjbitVec45 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc7bL, 0x33fffffffff7fffL +}; +static final long[] jjbitVec46 = { + 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L +}; +static final long[] jjbitVec47 = { + 0x7fffffe003f000fL, 0xffffc3ff01ffffffL, 0xffffffffffffffffL, 0x9ffffdffbfefffffL +}; +static final long[] jjbitVec48 = { + 0xffffffffffff8000L, 0xe7ffL, 0x3ffffffffffffL, 0x0L +}; +static final long[] jjbitVec49 = { + 0xf3fffffffffffffeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0xfffcfb080399fL +}; +static final long[] jjbitVec50 = { + 0xd36dfdfffff987eeL, 0x1fffc05e003987L, 0xf3edfdfffffbbfeeL, 0x2ffcf00013bbfL +}; +static final long[] jjbitVec51 = { + 0xf3edfdfffff99feeL, 0x2ffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0x200ff8000803dc7L +}; +static final long[] jjbitVec52 = { + 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xf3effdfffffddfecL, 0xffc340603ddfL +}; +static final long[] jjbitVec53 = { + 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL +}; +static final long[] jjbitVec54 = { + 0x87fffffffffffffeL, 0x3ff7fffL, 0x3bffecaefef02596L, 0x33ff3f5fL +}; +static final long[] jjbitVec55 = { + 0xc2a003ff03000001L, 0xfffe07fffffffeffL, 0x1ffffffffeff0fdfL, 0x40L +}; +static final long[] jjbitVec56 = { + 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x1ffffffffff003fL +}; +static final long[] jjbitVec57 = { + 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL +}; +static final long[] jjbitVec58 = { + 0x1fffff001fdfffL, 0xddfff000fffffL, 0xffffffffffffffffL, 0x3ff388fffffL +}; +static final long[] jjbitVec59 = { + 0xffffffff03ff3800L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L +}; +static final long[] jjbitVec60 = { + 0xfff0fff1fffffffL, 0x1f3fffffffffc0L, 0x0L, 0x0L +}; +static final long[] jjbitVec61 = { + 0x80007c000000f000L, 0x8002fc0f00100001L, 0x3ffff00000000L, 0x7e21fff0000L +}; +static final long[] jjbitVec62 = { + 0x1f3efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffee67fffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec63 = { + 0x10000000000006L, 0x0L, 0x0L, 0x0L +}; +static final long[] jjbitVec64 = { + 0x3L, 0x0L, 0x0L, 0x0L +}; +static final long[] jjbitVec65 = { + 0x0L, 0x800000000000000L, 0x0L, 0x0L +}; +static final long[] jjbitVec66 = { + 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L +}; +static final long[] jjbitVec67 = { + 0x18000f0000ffffL, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x9fffffffffffffffL +}; +static final long[] jjbitVec68 = { + 0x87fffffe03ff0010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0xe0000631cfcfcfcL +}; +private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 130; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + do + { + switch(jjstateSet[--i]) + { + case 45: + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 50; + else if (curChar == 47) + { + if (kind > 31) + kind = 31; + { jjCheckNAddStates(0, 2); } + } + break; + case 0: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 91) + kind = 91; + { jjCheckNAddStates(3, 17); } + } + else if (curChar == 47) + { jjAddStates(18, 19); } + else if (curChar == 36) + { + if (kind > 103) + kind = 103; + { jjCheckNAdd(43); } + } + else if (curChar == 34) + { jjCheckNAddStates(20, 23); } + else if (curChar == 39) + { jjAddStates(24, 26); } + else if (curChar == 46) + { jjCheckNAdd(1); } + if (curChar == 48) + { jjAddStates(27, 34); } + break; + case 1: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(35, 38); } + break; + case 2: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(2, 3); } + break; + case 3: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(39, 41); } + break; + case 5: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(6); } + break; + case 6: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(42, 44); } + break; + case 7: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(7, 8); } + break; + case 8: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddTwoStates(6, 9); } + break; + case 10: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(45, 48); } + break; + case 11: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(49, 53); } + break; + case 12: + if (curChar == 39) + { jjAddStates(24, 26); } + break; + case 13: + if ((0xffffff7fffffdbffL & l) != 0L) + { jjCheckNAdd(14); } + break; + case 14: + if (curChar == 39 && kind > 101) + kind = 101; + break; + case 16: + if ((0x8400000000L & l) != 0L) + { jjCheckNAdd(14); } + break; + case 17: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(18, 14); } + break; + case 18: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAdd(14); } + break; + case 19: + if ((0xf000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 20; + break; + case 20: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAdd(18); } + break; + case 22: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 23; + break; + case 23: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 24; + break; + case 24: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 25; + break; + case 25: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(14); } + break; + case 27: + if (curChar == 34) + { jjCheckNAddStates(20, 23); } + break; + case 28: + if ((0xfffffffbffffdbffL & l) != 0L) + { jjCheckNAddStates(20, 23); } + break; + case 30: + if ((0x8400000000L & l) != 0L) + { jjCheckNAddStates(20, 23); } + break; + case 32: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 33: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 34: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 35: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(20, 23); } + break; + case 37: + if (curChar == 34 && kind > 102) + kind = 102; + break; + case 38: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddStates(54, 58); } + break; + case 39: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddStates(20, 23); } + break; + case 40: + if ((0xf000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 41; + break; + case 41: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAdd(39); } + break; + case 42: + if (curChar != 36) + break; + if (kind > 103) + kind = 103; + { jjCheckNAdd(43); } + break; + case 43: + if ((0x3ff00100fffc1ffL & l) == 0L) + break; + if (kind > 103) + kind = 103; + { jjCheckNAdd(43); } + break; + case 44: + if (curChar == 47) + { jjAddStates(18, 19); } + break; + case 46: + if ((0xffffffffffffdbffL & l) == 0L) + break; + if (kind > 31) + kind = 31; + { jjCheckNAddStates(0, 2); } + break; + case 47: + if ((0x2400L & l) != 0L && kind > 31) + kind = 31; + break; + case 48: + if (curChar == 10 && kind > 31) + kind = 31; + break; + case 49: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 48; + break; + case 50: + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 51; + break; + case 51: + if ((0xffff7fffffffffffL & l) != 0L && kind > 32) + kind = 32; + break; + case 52: + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 50; + break; + case 53: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 91) + kind = 91; + { jjCheckNAddStates(3, 17); } + break; + case 54: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(54, 55); } + break; + case 55: + case 98: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(56); } + break; + case 57: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(57, 58); } + break; + case 58: + case 109: + if ((0x3ff000000000000L & l) != 0L && kind > 91) + kind = 91; + break; + case 59: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(59, 60); } + break; + case 60: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(59, 61); } + break; + case 61: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(62, 65); } + break; + case 63: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(64); } + break; + case 64: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(66, 68); } + break; + case 65: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(65, 66); } + break; + case 66: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(64, 9); } + break; + case 67: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(69, 72); } + break; + case 68: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(73, 77); } + break; + case 69: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(69, 70); } + break; + case 70: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(71, 72); } + break; + case 71: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(78, 80); } + break; + case 73: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(74); } + break; + case 74: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(81, 83); } + break; + case 75: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(75, 76); } + break; + case 76: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddTwoStates(74, 9); } + break; + case 77: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(84, 87); } + break; + case 78: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(88, 91); } + break; + case 79: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(79, 80); } + break; + case 80: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(81, 82); } + break; + case 81: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(92, 94); } + break; + case 82: + if (curChar != 46) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(95, 97); } + break; + case 83: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(98, 101); } + break; + case 84: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(84, 85); } + break; + case 85: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(95, 97); } + break; + case 87: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(88); } + break; + case 88: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(102, 104); } + break; + case 89: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(89, 90); } + break; + case 90: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddTwoStates(88, 9); } + break; + case 91: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(105, 108); } + break; + case 92: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddStates(109, 113); } + break; + case 93: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(114, 117); } + break; + case 94: + if (curChar == 48) + { jjAddStates(27, 34); } + break; + case 96: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(118, 120); } + break; + case 97: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(97, 98); } + break; + case 99: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddStates(121, 123); } + break; + case 100: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(100, 101); } + break; + case 101: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAdd(56); } + break; + case 103: + if ((0x3000000000000L & l) != 0L) + { jjCheckNAddStates(124, 126); } + break; + case 104: + if ((0x3000000000000L & l) != 0L) + { jjCheckNAddTwoStates(104, 105); } + break; + case 105: + if ((0x3000000000000L & l) != 0L) + { jjCheckNAdd(56); } + break; + case 107: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 91) + kind = 91; + { jjCheckNAddTwoStates(108, 109); } + break; + case 108: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(108, 109); } + break; + case 110: + if ((0xff000000000000L & l) == 0L) + break; + if (kind > 91) + kind = 91; + { jjCheckNAddTwoStates(111, 112); } + break; + case 111: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(111, 112); } + break; + case 112: + if ((0xff000000000000L & l) != 0L && kind > 91) + kind = 91; + break; + case 114: + if ((0x3000000000000L & l) == 0L) + break; + if (kind > 91) + kind = 91; + { jjCheckNAddTwoStates(115, 116); } + break; + case 115: + if ((0x3000000000000L & l) != 0L) + { jjCheckNAddTwoStates(115, 116); } + break; + case 116: + if ((0x3000000000000L & l) != 0L && kind > 91) + kind = 91; + break; + case 118: + if ((0x3ff000000000000L & l) != 0L) + { jjAddStates(127, 128); } + break; + case 119: + if (curChar == 46) + { jjCheckNAdd(120); } + break; + case 120: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(120, 121); } + break; + case 122: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(123); } + break; + case 123: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddTwoStates(123, 9); } + break; + case 125: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(129, 131); } + break; + case 126: + if (curChar == 46) + { jjCheckNAdd(127); } + break; + case 128: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(129); } + break; + case 129: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 96) + kind = 96; + { jjCheckNAddTwoStates(129, 9); } + break; + default : break; } - image = jjimage; - image.setLength(0); - jjimageLen = 0; - - for (; ; ) { - switch (curLexState) { - case 0: - try { - input_stream.backup(0); - while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) - curChar = input_stream.BeginToken(); - } catch (java.io.IOException e1) { - continue EOFLoop; - } - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - break; - case 1: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_1(); - if (jjmatchedPos == 0 && jjmatchedKind > 36) { - jjmatchedKind = 36; - } - break; - case 2: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_2(); - if (jjmatchedPos == 0 && jjmatchedKind > 36) { - jjmatchedKind = 36; - } - break; - } - if (jjmatchedKind != 0x7fffffff) { - if (jjmatchedPos + 1 < curPos) - input_stream.backup(curPos - jjmatchedPos - 1); - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - TokenLexicalActions(matchedToken); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - CommonTokenAction(matchedToken); - return matchedToken; - } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - matchedToken = jjFillToken(); - if (specialToken == null) - specialToken = matchedToken; - else { - matchedToken.specialToken = specialToken; - specialToken = (specialToken.next = matchedToken); - } - SkipLexicalActions(matchedToken); - } else - SkipLexicalActions(null); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - continue EOFLoop; - } - MoreLexicalActions(); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - curPos = 0; - jjmatchedKind = 0x7fffffff; - try { - curChar = input_stream.readChar(); - continue; - } catch (java.io.IOException e1) { - } - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { - input_stream.readChar(); - input_stream.backup(1); - } catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrException(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrException.LEXICAL_ERROR); + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 0: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 103) + kind = 103; + { jjCheckNAdd(43); } + break; + case 2: + if (curChar == 95) + { jjAddStates(132, 133); } + break; + case 4: + if ((0x2000000020L & l) != 0L) + { jjAddStates(134, 135); } + break; + case 7: + if (curChar == 95) + { jjAddStates(136, 137); } + break; + case 9: + if ((0x5000000050L & l) != 0L && kind > 96) + kind = 96; + break; + case 13: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAdd(14); } + break; + case 15: + if (curChar == 92) + { jjAddStates(138, 140); } + break; + case 16: + if ((0x14404410000000L & l) != 0L) + { jjCheckNAdd(14); } + break; + case 21: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 22; + break; + case 22: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 23; + break; + case 23: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 24; + break; + case 24: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 25; + break; + case 25: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(14); } + break; + case 26: + if (curChar == 92) + jjstateSet[jjnewStateCnt++] = 21; + break; + case 28: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(20, 23); } + break; + case 29: + if (curChar == 92) + { jjAddStates(141, 143); } + break; + case 30: + if ((0x14404410000000L & l) != 0L) + { jjCheckNAddStates(20, 23); } + break; + case 31: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 32; + break; + case 32: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 33: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 34: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 35: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(20, 23); } + break; + case 36: + if (curChar == 92) + jjstateSet[jjnewStateCnt++] = 31; + break; + case 43: + if ((0x87fffffe87fffffeL & l) == 0L) + break; + if (kind > 103) + kind = 103; + { jjCheckNAdd(43); } + break; + case 46: + if (kind > 31) + kind = 31; + { jjAddStates(0, 2); } + break; + case 51: + if (kind > 32) + kind = 32; + break; + case 54: + if (curChar == 95) + { jjAddStates(144, 145); } + break; + case 56: + if ((0x100000001000L & l) != 0L && kind > 90) + kind = 90; + break; + case 57: + if (curChar == 95) + { jjAddStates(146, 147); } + break; + case 59: + if (curChar == 95) + { jjAddStates(148, 149); } + break; + case 62: + if ((0x2000000020L & l) != 0L) + { jjAddStates(150, 151); } + break; + case 65: + if (curChar == 95) + { jjAddStates(152, 153); } + break; + case 69: + if (curChar == 95) + { jjAddStates(154, 155); } + break; + case 72: + if ((0x2000000020L & l) != 0L) + { jjAddStates(156, 157); } + break; + case 75: + if (curChar == 95) + { jjAddStates(158, 159); } + break; + case 79: + if (curChar == 95) + { jjAddStates(160, 161); } + break; + case 84: + if (curChar == 95) + { jjAddStates(162, 163); } + break; + case 86: + if ((0x2000000020L & l) != 0L) + { jjAddStates(164, 165); } + break; + case 89: + if (curChar == 95) + { jjAddStates(166, 167); } + break; + case 95: + if ((0x100000001000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 96; + break; + case 96: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(118, 120); } + break; + case 97: + if ((0x7e8000007eL & l) != 0L) + { jjCheckNAddTwoStates(97, 98); } + break; + case 98: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(56); } + break; + case 100: + if (curChar == 95) + { jjAddStates(168, 169); } + break; + case 102: + if ((0x400000004L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 103; + break; + case 104: + if (curChar == 95) + { jjAddStates(170, 171); } + break; + case 106: + if ((0x100000001000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 107; + break; + case 107: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 91) + kind = 91; + { jjCheckNAddTwoStates(108, 109); } + break; + case 108: + if ((0x7e8000007eL & l) != 0L) + { jjCheckNAddTwoStates(108, 109); } + break; + case 109: + if ((0x7e0000007eL & l) != 0L && kind > 91) + kind = 91; + break; + case 111: + if (curChar == 95) + { jjAddStates(172, 173); } + break; + case 113: + if ((0x400000004L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 114; + break; + case 115: + if (curChar == 95) + { jjAddStates(174, 175); } + break; + case 117: + if ((0x100000001000000L & l) != 0L) + { jjCheckNAddTwoStates(118, 119); } + break; + case 118: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddTwoStates(118, 119); } + break; + case 120: + if ((0x7e0000007eL & l) != 0L) + { jjAddStates(176, 177); } + break; + case 121: + if ((0x1000000010000L & l) != 0L) + { jjAddStates(178, 179); } + break; + case 124: + if ((0x100000001000000L & l) != 0L) + { jjCheckNAdd(125); } + break; + case 125: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(129, 131); } + break; + case 127: + if ((0x1000000010000L & l) != 0L) + { jjAddStates(180, 181); } + break; + default : break; } - } - } + } while(i != startsAt); + } + else + { + int hiByte = (curChar >> 8); + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 0: + if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) + break; + if (kind > 103) + kind = 103; + { jjCheckNAdd(43); } + break; + case 13: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + jjstateSet[jjnewStateCnt++] = 14; + break; + case 28: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjAddStates(20, 23); } + break; + case 43: + if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) + break; + if (kind > 103) + kind = 103; + { jjCheckNAdd(43); } + break; + case 46: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 31) + kind = 31; + { jjAddStates(0, 2); } + break; + case 51: + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 32) + kind = 32; + break; + default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 130 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +private int jjMoveStringLiteralDfa0_2(){ + switch(curChar) + { + case 42: + return jjMoveStringLiteralDfa1_2(0x800000000L); + default : + return 1; + } +} +private int jjMoveStringLiteralDfa1_2(long active0){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 47: + if ((active0 & 0x800000000L) != 0L) + return jjStopAtPos(1, 35); + break; + default : + return 2; + } + return 2; +} +private int jjMoveStringLiteralDfa0_1(){ + switch(curChar) + { + case 42: + return jjMoveStringLiteralDfa1_1(0x400000000L); + default : + return 1; + } +} +private int jjMoveStringLiteralDfa1_1(long active0){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 47: + if ((active0 & 0x400000000L) != 0L) + return jjStopAtPos(1, 34); + break; + default : + return 2; + } + return 2; +} +static final int[] jjnextStates = { + 46, 47, 49, 54, 55, 56, 57, 58, 59, 62, 9, 69, 72, 79, 82, 93, + 78, 68, 45, 52, 28, 29, 36, 37, 13, 15, 26, 95, 99, 102, 106, 110, + 113, 117, 124, 2, 4, 9, 11, 1, 4, 9, 7, 9, 10, 6, 7, 9, + 10, 1, 2, 4, 9, 11, 28, 29, 39, 36, 37, 61, 62, 9, 59, 62, + 9, 68, 65, 9, 67, 64, 65, 9, 67, 61, 59, 62, 9, 68, 69, 72, + 78, 75, 9, 77, 74, 75, 9, 77, 71, 69, 72, 78, 79, 82, 93, 83, + 86, 9, 84, 86, 9, 92, 89, 9, 91, 88, 89, 9, 91, 83, 84, 86, + 9, 92, 81, 79, 82, 93, 97, 98, 56, 100, 101, 56, 104, 105, 56, 118, + 119, 125, 126, 127, 2, 3, 5, 6, 7, 8, 16, 17, 19, 30, 38, 40, + 54, 55, 57, 58, 59, 60, 63, 64, 65, 66, 69, 70, 73, 74, 75, 76, + 79, 80, 84, 85, 87, 88, 89, 90, 100, 101, 104, 105, 111, 112, 115, 116, + 120, 121, 122, 123, 128, 129, +}; +private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec2[i2] & l2) != 0L); + default : + if ((jjbitVec0[i1] & l1) != 0L) + return true; + return false; + } +} +private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec4[i2] & l2) != 0L); + case 2: + return ((jjbitVec5[i2] & l2) != 0L); + case 3: + return ((jjbitVec6[i2] & l2) != 0L); + case 4: + return ((jjbitVec7[i2] & l2) != 0L); + case 5: + return ((jjbitVec8[i2] & l2) != 0L); + case 6: + return ((jjbitVec9[i2] & l2) != 0L); + case 7: + return ((jjbitVec10[i2] & l2) != 0L); + case 9: + return ((jjbitVec11[i2] & l2) != 0L); + case 10: + return ((jjbitVec12[i2] & l2) != 0L); + case 11: + return ((jjbitVec13[i2] & l2) != 0L); + case 12: + return ((jjbitVec14[i2] & l2) != 0L); + case 13: + return ((jjbitVec15[i2] & l2) != 0L); + case 14: + return ((jjbitVec16[i2] & l2) != 0L); + case 15: + return ((jjbitVec17[i2] & l2) != 0L); + case 16: + return ((jjbitVec18[i2] & l2) != 0L); + case 17: + return ((jjbitVec19[i2] & l2) != 0L); + case 18: + return ((jjbitVec20[i2] & l2) != 0L); + case 19: + return ((jjbitVec21[i2] & l2) != 0L); + case 20: + return ((jjbitVec0[i2] & l2) != 0L); + case 22: + return ((jjbitVec22[i2] & l2) != 0L); + case 23: + return ((jjbitVec23[i2] & l2) != 0L); + case 24: + return ((jjbitVec24[i2] & l2) != 0L); + case 25: + return ((jjbitVec25[i2] & l2) != 0L); + case 29: + return ((jjbitVec26[i2] & l2) != 0L); + case 30: + return ((jjbitVec27[i2] & l2) != 0L); + case 31: + return ((jjbitVec28[i2] & l2) != 0L); + case 32: + return ((jjbitVec29[i2] & l2) != 0L); + case 33: + return ((jjbitVec30[i2] & l2) != 0L); + case 48: + return ((jjbitVec31[i2] & l2) != 0L); + case 49: + return ((jjbitVec32[i2] & l2) != 0L); + case 77: + return ((jjbitVec33[i2] & l2) != 0L); + case 159: + return ((jjbitVec34[i2] & l2) != 0L); + case 164: + return ((jjbitVec35[i2] & l2) != 0L); + case 215: + return ((jjbitVec36[i2] & l2) != 0L); + case 216: + return ((jjbitVec37[i2] & l2) != 0L); + case 250: + return ((jjbitVec38[i2] & l2) != 0L); + case 251: + return ((jjbitVec39[i2] & l2) != 0L); + case 253: + return ((jjbitVec40[i2] & l2) != 0L); + case 254: + return ((jjbitVec41[i2] & l2) != 0L); + case 255: + return ((jjbitVec42[i2] & l2) != 0L); + default : + if ((jjbitVec3[i1] & l1) != 0L) + return true; + return false; + } +} +private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec43[i2] & l2) != 0L); + case 2: + return ((jjbitVec5[i2] & l2) != 0L); + case 3: + return ((jjbitVec44[i2] & l2) != 0L); + case 4: + return ((jjbitVec45[i2] & l2) != 0L); + case 5: + return ((jjbitVec46[i2] & l2) != 0L); + case 6: + return ((jjbitVec47[i2] & l2) != 0L); + case 7: + return ((jjbitVec48[i2] & l2) != 0L); + case 9: + return ((jjbitVec49[i2] & l2) != 0L); + case 10: + return ((jjbitVec50[i2] & l2) != 0L); + case 11: + return ((jjbitVec51[i2] & l2) != 0L); + case 12: + return ((jjbitVec52[i2] & l2) != 0L); + case 13: + return ((jjbitVec53[i2] & l2) != 0L); + case 14: + return ((jjbitVec54[i2] & l2) != 0L); + case 15: + return ((jjbitVec55[i2] & l2) != 0L); + case 16: + return ((jjbitVec56[i2] & l2) != 0L); + case 17: + return ((jjbitVec19[i2] & l2) != 0L); + case 18: + return ((jjbitVec20[i2] & l2) != 0L); + case 19: + return ((jjbitVec57[i2] & l2) != 0L); + case 20: + return ((jjbitVec0[i2] & l2) != 0L); + case 22: + return ((jjbitVec22[i2] & l2) != 0L); + case 23: + return ((jjbitVec58[i2] & l2) != 0L); + case 24: + return ((jjbitVec59[i2] & l2) != 0L); + case 25: + return ((jjbitVec60[i2] & l2) != 0L); + case 29: + return ((jjbitVec26[i2] & l2) != 0L); + case 30: + return ((jjbitVec27[i2] & l2) != 0L); + case 31: + return ((jjbitVec28[i2] & l2) != 0L); + case 32: + return ((jjbitVec61[i2] & l2) != 0L); + case 33: + return ((jjbitVec30[i2] & l2) != 0L); + case 48: + return ((jjbitVec62[i2] & l2) != 0L); + case 49: + return ((jjbitVec32[i2] & l2) != 0L); + case 77: + return ((jjbitVec33[i2] & l2) != 0L); + case 159: + return ((jjbitVec34[i2] & l2) != 0L); + case 164: + return ((jjbitVec35[i2] & l2) != 0L); + case 215: + return ((jjbitVec36[i2] & l2) != 0L); + case 216: + return ((jjbitVec63[i2] & l2) != 0L); + case 220: + return ((jjbitVec64[i2] & l2) != 0L); + case 221: + return ((jjbitVec65[i2] & l2) != 0L); + case 250: + return ((jjbitVec38[i2] & l2) != 0L); + case 251: + return ((jjbitVec66[i2] & l2) != 0L); + case 253: + return ((jjbitVec40[i2] & l2) != 0L); + case 254: + return ((jjbitVec67[i2] & l2) != 0L); + case 255: + return ((jjbitVec68[i2] & l2) != 0L); + default : + if ((jjbitVec3[i1] & l1) != 0L) + return true; + return false; + } +} - void SkipLexicalActions(Token matchedToken) { - switch (jjmatchedKind) { - default: - break; - } - } +/** Token literal values. */ +public static final String[] jjstrLiteralImages = { +"", null, null, null, null, null, null, null, null, null, null, null, null, +null, null, null, null, null, null, null, null, null, null, null, null, null, null, +null, null, null, null, null, null, null, null, null, null, +"\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156", +"\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150", +"\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164", +"\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145", +"\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145", +"\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162", +"\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163", +"\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164", +"\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167", +"\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145", +"\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156", +"\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160", +"\163\165\160\145\162", "\163\167\151\164\143\150", +"\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163", +"\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144", +"\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null, +null, null, null, null, null, null, null, "\50", "\51", "\173", "\175", "\133", +"\135", "\73", "\54", "\56", "\100", "\75", "\74", "\41", "\176", "\77", "\72", +"\75\75", "\74\75", "\76\75", "\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", +"\55", "\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\53\75", "\55\75", +"\52\75", "\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", +"\76\76\76\75", "\56\56\56", "\55\76", "\72\72", "\76\76\76", "\76\76", "\76", "\32", }; +protected Token jjFillToken() +{ + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = ASTParser.GTToken.newToken(jjmatchedKind, curTokenImage); + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + + return t; +} - void MoreLexicalActions() { - jjimageLen += (lengthOfMatch = jjmatchedPos + 1); - switch (jjmatchedKind) { - case 32: - image.append(input_stream.GetSuffix(jjimageLen)); - jjimageLen = 0; - input_stream.backup(1); - break; - default: - break; +int curLexState = 0; +int defaultLexState = 0; +int jjnewStateCnt; +int jjround; +int jjmatchedPos; +int jjmatchedKind; + +/** Get the next Token. */ +public Token getNextToken() +{ + Token specialToken = null; + Token matchedToken; + int curPos = 0; + + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(Exception e) + { + jjmatchedKind = 0; + jjmatchedPos = -1; + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + CommonTokenAction(matchedToken); + return matchedToken; + } + image = jjimage; + image.setLength(0); + jjimageLen = 0; + + for (;;) + { + switch(curLexState) + { + case 0: + try { input_stream.backup(0); + while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) + curChar = input_stream.BeginToken(); + } + catch (java.io.IOException e1) { continue EOFLoop; } + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 36) + { + jjmatchedKind = 36; + } + break; + case 2: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_2(); + if (jjmatchedPos == 0 && jjmatchedKind > 36) + { + jjmatchedKind = 36; + } + break; + } + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + TokenLexicalActions(matchedToken); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + CommonTokenAction(matchedToken); + return matchedToken; } - } - - void TokenLexicalActions(Token matchedToken) { - switch (jjmatchedKind) { - case 153: - image.append(jjstrLiteralImages[153]); - lengthOfMatch = jjstrLiteralImages[153].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken) matchedToken).realKind = RUNSIGNEDSHIFT; - input_stream.backup(2); - break; - case 154: - image.append(jjstrLiteralImages[154]); - lengthOfMatch = jjstrLiteralImages[154].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken) matchedToken).realKind = RSIGNEDSHIFT; - input_stream.backup(1); - break; - default: - break; + else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + if (specialToken == null) + specialToken = matchedToken; + else + { + matchedToken.specialToken = specialToken; + specialToken = (specialToken.next = matchedToken); + } + SkipLexicalActions(matchedToken); + } + else + SkipLexicalActions(null); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + continue EOFLoop; } - } - - private void jjCheckNAdd(int state) { - if (jjrounds[state] != jjround) { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; + MoreLexicalActions(); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + curPos = 0; + jjmatchedKind = 0x7fffffff; + try { + curChar = input_stream.readChar(); + continue; } - } - - private void jjAddStates(int start, int end) { - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); - } + catch (java.io.IOException e1) { } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrException(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrException.LEXICAL_ERROR); + } + } +} - private void jjCheckNAddTwoStates(int state1, int state2) { - jjCheckNAdd(state1); - jjCheckNAdd(state2); - } +void SkipLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + default : + break; + } +} +void MoreLexicalActions() +{ + jjimageLen += (lengthOfMatch = jjmatchedPos + 1); + switch(jjmatchedKind) + { + case 32 : + image.append(input_stream.GetSuffix(jjimageLen)); + jjimageLen = 0; + input_stream.backup(1); + break; + default : + break; + } +} +void TokenLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + case 153 : + image.append(jjstrLiteralImages[153]); + lengthOfMatch = jjstrLiteralImages[153].length(); + matchedToken.kind = GT; + ((ASTParser.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT; + input_stream.backup(2); + break; + case 154 : + image.append(jjstrLiteralImages[154]); + lengthOfMatch = jjstrLiteralImages[154].length(); + matchedToken.kind = GT; + ((ASTParser.GTToken)matchedToken).realKind = RSIGNEDSHIFT; + input_stream.backup(1); + break; + default : + break; + } +} +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} - private void jjCheckNAddStates(int start, int end) { - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); - } +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} - /** - * Constructor. - */ - public ASTParserTokenManager(JavaCharStream stream) { + /** Constructor. */ + public ASTParserTokenManager(JavaCharStream stream){ - if (JavaCharStream.staticFlag) + if (JavaCharStream.staticFlag) throw new RuntimeException("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - input_stream = stream; - } - - /** - * Constructor. - */ - public ASTParserTokenManager(JavaCharStream stream, int lexState) { - ReInit(stream); - SwitchTo(lexState); - } - - /** - * Reinitialise parser. - */ - public void ReInit(JavaCharStream stream) { - - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); - } - - private void ReInitRounds() { - int i; - jjround = 0x80000001; - for (i = 130; i-- > 0; ) - jjrounds[i] = 0x80000000; - } - - /** - * Reinitialise parser. - */ - public void ReInit(JavaCharStream stream, int lexState) { - - ReInit(stream); - SwitchTo(lexState); - } - - /** - * Switch to specified lex state. - */ - public void SwitchTo(int lexState) { - if (lexState >= 3 || lexState < 0) - throw new TokenMgrException("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrException.INVALID_LEXICAL_STATE); - else - curLexState = lexState; - } - - /** - * Lexer state names. - */ - public static final String[] lexStateNames = { - "DEFAULT", - "IN_JAVA_DOC_COMMENT", - "IN_MULTI_LINE_COMMENT", - }; - - /** - * Lex State array. - */ - public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, - }; - static final long[] jjtoToken = { - 0xffffffe000000001L, 0xfffffce10fffffffL, 0x1fffffffL, - }; - static final long[] jjtoSkip = { - 0xcfffffffeL, 0x0L, 0x0L, - }; - static final long[] jjtoSpecial = { - 0xc80000000L, 0x0L, 0x0L, - }; - static final long[] jjtoMore = { - 0x1300000000L, 0x0L, 0x0L, - }; - protected JavaCharStream input_stream; + input_stream = stream; + } + + /** Constructor. */ + public ASTParserTokenManager (JavaCharStream stream, int lexState){ + ReInit(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + public void ReInit(JavaCharStream stream) + { + + jjmatchedPos = jjnewStateCnt = 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + private void ReInitRounds() + { + int i; + jjround = 0x80000001; + for (i = 130; i-- > 0;) + jjrounds[i] = 0x80000000; + } + + /** Reinitialise parser. */ + public void ReInit( JavaCharStream stream, int lexState) + { + + ReInit( stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public void SwitchTo(int lexState) + { + if (lexState >= 3 || lexState < 0) + throw new TokenMgrException("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrException.INVALID_LEXICAL_STATE); + else + curLexState = lexState; + } + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", + "IN_JAVA_DOC_COMMENT", + "IN_MULTI_LINE_COMMENT", +}; + +/** Lex State array. */ +public static final int[] jjnewLexState = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, +}; +static final long[] jjtoToken = { + 0xffffffe000000001L, 0xfffffce10fffffffL, 0x1fffffffL, +}; +static final long[] jjtoSkip = { + 0xcfffffffeL, 0x0L, 0x0L, +}; +static final long[] jjtoSpecial = { + 0xc80000000L, 0x0L, 0x0L, +}; +static final long[] jjtoMore = { + 0x1300000000L, 0x0L, 0x0L, +}; + protected JavaCharStream input_stream; private final int[] jjrounds = new int[130]; private final int[] jjstateSet = new int[2 * 130]; @@ -2803,6 +2638,6 @@ public void SwitchTo(int lexState) { private StringBuilder image = jjimage; private int jjimageLen; private int lengthOfMatch; - + protected int curChar; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/JavaCharStream.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/JavaCharStream.java index 21812fcd70..da924dbe0a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/JavaCharStream.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/JavaCharStream.java @@ -18,527 +18,543 @@ * An implementation of interface CharStream, where the stream is assumed to * contain only ASCII characters (with java-like unicode escape processing). */ - + public -class JavaCharStream { - /** - * Whether parser is static. - */ - public static final boolean staticFlag = false; - - - static final int hexval(char c) throws java.io.IOException { - switch (c) { - case '0': - return 0; - case '1': - return 1; - case '2': - return 2; - case '3': - return 3; - case '4': - return 4; - case '5': - return 5; - case '6': - return 6; - case '7': - return 7; - case '8': - return 8; - case '9': - return 9; - - case 'a': - case 'A': - return 10; - case 'b': - case 'B': - return 11; - case 'c': - case 'C': - return 12; - case 'd': - case 'D': - return 13; - case 'e': - case 'E': - return 14; - case 'f': - case 'F': - return 15; - } - - throw new java.io.IOException(); // Should never come here - } - - /** - * Position in buffer. - */ - public int bufpos = -1; - int bufsize; - int available; - int tokenBegin; - protected int bufline[]; - protected int bufcolumn[]; - - protected int column = 0; - protected int line = 1; - - protected boolean prevCharIsCR = false; - protected boolean prevCharIsLF = false; - - protected Provider inputStream; - - protected char[] nextCharBuf; - protected char[] buffer; - protected int maxNextCharInd = 0; - protected int nextCharInd = -1; - protected int inBuf = 0; - protected int tabSize = 1; - protected boolean trackLineColumn = true; - - public void setTabSize(int i) { - tabSize = i; +class JavaCharStream +{ + /** Whether parser is static. */ + public static final boolean staticFlag = false; + + + static final int hexval(char c) throws java.io.IOException { + switch(c) + { + case '0' : + return 0; + case '1' : + return 1; + case '2' : + return 2; + case '3' : + return 3; + case '4' : + return 4; + case '5' : + return 5; + case '6' : + return 6; + case '7' : + return 7; + case '8' : + return 8; + case '9' : + return 9; + + case 'a' : + case 'A' : + return 10; + case 'b' : + case 'B' : + return 11; + case 'c' : + case 'C' : + return 12; + case 'd' : + case 'D' : + return 13; + case 'e' : + case 'E' : + return 14; + case 'f' : + case 'F' : + return 15; } - public int getTabSize(int i) { - return tabSize; + throw new java.io.IOException(); // Should never come here + } + +/** Position in buffer. */ + public int bufpos = -1; + int bufsize; + int available; + int tokenBegin; + protected int bufline[]; + protected int bufcolumn[]; + + protected int column = 0; + protected int line = 1; + + protected boolean prevCharIsCR = false; + protected boolean prevCharIsLF = false; + + protected Provider inputStream; + + protected char[] nextCharBuf; + protected char[] buffer; + protected int maxNextCharInd = 0; + protected int nextCharInd = -1; + protected int inBuf = 0; + protected int tabSize = 1; + protected boolean trackLineColumn = true; + + public void setTabSize(int i) { tabSize = i; } + public int getTabSize(int i) { return tabSize; } + + protected void ExpandBuff(boolean wrapAround) + { + char[] newbuffer = new char[bufsize + 2048]; + int newbufline[] = new int[bufsize + 2048]; + int newbufcolumn[] = new int[bufsize + 2048]; + + try + { + if (wrapAround) + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); + bufcolumn = newbufcolumn; + + bufpos += (bufsize - tokenBegin); } + else + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + buffer = newbuffer; - protected void ExpandBuff(boolean wrapAround) { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + bufline = newbufline; - try { - if (wrapAround) { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); - buffer = newbuffer; + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + bufcolumn = newbufcolumn; - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; + bufpos -= tokenBegin; + } + } + catch (Exception t) + { + throw new RuntimeException(t.getMessage()); + } - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; + available = (bufsize += 2048); + tokenBegin = 0; + } + + protected void FillBuff() throws java.io.IOException + { + int i; + if (maxNextCharInd == 4096) + maxNextCharInd = nextCharInd = 0; + + try { + if ((i = inputStream.read(nextCharBuf, maxNextCharInd, + 4096 - maxNextCharInd)) == -1) + { + inputStream.close(); + throw new java.io.IOException(); + } + else + maxNextCharInd += i; + return; + } + catch(java.io.IOException e) { + if (bufpos != 0) + { + --bufpos; + backup(0); + } + else + { + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + throw e; + } + } - bufpos += (bufsize - tokenBegin); - } else { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; + protected char ReadByte() throws java.io.IOException + { + if (++nextCharInd >= maxNextCharInd) + FillBuff(); - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; + return nextCharBuf[nextCharInd]; + } - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; +/** @return starting character for token. */ + public char BeginToken() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; - bufpos -= tokenBegin; - } - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } + if (++bufpos == bufsize) + bufpos = 0; - available = (bufsize += 2048); - tokenBegin = 0; + tokenBegin = bufpos; + return buffer[bufpos]; } - protected void FillBuff() throws java.io.IOException { - int i; - if (maxNextCharInd == 4096) - maxNextCharInd = nextCharInd = 0; - - try { - if ((i = inputStream.read(nextCharBuf, maxNextCharInd, - 4096 - maxNextCharInd)) == -1) { - inputStream.close(); - throw new java.io.IOException(); - } else - maxNextCharInd += i; - return; - } catch (java.io.IOException e) { - if (bufpos != 0) { - --bufpos; - backup(0); - } else { - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - throw e; - } + tokenBegin = 0; + bufpos = -1; + + return readChar(); + } + + protected void AdjustBuffSize() + { + if (available == bufsize) + { + if (tokenBegin > 2048) + { + bufpos = 0; + available = tokenBegin; + } + else + ExpandBuff(false); } - - protected char ReadByte() throws java.io.IOException { - if (++nextCharInd >= maxNextCharInd) - FillBuff(); - - return nextCharBuf[nextCharInd]; + else if (available > tokenBegin) + available = bufsize; + else if ((tokenBegin - available) < 2048) + ExpandBuff(true); + else + available = tokenBegin; + } + + protected void UpdateLineColumn(char c) + { + column++; + + if (prevCharIsLF) + { + prevCharIsLF = false; + line += (column = 1); } - - /** - * @return starting character for token. - */ - public char BeginToken() throws java.io.IOException { - if (inBuf > 0) { - --inBuf; - - if (++bufpos == bufsize) - bufpos = 0; - - tokenBegin = bufpos; - return buffer[bufpos]; - } - - tokenBegin = 0; - bufpos = -1; - - return readChar(); + else if (prevCharIsCR) + { + prevCharIsCR = false; + if (c == '\n') + { + prevCharIsLF = true; + } + else + line += (column = 1); } - protected void AdjustBuffSize() { - if (available == bufsize) { - if (tokenBegin > 2048) { - bufpos = 0; - available = tokenBegin; - } else - ExpandBuff(false); - } else if (available > tokenBegin) - available = bufsize; - else if ((tokenBegin - available) < 2048) - ExpandBuff(true); - else - available = tokenBegin; + switch (c) + { + case '\r' : + prevCharIsCR = true; + break; + case '\n' : + prevCharIsLF = true; + break; + case '\t' : + column--; + column += (tabSize - (column % tabSize)); + break; + default : + break; } - protected void UpdateLineColumn(char c) { - column++; - - if (prevCharIsLF) { - prevCharIsLF = false; - line += (column = 1); - } else if (prevCharIsCR) { - prevCharIsCR = false; - if (c == '\n') { - prevCharIsLF = true; - } else - line += (column = 1); - } + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } - switch (c) { - case '\r': - prevCharIsCR = true; - break; - case '\n': - prevCharIsLF = true; - break; - case '\t': - column--; - column += (tabSize - (column % tabSize)); - break; - default: - break; - } +/** Read a character. */ + public char readChar() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; - bufline[bufpos] = line; - bufcolumn[bufpos] = column; + if (++bufpos == bufsize) + bufpos = 0; + + return buffer[bufpos]; } - /** - * Read a character. - */ - public char readChar() throws java.io.IOException { - if (inBuf > 0) { - --inBuf; + char c; - if (++bufpos == bufsize) - bufpos = 0; + if (++bufpos == available) + AdjustBuffSize(); - return buffer[bufpos]; - } + if ((buffer[bufpos] = c = ReadByte()) == '\\') + { + UpdateLineColumn(c); - char c; + int backSlashCnt = 1; + for (;;) // Read all the backslashes + { if (++bufpos == available) - AdjustBuffSize(); + AdjustBuffSize(); - if ((buffer[bufpos] = c = ReadByte()) == '\\') { + try + { + if ((buffer[bufpos] = c = ReadByte()) != '\\') + { UpdateLineColumn(c); - - int backSlashCnt = 1; - - for (; ; ) // Read all the backslashes + // found a non-backslash char. + if ((c == 'u') && ((backSlashCnt & 1) == 1)) { - if (++bufpos == available) - AdjustBuffSize(); - - try { - if ((buffer[bufpos] = c = ReadByte()) != '\\') { - UpdateLineColumn(c); - // found a non-backslash char. - if ((c == 'u') && ((backSlashCnt & 1) == 1)) { - if (--bufpos < 0) - bufpos = bufsize - 1; - - break; - } - - backup(backSlashCnt); - return '\\'; - } - } catch (java.io.IOException e) { - // We are returning one backslash so we should only backup (count-1) - if (backSlashCnt > 1) - backup(backSlashCnt - 1); - - return '\\'; - } - - UpdateLineColumn(c); - backSlashCnt++; - } - - // Here, we have seen an odd number of backslash's followed by a 'u' - try { - while ((c = ReadByte()) == 'u') - ++column; + if (--bufpos < 0) + bufpos = bufsize - 1; - buffer[bufpos] = c = (char) (hexval(c) << 12 | - hexval(ReadByte()) << 8 | - hexval(ReadByte()) << 4 | - hexval(ReadByte())); - - column += 4; - } catch (java.io.IOException e) { - throw new RuntimeException("Invalid escape character at line " + line + - " column " + column + "."); + break; } - if (backSlashCnt == 1) - return c; - else { - backup(backSlashCnt - 1); - return '\\'; - } - } else { - UpdateLineColumn(c); - return c; + backup(backSlashCnt); + return '\\'; + } } - } + catch(java.io.IOException e) + { + // We are returning one backslash so we should only backup (count-1) + if (backSlashCnt > 1) + backup(backSlashCnt-1); - @Deprecated - /** - * @deprecated - * @see #getEndColumn - */ - public int getColumn() { - return bufcolumn[bufpos]; - } + return '\\'; + } - @Deprecated - /** - * @deprecated - * @see #getEndLine - */ - public int getLine() { - return bufline[bufpos]; + UpdateLineColumn(c); + backSlashCnt++; + } + + // Here, we have seen an odd number of backslash's followed by a 'u' + try + { + while ((c = ReadByte()) == 'u') + ++column; + + buffer[bufpos] = c = (char)(hexval(c) << 12 | + hexval(ReadByte()) << 8 | + hexval(ReadByte()) << 4 | + hexval(ReadByte())); + + column += 4; + } + catch(java.io.IOException e) + { + throw new RuntimeException("Invalid escape character at line " + line + + " column " + column + "."); + } + + if (backSlashCnt == 1) + return c; + else + { + backup(backSlashCnt - 1); + return '\\'; + } } - - /** - * Get end column. - */ - public int getEndColumn() { - return bufcolumn[bufpos]; + else + { + UpdateLineColumn(c); + return c; } - - /** - * Get end line. - */ - public int getEndLine() { - return bufline[bufpos]; + } + + @Deprecated + /** + * @deprecated + * @see #getEndColumn + */ + public int getColumn() { + return bufcolumn[bufpos]; + } + + @Deprecated + /** + * @deprecated + * @see #getEndLine + */ + public int getLine() { + return bufline[bufpos]; + } + +/** Get end column. */ + public int getEndColumn() { + return bufcolumn[bufpos]; + } + +/** Get end line. */ + public int getEndLine() { + return bufline[bufpos]; + } + +/** @return column of token start */ + public int getBeginColumn() { + return bufcolumn[tokenBegin]; + } + +/** @return line number of token start */ + public int getBeginLine() { + return bufline[tokenBegin]; + } + +/** Retreat. */ + public void backup(int amount) { + + inBuf += amount; + if ((bufpos -= amount) < 0) + bufpos += bufsize; + } + +/** Constructor. */ + public JavaCharStream(Provider dstream, + int startline, int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + +/** Constructor. */ + public JavaCharStream(Provider dstream, + int startline, int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(Provider dstream) + { + this(dstream, 1, 1, 4096); + } +/** Reinitialise. */ + public void ReInit(Provider dstream, + int startline, int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + if (buffer == null || buffersize != buffer.length) + { + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; } - - /** - * @return column of token start - */ - public int getBeginColumn() { - return bufcolumn[tokenBegin]; + prevCharIsLF = prevCharIsCR = false; + tokenBegin = inBuf = maxNextCharInd = 0; + nextCharInd = bufpos = -1; + } + +/** Reinitialise. */ + public void ReInit(Provider dstream, + int startline, int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } + +/** Reinitialise. */ + public void ReInit(Provider dstream) + { + ReInit(dstream, 1, 1, 4096); + } + + + + /** @return token image as String */ + public String GetImage() + { + if (bufpos >= tokenBegin) + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + else + return new String(buffer, tokenBegin, bufsize - tokenBegin) + + new String(buffer, 0, bufpos + 1); + } + + /** @return suffix */ + public char[] GetSuffix(int len) + { + char[] ret = new char[len]; + + if ((bufpos + 1) >= len) + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); + else + { + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, + len - bufpos - 1); + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); } - /** - * @return line number of token start - */ - public int getBeginLine() { - return bufline[tokenBegin]; + return ret; + } + + /** Set buffers back to null when finished. */ + public void Done() + { + nextCharBuf = null; + buffer = null; + bufline = null; + bufcolumn = null; + } + + /** + * Method to adjust line and column numbers for the start of a token. + */ + public void adjustBeginLineColumn(int newLine, int newCol) + { + int start = tokenBegin; + int len; + + if (bufpos >= tokenBegin) + { + len = bufpos - tokenBegin + inBuf + 1; } - - /** - * Retreat. - */ - public void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) - bufpos += bufsize; + else + { + len = bufsize - tokenBegin + bufpos + 1 + inBuf; } - /** - * Constructor. - */ - public JavaCharStream(Provider dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } + int i = 0, j = 0, k = 0; + int nextColDiff = 0, columnDiff = 0; - /** - * Constructor. - */ - public JavaCharStream(Provider dstream, - int startline, int startcolumn) { - this(dstream, startline, startcolumn, 4096); + while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) + { + bufline[j] = newLine; + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; + bufcolumn[j] = newCol + columnDiff; + columnDiff = nextColDiff; + i++; } - /** - * Constructor. - */ - public JavaCharStream(Provider dstream) { - this(dstream, 1, 1, 4096); - } + if (i < len) + { + bufline[j] = newLine++; + bufcolumn[j] = newCol + columnDiff; - /** - * Reinitialise. - */ - public void ReInit(Provider dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - prevCharIsLF = prevCharIsCR = false; - tokenBegin = inBuf = maxNextCharInd = 0; - nextCharInd = bufpos = -1; - } - - /** - * Reinitialise. - */ - public void ReInit(Provider dstream, - int startline, int startcolumn) { - ReInit(dstream, startline, startcolumn, 4096); - } - - /** - * Reinitialise. - */ - public void ReInit(Provider dstream) { - ReInit(dstream, 1, 1, 4096); - } - - - /** - * @return token image as String - */ - public String GetImage() { - if (bufpos >= tokenBegin) - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + while (i++ < len) + { + if (bufline[j = start % bufsize] != bufline[++start % bufsize]) + bufline[j] = newLine++; else - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); + bufline[j] = newLine; + } } - /** - * @return suffix - */ - public char[] GetSuffix(int len) { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - else { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); - } - - return ret; - } - - /** - * Set buffers back to null when finished. - */ - public void Done() { - nextCharBuf = null; - buffer = null; - bufline = null; - bufcolumn = null; - } - - /** - * Method to adjust line and column numbers for the start of a token. - */ - public void adjustBeginLineColumn(int newLine, int newCol) { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) { - len = bufpos - tokenBegin + inBuf + 1; - } else { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; - } - - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; - } - - if (i < len) { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) - bufline[j] = newLine++; - else - bufline[j] = newLine; - } - } - - line = bufline[j]; - column = bufcolumn[j]; - } - - boolean getTrackLineColumn() { - return trackLineColumn; - } - - void setTrackLineColumn(boolean tlc) { - trackLineColumn = tlc; - } + line = bufline[j]; + column = bufcolumn[j]; + } + boolean getTrackLineColumn() { return trackLineColumn; } + void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; } } /* JavaCC - OriginalChecksum=9ab0136fd4b1e2a45a251f41181a5bd8 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ParseException.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ParseException.java index 2058f88ff4..32283676c2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ParseException.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/ParseException.java @@ -19,208 +19,209 @@ * You can explicitly create objects of this exception type by * calling the method generateParseException in the generated * parser. - *

    + * * You can modify this class to customize your error reporting * mechanisms so long as you retain the public fields. */ public class ParseException extends Exception { - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; - - private static final String INDENT = " "; - - /** - * The end of line string (we do not use System.getProperty("") so that we are compatible with Android/GWT); - */ - protected static String EOL = "\n"; - - - public ParseException(Token currentTokenVal, - int[][] expectedTokenSequencesVal, - String[] tokenImageVal - ) { - this(currentTokenVal, expectedTokenSequencesVal, tokenImageVal, null); + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + private static final String INDENT = " "; + + /** + * The end of line string (we do not use System.getProperty("") so that we are compatible with Android/GWT); + */ + protected static String EOL = "\n"; + + + public ParseException(Token currentTokenVal, + int[][] expectedTokenSequencesVal, + String[] tokenImageVal + ) + { + this (currentTokenVal, expectedTokenSequencesVal, tokenImageVal, null); + } + + + /** + * This constructor is used by the method "generateParseException" + * in the generated parser. Calling this constructor generates + * a new object of this type with the fields "currentToken", + * "expectedTokenSequences", and "tokenImage" set. + */ + public ParseException(Token currentTokenVal, + int[][] expectedTokenSequencesVal, + String[] tokenImageVal, + String lexicalStateName + ) + { + super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal, lexicalStateName)); + currentToken = currentTokenVal; + expectedTokenSequences = expectedTokenSequencesVal; + tokenImage = tokenImageVal; + } + + /** + * The following constructors are for use by you for whatever + * purpose you can think of. Constructing the exception in this + * manner makes the exception behave in the normal way - i.e., as + * documented in the class "Throwable". The fields "errorToken", + * "expectedTokenSequences", and "tokenImage" do not contain + * relevant information. The JavaCC generated code does not use + * these constructors. + */ + + public ParseException() { + super(); + } + + /** Constructor with message. */ + public ParseException(String message) { + super(message); + } + + + /** + * This is the last token that has been consumed successfully. If + * this object has been created due to a parse error, the token + * followng this token will (therefore) be the first error token. + */ + public Token currentToken; + + /** + * Each entry in this array is an array of integers. Each array + * of integers represents a sequence of tokens (by their ordinal + * values) that is expected at this point of the parse. + */ + public int[][] expectedTokenSequences; + + /** + * This is a reference to the "tokenImage" array of the generated + * parser within which the parse error occurred. This array is + * defined in the generated ...Constants interface. + */ + public String[] tokenImage; + + /** + * It uses "currentToken" and "expectedTokenSequences" to generate a parse + * error message and returns it. If this object has been created + * due to a parse error, and you do not catch it (it gets thrown + * from the parser) the correct error message + * gets displayed. + */ + private static String initialise(Token currentToken, + int[][] expectedTokenSequences, + String[] tokenImage, + String lexicalStateName) { + StringBuilder sb = new StringBuilder(); + StringBuffer expected = new StringBuffer(); + + int maxSize = 0; + java.util.TreeSet sortedOptions = new java.util.TreeSet(); + for (int i = 0; i < expectedTokenSequences.length; i++) { + if (maxSize < expectedTokenSequences[i].length) { + maxSize = expectedTokenSequences[i].length; + } + for (int j = 0; j < expectedTokenSequences[i].length; j++) { + sortedOptions.add(tokenImage[expectedTokenSequences[i][j]]); + } } - - - /** - * This constructor is used by the method "generateParseException" - * in the generated parser. Calling this constructor generates - * a new object of this type with the fields "currentToken", - * "expectedTokenSequences", and "tokenImage" set. - */ - public ParseException(Token currentTokenVal, - int[][] expectedTokenSequencesVal, - String[] tokenImageVal, - String lexicalStateName - ) { - super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal, lexicalStateName)); - currentToken = currentTokenVal; - expectedTokenSequences = expectedTokenSequencesVal; - tokenImage = tokenImageVal; + + for (String option : sortedOptions) { + expected.append(INDENT).append(option).append(EOL); + } + + sb.append("Encountered unexpected token:"); + + Token tok = currentToken.next; + for (int i = 0; i < maxSize; i++) { + String tokenText = tok.image; + String escapedTokenText = add_escapes(tokenText); + if (i != 0) { + sb.append(" "); + } + if (tok.kind == 0) { + sb.append(tokenImage[0]); + break; + } + sb.append(" \""); + sb.append(escapedTokenText); + sb.append("\""); + sb.append(" " + tokenImage[tok.kind]); + tok = tok.next; } - - /** - * The following constructors are for use by you for whatever - * purpose you can think of. Constructing the exception in this - * manner makes the exception behave in the normal way - i.e., as - * documented in the class "Throwable". The fields "errorToken", - * "expectedTokenSequences", and "tokenImage" do not contain - * relevant information. The JavaCC generated code does not use - * these constructors. - */ - - public ParseException() { - super(); - } - - /** - * Constructor with message. - */ - public ParseException(String message) { - super(message); + sb.append(EOL).append(INDENT).append("at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn); + sb.append(".").append(EOL); + + if (expectedTokenSequences.length == 0) { + // Nothing to add here + } else { + int numExpectedTokens = expectedTokenSequences.length; + sb.append(EOL).append("Was expecting"+ (numExpectedTokens == 1 ? ":" : " one of:") + EOL + EOL); + sb.append(expected.toString()); } - - - /** - * This is the last token that has been consumed successfully. If - * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. - */ - public Token currentToken; - - /** - * Each entry in this array is an array of integers. Each array - * of integers represents a sequence of tokens (by their ordinal - * values) that is expected at this point of the parse. - */ - public int[][] expectedTokenSequences; - - /** - * This is a reference to the "tokenImage" array of the generated - * parser within which the parse error occurred. This array is - * defined in the generated ...Constants interface. - */ - public String[] tokenImage; - - /** - * It uses "currentToken" and "expectedTokenSequences" to generate a parse - * error message and returns it. If this object has been created - * due to a parse error, and you do not catch it (it gets thrown - * from the parser) the correct error message - * gets displayed. - */ - private static String initialise(Token currentToken, - int[][] expectedTokenSequences, - String[] tokenImage, - String lexicalStateName) { - StringBuilder sb = new StringBuilder(); - StringBuffer expected = new StringBuffer(); - - int maxSize = 0; - java.util.TreeSet sortedOptions = new java.util.TreeSet(); - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; - } - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - sortedOptions.add(tokenImage[expectedTokenSequences[i][j]]); - } - } - - for (String option : sortedOptions) { - expected.append(INDENT).append(option).append(EOL); - } - - sb.append("Encountered unexpected token:"); - - Token tok = currentToken.next; - for (int i = 0; i < maxSize; i++) { - String tokenText = tok.image; - String escapedTokenText = add_escapes(tokenText); - if (i != 0) { - sb.append(" "); - } - if (tok.kind == 0) { - sb.append(tokenImage[0]); - break; - } - sb.append(" \""); - sb.append(escapedTokenText); - sb.append("\""); - sb.append(" " + tokenImage[tok.kind]); - tok = tok.next; - } - sb.append(EOL).append(INDENT).append("at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn); - sb.append(".").append(EOL); - - if (expectedTokenSequences.length == 0) { - // Nothing to add here - } else { - int numExpectedTokens = expectedTokenSequences.length; - sb.append(EOL).append("Was expecting" + (numExpectedTokens == 1 ? ":" : " one of:") + EOL + EOL); - sb.append(expected.toString()); - } - // 2013/07/30 --> Seems to be inaccurate as represents the readahead state, not the lexical state BEFORE the unknown token + // 2013/07/30 --> Seems to be inaccurate as represents the readahead state, not the lexical state BEFORE the unknown token // if (lexicalStateName != null) { // sb.append(EOL).append("** Lexical State : ").append(lexicalStateName).append(EOL).append(EOL); // } - - return sb.toString(); - } - - - /** - * Used to convert raw characters to their escaped version - * when these raw version cannot be used as part of an ASCII - * string literal. - */ - static String add_escapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } + + return sb.toString(); + } + + + /** + * Used to convert raw characters to their escaped version + * when these raw version cannot be used as part of an ASCII + * string literal. + */ + static String add_escapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; } - return retval.toString(); - } + } + return retval.toString(); + } } /* JavaCC - OriginalChecksum=c0da6a86ac0d0ec8b633aeafa43e6e37 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Provider.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Provider.java index 02a2eb9c7c..13d71c5283 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Provider.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Provider.java @@ -20,22 +20,20 @@ public interface Provider { /** * Reads characters into an array - * - * @param buffer Destination buffer - * @param offset Offset at which to start storing characters - * @param len The maximum possible number of characters to read + * @param buffer Destination buffer + * @param offset Offset at which to start storing characters + * @param len The maximum possible number of characters to read * @return The number of characters read, or -1 if all read - * @throws IOException + * @exception IOException */ public int read(char buffer[], int offset, int len) throws IOException; - + /** * Closes the stream and releases any system resources associated with * it. - * - * @throws IOException + * @exception IOException */ - public void close() throws IOException; - + public void close() throws IOException; + } /* JavaCC - OriginalChecksum=89684d4e3db82aa5e480d095c170b352 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StreamProvider.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StreamProvider.java index fbcd67e82f..2c30e16104 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StreamProvider.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StreamProvider.java @@ -26,23 +26,23 @@ */ public class StreamProvider implements Provider { - Reader _reader; + Reader _reader; - public StreamProvider(Reader reader) { - _reader = reader; - } + public StreamProvider(Reader reader) { + _reader = reader; + } + + public StreamProvider(InputStream stream) throws IOException { + _reader = new BufferedReader(new InputStreamReader(stream)); + } + + public StreamProvider(InputStream stream, String charsetName) throws IOException { + _reader = new BufferedReader(new InputStreamReader(stream, charsetName)); + } - public StreamProvider(InputStream stream) throws IOException { - _reader = new BufferedReader(new InputStreamReader(stream)); - } - - public StreamProvider(InputStream stream, String charsetName) throws IOException { - _reader = new BufferedReader(new InputStreamReader(stream, charsetName)); - } - - @Override - public int read(char[] buffer, int off, int len) throws IOException { - int result = _reader.read(buffer, off, len); + @Override + public int read(char[] buffer, int off, int len) throws IOException { + int result = _reader.read(buffer, off, len); /* CBA -- Added 2014/03/29 -- This logic allows the generated Java code to be easily translated to C# (via sharpen) - @@ -50,20 +50,20 @@ public int read(char[] buffer, int off, int len) throws IOException { See : http://msdn.microsoft.com/en-us/library/9kstw824(v=vs.110).aspx ** Technically, this is not required for java but the overhead is extremely low compared to the code generation benefits. */ + + if (result == 0) { + if (off < buffer.length && len > 0) { + result = -1; + } + } + + return result; + } - if (result == 0) { - if (off < buffer.length && len > 0) { - result = -1; - } - } - - return result; - } - - @Override - public void close() throws IOException { - _reader.close(); - } + @Override + public void close() throws IOException { + _reader.close(); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StringProvider.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StringProvider.java index 056a442f75..83c3504c90 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StringProvider.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/StringProvider.java @@ -14,47 +14,47 @@ */ package com.github.javaparser; - -import java.io.IOException; - -public class StringProvider implements Provider { - - String _string; - int _position = 0; - int _size; - - public StringProvider(String string) { - _string = string; - _size = string.length(); - } - - @Override - public int read(char[] cbuf, int off, int len) throws IOException { - int numCharsOutstandingInString = _size - _position; - - if (numCharsOutstandingInString == 0) { - return -1; - } - - int numBytesInBuffer = cbuf.length; - int numBytesToRead = numBytesInBuffer - off; - numBytesToRead = numBytesToRead > len ? len : numBytesToRead; - - if (numBytesToRead > numCharsOutstandingInString) { - numBytesToRead = numCharsOutstandingInString; - } - - _string.getChars(_position, _position + numBytesToRead, cbuf, off); - - _position += numBytesToRead; - - return numBytesToRead; - } - - @Override - public void close() throws IOException { - _string = null; - } - -} + + import java.io.IOException; + + public class StringProvider implements Provider { + + String _string; + int _position = 0; + int _size; + + public StringProvider(String string) { + _string = string; + _size = string.length(); + } + + @Override + public int read(char[] cbuf, int off, int len) throws IOException { + int numCharsOutstandingInString = _size - _position; + + if (numCharsOutstandingInString == 0) { + return -1; + } + + int numBytesInBuffer = cbuf.length; + int numBytesToRead = numBytesInBuffer -off; + numBytesToRead = numBytesToRead > len ? len : numBytesToRead; + + if (numBytesToRead > numCharsOutstandingInString) { + numBytesToRead = numCharsOutstandingInString; + } + + _string.getChars(_position, _position + numBytesToRead, cbuf, off); + + _position += numBytesToRead; + + return numBytesToRead; + } + + @Override + public void close() throws IOException { + _string = null; + } + + } /* JavaCC - OriginalChecksum=9873e92cad8666980a4c6d392c0c7ad4 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Token.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Token.java index 4af5ff3b71..2731d04279 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Token.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/Token.java @@ -20,128 +20,124 @@ public class Token implements java.io.Serializable { - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; - - /** - * An integer that describes the kind of this token. This numbering - * system is determined by JavaCCParser, and a table of these numbers is - * stored in the file ...Constants.java. - */ - public int kind; - - /** - * The line number of the first character of this Token. - */ - public int beginLine; - /** - * The column number of the first character of this Token. - */ - public int beginColumn; - /** - * The line number of the last character of this Token. - */ - public int endLine; - /** - * The column number of the last character of this Token. - */ - public int endColumn; - - /** - * The string image of the token. - */ - public String image; - - /** - * A reference to the next regular (non-special) token from the input - * stream. If this is the last token from the input stream, or if the - * token manager has not read tokens beyond this one, this field is - * set to null. This is true only if this token is also a regular - * token. Otherwise, see below for a description of the contents of - * this field. - */ - public Token next; - - /** - * This field is used to access special tokens that occur prior to this - * token, but after the immediately preceding regular (non-special) token. - * If there are no such special tokens, this field is set to null. - * When there are more than one such special token, this field refers - * to the last of these special tokens, which in turn refers to the next - * previous special token through its specialToken field, and so on - * until the first special token (whose specialToken field is null). - * The next fields of special tokens refer to other special tokens that - * immediately follow it (without an intervening regular token). If there - * is no such token, this field is null. - */ - public Token specialToken; - - /** - * An optional attribute value of the Token. - * Tokens which are not used as syntactic sugar will often contain - * meaningful values that will be used later on by the compiler or - * interpreter. This attribute value is often different from the image. - * Any subclass of Token that actually wants to return a non-null value can - * override this method as appropriate. - */ - public Object getValue() { - return null; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /** + * An integer that describes the kind of this token. This numbering + * system is determined by JavaCCParser, and a table of these numbers is + * stored in the file ...Constants.java. + */ + public int kind; + + /** The line number of the first character of this Token. */ + public int beginLine; + /** The column number of the first character of this Token. */ + public int beginColumn; + /** The line number of the last character of this Token. */ + public int endLine; + /** The column number of the last character of this Token. */ + public int endColumn; + + /** + * The string image of the token. + */ + public String image; + + /** + * A reference to the next regular (non-special) token from the input + * stream. If this is the last token from the input stream, or if the + * token manager has not read tokens beyond this one, this field is + * set to null. This is true only if this token is also a regular + * token. Otherwise, see below for a description of the contents of + * this field. + */ + public Token next; + + /** + * This field is used to access special tokens that occur prior to this + * token, but after the immediately preceding regular (non-special) token. + * If there are no such special tokens, this field is set to null. + * When there are more than one such special token, this field refers + * to the last of these special tokens, which in turn refers to the next + * previous special token through its specialToken field, and so on + * until the first special token (whose specialToken field is null). + * The next fields of special tokens refer to other special tokens that + * immediately follow it (without an intervening regular token). If there + * is no such token, this field is null. + */ + public Token specialToken; + + /** + * An optional attribute value of the Token. + * Tokens which are not used as syntactic sugar will often contain + * meaningful values that will be used later on by the compiler or + * interpreter. This attribute value is often different from the image. + * Any subclass of Token that actually wants to return a non-null value can + * override this method as appropriate. + */ + public Object getValue() { + return null; + } + + /** + * No-argument constructor + */ + public Token() {} + + /** + * Constructs a new token for the specified Image. + */ + public Token(int kind) + { + this(kind, null); + } + + /** + * Constructs a new token for the specified Image and Kind. + */ + public Token(int kind, String image) + { + this.kind = kind; + this.image = image; + } + + /** + * Returns the image. + */ + public String toString() + { + return image; + } + + /** + * Returns a new Token object, by default. However, if you want, you + * can create and return subclass objects based on the value of ofKind. + * Simply add the cases to the switch for all those special cases. + * For example, if you have a subclass of Token called IDToken that + * you want to create if ofKind is ID, simply add something like : + * + * case MyParserConstants.ID : return new IDToken(ofKind, image); + * + * to the following switch statement. Then you can cast matchedToken + * variable to the appropriate type and use sit in your lexical actions. + */ + public static Token newToken(int ofKind, String image) + { + switch(ofKind) + { + default : return new Token(ofKind, image); } + } - /** - * No-argument constructor - */ - public Token() { - } - - /** - * Constructs a new token for the specified Image. - */ - public Token(int kind) { - this(kind, null); - } - - /** - * Constructs a new token for the specified Image and Kind. - */ - public Token(int kind, String image) { - this.kind = kind; - this.image = image; - } - - /** - * Returns the image. - */ - public String toString() { - return image; - } - - /** - * Returns a new Token object, by default. However, if you want, you - * can create and return subclass objects based on the value of ofKind. - * Simply add the cases to the switch for all those special cases. - * For example, if you have a subclass of Token called IDToken that - * you want to create if ofKind is ID, simply add something like : - *

    - * case MyParserConstants.ID : return new IDToken(ofKind, image); - *

    - * to the following switch statement. Then you can cast matchedToken - * variable to the appropriate type and use sit in your lexical actions. - */ - public static Token newToken(int ofKind, String image) { - switch (ofKind) { - default: - return new Token(ofKind, image); - } - } - - public static Token newToken(int ofKind) { - return newToken(ofKind, null); - } + public static Token newToken(int ofKind) + { + return newToken(ofKind, null); + } } /* JavaCC - OriginalChecksum=fd43051db65fcdc22df39a61d81bf7a4 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrError.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrError.java index 02afe0d7f9..09197e805c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrError.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrError.java @@ -14,152 +14,146 @@ */ package com.github.javaparser; -/** - * Token Manager Error. - */ -public class TokenMgrError extends Error { +/** Token Manager Error. */ +public class TokenMgrError extends Error +{ - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ + /* + * Ordinals for various reasons why an Error of this type can be thrown. + */ - /** - * Lexical error occurred. - */ - static final int LEXICAL_ERROR = 0; + /** + * Lexical error occurred. + */ + static final int LEXICAL_ERROR = 0; - /** - * An attempt was made to create a second instance of a static token manager. - */ - static final int STATIC_LEXER_ERROR = 1; + /** + * An attempt was made to create a second instance of a static token manager. + */ + static final int STATIC_LEXER_ERROR = 1; - /** - * Tried to change to an invalid lexical state. - */ - static final int INVALID_LEXICAL_STATE = 2; + /** + * Tried to change to an invalid lexical state. + */ + static final int INVALID_LEXICAL_STATE = 2; - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - static final int LOOP_DETECTED = 3; + /** + * Detected (and bailed out of) an infinite loop in the token manager. + */ + static final int LOOP_DETECTED = 3; - /** - * Indicates the reason why the exception is thrown. It will have - * one of the above 4 values. - */ - int errorCode; + /** + * Indicates the reason why the exception is thrown. It will have + * one of the above 4 values. + */ + int errorCode; - /** - * Replaces unprintable characters by their escaped (or unicode escaped) - * equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case 0: - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); + /** + * Replaces unprintable characters by their escaped (or unicode escaped) + * equivalents in the given string + */ + protected static final String addEscapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case 0 : + continue; + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } } + return retval.toString(); + } - /** - * Returns a detailed message for the Error when it is thrown by the - * token manager to indicate a lexical error. - * Parameters : - * EOFSeen : indicates if EOF caused the lexical error - * curLexState : lexical state in which this error occurred - * errorLine : line number when the error occurred - * errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred - * curchar : the offending character - * Note: You can customize the lexical error message by modifying this method. - */ - protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { - return ("Lexical error at line " + - errorLine + ", column " + - errorColumn + ". Encountered: " + - (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") + - "after : \"" + addEscapes(errorAfter) + "\""); - } + /** + * Returns a detailed message for the Error when it is thrown by the + * token manager to indicate a lexical error. + * Parameters : + * EOFSeen : indicates if EOF caused the lexical error + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred + * curchar : the offending character + * Note: You can customize the lexical error message by modifying this method. + */ + protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { + return("Lexical error at line " + + errorLine + ", column " + + errorColumn + ". Encountered: " + + (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + + "after : \"" + addEscapes(errorAfter) + "\""); + } - /** - * You can also modify the body of this method to customize your error messages. - * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - * of end-users concern, so you can return something like : - *

    - * "Internal Error : Please file a bug report .... " - *

    - * from this method for such cases in the release version of your parser. - */ - public String getMessage() { - return super.getMessage(); - } + /** + * You can also modify the body of this method to customize your error messages. + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + * of end-users concern, so you can return something like : + * + * "Internal Error : Please file a bug report .... " + * + * from this method for such cases in the release version of your parser. + */ + public String getMessage() { + return super.getMessage(); + } - /* - * Constructors of various flavors follow. - */ + /* + * Constructors of various flavors follow. + */ - /** - * No arg constructor. - */ - public TokenMgrError() { - } + /** No arg constructor. */ + public TokenMgrError() { + } - /** - * Constructor with message and reason. - */ - public TokenMgrError(String message, int reason) { - super(message); - errorCode = reason; - } + /** Constructor with message and reason. */ + public TokenMgrError(String message, int reason) { + super(message); + errorCode = reason; + } - /** - * Full Constructor. - */ - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { - this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); - } + /** Full Constructor. */ + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { + this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); + } } /* JavaCC - OriginalChecksum=f06c7e964b5c13a732337c2f3fb4f836 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrException.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrException.java index b0a10bc9d4..d290424fb7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrException.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources/com/github/javaparser/TokenMgrException.java @@ -14,151 +14,145 @@ */ package com.github.javaparser; -/** - * Token Manager Error. - */ -public class TokenMgrException extends RuntimeException { +/** Token Manager Error. */ +public class TokenMgrException extends RuntimeException +{ - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ + /* + * Ordinals for various reasons why an Error of this type can be thrown. + */ - /** - * Lexical error occurred. - */ - public static final int LEXICAL_ERROR = 0; + /** + * Lexical error occurred. + */ + public static final int LEXICAL_ERROR = 0; - /** - * An attempt was made to create a second instance of a static token manager. - */ - public static final int STATIC_LEXER_ERROR = 1; + /** + * An attempt was made to create a second instance of a static token manager. + */ + public static final int STATIC_LEXER_ERROR = 1; - /** - * Tried to change to an invalid lexical state. - */ - public static final int INVALID_LEXICAL_STATE = 2; + /** + * Tried to change to an invalid lexical state. + */ + public static final int INVALID_LEXICAL_STATE = 2; - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - public static final int LOOP_DETECTED = 3; + /** + * Detected (and bailed out of) an infinite loop in the token manager. + */ + public static final int LOOP_DETECTED = 3; - /** - * Indicates the reason why the exception is thrown. It will have - * one of the above 4 values. - */ - int errorCode; + /** + * Indicates the reason why the exception is thrown. It will have + * one of the above 4 values. + */ + int errorCode; - /** - * Replaces unprintable characters by their escaped (or unicode escaped) - * equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); + /** + * Replaces unprintable characters by their escaped (or unicode escaped) + * equivalents in the given string + */ + protected static final String addEscapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } } + return retval.toString(); + } - /** - * Returns a detailed message for the Error when it is thrown by the - * token manager to indicate a lexical error. - * Parameters : - * EOFSeen : indicates if EOF caused the lexical error - * curLexState : lexical state in which this error occurred - * errorLine : line number when the error occurred - * errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred - * curchar : the offending character - * Note: You can customize the lexical error message by modifying this method. - */ - protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) { - char curChar1 = (char) curChar; - return ("Lexical error at line " + - errorLine + ", column " + - errorColumn + ". Encountered: " + - (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar1)) + "\"") + " (" + (int) curChar + "), ") + - "after : \"" + addEscapes(errorAfter) + "\""); - } + /** + * Returns a detailed message for the Error when it is thrown by the + * token manager to indicate a lexical error. + * Parameters : + * EOFSeen : indicates if EOF caused the lexical error + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred + * curchar : the offending character + * Note: You can customize the lexical error message by modifying this method. + */ + protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) { + char curChar1 = (char)curChar; + return("Lexical error at line " + + errorLine + ", column " + + errorColumn + ". Encountered: " + + (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar1)) + "\"") + " (" + (int)curChar + "), ") + + "after : \"" + addEscapes(errorAfter) + "\""); + } - /** - * You can also modify the body of this method to customize your error messages. - * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - * of end-users concern, so you can return something like : - *

    - * "Internal Error : Please file a bug report .... " - *

    - * from this method for such cases in the release version of your parser. - */ - public String getMessage() { - return super.getMessage(); - } + /** + * You can also modify the body of this method to customize your error messages. + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + * of end-users concern, so you can return something like : + * + * "Internal Error : Please file a bug report .... " + * + * from this method for such cases in the release version of your parser. + */ + public String getMessage() { + return super.getMessage(); + } - /* - * Constructors of various flavors follow. - */ + /* + * Constructors of various flavors follow. + */ - /** - * No arg constructor. - */ - public TokenMgrException() { - } + /** No arg constructor. */ + public TokenMgrException() { + } - /** - * Constructor with message and reason. - */ - public TokenMgrException(String message, int reason) { - super(message); - errorCode = reason; - } + /** Constructor with message and reason. */ + public TokenMgrException(String message, int reason) { + super(message); + errorCode = reason; + } - /** - * Full Constructor. - */ - public TokenMgrException(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) { - this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); - } + /** Full Constructor. */ + public TokenMgrException(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) { + this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); + } } /* JavaCC - OriginalChecksum=d2d40125d51af5fe5bc7e2ab87d062ad (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParser.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParser.java index 9089096869..151cff21a9 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParser.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParser.java @@ -15,7 +15,6 @@ import java.io.*; import java.util.*; - import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.comments.*; @@ -34,7 +33,7 @@ void reset(InputStream in, String encoding) { private List add(List list, Object obj) { if (list == null) { - list = new LinkedList(); + list = new LinkedList(); } list.add(obj); return list; @@ -42,26 +41,26 @@ private List add(List list, Object obj) { private List add(int pos, List list, Object obj) { if (list == null) { - list = new LinkedList(); + list = new LinkedList(); } list.add(pos, obj); return list; } - private class Modifier { + private class Modifier { - final int modifiers; - final List annotations; - final int beginLine; - final int beginColumn; + final int modifiers; + final List annotations; + final int beginLine; + final int beginColumn; - public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.modifiers = modifiers; - this.annotations = annotations; + public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { + this.beginLine = beginLine; + this.beginColumn = beginColumn; + this.modifiers = modifiers; + this.annotations = annotations; + } } - } public int addModifier(int modifiers, int mod, Token token) { if ((ModifierSet.hasModifier(modifiers, mod))) { @@ -85,27 +84,27 @@ private void throwParseException(Token token, String message) { } private Expression generateLambda(Expression ret, Statement lambdaBody) { - if (ret instanceof EnclosedExpr) { - Expression inner = ((EnclosedExpr) ret).getInner(); - if (inner != null && inner instanceof NameExpr) { - VariableDeclaratorId id = new VariableDeclaratorId(inner.getBeginLine(), inner.getBeginColumn(), inner.getEndLine(), inner.getEndColumn(), ((NameExpr) inner).getName(), 0); + if (ret instanceof EnclosedExpr) { + Expression inner = ((EnclosedExpr) ret).getInner(); + if (inner != null && inner instanceof NameExpr) { + VariableDeclaratorId id = new VariableDeclaratorId(inner.getBeginLine(), inner.getBeginColumn(), inner.getEndLine(), inner.getEndColumn(), ((NameExpr)inner).getName(), 0); + List params = add(null, new Parameter(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), 0, null, new UnknownType(), false, id)); + ret = new LambdaExpr(ret.getBeginLine(), ret.getBeginColumn(), lambdaBody.getEndLine(), lambdaBody.getEndColumn(), params, lambdaBody, true); + } else { + ret = new LambdaExpr(ret.getBeginLine(), ret.getBeginColumn(), lambdaBody.getEndLine(), lambdaBody.getEndColumn(), null, lambdaBody, true); + } + } else if (ret instanceof NameExpr) { + VariableDeclaratorId id = new VariableDeclaratorId(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), ((NameExpr)ret).getName(), 0); List params = add(null, new Parameter(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), 0, null, new UnknownType(), false, id)); - ret = new LambdaExpr(ret.getBeginLine(), ret.getBeginColumn(), lambdaBody.getEndLine(), lambdaBody.getEndColumn(), params, lambdaBody, true); + ret = new LambdaExpr(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), params, lambdaBody, false); + } else if (ret instanceof LambdaExpr) { + ((LambdaExpr) ret).setBody(lambdaBody); + ret.setEndLine(lambdaBody.getEndLine()); + ret.setEndColumn(lambdaBody.getEndColumn()); } else { - ret = new LambdaExpr(ret.getBeginLine(), ret.getBeginColumn(), lambdaBody.getEndLine(), lambdaBody.getEndColumn(), null, lambdaBody, true); + throw new ParseException("Failed to parse lambda expression! Please create an issue at https://github.com/javaparser/javaparser/issues"); } - } else if (ret instanceof NameExpr) { - VariableDeclaratorId id = new VariableDeclaratorId(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), ((NameExpr) ret).getName(), 0); - List params = add(null, new Parameter(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), 0, null, new UnknownType(), false, id)); - ret = new LambdaExpr(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), params, lambdaBody, false); - } else if (ret instanceof LambdaExpr) { - ((LambdaExpr) ret).setBody(lambdaBody); - ret.setEndLine(lambdaBody.getEndLine()); - ret.setEndColumn(lambdaBody.getEndColumn()); - } else { - throw new ParseException("Failed to parse lambda expression! Please create an issue at https://github.com/javaparser/javaparser/issues"); - } - return ret; + return ret; } static final class GTToken extends Token { @@ -124,14 +123,14 @@ public static Token newToken(int kind, String image) { private Token last_special_token = null; - /***************************************** - * THE JAVA LANGUAGE GRAMMAR STARTS HERE * - *****************************************/ +/***************************************** + * THE JAVA LANGUAGE GRAMMAR STARTS HERE * + *****************************************/ - /* - * Program structuring syntax follows. - */ - final public CompilationUnit CompilationUnit() { +/* + * Program structuring syntax follows. + */ + final public CompilationUnit CompilationUnit() { PackageDeclaration pakage = null; List imports = null; ImportDeclaration in = null; @@ -139,483 +138,400 @@ final public CompilationUnit CompilationUnit() { TypeDeclaration tn = null; int line = -1; int column = 0; - if (jj_2_1(2147483647)) { - pakage = PackageDeclaration(); - line = pakage.getBeginLine(); - column = pakage.getBeginColumn(); - } else { - ; - } - label_1: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IMPORT: - ; - break; - default: - jj_la1[0] = jj_gen; - break label_1; - } - in = ImportDeclaration(); - if (line == -1) { - line = in.getBeginLine(); - column = in.getBeginColumn(); - } - imports = add(imports, in); - } - label_2: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case CLASS: - case ENUM: - case FINAL: - case INTERFACE: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case SEMICOLON: - case AT: - ; - break; - default: - jj_la1[1] = jj_gen; - break label_2; - } - tn = TypeDeclaration(); - if (line == -1) { - line = tn.getBeginLine(); - column = tn.getBeginColumn(); - } - types = add(types, tn); - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case 0: - jj_consume_token(0); - break; - case 131: - jj_consume_token(131); - break; - default: - jj_la1[2] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) - return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn, pakage, imports, types); - } - throw new Error("Missing return statement in function"); - } - - final public PackageDeclaration PackageDeclaration() { + if (jj_2_1(2147483647)) { + pakage = PackageDeclaration(); + line = pakage.getBeginLine(); column = pakage.getBeginColumn(); + } else { + ; + } + label_1: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IMPORT: + ; + break; + default: + jj_la1[0] = jj_gen; + break label_1; + } + in = ImportDeclaration(); + if(line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); + } + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case CLASS: + case ENUM: + case FINAL: + case INTERFACE: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case SEMICOLON: + case AT: + ; + break; + default: + jj_la1[1] = jj_gen; + break label_2; + } + tn = TypeDeclaration(); + if(line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 0: + jj_consume_token(0); + break; + case 131: + jj_consume_token(131); + break; + default: + jj_la1[2] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types);} + throw new Error("Missing return statement in function"); + } + + final public PackageDeclaration PackageDeclaration() { List annotations = null; AnnotationExpr ann; NameExpr name; int line; int column; - label_3: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[3] = jj_gen; - break label_3; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - jj_consume_token(PACKAGE); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - jj_consume_token(SEMICOLON); - { - if (true) return new PackageDeclaration(line, column, token.endLine, token.endColumn, annotations, name); - } - throw new Error("Missing return statement in function"); - } - - final public ImportDeclaration ImportDeclaration() { + label_3: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[3] = jj_gen; + break label_3; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + jj_consume_token(PACKAGE); + line=token.beginLine; column=token.beginColumn; + name = Name(); + jj_consume_token(SEMICOLON); + {if (true) return new PackageDeclaration(line, column, token.endLine, token.endColumn,annotations, name);} + throw new Error("Missing return statement in function"); + } + + final public ImportDeclaration ImportDeclaration() { NameExpr name; boolean isStatic = false; boolean isAsterisk = false; int line; int column; - jj_consume_token(IMPORT); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STATIC: - jj_consume_token(STATIC); - isStatic = true; - break; - default: - jj_la1[4] = jj_gen; - ; - } - name = Name(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DOT: - jj_consume_token(DOT); - jj_consume_token(STAR); - isAsterisk = true; - break; - default: - jj_la1[5] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) - return new ImportDeclaration(line, column, token.endLine, token.endColumn, name, isStatic, isAsterisk); - } - throw new Error("Missing return statement in function"); - } - - /* - * Modifiers. We match all modifiers in a single rule to reduce the chances of - * syntax errors for simple modifier mistakes. It will also enable us to give - * better error messages. - */ - final public Modifier Modifiers() { - int beginLine = -1; - int beginColumn = -1; - int modifiers = 0; - List annotations = null; - AnnotationExpr ann; - label_4: - while (true) { - if (jj_2_2(2)) { - ; - } else { - break label_4; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PUBLIC: - jj_consume_token(PUBLIC); - modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case STATIC: - jj_consume_token(STATIC); - modifiers = addModifier(modifiers, ModifierSet.STATIC, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case PROTECTED: - jj_consume_token(PROTECTED); - modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case PRIVATE: - jj_consume_token(PRIVATE); - modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case FINAL: - jj_consume_token(FINAL); - modifiers = addModifier(modifiers, ModifierSet.FINAL, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case ABSTRACT: - jj_consume_token(ABSTRACT); - modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case SYNCHRONIZED: - jj_consume_token(SYNCHRONIZED); - modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case NATIVE: - jj_consume_token(NATIVE); - modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case TRANSIENT: - jj_consume_token(TRANSIENT); - modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case VOLATILE: - jj_consume_token(VOLATILE); - modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case STRICTFP: - jj_consume_token(STRICTFP); - modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case AT: - ann = Annotation(); - annotations = add(annotations, ann); - if (beginLine == -1) { - beginLine = ann.getBeginLine(); - beginColumn = ann.getBeginColumn(); - } - break; - default: - jj_la1[6] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return new Modifier(beginLine, beginColumn, modifiers, annotations); - } - throw new Error("Missing return statement in function"); - } - - /* - * Declaration syntax follows. - */ - final public TypeDeclaration TypeDeclaration() { - Modifier modifier; - TypeDeclaration ret; - - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - break; - case ABSTRACT: - case CLASS: - case ENUM: - case FINAL: - case INTERFACE: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case AT: - modifier = Modifiers(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - default: - jj_la1[7] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[8] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier) { - boolean isInterface = false; - NameExpr name; - List typePar = null; - List extList = null; - List impList = null; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - jj_consume_token(CLASS); - break; - case INTERFACE: - jj_consume_token(INTERFACE); - isInterface = true; - break; - default: - jj_la1[9] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - name = Name(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typePar = TypeParameters(); - typePar.remove(0); - break; - default: - jj_la1[10] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - extList = ExtendsList(isInterface); - break; - default: - jj_la1[11] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IMPLEMENTS: - impList = ImplementsList(isInterface); - break; - default: - jj_la1[12] = jj_gen; - ; - } - members = ClassOrInterfaceBody(isInterface); - ClassOrInterfaceDeclaration tmp = new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, isInterface, null, typePar, extList, impList, members); - tmp.setNameExpr(name); - { - if (true) return tmp; - } - throw new Error("Missing return statement in function"); - } - - final public List ExtendsList(boolean isInterface) { - boolean extendsMoreThanOne = false; - List ret = new LinkedList(); - ClassOrInterfaceType cit; - AnnotationExpr ann; - List annotations = null; - jj_consume_token(EXTENDS); - label_5: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[13] = jj_gen; - break label_5; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - cit = ClassOrInterfaceType(); - cit.setAnnotations(annotations); - ret.add(cit); - label_6: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[14] = jj_gen; - break label_6; - } - jj_consume_token(COMMA); - cit = ClassOrInterfaceType(); - ret.add(cit); - extendsMoreThanOne = true; - } - if (extendsMoreThanOne && !isInterface) - throwParseException(token, "A class cannot extend more than one other class"); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } + jj_consume_token(IMPORT); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case STATIC: + jj_consume_token(STATIC); + isStatic = true; + break; + default: + jj_la1[4] = jj_gen; + ; + } + name = Name(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DOT: + jj_consume_token(DOT); + jj_consume_token(STAR); + isAsterisk = true; + break; + default: + jj_la1[5] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + {if (true) return new ImportDeclaration(line, column, token.endLine, token.endColumn,name, isStatic, isAsterisk);} + throw new Error("Missing return statement in function"); + } - final public List ImplementsList(boolean isInterface) { - List ret = new LinkedList(); - ClassOrInterfaceType cit; - AnnotationExpr ann; - List annotations = null; - jj_consume_token(IMPLEMENTS); - label_7: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[15] = jj_gen; - break label_7; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - cit = ClassOrInterfaceType(); - cit.setAnnotations(annotations); - ret.add(cit); - label_8: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[16] = jj_gen; - break label_8; - } - jj_consume_token(COMMA); - cit = ClassOrInterfaceType(); - ret.add(cit); - } - if (isInterface) - throwParseException(token, "An interface cannot implement other interfaces"); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } +/* + * Modifiers. We match all modifiers in a single rule to reduce the chances of + * syntax errors for simple modifier mistakes. It will also enable us to give + * better error messages. + */ + final public Modifier Modifiers() { + int beginLine = -1; + int beginColumn = -1; + int modifiers = 0; + List annotations = null; + AnnotationExpr ann; + label_4: + while (true) { + if (jj_2_2(2)) { + ; + } else { + break label_4; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PUBLIC: + jj_consume_token(PUBLIC); + modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case STATIC: + jj_consume_token(STATIC); + modifiers = addModifier(modifiers, ModifierSet.STATIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case PROTECTED: + jj_consume_token(PROTECTED); + modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case PRIVATE: + jj_consume_token(PRIVATE); + modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case FINAL: + jj_consume_token(FINAL); + modifiers = addModifier(modifiers, ModifierSet.FINAL, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case ABSTRACT: + jj_consume_token(ABSTRACT); + modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case SYNCHRONIZED: + jj_consume_token(SYNCHRONIZED); + modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case NATIVE: + jj_consume_token(NATIVE); + modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case TRANSIENT: + jj_consume_token(TRANSIENT); + modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case VOLATILE: + jj_consume_token(VOLATILE); + modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case STRICTFP: + jj_consume_token(STRICTFP); + modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} + break; + case AT: + ann = Annotation(); + annotations = add(annotations, ann); if(beginLine==-1) {beginLine=ann.getBeginLine(); beginColumn=ann.getBeginColumn();} + break; + default: + jj_la1[6] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return new Modifier(beginLine, beginColumn, modifiers, annotations);} + throw new Error("Missing return statement in function"); + } - final public EnumDeclaration EnumDeclaration(Modifier modifier) { +/* + * Declaration syntax follows. + */ + final public TypeDeclaration TypeDeclaration() { + Modifier modifier; + TypeDeclaration ret; + + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SEMICOLON: + jj_consume_token(SEMICOLON); + ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn); + break; + case ABSTRACT: + case CLASS: + case ENUM: + case FINAL: + case INTERFACE: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case AT: + modifier = Modifiers(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CLASS: + case INTERFACE: + ret = ClassOrInterfaceDeclaration(modifier); + break; + case ENUM: + ret = EnumDeclaration(modifier); + break; + case AT: + ret = AnnotationTypeDeclaration(modifier); + break; + default: + jj_la1[7] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[8] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier) { + boolean isInterface = false; + NameExpr name; + List typePar = null; + List extList = null; + List impList = null; + List members; + int line = modifier.beginLine; + int column = modifier.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CLASS: + jj_consume_token(CLASS); + break; + case INTERFACE: + jj_consume_token(INTERFACE); + isInterface = true; + break; + default: + jj_la1[9] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + if (line == -1) {line=token.beginLine; column=token.beginColumn;} + name = Name(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + typePar = TypeParameters(); + typePar.remove(0); + break; + default: + jj_la1[10] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case EXTENDS: + extList = ExtendsList(isInterface); + break; + default: + jj_la1[11] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IMPLEMENTS: + impList = ImplementsList(isInterface); + break; + default: + jj_la1[12] = jj_gen; + ; + } + members = ClassOrInterfaceBody(isInterface); + ClassOrInterfaceDeclaration tmp = new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, isInterface, null, typePar, extList, impList, members); + tmp.setNameExpr(name); + {if (true) return tmp;} + throw new Error("Missing return statement in function"); + } + + final public List ExtendsList(boolean isInterface) { + boolean extendsMoreThanOne = false; + List ret = new LinkedList(); + ClassOrInterfaceType cit; + AnnotationExpr ann; + List annotations = null; + jj_consume_token(EXTENDS); + label_5: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[13] = jj_gen; + break label_5; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + cit = ClassOrInterfaceType(); + cit.setAnnotations(annotations); ret.add(cit); + label_6: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[14] = jj_gen; + break label_6; + } + jj_consume_token(COMMA); + cit = ClassOrInterfaceType(); + ret.add(cit); extendsMoreThanOne = true; + } + if (extendsMoreThanOne && !isInterface) + throwParseException(token, "A class cannot extend more than one other class"); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List ImplementsList(boolean isInterface) { + List ret = new LinkedList(); + ClassOrInterfaceType cit; + AnnotationExpr ann; + List annotations = null; + jj_consume_token(IMPLEMENTS); + label_7: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[15] = jj_gen; + break label_7; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + cit = ClassOrInterfaceType(); + cit.setAnnotations(annotations); ret.add(cit); + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[16] = jj_gen; + break label_8; + } + jj_consume_token(COMMA); + cit = ClassOrInterfaceType(); + ret.add(cit); + } + if (isInterface) + throwParseException(token, "An interface cannot implement other interfaces"); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public EnumDeclaration EnumDeclaration(Modifier modifier) { NameExpr name; List impList = null; EnumConstantDeclaration entry; @@ -624,110 +540,105 @@ final public EnumDeclaration EnumDeclaration(Modifier modifier) { List members = null; int line = modifier.beginLine; int column = modifier.beginColumn; - jj_consume_token(ENUM); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - name = Name(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IMPLEMENTS: - impList = ImplementsList(false); - break; - default: - jj_la1[17] = jj_gen; - ; - } - jj_consume_token(LBRACE); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - case AT: - entries = new LinkedList(); - entry = EnumConstantDeclaration(); - entries.add(entry); - label_9: - while (true) { - if (jj_2_3(2)) { - ; - } else { - break label_9; - } - jj_consume_token(COMMA); - entry = EnumConstantDeclaration(); - entries.add(entry); - } - break; - default: - jj_la1[18] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[19] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - label_10: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case _DEFAULT: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: - ; - break; - default: - jj_la1[20] = jj_gen; - break label_10; - } - member = ClassOrInterfaceBodyDeclaration(false); - members = add(members, member); - } - break; - default: - jj_la1[21] = jj_gen; - ; - } - jj_consume_token(RBRACE); - EnumDeclaration tmp = new EnumDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, null, impList, entries, members); - tmp.setNameExpr(name); - { - if (true) return tmp; + jj_consume_token(ENUM); + if (line == -1) {line=token.beginLine; column=token.beginColumn;} + name = Name(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IMPLEMENTS: + impList = ImplementsList(false); + break; + default: + jj_la1[17] = jj_gen; + ; + } + jj_consume_token(LBRACE); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + case AT: + entries = new LinkedList(); + entry = EnumConstantDeclaration(); + entries.add(entry); + label_9: + while (true) { + if (jj_2_3(2)) { + ; + } else { + break label_9; } - throw new Error("Missing return statement in function"); - } - - final public EnumConstantDeclaration EnumConstantDeclaration() { + jj_consume_token(COMMA); + entry = EnumConstantDeclaration(); + entries.add(entry); + } + break; + default: + jj_la1[18] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + break; + default: + jj_la1[19] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SEMICOLON: + jj_consume_token(SEMICOLON); + label_10: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case _DEFAULT: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case LBRACE: + case SEMICOLON: + case AT: + case LT: + ; + break; + default: + jj_la1[20] = jj_gen; + break label_10; + } + member = ClassOrInterfaceBodyDeclaration(false); + members = add(members, member); + } + break; + default: + jj_la1[21] = jj_gen; + ; + } + jj_consume_token(RBRACE); + EnumDeclaration tmp = new EnumDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, null, impList, entries, members); + tmp.setNameExpr(name); + {if (true) return tmp;} + throw new Error("Missing return statement in function"); + } + + final public EnumConstantDeclaration EnumConstantDeclaration() { List annotations = null; AnnotationExpr ann; String name; @@ -736,572 +647,528 @@ final public EnumConstantDeclaration EnumConstantDeclaration() { int line = -1; int column = -1; - label_11: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[22] = jj_gen; - break label_11; - } - ann = Annotation(); - annotations = add(annotations, ann); - if (line == -1) { - line = ann.getBeginLine(); - column = ann.getBeginColumn(); - } - } - jj_consume_token(IDENTIFIER); - name = token.image; - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - break; - default: - jj_la1[23] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACE: - classBody = ClassOrInterfaceBody(false); - break; - default: - jj_la1[24] = jj_gen; - ; - } - EnumConstantDeclaration tmp = new EnumConstantDeclaration(line, column, token.endLine, token.endColumn, annotations, name, args, classBody); - - { - if (true) return tmp; - } - throw new Error("Missing return statement in function"); - } - - final public List TypeParameters() { + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[22] = jj_gen; + break label_11; + } + ann = Annotation(); + annotations = add(annotations, ann); if(line==-1){line=ann.getBeginLine(); column=ann.getBeginColumn();} + } + jj_consume_token(IDENTIFIER); + name = token.image; if(line==-1){line=token.beginLine; column=token.beginColumn;} + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LPAREN: + args = Arguments(); + break; + default: + jj_la1[23] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACE: + classBody = ClassOrInterfaceBody(false); + break; + default: + jj_la1[24] = jj_gen; + ; + } + EnumConstantDeclaration tmp = new EnumConstantDeclaration(line, column, token.endLine, token.endColumn, annotations, name, args, classBody); + + {if (true) return tmp;} + throw new Error("Missing return statement in function"); + } + + final public List TypeParameters() { List ret = new LinkedList(); TypeParameter tp; List annotations = null; AnnotationExpr ann; - jj_consume_token(LT); - ret.add(new int[]{token.beginLine, token.beginColumn}); - label_12: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[25] = jj_gen; - break label_12; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - tp = TypeParameter(); - ret.add(tp); - tp.setAnnotations(annotations); - annotations = null; - label_13: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[26] = jj_gen; - break label_13; - } - jj_consume_token(COMMA); - label_14: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[27] = jj_gen; - break label_14; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - tp = TypeParameter(); - ret.add(tp); - tp.setAnnotations(annotations); - annotations = null; - } - jj_consume_token(GT); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public TypeParameter TypeParameter() { + jj_consume_token(LT); + ret.add(new int[]{token.beginLine, token.beginColumn}); + label_12: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[25] = jj_gen; + break label_12; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + tp = TypeParameter(); + ret.add(tp); tp.setAnnotations(annotations); annotations = null; + label_13: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[26] = jj_gen; + break label_13; + } + jj_consume_token(COMMA); + label_14: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[27] = jj_gen; + break label_14; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + tp = TypeParameter(); + ret.add(tp); tp.setAnnotations(annotations); annotations = null; + } + jj_consume_token(GT); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public TypeParameter TypeParameter() { String name; List typeBound = null; int line; int column; - jj_consume_token(IDENTIFIER); - name = token.image; - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - typeBound = TypeBound(); - break; - default: - jj_la1[28] = jj_gen; - ; - } - { - if (true) return new TypeParameter(line, column, token.endLine, token.endColumn, name, typeBound); - } - throw new Error("Missing return statement in function"); - } - - final public List TypeBound() { + jj_consume_token(IDENTIFIER); + name = token.image; line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case EXTENDS: + typeBound = TypeBound(); + break; + default: + jj_la1[28] = jj_gen; + ; + } + {if (true) return new TypeParameter(line, column, token.endLine, token.endColumn,name, typeBound);} + throw new Error("Missing return statement in function"); + } + + final public List TypeBound() { List ret = new LinkedList(); ClassOrInterfaceType cit; AnnotationExpr ann; List annotations = null; - jj_consume_token(EXTENDS); - label_15: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[29] = jj_gen; - break label_15; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - cit = ClassOrInterfaceType(); - cit.setAnnotations(annotations); - ret.add(cit); - annotations = null; - label_16: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BIT_AND: - ; - break; - default: - jj_la1[30] = jj_gen; - break label_16; - } - jj_consume_token(BIT_AND); - label_17: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[31] = jj_gen; - break label_17; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - cit = ClassOrInterfaceType(); - cit.setAnnotations(annotations); - ret.add(cit); - annotations = null; - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List ClassOrInterfaceBody(boolean isInterface) { + jj_consume_token(EXTENDS); + label_15: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[29] = jj_gen; + break label_15; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + cit = ClassOrInterfaceType(); + cit.setAnnotations(annotations); ret.add(cit); annotations=null; + label_16: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BIT_AND: + ; + break; + default: + jj_la1[30] = jj_gen; + break label_16; + } + jj_consume_token(BIT_AND); + label_17: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[31] = jj_gen; + break label_17; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + cit = ClassOrInterfaceType(); + cit.setAnnotations(annotations); ret.add(cit); annotations=null; + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List ClassOrInterfaceBody(boolean isInterface) { List ret = new LinkedList(); BodyDeclaration member; - jj_consume_token(LBRACE); - label_18: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case _DEFAULT: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: - ; - break; - default: - jj_la1[32] = jj_gen; - break label_18; - } - member = ClassOrInterfaceBodyDeclaration(isInterface); - ret.add(member); - } - jj_consume_token(RBRACE); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) { - boolean isNestedInterface = false; - Modifier modifier; - Modifier modifier2 = null; - int aux = 0; - BodyDeclaration ret; - boolean isDefault = false; - - if (jj_2_6(2)) { - ret = InitializerDeclaration(); - if (isInterface) + jj_consume_token(LBRACE); + label_18: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case _DEFAULT: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case LBRACE: + case SEMICOLON: + case AT: + case LT: + ; + break; + default: + jj_la1[32] = jj_gen; + break label_18; + } + member = ClassOrInterfaceBodyDeclaration(isInterface); + ret.add(member); + } + jj_consume_token(RBRACE); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) { + boolean isNestedInterface = false; + Modifier modifier; + Modifier modifier2 = null; + int aux = 0; + BodyDeclaration ret; + boolean isDefault = false; + + if (jj_2_6(2)) { + ret = InitializerDeclaration(); + if (isInterface) throwParseException(token, "An interface cannot have initializers"); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case _DEFAULT: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case AT: - case LT: - modifier = Modifiers(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case _DEFAULT: - jj_consume_token(_DEFAULT); - modifier2 = Modifiers(); - if (!isInterface) { - throwParseException(token, "An interface cannot have default members"); - } - isDefault = true; - break; - default: - jj_la1[33] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - default: - jj_la1[34] = jj_gen; - if (jj_2_4(2147483647)) { - ret = ConstructorDeclaration(modifier); - } else if (jj_2_5(2147483647)) { - ret = FieldDeclaration(modifier); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case VOID: - case IDENTIFIER: - case LT: - ret = MethodDeclaration(modifier); - if (isDefault && ret != null && ((MethodDeclaration) ret).getBody() == null) { - throwParseException(token, "\"default\" methods must have a body"); - } - ((MethodDeclaration) ret).setDefault(isDefault); - if (modifier2 != null) { - aux = modifier2.modifiers; - } - ((MethodDeclaration) ret).setModifiers(addModifier(modifier.modifiers, aux, token)); - break; - default: - jj_la1[35] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - if (isDefault && !(ret instanceof MethodDeclaration)) { - throwParseException(token, "Just methods can have the keyword \"default\"."); - } - break; - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - break; - default: - jj_la1[36] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case _DEFAULT: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case AT: + case LT: + modifier = Modifiers(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case _DEFAULT: + jj_consume_token(_DEFAULT); + modifier2 = Modifiers(); + if(!isInterface) + { + throwParseException(token, "An interface cannot have default members"); + } + isDefault = true; + break; + default: + jj_la1[33] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CLASS: + case INTERFACE: + ret = ClassOrInterfaceDeclaration(modifier); + break; + case ENUM: + ret = EnumDeclaration(modifier); + break; + case AT: + ret = AnnotationTypeDeclaration(modifier); + break; + default: + jj_la1[34] = jj_gen; + if (jj_2_4(2147483647)) { + ret = ConstructorDeclaration(modifier); + } else if (jj_2_5(2147483647)) { + ret = FieldDeclaration(modifier); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case VOID: + case IDENTIFIER: + case LT: + ret = MethodDeclaration(modifier); + if(isDefault && ret!= null && ((MethodDeclaration)ret).getBody() == null) + { + throwParseException(token, "\"default\" methods must have a body"); + } + ((MethodDeclaration)ret).setDefault(isDefault); + if(modifier2!= null) + { + aux = modifier2.modifiers; + } + ((MethodDeclaration)ret).setModifiers(addModifier(modifier.modifiers, aux, token)); + break; + default: + jj_la1[35] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } + } } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public FieldDeclaration FieldDeclaration(Modifier modifier) { + if(isDefault && ! (ret instanceof MethodDeclaration)) + { + throwParseException(token, "Just methods can have the keyword \"default\"."); + } + break; + case SEMICOLON: + jj_consume_token(SEMICOLON); + ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn); + break; + default: + jj_la1[36] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public FieldDeclaration FieldDeclaration(Modifier modifier) { Type type; List variables = new LinkedList(); VariableDeclarator val; - // Modifiers are already matched in the caller - type = Type(); - val = VariableDeclarator(); - variables.add(val); - label_19: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[37] = jj_gen; - break label_19; - } - jj_consume_token(COMMA); - val = VariableDeclarator(); - variables.add(val); - } - jj_consume_token(SEMICOLON); + // Modifiers are already matched in the caller + type = Type(); + val = VariableDeclarator(); + variables.add(val); + label_19: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[37] = jj_gen; + break label_19; + } + jj_consume_token(COMMA); + val = VariableDeclarator(); + variables.add(val); + } + jj_consume_token(SEMICOLON); int line = modifier.beginLine; int column = modifier.beginColumn; - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - { - if (true) - return new FieldDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, variables); - } - throw new Error("Missing return statement in function"); - } + if (line == -1) { line=type.getBeginLine(); column=type.getBeginColumn(); } + {if (true) return new FieldDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, variables);} + throw new Error("Missing return statement in function"); + } - final public VariableDeclarator VariableDeclarator() { + final public VariableDeclarator VariableDeclarator() { VariableDeclaratorId id; Expression init = null; - id = VariableDeclaratorId(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSIGN: - jj_consume_token(ASSIGN); - init = VariableInitializer(); - break; - default: - jj_la1[38] = jj_gen; - ; - } - { - if (true) - return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init); - } - throw new Error("Missing return statement in function"); - } - - final public VariableDeclaratorId VariableDeclaratorId() { + id = VariableDeclaratorId(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ASSIGN: + jj_consume_token(ASSIGN); + init = VariableInitializer(); + break; + default: + jj_la1[38] = jj_gen; + ; + } + {if (true) return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init);} + throw new Error("Missing return statement in function"); + } + + final public VariableDeclaratorId VariableDeclaratorId() { String name; int arrayCount = 0; int line; int column; - jj_consume_token(IDENTIFIER); - name = token.image; - line = token.beginLine; - column = token.beginColumn; - label_20: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[39] = jj_gen; - break label_20; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - } - { - if (true) return new VariableDeclaratorId(line, column, token.endLine, token.endColumn, name, arrayCount); - } - throw new Error("Missing return statement in function"); - } - - final public Expression VariableInitializer() { + jj_consume_token(IDENTIFIER); + name = token.image; line=token.beginLine; column=token.beginColumn; + label_20: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACKET: + ; + break; + default: + jj_la1[39] = jj_gen; + break label_20; + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; + } + {if (true) return new VariableDeclaratorId(line, column, token.endLine, token.endColumn,name, arrayCount);} + throw new Error("Missing return statement in function"); + } + + final public Expression VariableInitializer() { Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACE: - ret = ArrayInitializer(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = Expression(); - break; - default: - jj_la1[40] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public ArrayInitializerExpr ArrayInitializer() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACE: + ret = ArrayInitializer(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = Expression(); + break; + default: + jj_la1[40] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public ArrayInitializerExpr ArrayInitializer() { List values = null; Expression val; int line; int column; - jj_consume_token(LBRACE); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - val = VariableInitializer(); - values = add(values, val); - label_21: - while (true) { - if (jj_2_7(2)) { - ; - } else { - break label_21; - } - jj_consume_token(COMMA); - val = VariableInitializer(); - values = add(values, val); - } - break; - default: - jj_la1[41] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[42] = jj_gen; - ; - } - jj_consume_token(RBRACE); - { - if (true) return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn, values); + jj_consume_token(LBRACE); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + val = VariableInitializer(); + values = add(values, val); + label_21: + while (true) { + if (jj_2_7(2)) { + ; + } else { + break label_21; } - throw new Error("Missing return statement in function"); - } - - final public MethodDeclaration MethodDeclaration(Modifier modifier) { + jj_consume_token(COMMA); + val = VariableInitializer(); + values = add(values, val); + } + break; + default: + jj_la1[41] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + break; + default: + jj_la1[42] = jj_gen; + ; + } + jj_consume_token(RBRACE); + {if (true) return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,values);} + throw new Error("Missing return statement in function"); + } + + final public MethodDeclaration MethodDeclaration(Modifier modifier) { List typeParameters = null; Type type; NameExpr name; @@ -1311,206 +1178,185 @@ final public MethodDeclaration MethodDeclaration(Modifier modifier) { BlockStmt block = null; int line = modifier.beginLine; int column = modifier.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeParameters = TypeParameters(); - int[] lineCol = (int[]) typeParameters.remove(0); - if (line == -1) { - line = lineCol[0]; - column = lineCol[1]; - } - break; - default: - jj_la1[43] = jj_gen; - ; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + typeParameters = TypeParameters(); + int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} + break; + default: + jj_la1[43] = jj_gen; + ; + } + type = ResultType(); + if(line==-1){line=type.getBeginLine(); column=type.getBeginColumn();} + name = Name(); + parameters = FormalParameters(); + label_22: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACKET: + ; + break; + default: + jj_la1[44] = jj_gen; + break label_22; + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case THROWS: + jj_consume_token(THROWS); + throws_ = NameList(); + break; + default: + jj_la1[45] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACE: + block = Block(); + break; + case SEMICOLON: + jj_consume_token(SEMICOLON); + break; + default: + jj_la1[46] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + MethodDeclaration tmp = new MethodDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, typeParameters, type, null, parameters, arrayCount, throws_, block); + tmp.setNameExpr(name); + {if (true) return tmp;} + throw new Error("Missing return statement in function"); + } + + final public List FormalParameters() { + List ret = null; + Parameter par; + jj_consume_token(LPAREN); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case AT: + par = FormalParameter(); + ret = add(ret, par); + label_23: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[47] = jj_gen; + break label_23; } - type = ResultType(); - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - name = Name(); - parameters = FormalParameters(); - label_22: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[44] = jj_gen; - break label_22; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case THROWS: - jj_consume_token(THROWS); - throws_ = NameList(); - break; - default: - jj_la1[45] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACE: - block = Block(); - break; - case SEMICOLON: - jj_consume_token(SEMICOLON); - break; - default: - jj_la1[46] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - MethodDeclaration tmp = new MethodDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, typeParameters, type, null, parameters, arrayCount, throws_, block); - tmp.setNameExpr(name); - { - if (true) return tmp; - } - throw new Error("Missing return statement in function"); - } - - final public List FormalParameters() { - List ret = null; - Parameter par; - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: - par = FormalParameter(); - ret = add(ret, par); - label_23: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[47] = jj_gen; - break label_23; - } - jj_consume_token(COMMA); - par = FormalParameter(); - ret = add(ret, par); - } - break; - default: - jj_la1[48] = jj_gen; - ; - } - jj_consume_token(RPAREN); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List FormalLambdaParameters() { - List ret = null; - Parameter par; jj_consume_token(COMMA); par = FormalParameter(); - ret = add(ret, par); - label_24: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[49] = jj_gen; - break label_24; - } - jj_consume_token(COMMA); - par = FormalParameter(); - ret = add(ret, par); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List InferredLambdaParameters() { - List ret = null; - VariableDeclaratorId id; - jj_consume_token(COMMA); - id = VariableDeclaratorId(); - ret = add(ret, new Parameter(id.getBeginLine(), id.getBeginColumn(), id.getEndLine(), id.getEndColumn(), 0, null, new UnknownType(), false, id)); - label_25: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[50] = jj_gen; - break label_25; - } - jj_consume_token(COMMA); - id = VariableDeclaratorId(); - ret = add(ret, new Parameter(id.getBeginLine(), id.getBeginColumn(), id.getEndLine(), id.getEndColumn(), 0, null, new UnknownType(), false, id)); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Parameter FormalParameter() { + ret = add(ret, par); + } + break; + default: + jj_la1[48] = jj_gen; + ; + } + jj_consume_token(RPAREN); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List FormalLambdaParameters() { + List ret = null; + Parameter par; + jj_consume_token(COMMA); + par = FormalParameter(); + ret = add(ret, par); + label_24: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[49] = jj_gen; + break label_24; + } + jj_consume_token(COMMA); + par = FormalParameter(); + ret = add(ret, par); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List InferredLambdaParameters() { + List ret = null; + VariableDeclaratorId id; + jj_consume_token(COMMA); + id = VariableDeclaratorId(); + ret = add(ret, new Parameter(id.getBeginLine(), id.getBeginColumn(), id.getEndLine(), id.getEndColumn(), 0, null, new UnknownType(), false, id)); + label_25: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[50] = jj_gen; + break label_25; + } + jj_consume_token(COMMA); + id = VariableDeclaratorId(); + ret = add(ret, new Parameter(id.getBeginLine(), id.getBeginColumn(), id.getEndLine(), id.getEndColumn(), 0, null, new UnknownType(), false, id)); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Parameter FormalParameter() { Modifier modifier; Type type; boolean isVarArg = false; VariableDeclaratorId id; - modifier = Modifiers(); - type = Type(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ELLIPSIS: - jj_consume_token(ELLIPSIS); - isVarArg = true; - break; - default: - jj_la1[51] = jj_gen; - ; - } - id = VariableDeclaratorId(); - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - { - if (true) - return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, isVarArg, id); - } - throw new Error("Missing return statement in function"); - } - - final public ConstructorDeclaration ConstructorDeclaration(Modifier modifier) { + modifier = Modifiers(); + type = Type(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ELLIPSIS: + jj_consume_token(ELLIPSIS); + isVarArg = true; + break; + default: + jj_la1[51] = jj_gen; + ; + } + id = VariableDeclaratorId(); + int line = modifier.beginLine; + int column = modifier.beginColumn; + if(line==-1){ line=type.getBeginLine(); column=type.getBeginColumn(); } + {if (true) return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, isVarArg, id);} + throw new Error("Missing return statement in function"); + } + + final public ConstructorDeclaration ConstructorDeclaration(Modifier modifier) { List typeParameters = null; NameExpr name; List parameters; @@ -1523,368 +1369,323 @@ final public ConstructorDeclaration ConstructorDeclaration(Modifier modifier) { int bbColumn = 0; int beLine = 0; int beColumn = 0; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeParameters = TypeParameters(); - int[] lineCol = (int[]) typeParameters.remove(0); - if (line == -1) { - line = lineCol[0]; - column = lineCol[1]; - } - break; - default: - jj_la1[52] = jj_gen; - ; - } - // Modifiers matched in the caller - name = SimpleName(); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - parameters = FormalParameters(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case THROWS: - jj_consume_token(THROWS); - throws_ = NameList(); - break; - default: - jj_la1[53] = jj_gen; - ; - } - jj_consume_token(LBRACE); - bbLine = token.beginLine; - bbColumn = token.beginColumn; - if (jj_2_8(2147483647)) { - exConsInv = ExplicitConstructorInvocation(); - } else { - ; - } - stmts = Statements(); - jj_consume_token(RBRACE); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + typeParameters = TypeParameters(); + int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} + break; + default: + jj_la1[52] = jj_gen; + ; + } + // Modifiers matched in the caller + name = SimpleName(); + if(line==-1){line=token.beginLine; column=token.beginColumn;} + parameters = FormalParameters(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case THROWS: + jj_consume_token(THROWS); + throws_ = NameList(); + break; + default: + jj_la1[53] = jj_gen; + ; + } + jj_consume_token(LBRACE); + bbLine=token.beginLine; bbColumn=token.beginColumn; + if (jj_2_8(2147483647)) { + exConsInv = ExplicitConstructorInvocation(); + } else { + ; + } + stmts = Statements(); + jj_consume_token(RBRACE); if (exConsInv != null) { - stmts = add(0, stmts, exConsInv); + stmts = add(0, stmts, exConsInv); } ConstructorDeclaration tmp = new ConstructorDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, typeParameters, null, parameters, throws_, new BlockStmt(bbLine, bbColumn, token.endLine, token.endColumn, stmts)); - tmp.setNameExpr(name); - { - if (true) return tmp; - } - throw new Error("Missing return statement in function"); - } + tmp.setNameExpr(name); + {if (true) return tmp;} + throw new Error("Missing return statement in function"); + } - final public ExplicitConstructorInvocationStmt ExplicitConstructorInvocation() { + final public ExplicitConstructorInvocationStmt ExplicitConstructorInvocation() { boolean isThis = false; List args; Expression expr = null; List typeArgs = null; int line = -1; int column = 0; - if (jj_2_10(2147483647)) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - case 132: - typeArgs = TypeArguments(); - int[] lineCol = (int[]) typeArgs.remove(0); - line = lineCol[0]; - column = lineCol[1]; - break; - default: - jj_la1[54] = jj_gen; - ; - } - jj_consume_token(THIS); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - isThis = true; - args = Arguments(); - jj_consume_token(SEMICOLON); + if (jj_2_10(2147483647)) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + case 132: + typeArgs = TypeArguments(); + int[] lineCol=(int[])typeArgs.remove(0); line=lineCol[0]; column=lineCol[1]; + break; + default: + jj_la1[54] = jj_gen; + ; + } + jj_consume_token(THIS); + if (line == -1) {line=token.beginLine; column=token.beginColumn;} isThis = true; + args = Arguments(); + jj_consume_token(SEMICOLON); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LT: + case 132: + if (jj_2_9(2147483647)) { + expr = PrimaryExpressionWithoutSuperSuffix(); + jj_consume_token(DOT); + line=expr.getBeginLine(); column=expr.getBeginColumn(); } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LT: - case 132: - if (jj_2_9(2147483647)) { - expr = PrimaryExpressionWithoutSuperSuffix(); - jj_consume_token(DOT); - line = expr.getBeginLine(); - column = expr.getBeginColumn(); - } else { - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - case 132: - typeArgs = TypeArguments(); - int[] lineCol = (int[]) typeArgs.remove(0); - if (line == -1) { - line = lineCol[0]; - column = lineCol[1]; - } - break; - default: - jj_la1[55] = jj_gen; - ; - } - jj_consume_token(SUPER); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - args = Arguments(); - jj_consume_token(SEMICOLON); - break; - default: - jj_la1[56] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) - return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn, typeArgs, isThis, expr, args); - } - throw new Error("Missing return statement in function"); - } - - final public List Statements() { + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + case 132: + typeArgs = TypeArguments(); + int[] lineCol=(int[])typeArgs.remove(0); if (line == -1) {line=lineCol[0]; column=lineCol[1];} + break; + default: + jj_la1[55] = jj_gen; + ; + } + jj_consume_token(SUPER); + if (line == -1) {line=token.beginLine; column=token.beginColumn;} + args = Arguments(); + jj_consume_token(SEMICOLON); + break; + default: + jj_la1[56] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn,typeArgs, isThis, expr, args);} + throw new Error("Missing return statement in function"); + } + + final public List Statements() { List ret = null; Statement stmt; - label_26: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CLASS: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case FOR: - case IF: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case RETURN: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRANSIENT: - case TRUE: - case TRY: - case VOID: - case VOLATILE: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case AT: - case INCR: - case DECR: - ; - break; - default: - jj_la1[57] = jj_gen; - break label_26; - } - stmt = BlockStatement(); - ret = add(ret, stmt); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public InitializerDeclaration InitializerDeclaration() { + label_26: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case ASSERT: + case BOOLEAN: + case BREAK: + case BYTE: + case CHAR: + case CLASS: + case CONTINUE: + case DO: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case FOR: + case IF: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case RETURN: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SWITCH: + case SYNCHRONIZED: + case THIS: + case THROW: + case TRANSIENT: + case TRUE: + case TRY: + case VOID: + case VOLATILE: + case WHILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case SEMICOLON: + case AT: + case INCR: + case DECR: + ; + break; + default: + jj_la1[57] = jj_gen; + break label_26; + } + stmt = BlockStatement(); + ret = add(ret, stmt); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public InitializerDeclaration InitializerDeclaration() { BlockStmt block; int line = -1; int column = 0; boolean isStatic = false; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STATIC: - jj_consume_token(STATIC); - isStatic = true; - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[58] = jj_gen; - ; - } - block = Block(); - if (line == -1) { - line = block.getBeginLine(); - column = block.getBeginColumn(); - } - { - if (true) return new InitializerDeclaration(line, column, token.endLine, token.endColumn, isStatic, block); - } - throw new Error("Missing return statement in function"); - } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case STATIC: + jj_consume_token(STATIC); + isStatic = true; line=token.beginLine; column=token.beginColumn; + break; + default: + jj_la1[58] = jj_gen; + ; + } + block = Block(); + if(line==-1){line=block.getBeginLine(); column=block.getBeginColumn();} + {if (true) return new InitializerDeclaration(line, column, token.endLine, token.endColumn, isStatic, block);} + throw new Error("Missing return statement in function"); + } - /* - * Type, name and expression syntax follows. - */ - final public Type Type() { +/* + * Type, name and expression syntax follows. + */ + final public Type Type() { Type ret; - if (jj_2_11(2)) { - ret = ReferenceType(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - ret = PrimitiveType(); - break; - default: - jj_la1[59] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public ReferenceType ReferenceType() { + if (jj_2_11(2)) { + ret = ReferenceType(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + ret = PrimitiveType(); + break; + default: + jj_la1[59] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public ReferenceType ReferenceType() { Type type; int arrayCount = 0; List annotations = null; - List accum = null; + List accum= null; AnnotationExpr ann; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - type = PrimitiveType(); - label_27: - while (true) { - label_28: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[60] = jj_gen; - break label_28; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - accum = add(accum, annotations); - annotations = null; - if (jj_2_12(2)) { - ; - } else { - break label_27; - } - } - break; - case IDENTIFIER: - type = ClassOrInterfaceType(); - label_29: - while (true) { - if (jj_2_13(2)) { - ; - } else { - break label_29; - } - label_30: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[61] = jj_gen; - break label_30; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - accum = add(accum, annotations); - annotations = null; - } - break; - default: - jj_la1[62] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) - return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount, null, accum); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + type = PrimitiveType(); + label_27: + while (true) { + label_28: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[60] = jj_gen; + break label_28; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; accum = add(accum, annotations); annotations= null; + if (jj_2_12(2)) { + ; + } else { + break label_27; + } + } + break; + case IDENTIFIER: + type = ClassOrInterfaceType(); + label_29: + while (true) { + if (jj_2_13(2)) { + ; + } else { + break label_29; } - throw new Error("Missing return statement in function"); - } - - final public ClassOrInterfaceType ClassOrInterfaceType() { + label_30: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[61] = jj_gen; + break label_30; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; accum = add(accum, annotations); annotations= null; + } + break; + default: + jj_la1[62] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount, null, accum);} + throw new Error("Missing return statement in function"); + } + + final public ClassOrInterfaceType ClassOrInterfaceType() { ClassOrInterfaceType ret; String name; List typeArgs = null; @@ -1892,401 +1693,370 @@ final public ClassOrInterfaceType ClassOrInterfaceType() { int column; List annotations = null; AnnotationExpr ann; - jj_consume_token(IDENTIFIER); - line = token.beginLine; - column = token.beginColumn; - name = token.image; - if (jj_2_14(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn, null, name, typeArgs); - label_31: - while (true) { - if (jj_2_15(2)) { - ; - } else { - break label_31; - } - jj_consume_token(DOT); - label_32: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[63] = jj_gen; - break label_32; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - jj_consume_token(IDENTIFIER); - name = token.image; - if (jj_2_16(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn, ret, name, typeArgs); - ret.setAnnotations(annotations); - annotations = null; - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List TypeArguments() { + jj_consume_token(IDENTIFIER); + line=token.beginLine; column=token.beginColumn; + name = token.image; + if (jj_2_14(2)) { + typeArgs = TypeArguments(); + typeArgs.remove(0); + } else { + ; + } + ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,null, name, typeArgs); + label_31: + while (true) { + if (jj_2_15(2)) { + ; + } else { + break label_31; + } + jj_consume_token(DOT); + label_32: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[63] = jj_gen; + break label_32; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + jj_consume_token(IDENTIFIER); + name = token.image; + if (jj_2_16(2)) { + typeArgs = TypeArguments(); + typeArgs.remove(0); + } else { + ; + } + ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,ret, name, typeArgs); ret.setAnnotations(annotations); annotations = null; + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List TypeArguments() { List ret = new LinkedList(); Type type; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - jj_consume_token(LT); - ret.add(new int[]{token.beginLine, token.beginColumn}); - type = TypeArgument(); - ret.add(type); - label_33: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[64] = jj_gen; - break label_33; - } - jj_consume_token(COMMA); - type = TypeArgument(); - ret.add(type); - } - jj_consume_token(GT); - { - if (true) return ret; - } - break; - case 132: - jj_consume_token(132); - ret.add(null); - { - if (true) return ret; - } - break; - default: - jj_la1[65] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + jj_consume_token(LT); + ret.add(new int[]{token.beginLine, token.beginColumn}); + type = TypeArgument(); + ret.add(type); + label_33: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[64] = jj_gen; + break label_33; } - throw new Error("Missing return statement in function"); - } - - final public Type TypeArgument() { + jj_consume_token(COMMA); + type = TypeArgument(); + ret.add(type); + } + jj_consume_token(GT); + {if (true) return ret;} + break; + case 132: + jj_consume_token(132); + ret.add(null); + {if (true) return ret;} + break; + default: + jj_la1[65] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + throw new Error("Missing return statement in function"); + } + + final public Type TypeArgument() { Type ret; List annotations = null; AnnotationExpr ann; - label_34: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[66] = jj_gen; - break label_34; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = ReferenceType(); - break; - case HOOK: - ret = Wildcard(); - break; - default: - jj_la1[67] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret.setAnnotations(annotations); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public WildcardType Wildcard() { + label_34: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[66] = jj_gen; + break label_34; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + ret = ReferenceType(); + break; + case HOOK: + ret = Wildcard(); + break; + default: + jj_la1[67] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret.setAnnotations(annotations); {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public WildcardType Wildcard() { ReferenceType ext = null; ReferenceType sup = null; int line; int column; AnnotationExpr ann; List annotations = null; - jj_consume_token(HOOK); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - case SUPER: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - jj_consume_token(EXTENDS); - label_35: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[68] = jj_gen; - break label_35; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - ext = ReferenceType(); - ext.setAnnotations(annotations); - break; - case SUPER: - jj_consume_token(SUPER); - label_36: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[69] = jj_gen; - break label_36; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - sup = ReferenceType(); - sup.setAnnotations(annotations); - break; - default: - jj_la1[70] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[71] = jj_gen; - ; - } - { - if (true) return new WildcardType(line, column, token.endLine, token.endColumn, ext, sup); - } - throw new Error("Missing return statement in function"); - } - - final public PrimitiveType PrimitiveType() { + jj_consume_token(HOOK); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case EXTENDS: + case SUPER: + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case EXTENDS: + jj_consume_token(EXTENDS); + label_35: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[68] = jj_gen; + break label_35; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + ext = ReferenceType(); + ext.setAnnotations(annotations); + break; + case SUPER: + jj_consume_token(SUPER); + label_36: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[69] = jj_gen; + break label_36; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + sup = ReferenceType(); + sup.setAnnotations(annotations); + break; + default: + jj_la1[70] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[71] = jj_gen; + ; + } + {if (true) return new WildcardType(line, column, token.endLine, token.endColumn,ext, sup);} + throw new Error("Missing return statement in function"); + } + + final public PrimitiveType PrimitiveType() { PrimitiveType ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - jj_consume_token(BOOLEAN); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); - break; - case CHAR: - jj_consume_token(CHAR); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); - break; - case BYTE: - jj_consume_token(BYTE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); - break; - case SHORT: - jj_consume_token(SHORT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); - break; - case INT: - jj_consume_token(INT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); - break; - case LONG: - jj_consume_token(LONG); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); - break; - case FLOAT: - jj_consume_token(FLOAT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); - break; - case DOUBLE: - jj_consume_token(DOUBLE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); - break; - default: - jj_la1[72] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Type ResultType() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + jj_consume_token(BOOLEAN); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); + break; + case CHAR: + jj_consume_token(CHAR); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); + break; + case BYTE: + jj_consume_token(BYTE); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); + break; + case SHORT: + jj_consume_token(SHORT); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); + break; + case INT: + jj_consume_token(INT); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); + break; + case LONG: + jj_consume_token(LONG); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); + break; + case FLOAT: + jj_consume_token(FLOAT); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); + break; + case DOUBLE: + jj_consume_token(DOUBLE); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); + break; + default: + jj_la1[72] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Type ResultType() { Type ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case VOID: - jj_consume_token(VOID); - ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = Type(); - break; - default: - jj_la1[73] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public NameExpr Name() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case VOID: + jj_consume_token(VOID); + ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + ret = Type(); + break; + default: + jj_la1[73] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public NameExpr Name() { NameExpr ret; - jj_consume_token(IDENTIFIER); - ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - label_37: - while (true) { - if (jj_2_17(2)) { - ; - } else { - break label_37; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER); - ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List ClassOrInterfaceTypeList() { + jj_consume_token(IDENTIFIER); + ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + label_37: + while (true) { + if (jj_2_17(2)) { + ; + } else { + break label_37; + } + jj_consume_token(DOT); + jj_consume_token(IDENTIFIER); + ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List ClassOrInterfaceTypeList() { List ret = new LinkedList(); ClassOrInterfaceType type; - List annotations = null; + List annotations= null; AnnotationExpr ann; - label_38: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[74] = jj_gen; - break label_38; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - type = ClassOrInterfaceType(); - type.setAnnotations(annotations); - ret.add(type); - annotations = null; - label_39: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[75] = jj_gen; - break label_39; - } - jj_consume_token(COMMA); - label_40: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[76] = jj_gen; - break label_40; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - type = ClassOrInterfaceType(); - type.setAnnotations(annotations); - ret.add(type); - annotations = null; - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public NameExpr SimpleName() { - NameExpr ret; - jj_consume_token(IDENTIFIER); - ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List NameList() { + label_38: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[74] = jj_gen; + break label_38; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + type = ClassOrInterfaceType(); + type.setAnnotations(annotations); ret.add(type); annotations=null; + label_39: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[75] = jj_gen; + break label_39; + } + jj_consume_token(COMMA); + label_40: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[76] = jj_gen; + break label_40; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + type = ClassOrInterfaceType(); + type.setAnnotations(annotations); ret.add(type); annotations=null; + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public NameExpr SimpleName() { + NameExpr ret; + jj_consume_token(IDENTIFIER); + ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List NameList() { List ret = new LinkedList(); NameExpr name; - name = Name(); - ret.add(name); - label_41: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[77] = jj_gen; - break label_41; - } - jj_consume_token(COMMA); - name = Name(); - ret.add(name); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } + name = Name(); + ret.add(name); + label_41: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[77] = jj_gen; + break label_41; + } + jj_consume_token(COMMA); + name = Name(); + ret.add(name); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } - /* - * Expression syntax follows. - */ - final public Expression Expression() { +/* + * Expression syntax follows. + */ + final public Expression Expression() { Expression ret; AssignExpr.Operator op; Expression value; @@ -2295,830 +2065,777 @@ final public Expression Expression() { List typeArgs = null; VariableDeclaratorId id = null; Expression inner = null; - ret = ConditionalExpression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSIGN: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - case ARROW: - case DOUBLECOLON: - if (jj_2_18(2)) { - op = AssignmentOperator(); - value = Expression(); - ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ARROW: - jj_consume_token(ARROW); - lambdaBody = LambdaBody(); - if (ret instanceof CastExpr) { - inner = generateLambda(((CastExpr) ret).getExpr(), lambdaBody); - ((CastExpr) ret).setExpr(inner); - } else if (ret instanceof ConditionalExpr) { - ConditionalExpr ce = (ConditionalExpr) ret; - if (ce.getElseExpr() != null) { - ce.setElseExpr(generateLambda(ce.getElseExpr(), lambdaBody)); - } - } else { - ret = generateLambda(ret, lambdaBody); - } - break; - case DOUBLECOLON: - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeParameters(); - typeArgs.remove(0); - break; - default: - jj_la1[78] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - break; - case NEW: - jj_consume_token(NEW); - break; - default: - jj_la1[79] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new MethodReferenceExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, token.image); - break; - default: - jj_la1[80] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - default: - jj_la1[81] = jj_gen; - ; - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public AssignExpr.Operator AssignmentOperator() { - AssignExpr.Operator ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSIGN: - jj_consume_token(ASSIGN); - ret = AssignExpr.Operator.assign; - break; - case STARASSIGN: - jj_consume_token(STARASSIGN); - ret = AssignExpr.Operator.star; - break; - case SLASHASSIGN: - jj_consume_token(SLASHASSIGN); - ret = AssignExpr.Operator.slash; - break; - case REMASSIGN: - jj_consume_token(REMASSIGN); - ret = AssignExpr.Operator.rem; - break; - case PLUSASSIGN: - jj_consume_token(PLUSASSIGN); - ret = AssignExpr.Operator.plus; - break; - case MINUSASSIGN: - jj_consume_token(MINUSASSIGN); - ret = AssignExpr.Operator.minus; - break; - case LSHIFTASSIGN: - jj_consume_token(LSHIFTASSIGN); - ret = AssignExpr.Operator.lShift; - break; - case RSIGNEDSHIFTASSIGN: - jj_consume_token(RSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rSignedShift; - break; - case RUNSIGNEDSHIFTASSIGN: - jj_consume_token(RUNSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rUnsignedShift; - break; - case ANDASSIGN: - jj_consume_token(ANDASSIGN); - ret = AssignExpr.Operator.and; - break; - case XORASSIGN: - jj_consume_token(XORASSIGN); - ret = AssignExpr.Operator.xor; - break; - case ORASSIGN: - jj_consume_token(ORASSIGN); - ret = AssignExpr.Operator.or; - break; - default: - jj_la1[82] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalExpression() { + ret = ConditionalExpression(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ASSIGN: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN: + case ARROW: + case DOUBLECOLON: + if (jj_2_18(2)) { + op = AssignmentOperator(); + value = Expression(); + ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ARROW: + jj_consume_token(ARROW); + lambdaBody = LambdaBody(); + if (ret instanceof CastExpr) + { + inner = generateLambda(((CastExpr)ret).getExpr(), lambdaBody); + ((CastExpr)ret).setExpr(inner); + } + else if (ret instanceof ConditionalExpr){ + ConditionalExpr ce = (ConditionalExpr) ret; + if(ce.getElseExpr() != null){ + ce.setElseExpr(generateLambda(ce.getElseExpr(), lambdaBody)); + } + } + else + { + ret = generateLambda(ret, lambdaBody); + } + break; + case DOUBLECOLON: + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + typeArgs = TypeParameters(); + typeArgs.remove(0); + break; + default: + jj_la1[78] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + break; + case NEW: + jj_consume_token(NEW); + break; + default: + jj_la1[79] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = new MethodReferenceExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, token.image); + break; + default: + jj_la1[80] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + default: + jj_la1[81] = jj_gen; + ; + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public AssignExpr.Operator AssignmentOperator() { + AssignExpr.Operator ret; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ASSIGN: + jj_consume_token(ASSIGN); + ret = AssignExpr.Operator.assign; + break; + case STARASSIGN: + jj_consume_token(STARASSIGN); + ret = AssignExpr.Operator.star; + break; + case SLASHASSIGN: + jj_consume_token(SLASHASSIGN); + ret = AssignExpr.Operator.slash; + break; + case REMASSIGN: + jj_consume_token(REMASSIGN); + ret = AssignExpr.Operator.rem; + break; + case PLUSASSIGN: + jj_consume_token(PLUSASSIGN); + ret = AssignExpr.Operator.plus; + break; + case MINUSASSIGN: + jj_consume_token(MINUSASSIGN); + ret = AssignExpr.Operator.minus; + break; + case LSHIFTASSIGN: + jj_consume_token(LSHIFTASSIGN); + ret = AssignExpr.Operator.lShift; + break; + case RSIGNEDSHIFTASSIGN: + jj_consume_token(RSIGNEDSHIFTASSIGN); + ret = AssignExpr.Operator.rSignedShift; + break; + case RUNSIGNEDSHIFTASSIGN: + jj_consume_token(RUNSIGNEDSHIFTASSIGN); + ret = AssignExpr.Operator.rUnsignedShift; + break; + case ANDASSIGN: + jj_consume_token(ANDASSIGN); + ret = AssignExpr.Operator.and; + break; + case XORASSIGN: + jj_consume_token(XORASSIGN); + ret = AssignExpr.Operator.xor; + break; + case ORASSIGN: + jj_consume_token(ORASSIGN); + ret = AssignExpr.Operator.or; + break; + default: + jj_la1[82] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression ConditionalExpression() { Expression ret; Expression left; Expression right; - ret = ConditionalOrExpression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case HOOK: - jj_consume_token(HOOK); - left = Expression(); - jj_consume_token(COLON); - right = ConditionalExpression(); - ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); - break; - default: - jj_la1[83] = jj_gen; - ; - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalOrExpression() { + ret = ConditionalOrExpression(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case HOOK: + jj_consume_token(HOOK); + left = Expression(); + jj_consume_token(COLON); + right = ConditionalExpression(); + ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); + break; + default: + jj_la1[83] = jj_gen; + ; + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression ConditionalOrExpression() { Expression ret; Expression right; - ret = ConditionalAndExpression(); - label_42: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SC_OR: - ; - break; - default: - jj_la1[84] = jj_gen; - break label_42; - } - jj_consume_token(SC_OR); - right = ConditionalAndExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalAndExpression() { + ret = ConditionalAndExpression(); + label_42: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SC_OR: + ; + break; + default: + jj_la1[84] = jj_gen; + break label_42; + } + jj_consume_token(SC_OR); + right = ConditionalAndExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression ConditionalAndExpression() { Expression ret; Expression right; - ret = InclusiveOrExpression(); - label_43: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SC_AND: - ; - break; - default: - jj_la1[85] = jj_gen; - break label_43; - } - jj_consume_token(SC_AND); - right = InclusiveOrExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression InclusiveOrExpression() { + ret = InclusiveOrExpression(); + label_43: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SC_AND: + ; + break; + default: + jj_la1[85] = jj_gen; + break label_43; + } + jj_consume_token(SC_AND); + right = InclusiveOrExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression InclusiveOrExpression() { Expression ret; Expression right; - ret = ExclusiveOrExpression(); - label_44: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BIT_OR: - ; - break; - default: - jj_la1[86] = jj_gen; - break label_44; - } - jj_consume_token(BIT_OR); - right = ExclusiveOrExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression ExclusiveOrExpression() { + ret = ExclusiveOrExpression(); + label_44: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BIT_OR: + ; + break; + default: + jj_la1[86] = jj_gen; + break label_44; + } + jj_consume_token(BIT_OR); + right = ExclusiveOrExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression ExclusiveOrExpression() { Expression ret; Expression right; - ret = AndExpression(); - label_45: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case XOR: - ; - break; - default: - jj_la1[87] = jj_gen; - break label_45; - } - jj_consume_token(XOR); - right = AndExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression AndExpression() { + ret = AndExpression(); + label_45: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case XOR: + ; + break; + default: + jj_la1[87] = jj_gen; + break label_45; + } + jj_consume_token(XOR); + right = AndExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression AndExpression() { Expression ret; Expression right; - ret = EqualityExpression(); - label_46: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BIT_AND: - ; - break; - default: - jj_la1[88] = jj_gen; - break label_46; - } - jj_consume_token(BIT_AND); - right = EqualityExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression EqualityExpression() { + ret = EqualityExpression(); + label_46: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BIT_AND: + ; + break; + default: + jj_la1[88] = jj_gen; + break label_46; + } + jj_consume_token(BIT_AND); + right = EqualityExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression EqualityExpression() { Expression ret; Expression right; BinaryExpr.Operator op; - ret = InstanceOfExpression(); - label_47: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EQ: - case NE: - ; - break; - default: - jj_la1[89] = jj_gen; - break label_47; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EQ: - jj_consume_token(EQ); - op = BinaryExpr.Operator.equals; - break; - case NE: - jj_consume_token(NE); - op = BinaryExpr.Operator.notEquals; - break; - default: - jj_la1[90] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = InstanceOfExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression InstanceOfExpression() { + ret = InstanceOfExpression(); + label_47: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case EQ: + case NE: + ; + break; + default: + jj_la1[89] = jj_gen; + break label_47; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case EQ: + jj_consume_token(EQ); + op = BinaryExpr.Operator.equals; + break; + case NE: + jj_consume_token(NE); + op = BinaryExpr.Operator.notEquals; + break; + default: + jj_la1[90] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = InstanceOfExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression InstanceOfExpression() { Expression ret; Type type; - ret = RelationalExpression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INSTANCEOF: - jj_consume_token(INSTANCEOF); - type = Type(); - ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); - break; - default: - jj_la1[91] = jj_gen; - ; - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression RelationalExpression() { + ret = RelationalExpression(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case INSTANCEOF: + jj_consume_token(INSTANCEOF); + type = Type(); + ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); + break; + default: + jj_la1[91] = jj_gen; + ; + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression RelationalExpression() { Expression ret; Expression right; BinaryExpr.Operator op; - ret = ShiftExpression(); - label_48: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - case LE: - case GE: - case GT: - ; - break; - default: - jj_la1[92] = jj_gen; - break label_48; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - jj_consume_token(LT); - op = BinaryExpr.Operator.less; - break; - case GT: - jj_consume_token(GT); - op = BinaryExpr.Operator.greater; - break; - case LE: - jj_consume_token(LE); - op = BinaryExpr.Operator.lessEquals; - break; - case GE: - jj_consume_token(GE); - op = BinaryExpr.Operator.greaterEquals; - break; - default: - jj_la1[93] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = ShiftExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression ShiftExpression() { + ret = ShiftExpression(); + label_48: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + case LE: + case GE: + case GT: + ; + break; + default: + jj_la1[92] = jj_gen; + break label_48; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + jj_consume_token(LT); + op = BinaryExpr.Operator.less; + break; + case GT: + jj_consume_token(GT); + op = BinaryExpr.Operator.greater; + break; + case LE: + jj_consume_token(LE); + op = BinaryExpr.Operator.lessEquals; + break; + case GE: + jj_consume_token(GE); + op = BinaryExpr.Operator.greaterEquals; + break; + default: + jj_la1[93] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = ShiftExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression ShiftExpression() { Expression ret; Expression right; BinaryExpr.Operator op; - ret = AdditiveExpression(); - label_49: - while (true) { - if (jj_2_19(1)) { - ; - } else { - break label_49; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LSHIFT: - jj_consume_token(LSHIFT); - op = BinaryExpr.Operator.lShift; - break; - default: - jj_la1[94] = jj_gen; - if (jj_2_20(1)) { - RSIGNEDSHIFT(); - op = BinaryExpr.Operator.rSignedShift; - } else if (jj_2_21(1)) { - RUNSIGNEDSHIFT(); - op = BinaryExpr.Operator.rUnsignedShift; - } else { - jj_consume_token(-1); - throw new ParseException(); - } - } - right = AdditiveExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) return ret; + ret = AdditiveExpression(); + label_49: + while (true) { + if (jj_2_19(1)) { + ; + } else { + break label_49; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LSHIFT: + jj_consume_token(LSHIFT); + op = BinaryExpr.Operator.lShift; + break; + default: + jj_la1[94] = jj_gen; + if (jj_2_20(1)) { + RSIGNEDSHIFT(); + op = BinaryExpr.Operator.rSignedShift; + } else if (jj_2_21(1)) { + RUNSIGNEDSHIFT(); + op = BinaryExpr.Operator.rUnsignedShift; + } else { + jj_consume_token(-1); + throw new ParseException(); } - throw new Error("Missing return statement in function"); + } + right = AdditiveExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } - final public Expression AdditiveExpression() { + final public Expression AdditiveExpression() { Expression ret; Expression right; BinaryExpr.Operator op; - ret = MultiplicativeExpression(); - label_50: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PLUS: - case MINUS: - ; - break; - default: - jj_la1[95] = jj_gen; - break label_50; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - op = BinaryExpr.Operator.plus; - break; - case MINUS: - jj_consume_token(MINUS); - op = BinaryExpr.Operator.minus; - break; - default: - jj_la1[96] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = MultiplicativeExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression MultiplicativeExpression() { + ret = MultiplicativeExpression(); + label_50: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PLUS: + case MINUS: + ; + break; + default: + jj_la1[95] = jj_gen; + break label_50; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PLUS: + jj_consume_token(PLUS); + op = BinaryExpr.Operator.plus; + break; + case MINUS: + jj_consume_token(MINUS); + op = BinaryExpr.Operator.minus; + break; + default: + jj_la1[96] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = MultiplicativeExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression MultiplicativeExpression() { Expression ret; Expression right; BinaryExpr.Operator op; - ret = UnaryExpression(); - label_51: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STAR: - case SLASH: - case REM: - ; - break; - default: - jj_la1[97] = jj_gen; - break label_51; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STAR: - jj_consume_token(STAR); - op = BinaryExpr.Operator.times; - break; - case SLASH: - jj_consume_token(SLASH); - op = BinaryExpr.Operator.divide; - break; - case REM: - jj_consume_token(REM); - op = BinaryExpr.Operator.remainder; - break; - default: - jj_la1[98] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = UnaryExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression UnaryExpression() { + ret = UnaryExpression(); + label_51: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case STAR: + case SLASH: + case REM: + ; + break; + default: + jj_la1[97] = jj_gen; + break label_51; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case STAR: + jj_consume_token(STAR); + op = BinaryExpr.Operator.times; + break; + case SLASH: + jj_consume_token(SLASH); + op = BinaryExpr.Operator.divide; + break; + case REM: + jj_consume_token(REM); + op = BinaryExpr.Operator.remainder; + break; + default: + jj_la1[98] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = UnaryExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression UnaryExpression() { Expression ret; UnaryExpr.Operator op; int line = 0; int column = 0; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INCR: - ret = PreIncrementExpression(); - break; - case DECR: - ret = PreDecrementExpression(); - break; - case PLUS: - case MINUS: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - op = UnaryExpr.Operator.positive; - line = token.beginLine; - column = token.beginColumn; - break; - case MINUS: - jj_consume_token(MINUS); - op = UnaryExpr.Operator.negative; - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[99] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - if (op == UnaryExpr.Operator.negative) { - if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr) ret).isMinValue()) { - ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr) ret).isMinValue()) { - ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); - } - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); - } - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - ret = UnaryExpressionNotPlusMinus(); - break; - default: - jj_la1[100] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression PreIncrementExpression() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case INCR: + ret = PreIncrementExpression(); + break; + case DECR: + ret = PreDecrementExpression(); + break; + case PLUS: + case MINUS: + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PLUS: + jj_consume_token(PLUS); + op = UnaryExpr.Operator.positive; line=token.beginLine; column=token.beginColumn; + break; + case MINUS: + jj_consume_token(MINUS); + op = UnaryExpr.Operator.negative; line=token.beginLine; column=token.beginColumn; + break; + default: + jj_la1[99] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = UnaryExpression(); + if(op == UnaryExpr.Operator.negative) { + if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr)ret).isMinValue()) { + ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); + } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr)ret).isMinValue()) { + ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); + } else { + ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); + } + } else { + ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); + } + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + ret = UnaryExpressionNotPlusMinus(); + break; + default: + jj_la1[100] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression PreIncrementExpression() { Expression ret; int line; int column; - jj_consume_token(INCR); - line = token.beginLine; - column = token.beginColumn; - ret = UnaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preIncrement); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression PreDecrementExpression() { + jj_consume_token(INCR); + line=token.beginLine; column=token.beginColumn; + ret = UnaryExpression(); + ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preIncrement); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression PreDecrementExpression() { Expression ret; int line; int column; - jj_consume_token(DECR); - line = token.beginLine; - column = token.beginColumn; - ret = UnaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preDecrement); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression UnaryExpressionNotPlusMinus() { + jj_consume_token(DECR); + line=token.beginLine; column=token.beginColumn; + ret = UnaryExpression(); + ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preDecrement); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression UnaryExpressionNotPlusMinus() { Expression ret; UnaryExpr.Operator op; int line = 0; int column = 0; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BANG: - case TILDE: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case TILDE: - jj_consume_token(TILDE); - op = UnaryExpr.Operator.inverse; - line = token.beginLine; - column = token.beginColumn; - break; - case BANG: - jj_consume_token(BANG); - op = UnaryExpr.Operator.not; - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[101] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); - break; - default: - jj_la1[102] = jj_gen; - if (jj_2_22(2147483647)) { - ret = CastExpression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - ret = PostfixExpression(); - break; - default: - jj_la1[103] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression PostfixExpression() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BANG: + case TILDE: + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case TILDE: + jj_consume_token(TILDE); + op = UnaryExpr.Operator.inverse; line=token.beginLine; column=token.beginColumn; + break; + case BANG: + jj_consume_token(BANG); + op = UnaryExpr.Operator.not; line=token.beginLine; column=token.beginColumn; + break; + default: + jj_la1[101] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = UnaryExpression(); + ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); + break; + default: + jj_la1[102] = jj_gen; + if (jj_2_22(2147483647)) { + ret = CastExpression(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + ret = PostfixExpression(); + break; + default: + jj_la1[103] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression PostfixExpression() { Expression ret; UnaryExpr.Operator op; - ret = PrimaryExpression(); - if (jj_2_23(2)) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INCR: - jj_consume_token(INCR); - op = UnaryExpr.Operator.posIncrement; - break; - case DECR: - jj_consume_token(DECR); - op = UnaryExpr.Operator.posDecrement; - break; - default: - jj_la1[104] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); - } else { - ; - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression CastExpression() { + ret = PrimaryExpression(); + if (jj_2_23(2)) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case INCR: + jj_consume_token(INCR); + op = UnaryExpr.Operator.posIncrement; + break; + case DECR: + jj_consume_token(DECR); + op = UnaryExpr.Operator.posDecrement; + break; + default: + jj_la1[104] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); + } else { + ; + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression CastExpression() { Expression ret; Type type; int line; int column; AnnotationExpr ann; List annotations = null; - jj_consume_token(LPAREN); - line = token.beginLine; - column = token.beginColumn; - label_52: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[105] = jj_gen; - break label_52; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - if (jj_2_24(2)) { - type = PrimitiveType(); - jj_consume_token(RPAREN); - ret = UnaryExpression(); - type.setAnnotations(annotations); - ret = new CastExpr(line, column, token.endLine, token.endColumn, type, ret); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - type = ReferenceType(); - jj_consume_token(RPAREN); - ret = UnaryExpressionNotPlusMinus(); - type.setAnnotations(annotations); - ret = new CastExpr(line, column, token.endLine, token.endColumn, type, ret); - break; - default: - jj_la1[106] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryExpression() { + jj_consume_token(LPAREN); + line=token.beginLine; column=token.beginColumn; + label_52: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[105] = jj_gen; + break label_52; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + if (jj_2_24(2)) { + type = PrimitiveType(); + jj_consume_token(RPAREN); + ret = UnaryExpression(); + type.setAnnotations(annotations); ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + type = ReferenceType(); + jj_consume_token(RPAREN); + ret = UnaryExpressionNotPlusMinus(); + type.setAnnotations(annotations); ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); + break; + default: + jj_la1[106] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression PrimaryExpression() { Expression ret; Expression inner; - ret = PrimaryPrefix(); - label_53: - while (true) { - if (jj_2_25(2)) { - ; - } else { - break label_53; - } - ret = PrimarySuffix(ret); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryExpressionWithoutSuperSuffix() { + ret = PrimaryPrefix(); + label_53: + while (true) { + if (jj_2_25(2)) { + ; + } else { + break label_53; + } + ret = PrimarySuffix(ret); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression PrimaryExpressionWithoutSuperSuffix() { Expression ret; Expression inner; - ret = PrimaryPrefix(); - label_54: - while (true) { - if (jj_2_26(2147483647)) { - ; - } else { - break label_54; - } - ret = PrimarySuffixWithoutSuper(ret); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryPrefix() { + ret = PrimaryPrefix(); + label_54: + while (true) { + if (jj_2_26(2147483647)) { + ; + } else { + break label_54; + } + ret = PrimarySuffixWithoutSuper(ret); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression PrimaryPrefix() { Expression ret = null; NameExpr name; List typeArgs = null; @@ -3130,524 +2847,506 @@ final public Expression PrimaryPrefix() { int column; Parameter p = null; VariableDeclaratorId id = null; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case FALSE: - case NULL: - case TRUE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - ret = Literal(); - break; - case THIS: - jj_consume_token(THIS); - ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); - break; - case SUPER: - jj_consume_token(SUPER); - ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DOT: - jj_consume_token(DOT); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - case 132: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[107] = jj_gen; - ; - } - name = SimpleName(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs = true; - break; - default: - jj_la1[108] = jj_gen; - ; - } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case FALSE: + case NULL: + case TRUE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + ret = Literal(); + break; + case THIS: + jj_consume_token(THIS); + ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); + break; + case SUPER: + jj_consume_token(SUPER); + ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DOT: + jj_consume_token(DOT); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + case 132: + typeArgs = TypeArguments(); + typeArgs.remove(0); + break; + default: + jj_la1[107] = jj_gen; + ; + } + name = SimpleName(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LPAREN: + args = Arguments(); + hasArgs=true; + break; + default: + jj_la1[108] = jj_gen; + ; + } if (hasArgs) { - MethodCallExpr m = new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, null, args); - m.setNameExpr(name); - ret = m; - } else { - FieldAccessExpr f = new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, null); - f.setFieldExpr(name); - ret = f; - } - break; - case DOUBLECOLON: - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeParameters(); - typeArgs.remove(0); - break; - default: - jj_la1[109] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - break; - case NEW: - jj_consume_token(NEW); - break; - default: - jj_la1[110] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new MethodReferenceExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, token.image); - break; - case LPAREN: - args = Arguments(); - new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, null, args); - break; - default: - jj_la1[111] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - case LPAREN: - jj_consume_token(LPAREN); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - if (jj_2_27(2147483647)) { - p = FormalParameter(); - isLambda = true; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - args = FormalLambdaParameters(); - break; - default: - jj_la1[112] = jj_gen; - ; - } + MethodCallExpr m = new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, null, args); + m.setNameExpr(name); + ret = m; } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = Expression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - args = InferredLambdaParameters(); - isLambda = true; - break; - default: - jj_la1[113] = jj_gen; - ; - } - break; - default: - jj_la1[114] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - default: - jj_la1[115] = jj_gen; - ; - } - jj_consume_token(RPAREN); - if (!isLambda) { - ret = new EnclosedExpr(line, column, token.endLine, token.endColumn, ret); - } else { - if (ret != null) { - if (ret instanceof NameExpr) { - id = new VariableDeclaratorId(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), ((NameExpr) ret).getName(), 0); - p = new Parameter(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), 0, null, new UnknownType(), false, id); + FieldAccessExpr f = new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, null); + f.setFieldExpr(name); + ret = f; } - - } - args = add(0, args, p); - ret = new LambdaExpr(p.getBeginLine(), p.getBeginColumn(), token.endLine, token.endColumn, args, null, true); - } - break; - case NEW: - ret = AllocationExpression(null); - break; + break; + case DOUBLECOLON: + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + typeArgs = TypeParameters(); + typeArgs.remove(0); + break; + default: + jj_la1[109] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + break; + case NEW: + jj_consume_token(NEW); + break; + default: + jj_la1[110] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = new MethodReferenceExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, token.image); + break; + case LPAREN: + args = Arguments(); + new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, null, args); + break; + default: + jj_la1[111] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + case LPAREN: + jj_consume_token(LPAREN); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + if (jj_2_27(2147483647)) { + p = FormalParameter(); + isLambda = true; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + args = FormalLambdaParameters(); + break; + default: + jj_la1[112] = jj_gen; + ; + } + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = Expression(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + args = InferredLambdaParameters(); + isLambda = true; + break; default: - jj_la1[119] = jj_gen; - if (jj_2_28(2147483647)) { - type = ResultType(); - jj_consume_token(DOT); - jj_consume_token(CLASS); - ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); - } else if (jj_2_29(2147483647)) { - type = ResultType(); - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeParameters(); - typeArgs.remove(0); - break; - default: - jj_la1[116] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - break; - case NEW: - jj_consume_token(NEW); - break; - default: - jj_la1[117] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new TypeExpr(type.getBeginLine(), type.getBeginColumn(), type.getEndLine(), type.getEndColumn(), type); - ret = new MethodReferenceExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, token.image); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - name = SimpleName(); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs = true; - break; - default: - jj_la1[118] = jj_gen; - ; - } - if (hasArgs) { + jj_la1[113] = jj_gen; + ; + } + break; + default: + jj_la1[114] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + default: + jj_la1[115] = jj_gen; + ; + } + jj_consume_token(RPAREN); + if(!isLambda) { ret = new EnclosedExpr(line, column, token.endLine, token.endColumn,ret);} + else{ + if(ret != null){ + if(ret instanceof NameExpr) + { + id = new VariableDeclaratorId(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), ((NameExpr)ret).getName(), 0); + p = new Parameter(ret.getBeginLine(), ret.getBeginColumn(), ret.getEndLine(), ret.getEndColumn(), 0, null, new UnknownType(), false, id); + } + + } + args = add(0, args, p); + ret = new LambdaExpr(p.getBeginLine(), p.getBeginColumn(), token.endLine, token.endColumn, args, null, true); + } + break; + case NEW: + ret = AllocationExpression(null); + break; + default: + jj_la1[119] = jj_gen; + if (jj_2_28(2147483647)) { + type = ResultType(); + jj_consume_token(DOT); + jj_consume_token(CLASS); + ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); + } else if (jj_2_29(2147483647)) { + type = ResultType(); + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + typeArgs = TypeParameters(); + typeArgs.remove(0); + break; + default: + jj_la1[116] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + break; + case NEW: + jj_consume_token(NEW); + break; + default: + jj_la1[117] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = new TypeExpr(type.getBeginLine(), type.getBeginColumn(), type.getEndLine(), type.getEndColumn(), type); + ret = new MethodReferenceExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, token.image); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + name = SimpleName(); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LPAREN: + args = Arguments(); + hasArgs=true; + break; + default: + jj_la1[118] = jj_gen; + ; + } + if (hasArgs) { MethodCallExpr m = new MethodCallExpr(line, column, token.endLine, token.endColumn, null, null, null, args); m.setNameExpr(name); ret = m; - } else { + } else { ret = name; - } - break; - default: - jj_la1[120] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - { - if (true) return ret; + } + break; + default: + jj_la1[120] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - throw new Error("Missing return statement in function"); + } } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } - final public Expression PrimarySuffix(Expression scope) { + final public Expression PrimarySuffix(Expression scope) { Expression ret; - if (jj_2_30(2)) { - ret = PrimarySuffixWithoutSuper(scope); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DOT: - jj_consume_token(DOT); - jj_consume_token(SUPER); - ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); - break; - default: - jj_la1[121] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimarySuffixWithoutSuper(Expression scope) { + if (jj_2_30(2)) { + ret = PrimarySuffixWithoutSuper(scope); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DOT: + jj_consume_token(DOT); + jj_consume_token(SUPER); + ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); + break; + default: + jj_la1[121] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression PrimarySuffixWithoutSuper(Expression scope) { Expression ret; List typeArgs = null; List args = null; boolean hasArgs = false; NameExpr name; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DOT: - jj_consume_token(DOT); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case THIS: - jj_consume_token(THIS); - ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); - break; - case NEW: - ret = AllocationExpression(scope); - break; - default: - jj_la1[124] = jj_gen; - if (jj_2_31(2147483647)) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - case 132: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[122] = jj_gen; - ; - } - name = SimpleName(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs = true; - break; - default: - jj_la1[123] = jj_gen; - ; - } - if (hasArgs) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DOT: + jj_consume_token(DOT); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case THIS: + jj_consume_token(THIS); + ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); + break; + case NEW: + ret = AllocationExpression(scope); + break; + default: + jj_la1[124] = jj_gen; + if (jj_2_31(2147483647)) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + case 132: + typeArgs = TypeArguments(); + typeArgs.remove(0); + break; + default: + jj_la1[122] = jj_gen; + ; + } + name = SimpleName(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LPAREN: + args = Arguments(); + hasArgs=true; + break; + default: + jj_la1[123] = jj_gen; + ; + } + if (hasArgs) { MethodCallExpr m = new MethodCallExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, null, args); m.setNameExpr(name); ret = m; - } else { - FieldAccessExpr f = new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, null); + } else { + FieldAccessExpr f = new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, null); f.setFieldExpr(name); ret = f; - } - } else { - jj_consume_token(-1); - throw new ParseException(); } - } - break; - case LBRACKET: - jj_consume_token(LBRACKET); - ret = Expression(); - jj_consume_token(RBRACKET); - ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); - break; - default: - jj_la1[125] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression Literal() { + } else { + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + case LBRACKET: + jj_consume_token(LBRACKET); + ret = Expression(); + jj_consume_token(RBRACKET); + ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); + break; + default: + jj_la1[125] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression Literal() { Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INTEGER_LITERAL: - jj_consume_token(INTEGER_LITERAL); - ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case LONG_LITERAL: - jj_consume_token(LONG_LITERAL); - ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case FLOATING_POINT_LITERAL: - jj_consume_token(FLOATING_POINT_LITERAL); - ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case CHARACTER_LITERAL: - jj_consume_token(CHARACTER_LITERAL); - ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length() - 1)); - break; - case STRING_LITERAL: - jj_consume_token(STRING_LITERAL); - ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length() - 1)); - break; - case FALSE: - case TRUE: - ret = BooleanLiteral(); - break; - case NULL: - ret = NullLiteral(); - break; - default: - jj_la1[126] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression BooleanLiteral() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case INTEGER_LITERAL: + jj_consume_token(INTEGER_LITERAL); + ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + break; + case LONG_LITERAL: + jj_consume_token(LONG_LITERAL); + ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + break; + case FLOATING_POINT_LITERAL: + jj_consume_token(FLOATING_POINT_LITERAL); + ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + break; + case CHARACTER_LITERAL: + jj_consume_token(CHARACTER_LITERAL); + ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); + break; + case STRING_LITERAL: + jj_consume_token(STRING_LITERAL); + ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); + break; + case FALSE: + case TRUE: + ret = BooleanLiteral(); + break; + case NULL: + ret = NullLiteral(); + break; + default: + jj_la1[126] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression BooleanLiteral() { Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case TRUE: - jj_consume_token(TRUE); - ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); - break; - case FALSE: - jj_consume_token(FALSE); - ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); - break; - default: - jj_la1[127] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression NullLiteral() { - jj_consume_token(NULL); - { - if (true) return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - } - throw new Error("Missing return statement in function"); - } - - final public List Arguments() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case TRUE: + jj_consume_token(TRUE); + ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); + break; + case FALSE: + jj_consume_token(FALSE); + ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); + break; + default: + jj_la1[127] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression NullLiteral() { + jj_consume_token(NULL); + {if (true) return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn);} + throw new Error("Missing return statement in function"); + } + + final public List Arguments() { List ret = null; - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ArgumentList(); - break; - default: - jj_la1[128] = jj_gen; - ; - } - jj_consume_token(RPAREN); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List ArgumentList() { + jj_consume_token(LPAREN); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = ArgumentList(); + break; + default: + jj_la1[128] = jj_gen; + ; + } + jj_consume_token(RPAREN); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List ArgumentList() { List ret = new LinkedList(); Expression expr; - expr = Expression(); - ret.add(expr); - label_55: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[129] = jj_gen; - break label_55; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression AllocationExpression(Expression scope) { + expr = Expression(); + ret.add(expr); + label_55: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[129] = jj_gen; + break label_55; + } + jj_consume_token(COMMA); + expr = Expression(); + ret.add(expr); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression AllocationExpression(Expression scope) { Expression ret; ArrayCreationExpr arrayExpr; Type type; @@ -3659,125 +3358,115 @@ final public Expression AllocationExpression(Expression scope) { int column; List annotations = null; AnnotationExpr ann; - jj_consume_token(NEW); - if (scope == null) { - line = token.beginLine; - column = token.beginColumn; - } else { - line = scope.getBeginLine(); - column = scope.getBeginColumn(); - } - label_56: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[130] = jj_gen; - break label_56; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - type = PrimitiveType(); - type.setAnnotations(annotations); - arr = ArrayDimsAndInits(); - arrayExpr = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, null, 0); - arrayExpr.setArraysAnnotations((List) arr[2]); + jj_consume_token(NEW); + if(scope==null) {line=token.beginLine; column=token.beginColumn;} else {line=scope.getBeginLine(); column=scope.getBeginColumn();} + label_56: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[130] = jj_gen; + break label_56; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + type = PrimitiveType(); + type.setAnnotations(annotations); + arr = ArrayDimsAndInits(); + arrayExpr = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, null, 0); + arrayExpr.setArraysAnnotations((List)arr[2]); if (arr[0] instanceof Integer) { - arrayExpr.setArrayCount(((Integer) arr[0]).intValue()); - arrayExpr.setInitializer((ArrayInitializerExpr) arr[1]); + arrayExpr.setArrayCount(((Integer)arr[0]).intValue()); + arrayExpr.setInitializer((ArrayInitializerExpr)arr[1]); } else { - arrayExpr.setArrayCount(((Integer) arr[1]).intValue()); - arrayExpr.setDimensions((List) arr[0]); + arrayExpr.setArrayCount(((Integer)arr[1]).intValue()); + arrayExpr.setDimensions((List)arr[0]); } ret = arrayExpr; - break; - case IDENTIFIER: - case LT: - case 132: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - case 132: - typeArgs = TypeArguments(); - label_57: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[131] = jj_gen; - break label_57; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - typeArgs.remove(0); - break; - default: - jj_la1[132] = jj_gen; - ; - } - type = ClassOrInterfaceType(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - case AT: - arr = ArrayDimsAndInits(); - type.setAnnotations(annotations); - arrayExpr = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, null, 0); - arrayExpr.setArraysAnnotations((List) arr[2]); + break; + case IDENTIFIER: + case LT: + case 132: + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + case 132: + typeArgs = TypeArguments(); + label_57: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[131] = jj_gen; + break label_57; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + typeArgs.remove(0); + break; + default: + jj_la1[132] = jj_gen; + ; + } + type = ClassOrInterfaceType(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACKET: + case AT: + arr = ArrayDimsAndInits(); + type.setAnnotations(annotations); arrayExpr = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, null, 0); + arrayExpr.setArraysAnnotations((List)arr[2]); if (arr[0] instanceof Integer) { - arrayExpr.setArrayCount(((Integer) arr[0]).intValue()); - arrayExpr.setInitializer((ArrayInitializerExpr) arr[1]); + arrayExpr.setArrayCount(((Integer)arr[0]).intValue()); + arrayExpr.setInitializer((ArrayInitializerExpr)arr[1]); } else { - arrayExpr.setArrayCount(((Integer) arr[1]).intValue()); - arrayExpr.setDimensions((List) arr[0]); + arrayExpr.setArrayCount(((Integer)arr[1]).intValue()); + arrayExpr.setDimensions((List)arr[0]); } ret = arrayExpr; - break; - case LPAREN: - args = Arguments(); - if (jj_2_32(2)) { - anonymousBody = ClassOrInterfaceBody(false); - } else { - ; - } - type.setAnnotations(annotations); - ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); - break; - default: - jj_la1[133] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[134] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } + break; + case LPAREN: + args = Arguments(); + if (jj_2_32(2)) { + anonymousBody = ClassOrInterfaceBody(false); + } else { + ; + } + type.setAnnotations(annotations); ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); + break; + default: + jj_la1[133] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[134] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } - /* - * The third LOOKAHEAD specification below is to parse to PrimarySuffix - * if there is an expression between the "[...]". - */ - final public Object[] ArrayDimsAndInits() { +/* + * The third LOOKAHEAD specification below is to parse to PrimarySuffix + * if there is an expression between the "[...]". + */ + final public Object[] ArrayDimsAndInits() { Object[] ret = new Object[3]; Expression expr; List inits = null; @@ -3785,409 +3474,375 @@ final public Object[] ArrayDimsAndInits() { List accum = null; List annotations = null; AnnotationExpr ann; - label_58: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[135] = jj_gen; - break label_58; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - if (jj_2_35(2)) { - label_59: - while (true) { - jj_consume_token(LBRACKET); - expr = Expression(); - accum = add(accum, annotations); - annotations = null; - inits = add(inits, expr); - jj_consume_token(RBRACKET); - if (jj_2_33(2)) { - ; - } else { - break label_59; - } - } - label_60: - while (true) { - if (jj_2_34(2)) { - ; - } else { - break label_60; - } - label_61: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[136] = jj_gen; - break label_61; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - i++; - } - accum = add(accum, annotations); - annotations = null; - ret[0] = inits; - ret[1] = new Integer(i); + label_58: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[135] = jj_gen; + break label_58; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + if (jj_2_35(2)) { + label_59: + while (true) { + jj_consume_token(LBRACKET); + expr = Expression(); + accum = add(accum, annotations); annotations=null; inits = add(inits, expr); + jj_consume_token(RBRACKET); + if (jj_2_33(2)) { + ; } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - label_62: - while (true) { - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - i++; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[137] = jj_gen; - break label_62; - } - } - expr = ArrayInitializer(); - accum = add(accum, annotations); - annotations = null; - ret[0] = new Integer(i); - ret[1] = expr; - break; - default: - jj_la1[138] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + break label_59; } - ret[2] = accum; - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - /* - * Statement syntax follows. - */ - final public Statement Statement() { - Statement ret; - if (jj_2_36(2)) { - ret = LabeledStatement(); + } + label_60: + while (true) { + if (jj_2_34(2)) { + ; } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSERT: - ret = AssertStatement(); - break; - case LBRACE: - ret = Block(); - break; - case SEMICOLON: - ret = EmptyStatement(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case INCR: - case DECR: - ret = StatementExpression(); - break; - case SWITCH: - ret = SwitchStatement(); - break; - case IF: - ret = IfStatement(); - break; - case WHILE: - ret = WhileStatement(); - break; - case DO: - ret = DoStatement(); - break; - case FOR: - ret = ForStatement(); - break; - case BREAK: - ret = BreakStatement(); - break; - case CONTINUE: - ret = ContinueStatement(); - break; - case RETURN: - ret = ReturnStatement(); - break; - case THROW: - ret = ThrowStatement(); - break; - case SYNCHRONIZED: - ret = SynchronizedStatement(); - break; - case TRY: - ret = TryStatement(); - break; - default: - jj_la1[139] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return ret; + break label_60; } - throw new Error("Missing return statement in function"); - } + label_61: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ; + break; + default: + jj_la1[136] = jj_gen; + break label_61; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + i++; + } + accum = add(accum, annotations); annotations=null; ret[0] = inits; ret[1] = new Integer(i); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACKET: + label_62: + while (true) { + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + i++; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LBRACKET: + ; + break; + default: + jj_la1[137] = jj_gen; + break label_62; + } + } + expr = ArrayInitializer(); + accum = add(accum, annotations);annotations=null; ret[0] = new Integer(i); ret[1] = expr; + break; + default: + jj_la1[138] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + ret[2]=accum; {if (true) return ret;} + throw new Error("Missing return statement in function"); + } - final public AssertStmt AssertStatement() { +/* + * Statement syntax follows. + */ + final public Statement Statement() { + Statement ret; + if (jj_2_36(2)) { + ret = LabeledStatement(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ASSERT: + ret = AssertStatement(); + break; + case LBRACE: + ret = Block(); + break; + case SEMICOLON: + ret = EmptyStatement(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case INCR: + case DECR: + ret = StatementExpression(); + break; + case SWITCH: + ret = SwitchStatement(); + break; + case IF: + ret = IfStatement(); + break; + case WHILE: + ret = WhileStatement(); + break; + case DO: + ret = DoStatement(); + break; + case FOR: + ret = ForStatement(); + break; + case BREAK: + ret = BreakStatement(); + break; + case CONTINUE: + ret = ContinueStatement(); + break; + case RETURN: + ret = ReturnStatement(); + break; + case THROW: + ret = ThrowStatement(); + break; + case SYNCHRONIZED: + ret = SynchronizedStatement(); + break; + case TRY: + ret = TryStatement(); + break; + default: + jj_la1[139] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public AssertStmt AssertStatement() { Expression check; Expression msg = null; int line; int column; - jj_consume_token(ASSERT); - line = token.beginLine; - column = token.beginColumn; - check = Expression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COLON: - jj_consume_token(COLON); - msg = Expression(); - break; - default: - jj_la1[140] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) return new AssertStmt(line, column, token.endLine, token.endColumn, check, msg); - } - throw new Error("Missing return statement in function"); - } - - final public LabeledStmt LabeledStatement() { + jj_consume_token(ASSERT); + line=token.beginLine; column=token.beginColumn; + check = Expression(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COLON: + jj_consume_token(COLON); + msg = Expression(); + break; + default: + jj_la1[140] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + {if (true) return new AssertStmt(line, column, token.endLine, token.endColumn,check, msg);} + throw new Error("Missing return statement in function"); + } + + final public LabeledStmt LabeledStatement() { String label; Statement stmt; int line; int column; - jj_consume_token(IDENTIFIER); - line = token.beginLine; - column = token.beginColumn; - label = token.image; - jj_consume_token(COLON); - stmt = Statement(); - { - if (true) return new LabeledStmt(line, column, token.endLine, token.endColumn, label, stmt); - } - throw new Error("Missing return statement in function"); - } - - final public BlockStmt Block() { + jj_consume_token(IDENTIFIER); + line=token.beginLine; column=token.beginColumn; + label = token.image; + jj_consume_token(COLON); + stmt = Statement(); + {if (true) return new LabeledStmt(line, column, token.endLine, token.endColumn,label, stmt);} + throw new Error("Missing return statement in function"); + } + + final public BlockStmt Block() { List stmts; int beginLine; int beginColumn; - jj_consume_token(LBRACE); - beginLine = token.beginLine; - beginColumn = token.beginColumn; - stmts = Statements(); - jj_consume_token(RBRACE); - { - if (true) return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts); - } - throw new Error("Missing return statement in function"); - } + jj_consume_token(LBRACE); + beginLine=token.beginLine; beginColumn=token.beginColumn; + stmts = Statements(); + jj_consume_token(RBRACE); + {if (true) return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts);} + throw new Error("Missing return statement in function"); + } - /* - * Classes inside block stametents can only be abstract or final. The semantic must check it. - */ - final public Statement BlockStatement() { +/* + * Classes inside block stametents can only be abstract or final. The semantic must check it. + */ + final public Statement BlockStatement() { Statement ret; Expression expr; ClassOrInterfaceDeclaration typeDecl; Modifier modifier; - if (jj_2_37(2147483647)) { - - modifier = Modifiers(); - typeDecl = ClassOrInterfaceDeclaration(modifier); - ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); - } else if (jj_2_38(2147483647)) { - expr = VariableDeclarationExpression(); - jj_consume_token(SEMICOLON); + if (jj_2_37(2147483647)) { + + modifier = Modifiers(); + typeDecl = ClassOrInterfaceDeclaration(modifier); + ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); + } else if (jj_2_38(2147483647)) { + expr = VariableDeclarationExpression(); + jj_consume_token(SEMICOLON); ret = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FLOAT: - case FOR: - case IF: - case INT: - case LONG: - case NEW: - case NULL: - case RETURN: - case SHORT: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRUE: - case TRY: - case VOID: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case INCR: - case DECR: - ret = Statement(); - break; - default: - jj_la1[141] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public VariableDeclarationExpr VariableDeclarationExpression() { + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ASSERT: + case BOOLEAN: + case BREAK: + case BYTE: + case CHAR: + case CONTINUE: + case DO: + case DOUBLE: + case FALSE: + case FLOAT: + case FOR: + case IF: + case INT: + case LONG: + case NEW: + case NULL: + case RETURN: + case SHORT: + case SUPER: + case SWITCH: + case SYNCHRONIZED: + case THIS: + case THROW: + case TRUE: + case TRY: + case VOID: + case WHILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case SEMICOLON: + case INCR: + case DECR: + ret = Statement(); + break; + default: + jj_la1[141] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public VariableDeclarationExpr VariableDeclarationExpression() { Modifier modifier; Type type; List vars = new LinkedList(); VariableDeclarator var; - modifier = Modifiers(); - type = Type(); - var = VariableDeclarator(); - vars.add(var); - label_63: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[142] = jj_gen; - break label_63; - } - jj_consume_token(COMMA); - var = VariableDeclarator(); - vars.add(var); - } - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - { - if (true) - return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, vars); - } - throw new Error("Missing return statement in function"); - } - - final public EmptyStmt EmptyStatement() { - jj_consume_token(SEMICOLON); - { - if (true) return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - } - throw new Error("Missing return statement in function"); - } - - final public Statement LambdaBody() { - Expression expr; - Statement n = null; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - expr = Expression(); - n = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); - break; - case LBRACE: - n = Block(); - break; - default: - jj_la1[143] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return n; - } - throw new Error("Missing return statement in function"); - } - - final public ExpressionStmt StatementExpression() { + modifier = Modifiers(); + type = Type(); + var = VariableDeclarator(); + vars.add(var); + label_63: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[142] = jj_gen; + break label_63; + } + jj_consume_token(COMMA); + var = VariableDeclarator(); + vars.add(var); + } + int line = modifier.beginLine; + int column = modifier.beginColumn; + if(line==-1) {line=type.getBeginLine(); column=type.getBeginColumn(); } + {if (true) return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, vars);} + throw new Error("Missing return statement in function"); + } + + final public EmptyStmt EmptyStatement() { + jj_consume_token(SEMICOLON); + {if (true) return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn);} + throw new Error("Missing return statement in function"); + } + + final public Statement LambdaBody() { + Expression expr; + Statement n = null; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + expr = Expression(); + n = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); + break; + case LBRACE: + n = Block(); + break; + default: + jj_la1[143] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return n;} + throw new Error("Missing return statement in function"); + } + + final public ExpressionStmt StatementExpression() { Expression expr; AssignExpr.Operator op; Expression value; @@ -4197,278 +3852,262 @@ final public ExpressionStmt StatementExpression() { VariableDeclaratorId id = null; List params = null; Expression inner = null; - if (jj_2_39(2)) { - expr = PreIncrementExpression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DECR: - expr = PreDecrementExpression(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - expr = PrimaryExpression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSIGN: - case INCR: - case DECR: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - case ARROW: - case DOUBLECOLON: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INCR: - jj_consume_token(INCR); - expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); - break; - case DECR: - jj_consume_token(DECR); - expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); - break; - case ASSIGN: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - op = AssignmentOperator(); - value = Expression(); - expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); - break; - case DOUBLECOLON: - jj_consume_token(DOUBLECOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeParameters(); - typeArgs.remove(0); - break; - default: - jj_la1[144] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - break; - case NEW: - jj_consume_token(NEW); - break; - default: - jj_la1[145] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - expr = new MethodReferenceExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, typeArgs, token.image); - break; - case ARROW: - jj_consume_token(ARROW); - lambdaBody = LambdaBody(); - if (expr instanceof CastExpr) { - inner = generateLambda(((CastExpr) expr).getExpr(), lambdaBody); - ((CastExpr) expr).setExpr(inner); - } else { - expr = generateLambda(expr, lambdaBody); - } - break; - default: - jj_la1[146] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[147] = jj_gen; - ; - } - break; - default: - jj_la1[148] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + if (jj_2_39(2)) { + expr = PreIncrementExpression(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DECR: + expr = PreDecrementExpression(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + expr = PrimaryExpression(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ASSIGN: + case INCR: + case DECR: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN: + case ARROW: + case DOUBLECOLON: + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case INCR: + jj_consume_token(INCR); + expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); + break; + case DECR: + jj_consume_token(DECR); + expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); + break; + case ASSIGN: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN: + op = AssignmentOperator(); + value = Expression(); + expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); + break; + case DOUBLECOLON: + jj_consume_token(DOUBLECOLON); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LT: + typeArgs = TypeParameters(); + typeArgs.remove(0); + break; + default: + jj_la1[144] = jj_gen; + ; } - } - jj_consume_token(SEMICOLON); - { - if (true) - return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); - } - throw new Error("Missing return statement in function"); - } - - final public SwitchStmt SwitchStatement() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + break; + case NEW: + jj_consume_token(NEW); + break; + default: + jj_la1[145] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + expr = new MethodReferenceExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, typeArgs, token.image); + break; + case ARROW: + jj_consume_token(ARROW); + lambdaBody = LambdaBody(); + if (expr instanceof CastExpr) + { + inner = generateLambda(((CastExpr)expr).getExpr(), lambdaBody); + ((CastExpr)expr).setExpr(inner); + } + else + { + expr = generateLambda(expr, lambdaBody); + } + break; + default: + jj_la1[146] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[147] = jj_gen; + ; + } + break; + default: + jj_la1[148] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + jj_consume_token(SEMICOLON); + {if (true) return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr);} + throw new Error("Missing return statement in function"); + } + + final public SwitchStmt SwitchStatement() { Expression selector; SwitchEntryStmt entry; List entries = null; int line; int column; - jj_consume_token(SWITCH); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - selector = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(LBRACE); - label_64: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CASE: - case _DEFAULT: - ; - break; - default: - jj_la1[149] = jj_gen; - break label_64; - } - entry = SwitchEntry(); - entries = add(entries, entry); - } - jj_consume_token(RBRACE); - { - if (true) return new SwitchStmt(line, column, token.endLine, token.endColumn, selector, entries); - } - throw new Error("Missing return statement in function"); - } - - final public SwitchEntryStmt SwitchEntry() { + jj_consume_token(SWITCH); + line=token.beginLine; column=token.beginColumn; + jj_consume_token(LPAREN); + selector = Expression(); + jj_consume_token(RPAREN); + jj_consume_token(LBRACE); + label_64: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CASE: + case _DEFAULT: + ; + break; + default: + jj_la1[149] = jj_gen; + break label_64; + } + entry = SwitchEntry(); + entries = add(entries, entry); + } + jj_consume_token(RBRACE); + {if (true) return new SwitchStmt(line, column, token.endLine, token.endColumn,selector, entries);} + throw new Error("Missing return statement in function"); + } + + final public SwitchEntryStmt SwitchEntry() { Expression label = null; List stmts; int line; int column; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CASE: - jj_consume_token(CASE); - line = token.beginLine; - column = token.beginColumn; - label = Expression(); - break; - case _DEFAULT: - jj_consume_token(_DEFAULT); - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[150] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(COLON); - stmts = Statements(); - { - if (true) return new SwitchEntryStmt(line, column, token.endLine, token.endColumn, label, stmts); - } - throw new Error("Missing return statement in function"); - } - - final public IfStmt IfStatement() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CASE: + jj_consume_token(CASE); + line=token.beginLine; column=token.beginColumn; + label = Expression(); + break; + case _DEFAULT: + jj_consume_token(_DEFAULT); + line=token.beginLine; column=token.beginColumn; + break; + default: + jj_la1[150] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(COLON); + stmts = Statements(); + {if (true) return new SwitchEntryStmt(line, column, token.endLine, token.endColumn,label, stmts);} + throw new Error("Missing return statement in function"); + } + + final public IfStmt IfStatement() { Expression condition; Statement thenStmt; Statement elseStmt = null; int line; int column; - Comment thenCmmt = null; - Comment elseCmmt = null; - jj_consume_token(IF); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - - thenStmt = Statement(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ELSE: - jj_consume_token(ELSE); - - elseStmt = Statement(); - break; - default: - jj_la1[151] = jj_gen; - ; - } - IfStmt tmp = new IfStmt(line, column, token.endLine, token.endColumn, condition, thenStmt, elseStmt); - - thenStmt.setComment(thenCmmt); - if (elseStmt != null) - elseStmt.setComment(elseCmmt); - { - if (true) return tmp; - } - throw new Error("Missing return statement in function"); - } - - final public WhileStmt WhileStatement() { + Comment thenCmmt = null; + Comment elseCmmt = null; + jj_consume_token(IF); + line=token.beginLine; column=token.beginColumn; + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + + thenStmt = Statement(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ELSE: + jj_consume_token(ELSE); + + elseStmt = Statement(); + break; + default: + jj_la1[151] = jj_gen; + ; + } + IfStmt tmp = new IfStmt(line, column, token.endLine, token.endColumn,condition, thenStmt, elseStmt); + + thenStmt.setComment(thenCmmt); + if (elseStmt != null) + elseStmt.setComment(elseCmmt); + {if (true) return tmp;} + throw new Error("Missing return statement in function"); + } + + final public WhileStmt WhileStatement() { Expression condition; Statement body; int line; int column; - jj_consume_token(WHILE); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - body = Statement(); - { - if (true) return new WhileStmt(line, column, token.endLine, token.endColumn, condition, body); - } - throw new Error("Missing return statement in function"); - } - - final public DoStmt DoStatement() { + jj_consume_token(WHILE); + line=token.beginLine; column=token.beginColumn; + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + body = Statement(); + {if (true) return new WhileStmt(line, column, token.endLine, token.endColumn,condition, body);} + throw new Error("Missing return statement in function"); + } + + final public DoStmt DoStatement() { Expression condition; Statement body; int line; int column; - jj_consume_token(DO); - line = token.beginLine; - column = token.beginColumn; - body = Statement(); - jj_consume_token(WHILE); - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(SEMICOLON); - { - if (true) return new DoStmt(line, column, token.endLine, token.endColumn, body, condition); - } - throw new Error("Missing return statement in function"); - } - - final public Statement ForStatement() { + jj_consume_token(DO); + line=token.beginLine; column=token.beginColumn; + body = Statement(); + jj_consume_token(WHILE); + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + jj_consume_token(SEMICOLON); + {if (true) return new DoStmt(line, column, token.endLine, token.endColumn,body, condition);} + throw new Error("Missing return statement in function"); + } + + final public Statement ForStatement() { String id = null; VariableDeclarationExpr varExpr = null; Expression expr = null; @@ -4477,410 +4116,383 @@ final public Statement ForStatement() { Statement body; int line; int column; - jj_consume_token(FOR); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - if (jj_2_40(2147483647)) { - varExpr = VariableDeclarationExpression(); - jj_consume_token(COLON); - expr = Expression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case SEMICOLON: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - init = ForInit(); - break; - default: - jj_la1[152] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - expr = Expression(); - break; - default: - jj_la1[153] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - update = ForUpdate(); - break; - default: - jj_la1[154] = jj_gen; - ; - } - break; - default: - jj_la1[155] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + jj_consume_token(FOR); + line=token.beginLine; column=token.beginColumn; + jj_consume_token(LPAREN); + if (jj_2_40(2147483647)) { + varExpr = VariableDeclarationExpression(); + jj_consume_token(COLON); + expr = Expression(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case SEMICOLON: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + init = ForInit(); + break; + default: + jj_la1[152] = jj_gen; + ; } - jj_consume_token(RPAREN); - body = Statement(); - if (varExpr != null) { - { - if (true) return new ForeachStmt(line, column, token.endLine, token.endColumn, varExpr, expr, body); - } + jj_consume_token(SEMICOLON); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + expr = Expression(); + break; + default: + jj_la1[153] = jj_gen; + ; } - { - if (true) return new ForStmt(line, column, token.endLine, token.endColumn, init, expr, update, body); + jj_consume_token(SEMICOLON); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + update = ForUpdate(); + break; + default: + jj_la1[154] = jj_gen; + ; + } + break; + default: + jj_la1[155] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + jj_consume_token(RPAREN); + body = Statement(); + if (varExpr != null) { + {if (true) return new ForeachStmt(line, column, token.endLine, token.endColumn,varExpr, expr, body);} } - throw new Error("Missing return statement in function"); - } + {if (true) return new ForStmt(line, column, token.endLine, token.endColumn,init, expr, update, body);} + throw new Error("Missing return statement in function"); + } - final public List ForInit() { + final public List ForInit() { List ret; Expression expr; - if (jj_2_41(2147483647)) { - expr = VariableDeclarationExpression(); - ret = new LinkedList(); - ret.add(expr); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ExpressionList(); - break; - default: - jj_la1[156] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List ExpressionList() { + if (jj_2_41(2147483647)) { + expr = VariableDeclarationExpression(); + ret = new LinkedList(); ret.add(expr); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = ExpressionList(); + break; + default: + jj_la1[156] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List ExpressionList() { List ret = new LinkedList(); Expression expr; - expr = Expression(); - ret.add(expr); - label_65: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[157] = jj_gen; - break label_65; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public List ForUpdate() { + expr = Expression(); + ret.add(expr); + label_65: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[157] = jj_gen; + break label_65; + } + jj_consume_token(COMMA); + expr = Expression(); + ret.add(expr); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public List ForUpdate() { List ret; - ret = ExpressionList(); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } + ret = ExpressionList(); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } - final public BreakStmt BreakStatement() { + final public BreakStmt BreakStatement() { String id = null; int line; int column; - jj_consume_token(BREAK); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - id = token.image; - break; - default: - jj_la1[158] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) return new BreakStmt(line, column, token.endLine, token.endColumn, id); - } - throw new Error("Missing return statement in function"); - } - - final public ContinueStmt ContinueStatement() { + jj_consume_token(BREAK); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + id = token.image; + break; + default: + jj_la1[158] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + {if (true) return new BreakStmt(line, column, token.endLine, token.endColumn,id);} + throw new Error("Missing return statement in function"); + } + + final public ContinueStmt ContinueStatement() { String id = null; int line; int column; - jj_consume_token(CONTINUE); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - id = token.image; - break; - default: - jj_la1[159] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) return new ContinueStmt(line, column, token.endLine, token.endColumn, id); - } - throw new Error("Missing return statement in function"); - } - - final public ReturnStmt ReturnStatement() { + jj_consume_token(CONTINUE); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + id = token.image; + break; + default: + jj_la1[159] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + {if (true) return new ContinueStmt(line, column, token.endLine, token.endColumn,id);} + throw new Error("Missing return statement in function"); + } + + final public ReturnStmt ReturnStatement() { Expression expr = null; int line; int column; - jj_consume_token(RETURN); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - expr = Expression(); - break; - default: - jj_la1[160] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) return new ReturnStmt(line, column, token.endLine, token.endColumn, expr); - } - throw new Error("Missing return statement in function"); - } - - final public ThrowStmt ThrowStatement() { + jj_consume_token(RETURN); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + expr = Expression(); + break; + default: + jj_la1[160] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + {if (true) return new ReturnStmt(line, column, token.endLine, token.endColumn,expr);} + throw new Error("Missing return statement in function"); + } + + final public ThrowStmt ThrowStatement() { Expression expr; int line; int column; - jj_consume_token(THROW); - line = token.beginLine; - column = token.beginColumn; - expr = Expression(); - jj_consume_token(SEMICOLON); - { - if (true) return new ThrowStmt(line, column, token.endLine, token.endColumn, expr); - } - throw new Error("Missing return statement in function"); - } - - final public SynchronizedStmt SynchronizedStatement() { + jj_consume_token(THROW); + line=token.beginLine; column=token.beginColumn; + expr = Expression(); + jj_consume_token(SEMICOLON); + {if (true) return new ThrowStmt(line, column, token.endLine, token.endColumn,expr);} + throw new Error("Missing return statement in function"); + } + + final public SynchronizedStmt SynchronizedStatement() { Expression expr; BlockStmt block; int line; int column; - jj_consume_token(SYNCHRONIZED); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - expr = Expression(); - jj_consume_token(RPAREN); - block = Block(); - { - if (true) return new SynchronizedStmt(line, column, token.endLine, token.endColumn, expr, block); - } - throw new Error("Missing return statement in function"); - } - - final public TryStmt TryStatement() { + jj_consume_token(SYNCHRONIZED); + line=token.beginLine; column=token.beginColumn; + jj_consume_token(LPAREN); + expr = Expression(); + jj_consume_token(RPAREN); + block = Block(); + {if (true) return new SynchronizedStmt(line, column, token.endLine, token.endColumn,expr, block);} + throw new Error("Missing return statement in function"); + } + + final public TryStmt TryStatement() { List resources = new LinkedList(); BlockStmt tryBlock; BlockStmt finallyBlock = null; @@ -4895,5290 +4507,4642 @@ final public TryStmt TryStatement() { int column; int cLine; int cColumn; - jj_consume_token(TRY); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - resources = ResourceSpecification(); - break; - default: - jj_la1[161] = jj_gen; - ; - } - tryBlock = Block(); - label_66: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CATCH: - ; - break; - default: - jj_la1[162] = jj_gen; - break label_66; - } - jj_consume_token(CATCH); - cLine = token.beginLine; - cColumn = token.beginColumn; - jj_consume_token(LPAREN); - exceptModifier = Modifiers(); - exceptType = Type(); - exceptTypes.add(exceptType); - label_67: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BIT_OR: - ; - break; - default: - jj_la1[163] = jj_gen; - break label_67; - } - jj_consume_token(BIT_OR); - exceptType = Type(); - exceptTypes.add(exceptType); - } - exceptId = VariableDeclaratorId(); - jj_consume_token(RPAREN); - catchBlock = Block(); - catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, exceptModifier.modifiers, exceptModifier.annotations, exceptTypes, exceptId, catchBlock)); - exceptTypes = new LinkedList(); - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case FINALLY: - jj_consume_token(FINALLY); - finallyBlock = Block(); - break; - default: - jj_la1[164] = jj_gen; - ; - } - { - if (true) - return new TryStmt(line, column, token.endLine, token.endColumn, resources, tryBlock, catchs, finallyBlock); - } - throw new Error("Missing return statement in function"); - } - - final public List ResourceSpecification() { - List vars; - jj_consume_token(LPAREN); - vars = Resources(); - if (jj_2_42(2)) { - jj_consume_token(SEMICOLON); - } else { - ; - } - jj_consume_token(RPAREN); - { - if (true) return vars; - } - throw new Error("Missing return statement in function"); - } - - final public List Resources() { + jj_consume_token(TRY); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case LPAREN: + resources = ResourceSpecification(); + break; + default: + jj_la1[161] = jj_gen; + ; + } + tryBlock = Block(); + label_66: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CATCH: + ; + break; + default: + jj_la1[162] = jj_gen; + break label_66; + } + jj_consume_token(CATCH); + cLine=token.beginLine; cColumn=token.beginColumn; + jj_consume_token(LPAREN); + exceptModifier = Modifiers(); + exceptType = Type(); + exceptTypes.add(exceptType); + label_67: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BIT_OR: + ; + break; + default: + jj_la1[163] = jj_gen; + break label_67; + } + jj_consume_token(BIT_OR); + exceptType = Type(); + exceptTypes.add(exceptType); + } + exceptId = VariableDeclaratorId(); + jj_consume_token(RPAREN); + catchBlock = Block(); + catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, exceptModifier.modifiers, exceptModifier.annotations, exceptTypes, exceptId, catchBlock)); exceptTypes = new LinkedList(); + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case FINALLY: + jj_consume_token(FINALLY); + finallyBlock = Block(); + break; + default: + jj_la1[164] = jj_gen; + ; + } + {if (true) return new TryStmt(line, column, token.endLine, token.endColumn, resources, tryBlock, catchs, finallyBlock);} + throw new Error("Missing return statement in function"); + } + + final public List ResourceSpecification() { +List vars; + jj_consume_token(LPAREN); + vars = Resources(); + if (jj_2_42(2)) { + jj_consume_token(SEMICOLON); + } else { + ; + } + jj_consume_token(RPAREN); + {if (true) return vars;} + throw new Error("Missing return statement in function"); + } + + final public List Resources() { List vars = new LinkedList(); VariableDeclarationExpr var; - /*this is a bit more lenient than we need to be, eg allowing access modifiers like private*/ - var = VariableDeclarationExpression(); - vars.add(var); - label_68: - while (true) { - if (jj_2_43(2)) { - ; - } else { - break label_68; - } - jj_consume_token(SEMICOLON); - var = VariableDeclarationExpression(); - vars.add(var); - } - { - if (true) return vars; - } - throw new Error("Missing return statement in function"); + /*this is a bit more lenient than we need to be, eg allowing access modifiers like private*/ + var = VariableDeclarationExpression(); + vars.add(var); + label_68: + while (true) { + if (jj_2_43(2)) { + ; + } else { + break label_68; + } + jj_consume_token(SEMICOLON); + var = VariableDeclarationExpression(); + vars.add(var); + } + {if (true) return vars;} + throw new Error("Missing return statement in function"); + } + +/* We use productions to match >>>, >> and > so that we can keep the + * type declaration syntax with generics clean + */ + final public void RUNSIGNEDSHIFT() { + if (getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT) { + + } else { + jj_consume_token(-1); + throw new ParseException(); } + jj_consume_token(GT); + jj_consume_token(GT); + jj_consume_token(GT); + } - /* We use productions to match >>>, >> and > so that we can keep the - * type declaration syntax with generics clean - */ - final public void RUNSIGNEDSHIFT() { - if (getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT) { + final public void RSIGNEDSHIFT() { + if (getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT) { - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); - jj_consume_token(GT); - } - - final public void RSIGNEDSHIFT() { - if (getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT) { - - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); + } else { + jj_consume_token(-1); + throw new ParseException(); } + jj_consume_token(GT); + jj_consume_token(GT); + } - /* Annotation syntax follows. */ - final public AnnotationExpr Annotation() { +/* Annotation syntax follows. */ + final public AnnotationExpr Annotation() { AnnotationExpr ret; - if (jj_2_44(2147483647)) { - ret = NormalAnnotation(); - } else if (jj_2_45(2147483647)) { - ret = SingleMemberAnnotation(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ret = MarkerAnnotation(); - break; - default: - jj_la1[165] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public NormalAnnotationExpr NormalAnnotation() { + if (jj_2_44(2147483647)) { + ret = NormalAnnotation(); + } else if (jj_2_45(2147483647)) { + ret = SingleMemberAnnotation(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ret = MarkerAnnotation(); + break; + default: + jj_la1[165] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public NormalAnnotationExpr NormalAnnotation() { NameExpr name; List pairs = null; int line; int column; - jj_consume_token(AT); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - pairs = MemberValuePairs(); - break; - default: - jj_la1[166] = jj_gen; - ; - } - jj_consume_token(RPAREN); - { - if (true) return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn, name, pairs); - } - throw new Error("Missing return statement in function"); - } - - final public MarkerAnnotationExpr MarkerAnnotation() { + jj_consume_token(AT); + line=token.beginLine; column=token.beginColumn; + name = Name(); + jj_consume_token(LPAREN); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + pairs = MemberValuePairs(); + break; + default: + jj_la1[166] = jj_gen; + ; + } + jj_consume_token(RPAREN); + {if (true) return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn,name, pairs);} + throw new Error("Missing return statement in function"); + } + + final public MarkerAnnotationExpr MarkerAnnotation() { NameExpr name; int line; int column; - jj_consume_token(AT); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - { - if (true) return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn, name); - } - throw new Error("Missing return statement in function"); - } - - final public SingleMemberAnnotationExpr SingleMemberAnnotation() { + jj_consume_token(AT); + line=token.beginLine; column=token.beginColumn; + name = Name(); + {if (true) return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn,name);} + throw new Error("Missing return statement in function"); + } + + final public SingleMemberAnnotationExpr SingleMemberAnnotation() { NameExpr name; Expression memberVal; int line; int column; - jj_consume_token(AT); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - jj_consume_token(LPAREN); - memberVal = MemberValue(); - jj_consume_token(RPAREN); - { - if (true) - return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn, name, memberVal); - } - throw new Error("Missing return statement in function"); - } - - final public List MemberValuePairs() { + jj_consume_token(AT); + line=token.beginLine; column=token.beginColumn; + name = Name(); + jj_consume_token(LPAREN); + memberVal = MemberValue(); + jj_consume_token(RPAREN); + {if (true) return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn,name, memberVal);} + throw new Error("Missing return statement in function"); + } + + final public List MemberValuePairs() { List ret = new LinkedList(); MemberValuePair pair; - pair = MemberValuePair(); - ret.add(pair); - label_69: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[167] = jj_gen; - break label_69; - } - jj_consume_token(COMMA); - pair = MemberValuePair(); - ret.add(pair); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public MemberValuePair MemberValuePair() { + pair = MemberValuePair(); + ret.add(pair); + label_69: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[167] = jj_gen; + break label_69; + } + jj_consume_token(COMMA); + pair = MemberValuePair(); + ret.add(pair); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public MemberValuePair MemberValuePair() { String name; Expression value; int line; int column; - jj_consume_token(IDENTIFIER); - name = token.image; - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(ASSIGN); - value = MemberValue(); - { - if (true) return new MemberValuePair(line, column, token.endLine, token.endColumn, name, value); - } - throw new Error("Missing return statement in function"); - } - - final public Expression MemberValue() { + jj_consume_token(IDENTIFIER); + name = token.image; line=token.beginLine; column=token.beginColumn; + jj_consume_token(ASSIGN); + value = MemberValue(); + {if (true) return new MemberValuePair(line, column, token.endLine, token.endColumn,name, value);} + throw new Error("Missing return statement in function"); + } + + final public Expression MemberValue() { Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ret = Annotation(); - break; - case LBRACE: - ret = MemberValueArrayInitializer(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ConditionalExpression(); - break; - default: - jj_la1[168] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public Expression MemberValueArrayInitializer() { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case AT: + ret = Annotation(); + break; + case LBRACE: + ret = MemberValueArrayInitializer(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = ConditionalExpression(); + break; + default: + jj_la1[168] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public Expression MemberValueArrayInitializer() { List ret = new LinkedList(); Expression member; int line; int column; - jj_consume_token(LBRACE); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - member = MemberValue(); - ret.add(member); - label_70: - while (true) { - if (jj_2_46(2)) { - ; - } else { - break label_70; - } - jj_consume_token(COMMA); - member = MemberValue(); - ret.add(member); - } - break; - default: - jj_la1[169] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[170] = jj_gen; - ; - } - jj_consume_token(RBRACE); - { - if (true) return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn, ret); + jj_consume_token(LBRACE); + line=token.beginLine; column=token.beginColumn; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + member = MemberValue(); + ret.add(member); + label_70: + while (true) { + if (jj_2_46(2)) { + ; + } else { + break label_70; } - throw new Error("Missing return statement in function"); - } - - /* Annotation Types. */ - final public AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier) { + jj_consume_token(COMMA); + member = MemberValue(); + ret.add(member); + } + break; + default: + jj_la1[169] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + break; + default: + jj_la1[170] = jj_gen; + ; + } + jj_consume_token(RBRACE); + {if (true) return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,ret);} + throw new Error("Missing return statement in function"); + } + +/* Annotation Types. */ + final public AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier) { NameExpr name; List members; int line = modifier.beginLine; int column = modifier.beginColumn; - jj_consume_token(AT); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - jj_consume_token(INTERFACE); - name = Name(); - members = AnnotationTypeBody(); - AnnotationDeclaration tmp = new AnnotationDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, null, members); - tmp.setNameExpr(name); - { - if (true) return tmp; - } - throw new Error("Missing return statement in function"); - } - - final public List AnnotationTypeBody() { + jj_consume_token(AT); + if (line == -1) {line=token.beginLine; column=token.beginColumn;} + jj_consume_token(INTERFACE); + name = Name(); + members = AnnotationTypeBody(); + AnnotationDeclaration tmp = new AnnotationDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, null, members); + tmp.setNameExpr(name); + {if (true) return tmp;} + throw new Error("Missing return statement in function"); + } + + final public List AnnotationTypeBody() { List ret = null; BodyDeclaration member; - jj_consume_token(LBRACE); - label_71: - while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case SEMICOLON: - case AT: - ; - break; - default: - jj_la1[171] = jj_gen; - break label_71; - } - member = AnnotationBodyDeclaration(); - ret = add(ret, member); - } - jj_consume_token(RBRACE); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public BodyDeclaration AnnotationBodyDeclaration() { - Modifier modifier; - BodyDeclaration ret; - - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - break; - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: - modifier = Modifiers(); - if (jj_2_47(2147483647)) { - ret = AnnotationTypeMemberDeclaration(modifier); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = FieldDeclaration(modifier); - break; - default: - jj_la1[172] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - default: - jj_la1[173] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier) { + jj_consume_token(LBRACE); + label_71: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case SEMICOLON: + case AT: + ; + break; + default: + jj_la1[171] = jj_gen; + break label_71; + } + member = AnnotationBodyDeclaration(); + ret = add(ret, member); + } + jj_consume_token(RBRACE); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public BodyDeclaration AnnotationBodyDeclaration() { + Modifier modifier; + BodyDeclaration ret; + + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case SEMICOLON: + jj_consume_token(SEMICOLON); + ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn); + break; + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case AT: + modifier = Modifiers(); + if (jj_2_47(2147483647)) { + ret = AnnotationTypeMemberDeclaration(modifier); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CLASS: + case INTERFACE: + ret = ClassOrInterfaceDeclaration(modifier); + break; + case ENUM: + ret = EnumDeclaration(modifier); + break; + case AT: + ret = AnnotationTypeDeclaration(modifier); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + ret = FieldDeclaration(modifier); + break; + default: + jj_la1[172] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + default: + jj_la1[173] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier) { Type type; String name; Expression defaultVal = null; - type = Type(); - jj_consume_token(IDENTIFIER); - name = token.image; - jj_consume_token(LPAREN); - jj_consume_token(RPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case _DEFAULT: - defaultVal = DefaultValue(); - break; - default: - jj_la1[174] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - int line = modifier.beginLine; - int column = modifier.beginColumn; - { - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - } - { - if (true) - return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, name, defaultVal); - } - throw new Error("Missing return statement in function"); - } - - final public Expression DefaultValue() { + type = Type(); + jj_consume_token(IDENTIFIER); + name = token.image; + jj_consume_token(LPAREN); + jj_consume_token(RPAREN); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case _DEFAULT: + defaultVal = DefaultValue(); + break; + default: + jj_la1[174] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + int line = modifier.beginLine; + int column = modifier.beginColumn; + { if (line == -1) {line=type.getBeginLine(); column=type.getBeginColumn();} } + {if (true) return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, name, defaultVal);} + throw new Error("Missing return statement in function"); + } + + final public Expression DefaultValue() { Expression ret; - jj_consume_token(_DEFAULT); - ret = MemberValue(); - { - if (true) return ret; - } - throw new Error("Missing return statement in function"); - } - - private boolean jj_2_1(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_1(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(0, xla); - } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_2(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(1, xla); - } - } - - private boolean jj_2_3(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_3(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(2, xla); - } - } - - private boolean jj_2_4(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_4(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(3, xla); - } - } + jj_consume_token(_DEFAULT); + ret = MemberValue(); + {if (true) return ret;} + throw new Error("Missing return statement in function"); + } + + private boolean jj_2_1(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_1(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(0, xla); } + } + + private boolean jj_2_2(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_2(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(1, xla); } + } + + private boolean jj_2_3(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_3(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(2, xla); } + } + + private boolean jj_2_4(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_4(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(3, xla); } + } + + private boolean jj_2_5(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_5(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(4, xla); } + } + + private boolean jj_2_6(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_6(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(5, xla); } + } + + private boolean jj_2_7(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_7(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(6, xla); } + } + + private boolean jj_2_8(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_8(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(7, xla); } + } + + private boolean jj_2_9(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_9(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(8, xla); } + } + + private boolean jj_2_10(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_10(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(9, xla); } + } + + private boolean jj_2_11(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_11(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(10, xla); } + } + + private boolean jj_2_12(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_12(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(11, xla); } + } + + private boolean jj_2_13(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_13(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(12, xla); } + } + + private boolean jj_2_14(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_14(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(13, xla); } + } + + private boolean jj_2_15(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_15(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(14, xla); } + } + + private boolean jj_2_16(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_16(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(15, xla); } + } + + private boolean jj_2_17(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_17(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(16, xla); } + } + + private boolean jj_2_18(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_18(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(17, xla); } + } + + private boolean jj_2_19(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_19(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(18, xla); } + } + + private boolean jj_2_20(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_20(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(19, xla); } + } + + private boolean jj_2_21(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_21(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(20, xla); } + } + + private boolean jj_2_22(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_22(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(21, xla); } + } + + private boolean jj_2_23(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_23(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(22, xla); } + } + + private boolean jj_2_24(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_24(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(23, xla); } + } + + private boolean jj_2_25(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_25(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(24, xla); } + } + + private boolean jj_2_26(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_26(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(25, xla); } + } + + private boolean jj_2_27(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_27(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(26, xla); } + } + + private boolean jj_2_28(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_28(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(27, xla); } + } + + private boolean jj_2_29(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_29(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(28, xla); } + } + + private boolean jj_2_30(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_30(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(29, xla); } + } + + private boolean jj_2_31(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_31(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(30, xla); } + } + + private boolean jj_2_32(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_32(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(31, xla); } + } + + private boolean jj_2_33(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_33(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(32, xla); } + } + + private boolean jj_2_34(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_34(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(33, xla); } + } + + private boolean jj_2_35(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_35(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(34, xla); } + } + + private boolean jj_2_36(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_36(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(35, xla); } + } + + private boolean jj_2_37(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_37(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(36, xla); } + } + + private boolean jj_2_38(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_38(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(37, xla); } + } + + private boolean jj_2_39(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_39(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(38, xla); } + } + + private boolean jj_2_40(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_40(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(39, xla); } + } + + private boolean jj_2_41(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_41(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(40, xla); } + } + + private boolean jj_2_42(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_42(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(41, xla); } + } + + private boolean jj_2_43(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_43(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(42, xla); } + } + + private boolean jj_2_44(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_44(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(43, xla); } + } + + private boolean jj_2_45(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_45(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(44, xla); } + } + + private boolean jj_2_46(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_46(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(45, xla); } + } + + private boolean jj_2_47(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_47(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(46, xla); } + } + + private boolean jj_3R_172() { + if (jj_3R_168()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_207()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_294() { + if (jj_3R_133()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_25()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_422() { + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_155() { + if (jj_3R_94()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_201()) return true; + return false; + } + + private boolean jj_3R_424() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_437()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_438()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3_24() { + if (jj_3R_107()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_174()) return true; + return false; + } + + private boolean jj_3R_88() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_421() { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_423() { + if (jj_3R_436()) return true; + return false; + } + + private boolean jj_3R_388() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_172()) return true; + return false; + } + + private boolean jj_3R_361() { + if (jj_scan_token(TRY)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_423()) jj_scanpos = xsp; + if (jj_3R_128()) return true; + xsp = jj_scanpos; + if (jj_3R_424()) { + jj_scanpos = xsp; + if (jj_3R_425()) return true; + } + return false; + } + + private boolean jj_3R_154() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_302() { + if (jj_3R_87()) return true; + if (jj_3R_172()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_388()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_104() { + if (jj_scan_token(LPAREN)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_154()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3_24()) { + jj_scanpos = xsp; + if (jj_3R_155()) return true; + } + return false; + } + + private boolean jj_3R_241() { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_420() { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_106() { + if (jj_scan_token(DECR)) return true; + return false; + } + + private boolean jj_3_23() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_105()) { + jj_scanpos = xsp; + if (jj_3R_106()) return true; + } + return false; + } + + private boolean jj_3R_105() { + if (jj_scan_token(INCR)) return true; + return false; + } + + private boolean jj_3_5() { + if (jj_3R_87()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_88()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_scan_token(88)) { + jj_scanpos = xsp; + if (jj_scan_token(91)) { + jj_scanpos = xsp; + if (jj_scan_token(87)) return true; + } + } + return false; + } + + private boolean jj_3R_86() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3_22() { + if (jj_3R_104()) return true; + return false; + } + + private boolean jj_3_4() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_86()) jj_scanpos = xsp; + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3R_216() { + if (jj_3R_245()) return true; + return false; + } + + private boolean jj_3R_267() { + if (jj_3R_294()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_23()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_277() { + if (jj_3R_303()) return true; + return false; + } + + private boolean jj_3R_360() { + if (jj_scan_token(SYNCHRONIZED)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3R_271() { + if (jj_scan_token(_DEFAULT)) return true; + if (jj_3R_116()) return true; + return false; + } + + private boolean jj_3R_276() { + if (jj_3R_302()) return true; + return false; + } + + private boolean jj_3R_235() { + if (jj_3R_104()) return true; + return false; + } + + private boolean jj_3R_236() { + if (jj_3R_267()) return true; + return false; + } + + private boolean jj_3R_266() { + if (jj_scan_token(BANG)) return true; + return false; + } + + private boolean jj_3R_275() { + if (jj_3R_301()) return true; + return false; + } + + private boolean jj_3R_265() { + if (jj_scan_token(TILDE)) return true; + return false; + } + + private boolean jj_3R_274() { + if (jj_3R_300()) return true; + return false; + } + + private boolean jj_3R_234() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_265()) { + jj_scanpos = xsp; + if (jj_3R_266()) return true; + } + if (jj_3R_174()) return true; + return false; + } + + private boolean jj_3R_273() { + if (jj_3R_299()) return true; + return false; + } + + private boolean jj_3R_272() { + if (jj_3R_298()) return true; + return false; + } + + private boolean jj_3R_359() { + if (jj_scan_token(THROW)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_201() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_234()) { + jj_scanpos = xsp; + if (jj_3R_235()) { + jj_scanpos = xsp; + if (jj_3R_236()) return true; + } + } + return false; + } + + private boolean jj_3R_358() { + if (jj_scan_token(RETURN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_422()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_461() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_240() { + if (jj_3R_116()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_271()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_272()) { + jj_scanpos = xsp; + if (jj_3R_273()) { + jj_scanpos = xsp; + if (jj_3R_274()) { + jj_scanpos = xsp; + if (jj_3R_275()) { + jj_scanpos = xsp; + if (jj_3R_276()) { + jj_scanpos = xsp; + if (jj_3R_277()) return true; + } + } + } + } + } + return false; + } + + private boolean jj_3R_242() { + if (jj_scan_token(DECR)) return true; + if (jj_3R_174()) return true; + return false; + } + + private boolean jj_3R_357() { + if (jj_scan_token(CONTINUE)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_421()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3_6() { + if (jj_3R_89()) return true; + return false; + } + + private boolean jj_3R_417() { + if (jj_scan_token(ELSE)) return true; + if (jj_3R_306()) return true; + return false; + } + + private boolean jj_3R_118() { + if (jj_scan_token(INCR)) return true; + if (jj_3R_174()) return true; + return false; + } + + private boolean jj_3R_435() { + if (jj_3R_452()) return true; + return false; + } + + private boolean jj_3R_211() { + if (jj_3R_201()) return true; + return false; + } + + private boolean jj_3R_206() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_6()) { + jj_scanpos = xsp; + if (jj_3R_240()) { + jj_scanpos = xsp; + if (jj_3R_241()) return true; + } + } + return false; + } + + private boolean jj_3R_356() { + if (jj_scan_token(BREAK)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_420()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_171() { + if (jj_3R_206()) return true; + return false; + } + + private boolean jj_3R_452() { + if (jj_3R_459()) return true; + return false; + } + + private boolean jj_3R_279() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_244() { + if (jj_scan_token(MINUS)) return true; + return false; + } + + private boolean jj_3R_113() { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_171()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_305() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_243() { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3R_210() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_243()) { + jj_scanpos = xsp; + if (jj_3R_244()) return true; + } + if (jj_3R_174()) return true; + return false; + } + + private boolean jj_3R_209() { + if (jj_3R_242()) return true; + return false; + } + + private boolean jj_3_41() { + if (jj_3R_116()) return true; + if (jj_3R_87()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_208() { + if (jj_3R_118()) return true; + return false; + } + + private boolean jj_3R_280() { + if (jj_scan_token(BIT_AND)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_305()) { jj_scanpos = xsp; break; } + } + if (jj_3R_198()) return true; + return false; + } + + private boolean jj_3R_459() { + if (jj_3R_100()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_461()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_245() { + if (jj_scan_token(EXTENDS)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_279()) { jj_scanpos = xsp; break; } + } + if (jj_3R_198()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_280()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_458() { + if (jj_3R_459()) return true; + return false; + } + + private boolean jj_3R_434() { + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_457() { + if (jj_3R_117()) return true; + return false; + } + + private boolean jj_3R_174() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_208()) { + jj_scanpos = xsp; + if (jj_3R_209()) { + jj_scanpos = xsp; + if (jj_3R_210()) { + jj_scanpos = xsp; + if (jj_3R_211()) return true; + } + } + } + return false; + } + + private boolean jj_3R_430() { + if (jj_scan_token(REM)) return true; + return false; + } + + private boolean jj_3_3() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_85()) return true; + return false; + } + + private boolean jj_3R_429() { + if (jj_scan_token(SLASH)) return true; + return false; + } + + private boolean jj_3R_182() { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_216()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_428() { + if (jj_scan_token(STAR)) return true; + return false; + } + + private boolean jj_3R_451() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_457()) { + jj_scanpos = xsp; + if (jj_3R_458()) return true; + } + return false; + } + + private boolean jj_3R_412() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_428()) { + jj_scanpos = xsp; + if (jj_3R_429()) { + jj_scanpos = xsp; + if (jj_3R_430()) return true; + } + } + if (jj_3R_174()) return true; + return false; + } + + private boolean jj_3R_217() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_408() { + if (jj_3R_113()) return true; + return false; + } + + private boolean jj_3_40() { + if (jj_3R_117()) return true; + if (jj_scan_token(COLON)) return true; + return false; + } + + private boolean jj_3R_376() { + if (jj_3R_174()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_412()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_183() { + if (jj_scan_token(COMMA)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_217()) { jj_scanpos = xsp; break; } + } + if (jj_3R_182()) return true; + return false; + } + + private boolean jj_3R_181() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_433() { + if (jj_3R_451()) return true; + return false; + } + + private boolean jj_3R_414() { + if (jj_scan_token(MINUS)) return true; + return false; + } + + private boolean jj_3R_413() { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3R_125() { + if (jj_scan_token(LT)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_181()) { jj_scanpos = xsp; break; } + } + if (jj_3R_182()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_183()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_419() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_433()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + xsp = jj_scanpos; + if (jj_3R_434()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + xsp = jj_scanpos; + if (jj_3R_435()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_402() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_413()) { + jj_scanpos = xsp; + if (jj_3R_414()) return true; + } + if (jj_3R_376()) return true; + return false; + } + + private boolean jj_3R_418() { + if (jj_3R_117()) return true; + if (jj_scan_token(COLON)) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_372() { + if (jj_3R_376()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_402()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_355() { + if (jj_scan_token(FOR)) return true; + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_418()) { + jj_scanpos = xsp; + if (jj_3R_419()) return true; + } + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_306()) return true; + return false; + } + + private boolean jj_3R_407() { + if (jj_3R_187()) return true; + return false; + } + + private boolean jj_3_21() { + if (jj_3R_103()) return true; + return false; + } + + private boolean jj_3_20() { + if (jj_3R_102()) return true; + return false; + } + + private boolean jj_3R_124() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_101() { + if (jj_scan_token(LSHIFT)) return true; + return false; + } + + private boolean jj_3_19() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_101()) { + jj_scanpos = xsp; + if (jj_3_20()) { + jj_scanpos = xsp; + if (jj_3_21()) return true; + } + } + if (jj_3R_372()) return true; + return false; + } + + private boolean jj_3R_85() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_124()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(IDENTIFIER)) return true; + xsp = jj_scanpos; + if (jj_3R_407()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_408()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_398() { + if (jj_3R_206()) return true; + return false; + } + + private boolean jj_3R_373() { + if (jj_scan_token(INSTANCEOF)) return true; + if (jj_3R_87()) return true; + return false; + } + + private boolean jj_3R_354() { + if (jj_scan_token(DO)) return true; + if (jj_3R_306()) return true; + if (jj_scan_token(WHILE)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_370() { + if (jj_3R_372()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_19()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_383() { + if (jj_scan_token(SEMICOLON)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_398()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_395() { + if (jj_scan_token(GE)) return true; + return false; + } + + private boolean jj_3R_394() { + if (jj_scan_token(LE)) return true; + return false; + } + + private boolean jj_3R_393() { + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_392() { + if (jj_scan_token(LT)) return true; + return false; + } + + private boolean jj_3R_377() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_392()) { + jj_scanpos = xsp; + if (jj_3R_393()) { + jj_scanpos = xsp; + if (jj_3R_394()) { + jj_scanpos = xsp; + if (jj_3R_395()) return true; + } + } + } + if (jj_3R_370()) return true; + return false; + } + + private boolean jj_3R_353() { + if (jj_scan_token(WHILE)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_306()) return true; + return false; + } + + private boolean jj_3R_382() { + if (jj_3R_85()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_3()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_368() { + if (jj_3R_370()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_377()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_381() { + if (jj_3R_397()) return true; + return false; + } + + private boolean jj_3R_369() { + if (jj_scan_token(BIT_AND)) return true; + if (jj_3R_345()) return true; + return false; + } + + private boolean jj_3R_299() { + if (jj_scan_token(ENUM)) return true; + if (jj_3R_119()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_381()) jj_scanpos = xsp; + if (jj_scan_token(LBRACE)) return true; + xsp = jj_scanpos; + if (jj_3R_382()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(88)) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_383()) jj_scanpos = xsp; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_364() { + if (jj_3R_368()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_373()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_352() { + if (jj_scan_token(IF)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_306()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_417()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_405() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_375() { + if (jj_scan_token(NE)) return true; + return false; + } + + private boolean jj_3R_374() { + if (jj_scan_token(EQ)) return true; + return false; + } + + private boolean jj_3R_371() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_374()) { + jj_scanpos = xsp; + if (jj_3R_375()) return true; + } + if (jj_3R_364()) return true; + return false; + } + + private boolean jj_3R_365() { + if (jj_scan_token(XOR)) return true; + if (jj_3R_315()) return true; + return false; + } + + private boolean jj_3R_346() { + if (jj_scan_token(BIT_OR)) return true; + if (jj_3R_293()) return true; + return false; + } + + private boolean jj_3R_406() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_198()) return true; + return false; + } + + private boolean jj_3R_345() { + if (jj_3R_364()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_371()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_450() { + if (jj_scan_token(_DEFAULT)) return true; + return false; + } + + private boolean jj_3R_449() { + if (jj_scan_token(CASE)) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_397() { + if (jj_scan_token(IMPLEMENTS)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_405()) { jj_scanpos = xsp; break; } + } + if (jj_3R_198()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_406()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_403() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_316() { + if (jj_scan_token(SC_AND)) return true; + if (jj_3R_264()) return true; + return false; + } + + private boolean jj_3R_315() { + if (jj_3R_345()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_369()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_432() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_449()) { + jj_scanpos = xsp; + if (jj_3R_450()) return true; + } + if (jj_scan_token(COLON)) return true; + if (jj_3R_184()) return true; + return false; + } + + private boolean jj_3R_295() { + if (jj_scan_token(SC_OR)) return true; + if (jj_3R_233()) return true; + return false; + } + + private boolean jj_3R_404() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_198()) return true; + return false; + } + + private boolean jj_3R_396() { + if (jj_scan_token(EXTENDS)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_403()) { jj_scanpos = xsp; break; } + } + if (jj_3R_198()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_404()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_293() { + if (jj_3R_315()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_365()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_416() { + if (jj_3R_432()) return true; + return false; + } + + private boolean jj_3R_351() { + if (jj_scan_token(SWITCH)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_scan_token(LBRACE)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_416()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_319() { + if (jj_scan_token(INTERFACE)) return true; + return false; + } + + private boolean jj_3R_264() { + if (jj_3R_293()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_346()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_380() { + if (jj_3R_397()) return true; + return false; + } + + private boolean jj_3R_173() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_172()) return true; + return false; + } + + private boolean jj_3R_379() { + if (jj_3R_396()) return true; + return false; + } + + private boolean jj_3R_378() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3R_456() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3R_233() { + if (jj_3R_264()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_316()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_298() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(20)) { + jj_scanpos = xsp; + if (jj_3R_319()) return true; + } + if (jj_3R_119()) return true; + xsp = jj_scanpos; + if (jj_3R_378()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_379()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_380()) jj_scanpos = xsp; + if (jj_3R_113()) return true; + return false; + } + + private boolean jj_3R_448() { + if (jj_scan_token(ARROW)) return true; + if (jj_3R_296()) return true; + return false; + } + + private boolean jj_3R_447() { + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_456()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(78)) { + jj_scanpos = xsp; + if (jj_scan_token(43)) return true; + } + return false; + } + + private boolean jj_3R_446() { + if (jj_3R_99()) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_445() { + if (jj_scan_token(DECR)) return true; + return false; + } + + private boolean jj_3R_200() { + if (jj_3R_233()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_295()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_444() { + if (jj_scan_token(INCR)) return true; + return false; + } + + private boolean jj_3R_431() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_444()) { + jj_scanpos = xsp; + if (jj_3R_445()) { + jj_scanpos = xsp; + if (jj_3R_446()) { + jj_scanpos = xsp; + if (jj_3R_447()) { + jj_scanpos = xsp; + if (jj_3R_448()) return true; + } + } + } + } + return false; + } + + private boolean jj_3R_367() { + if (jj_3R_294()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_431()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_366() { + if (jj_3R_242()) return true; + return false; + } + + private boolean jj_3R_268() { + if (jj_scan_token(HOOK)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(COLON)) return true; + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3R_151() { + if (jj_3R_200()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_268()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3_39() { + if (jj_3R_118()) return true; + return false; + } + + private boolean jj_3R_350() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_39()) { + jj_scanpos = xsp; + if (jj_3R_366()) { + jj_scanpos = xsp; + if (jj_3R_367()) return true; + } + } + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_150() { + if (jj_scan_token(ORASSIGN)) return true; + return false; + } + + private boolean jj_3R_149() { + if (jj_scan_token(XORASSIGN)) return true; + return false; + } + + private boolean jj_3R_148() { + if (jj_scan_token(ANDASSIGN)) return true; + return false; + } + + private boolean jj_3R_147() { + if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; + return false; + } + + private boolean jj_3R_146() { + if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true; + return false; + } + + private boolean jj_3R_145() { + if (jj_scan_token(LSHIFTASSIGN)) return true; + return false; + } + + private boolean jj_3R_144() { + if (jj_scan_token(MINUSASSIGN)) return true; + return false; + } + + private boolean jj_3R_143() { + if (jj_scan_token(PLUSASSIGN)) return true; + return false; + } + + private boolean jj_3R_142() { + if (jj_scan_token(REMASSIGN)) return true; + return false; + } + + private boolean jj_3R_141() { + if (jj_scan_token(SLASHASSIGN)) return true; + return false; + } + + private boolean jj_3R_140() { + if (jj_scan_token(STARASSIGN)) return true; + return false; + } + + private boolean jj_3R_139() { + if (jj_scan_token(ASSIGN)) return true; + return false; + } + + private boolean jj_3R_318() { + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3R_99() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_139()) { + jj_scanpos = xsp; + if (jj_3R_140()) { + jj_scanpos = xsp; + if (jj_3R_141()) { + jj_scanpos = xsp; + if (jj_3R_142()) { + jj_scanpos = xsp; + if (jj_3R_143()) { + jj_scanpos = xsp; + if (jj_3R_144()) { + jj_scanpos = xsp; + if (jj_3R_145()) { + jj_scanpos = xsp; + if (jj_3R_146()) { + jj_scanpos = xsp; + if (jj_3R_147()) { + jj_scanpos = xsp; + if (jj_3R_148()) { + jj_scanpos = xsp; + if (jj_3R_149()) { + jj_scanpos = xsp; + if (jj_3R_150()) return true; + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_84() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_83() { + if (jj_scan_token(STRICTFP)) return true; + return false; + } + + private boolean jj_3R_297() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3R_317() { + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_82() { + if (jj_scan_token(VOLATILE)) return true; + return false; + } + + private boolean jj_3R_81() { + if (jj_scan_token(TRANSIENT)) return true; + return false; + } + + private boolean jj_3R_114() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_80() { + if (jj_scan_token(NATIVE)) return true; + return false; + } + + private boolean jj_3R_79() { + if (jj_scan_token(SYNCHRONIZED)) return true; + return false; + } + + private boolean jj_3R_270() { + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_297()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(78)) { + jj_scanpos = xsp; + if (jj_scan_token(43)) return true; + } + return false; + } + + private boolean jj_3R_296() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_317()) { + jj_scanpos = xsp; + if (jj_3R_318()) return true; + } + return false; + } + + private boolean jj_3R_78() { + if (jj_scan_token(ABSTRACT)) return true; + return false; + } + + private boolean jj_3R_415() { + if (jj_scan_token(COLON)) return true; + if (jj_3R_100()) return true; + return false; + } - private boolean jj_2_5(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_5(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(4, xla); - } - } - - private boolean jj_2_6(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_6(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(5, xla); - } - } - - private boolean jj_2_7(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_7(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(6, xla); - } - } - - private boolean jj_2_8(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_8(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(7, xla); - } - } - - private boolean jj_2_9(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_9(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(8, xla); - } - } - - private boolean jj_2_10(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_10(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(9, xla); - } - } - - private boolean jj_2_11(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_11(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(10, xla); - } - } - - private boolean jj_2_12(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_12(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(11, xla); - } - } - - private boolean jj_2_13(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_13(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(12, xla); - } - } - - private boolean jj_2_14(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_14(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(13, xla); - } - } - - private boolean jj_2_15(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_15(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(14, xla); - } - } - - private boolean jj_2_16(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_16(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(15, xla); - } - } - - private boolean jj_2_17(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_17(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(16, xla); - } - } - - private boolean jj_2_18(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_18(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(17, xla); - } - } - - private boolean jj_2_19(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_19(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(18, xla); - } - } - - private boolean jj_2_20(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_20(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(19, xla); - } - } - - private boolean jj_2_21(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_21(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(20, xla); - } - } - - private boolean jj_2_22(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_22(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(21, xla); - } - } - - private boolean jj_2_23(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_23(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(22, xla); - } - } - - private boolean jj_2_24(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_24(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(23, xla); - } - } - - private boolean jj_2_25(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_25(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(24, xla); - } - } - - private boolean jj_2_26(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_26(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(25, xla); - } - } - - private boolean jj_2_27(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_27(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(26, xla); - } - } - - private boolean jj_2_28(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_28(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(27, xla); - } - } - - private boolean jj_2_29(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_29(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(28, xla); - } - } - - private boolean jj_2_30(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_30(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(29, xla); - } - } - - private boolean jj_2_31(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_31(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(30, xla); - } - } - - private boolean jj_2_32(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_32(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(31, xla); - } - } - - private boolean jj_2_33(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_33(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(32, xla); - } - } - - private boolean jj_2_34(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_34(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(33, xla); - } - } - - private boolean jj_2_35(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_35(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(34, xla); - } - } - - private boolean jj_2_36(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_36(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(35, xla); - } - } - - private boolean jj_2_37(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_37(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(36, xla); - } - } - - private boolean jj_2_38(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_38(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(37, xla); - } - } - - private boolean jj_2_39(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_39(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(38, xla); - } - } - - private boolean jj_2_40(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_40(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(39, xla); - } - } - - private boolean jj_2_41(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_41(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(40, xla); - } - } - - private boolean jj_2_42(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_42(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(41, xla); - } - } - - private boolean jj_2_43(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_43(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(42, xla); - } - } - - private boolean jj_2_44(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_44(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(43, xla); - } - } - - private boolean jj_2_45(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_45(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(44, xla); - } - } + private boolean jj_3R_77() { + if (jj_scan_token(FINAL)) return true; + return false; + } - private boolean jj_2_46(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_46(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(45, xla); - } - } + private boolean jj_3R_76() { + if (jj_scan_token(PRIVATE)) return true; + return false; + } - private boolean jj_2_47(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_47(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(46, xla); - } + private boolean jj_3R_75() { + if (jj_scan_token(PROTECTED)) return true; + return false; + } + + private boolean jj_3R_74() { + if (jj_scan_token(STATIC)) return true; + return false; + } + + private boolean jj_3R_349() { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3_34() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_114()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_73() { + if (jj_scan_token(PUBLIC)) return true; + return false; + } + + private boolean jj_3_2() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_73()) { + jj_scanpos = xsp; + if (jj_3R_74()) { + jj_scanpos = xsp; + if (jj_3R_75()) { + jj_scanpos = xsp; + if (jj_3R_76()) { + jj_scanpos = xsp; + if (jj_3R_77()) { + jj_scanpos = xsp; + if (jj_3R_78()) { + jj_scanpos = xsp; + if (jj_3R_79()) { + jj_scanpos = xsp; + if (jj_3R_80()) { + jj_scanpos = xsp; + if (jj_3R_81()) { + jj_scanpos = xsp; + if (jj_3R_82()) { + jj_scanpos = xsp; + if (jj_3R_83()) { + jj_scanpos = xsp; + if (jj_3R_84()) return true; + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_116() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_2()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3_18() { + if (jj_3R_99()) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_269() { + if (jj_scan_token(ARROW)) return true; + if (jj_3R_296()) return true; + return false; + } + + private boolean jj_3R_411() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_119()) return true; + return false; + } + + private boolean jj_3R_239() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_18()) { + jj_scanpos = xsp; + if (jj_3R_269()) { + jj_scanpos = xsp; + if (jj_3R_270()) return true; + } + } + return false; + } + + private boolean jj_3_38() { + if (jj_3R_117()) return true; + return false; + } + + private boolean jj_3R_117() { + if (jj_3R_116()) return true; + if (jj_3R_87()) return true; + if (jj_3R_172()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_173()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_100() { + if (jj_3R_151()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_239()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3_37() { + if (jj_3R_116()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(20)) { + jj_scanpos = xsp; + if (jj_scan_token(40)) return true; + } + return false; + } + + private boolean jj_3R_283() { + if (jj_3R_306()) return true; + return false; + } + + private boolean jj_3R_282() { + if (jj_3R_117()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_281() { + if (jj_3R_116()) return true; + if (jj_3R_298()) return true; + return false; + } + + private boolean jj_3R_246() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_281()) { + jj_scanpos = xsp; + if (jj_3R_282()) { + jj_scanpos = xsp; + if (jj_3R_283()) return true; + } + } + return false; + } + + private boolean jj_3R_122() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_72() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_122()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(PACKAGE)) return true; + if (jj_3R_119()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3_1() { + if (jj_3R_72()) return true; + return false; + } + + private boolean jj_3R_401() { + if (jj_3R_119()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_411()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_128() { + if (jj_scan_token(LBRACE)) return true; + if (jj_3R_184()) return true; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_227() { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_115() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(COLON)) return true; + if (jj_3R_306()) return true; + return false; + } + + private boolean jj_3R_348() { + if (jj_scan_token(ASSERT)) return true; + if (jj_3R_100()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_415()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3_17() { + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_119() { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_17()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_339() { + if (jj_3R_361()) return true; + return false; + } + + private boolean jj_3R_338() { + if (jj_3R_360()) return true; + return false; + } + + private boolean jj_3R_337() { + if (jj_3R_359()) return true; + return false; + } + + private boolean jj_3R_170() { + if (jj_3R_87()) return true; + return false; + } + + private boolean jj_3R_336() { + if (jj_3R_358()) return true; + return false; + } + + private boolean jj_3R_169() { + if (jj_scan_token(VOID)) return true; + return false; + } + + private boolean jj_3R_335() { + if (jj_3R_357()) return true; + return false; + } + + private boolean jj_3R_334() { + if (jj_3R_356()) return true; + return false; + } + + private boolean jj_3R_333() { + if (jj_3R_355()) return true; + return false; + } + + private boolean jj_3R_332() { + if (jj_3R_354()) return true; + return false; + } + + private boolean jj_3R_331() { + if (jj_3R_353()) return true; + return false; + } + + private boolean jj_3R_111() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_169()) { + jj_scanpos = xsp; + if (jj_3R_170()) return true; + } + return false; + } + + private boolean jj_3R_330() { + if (jj_3R_352()) return true; + return false; + } + + private boolean jj_3R_329() { + if (jj_3R_351()) return true; + return false; + } + + private boolean jj_3R_328() { + if (jj_3R_350()) return true; + return false; + } + + private boolean jj_3R_327() { + if (jj_3R_349()) return true; + return false; + } + + private boolean jj_3R_326() { + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3R_163() { + if (jj_scan_token(DOUBLE)) return true; + return false; + } + + private boolean jj_3R_325() { + if (jj_3R_348()) return true; + return false; + } + + private boolean jj_3R_162() { + if (jj_scan_token(FLOAT)) return true; + return false; + } + + private boolean jj_3R_161() { + if (jj_scan_token(LONG)) return true; + return false; + } + + private boolean jj_3_36() { + if (jj_3R_115()) return true; + return false; + } + + private boolean jj_3R_160() { + if (jj_scan_token(INT)) return true; + return false; + } + + private boolean jj_3R_363() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_159() { + if (jj_scan_token(SHORT)) return true; + return false; + } + + private boolean jj_3R_362() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_158() { + if (jj_scan_token(BYTE)) return true; + return false; + } + + private boolean jj_3R_157() { + if (jj_scan_token(CHAR)) return true; + return false; + } + + private boolean jj_3R_156() { + if (jj_scan_token(BOOLEAN)) return true; + return false; + } + + private boolean jj_3R_306() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_36()) { + jj_scanpos = xsp; + if (jj_3R_325()) { + jj_scanpos = xsp; + if (jj_3R_326()) { + jj_scanpos = xsp; + if (jj_3R_327()) { + jj_scanpos = xsp; + if (jj_3R_328()) { + jj_scanpos = xsp; + if (jj_3R_329()) { + jj_scanpos = xsp; + if (jj_3R_330()) { + jj_scanpos = xsp; + if (jj_3R_331()) { + jj_scanpos = xsp; + if (jj_3R_332()) { + jj_scanpos = xsp; + if (jj_3R_333()) { + jj_scanpos = xsp; + if (jj_3R_334()) { + jj_scanpos = xsp; + if (jj_3R_335()) { + jj_scanpos = xsp; + if (jj_3R_336()) { + jj_scanpos = xsp; + if (jj_3R_337()) { + jj_scanpos = xsp; + if (jj_3R_338()) { + jj_scanpos = xsp; + if (jj_3R_339()) return true; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_344() { + if (jj_scan_token(SUPER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_363()) { jj_scanpos = xsp; break; } + } + if (jj_3R_94()) return true; + return false; + } + + private boolean jj_3R_107() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_156()) { + jj_scanpos = xsp; + if (jj_3R_157()) { + jj_scanpos = xsp; + if (jj_3R_158()) { + jj_scanpos = xsp; + if (jj_3R_159()) { + jj_scanpos = xsp; + if (jj_3R_160()) { + jj_scanpos = xsp; + if (jj_3R_161()) { + jj_scanpos = xsp; + if (jj_3R_162()) { + jj_scanpos = xsp; + if (jj_3R_163()) return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_342() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_343() { + if (jj_scan_token(EXTENDS)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_362()) { jj_scanpos = xsp; break; } + } + if (jj_3R_94()) return true; + return false; + } + + private boolean jj_3R_314() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_343()) { + jj_scanpos = xsp; + if (jj_3R_344()) return true; + } + return false; + } + + private boolean jj_3R_312() { + Token xsp; + if (jj_3R_342()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_342()) { jj_scanpos = xsp; break; } } + if (jj_3R_185()) return true; + return false; + } - private boolean jj_3R_172() { - if (jj_3R_168()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_207()) jj_scanpos = xsp; - return false; - } + private boolean jj_3_33() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } - private boolean jj_3R_294() { - if (jj_3R_133()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_25()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_422() { - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_155() { - if (jj_3R_94()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_201()) return true; - return false; - } - - private boolean jj_3R_424() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_437()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_438()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_24() { - if (jj_3R_107()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_88() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_421() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_423() { - if (jj_3R_436()) return true; - return false; - } - - private boolean jj_3R_388() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_172()) return true; - return false; - } - - private boolean jj_3R_361() { - if (jj_scan_token(TRY)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_423()) jj_scanpos = xsp; - if (jj_3R_128()) return true; - xsp = jj_scanpos; - if (jj_3R_424()) { - jj_scanpos = xsp; - if (jj_3R_425()) return true; - } - return false; - } - - private boolean jj_3R_154() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_302() { - if (jj_3R_87()) return true; - if (jj_3R_172()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_388()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_104() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_154()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3_24()) { - jj_scanpos = xsp; - if (jj_3R_155()) return true; - } - return false; - } - - private boolean jj_3R_241() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_420() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_106() { - if (jj_scan_token(DECR)) return true; - return false; - } - - private boolean jj_3_23() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_105()) { - jj_scanpos = xsp; - if (jj_3R_106()) return true; - } - return false; - } - - private boolean jj_3R_105() { - if (jj_scan_token(INCR)) return true; - return false; - } - - private boolean jj_3_5() { - if (jj_3R_87()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_88()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_scan_token(88)) { - jj_scanpos = xsp; - if (jj_scan_token(91)) { - jj_scanpos = xsp; - if (jj_scan_token(87)) return true; - } - } - return false; - } - - private boolean jj_3R_86() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3_22() { - if (jj_3R_104()) return true; - return false; - } - - private boolean jj_3_4() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_86()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_216() { - if (jj_3R_245()) return true; - return false; - } - - private boolean jj_3R_267() { - if (jj_3R_294()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_23()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_277() { - if (jj_3R_303()) return true; - return false; - } - - private boolean jj_3R_360() { - if (jj_scan_token(SYNCHRONIZED)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3R_271() { - if (jj_scan_token(_DEFAULT)) return true; - if (jj_3R_116()) return true; - return false; - } - - private boolean jj_3R_276() { - if (jj_3R_302()) return true; - return false; - } - - private boolean jj_3R_235() { - if (jj_3R_104()) return true; - return false; - } - - private boolean jj_3R_236() { - if (jj_3R_267()) return true; - return false; - } - - private boolean jj_3R_266() { - if (jj_scan_token(BANG)) return true; - return false; - } - - private boolean jj_3R_275() { - if (jj_3R_301()) return true; - return false; - } - - private boolean jj_3R_265() { - if (jj_scan_token(TILDE)) return true; - return false; - } - - private boolean jj_3R_274() { - if (jj_3R_300()) return true; - return false; - } - - private boolean jj_3R_234() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_265()) { - jj_scanpos = xsp; - if (jj_3R_266()) return true; - } - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_273() { - if (jj_3R_299()) return true; - return false; - } - - private boolean jj_3R_272() { - if (jj_3R_298()) return true; - return false; - } - - private boolean jj_3R_359() { - if (jj_scan_token(THROW)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_201() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_234()) { - jj_scanpos = xsp; - if (jj_3R_235()) { - jj_scanpos = xsp; - if (jj_3R_236()) return true; - } - } - return false; - } - - private boolean jj_3R_358() { - if (jj_scan_token(RETURN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_422()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_461() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_240() { - if (jj_3R_116()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_271()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_272()) { - jj_scanpos = xsp; - if (jj_3R_273()) { - jj_scanpos = xsp; - if (jj_3R_274()) { - jj_scanpos = xsp; - if (jj_3R_275()) { - jj_scanpos = xsp; - if (jj_3R_276()) { - jj_scanpos = xsp; - if (jj_3R_277()) return true; - } - } - } - } - } - return false; - } - - private boolean jj_3R_242() { - if (jj_scan_token(DECR)) return true; - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_357() { - if (jj_scan_token(CONTINUE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_421()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_6() { - if (jj_3R_89()) return true; - return false; - } - - private boolean jj_3R_417() { - if (jj_scan_token(ELSE)) return true; - if (jj_3R_306()) return true; - return false; - } - - private boolean jj_3R_118() { - if (jj_scan_token(INCR)) return true; - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_435() { - if (jj_3R_452()) return true; - return false; - } - - private boolean jj_3R_211() { - if (jj_3R_201()) return true; - return false; - } - - private boolean jj_3R_206() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_6()) { - jj_scanpos = xsp; - if (jj_3R_240()) { - jj_scanpos = xsp; - if (jj_3R_241()) return true; - } - } - return false; - } - - private boolean jj_3R_356() { - if (jj_scan_token(BREAK)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_420()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_171() { - if (jj_3R_206()) return true; - return false; - } - - private boolean jj_3R_452() { - if (jj_3R_459()) return true; - return false; - } - - private boolean jj_3R_279() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_244() { - if (jj_scan_token(MINUS)) return true; - return false; - } - - private boolean jj_3R_113() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_171()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_305() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_243() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3R_210() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_243()) { - jj_scanpos = xsp; - if (jj_3R_244()) return true; - } - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_209() { - if (jj_3R_242()) return true; - return false; - } - - private boolean jj_3_41() { - if (jj_3R_116()) return true; - if (jj_3R_87()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_208() { - if (jj_3R_118()) return true; - return false; - } - - private boolean jj_3R_280() { - if (jj_scan_token(BIT_AND)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_305()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_198()) return true; - return false; - } - - private boolean jj_3R_459() { - if (jj_3R_100()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_461()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_245() { - if (jj_scan_token(EXTENDS)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_279()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_198()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_280()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_458() { - if (jj_3R_459()) return true; - return false; - } - - private boolean jj_3R_434() { - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_457() { - if (jj_3R_117()) return true; - return false; - } - - private boolean jj_3R_174() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_208()) { - jj_scanpos = xsp; - if (jj_3R_209()) { - jj_scanpos = xsp; - if (jj_3R_210()) { - jj_scanpos = xsp; - if (jj_3R_211()) return true; - } - } - } - return false; - } - - private boolean jj_3R_430() { - if (jj_scan_token(REM)) return true; - return false; - } - - private boolean jj_3_3() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_429() { - if (jj_scan_token(SLASH)) return true; - return false; - } - - private boolean jj_3R_182() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_216()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_428() { - if (jj_scan_token(STAR)) return true; - return false; - } - - private boolean jj_3R_451() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_457()) { - jj_scanpos = xsp; - if (jj_3R_458()) return true; - } - return false; - } - - private boolean jj_3R_412() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_428()) { - jj_scanpos = xsp; - if (jj_3R_429()) { - jj_scanpos = xsp; - if (jj_3R_430()) return true; - } - } - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_217() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_408() { - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3_40() { - if (jj_3R_117()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_376() { - if (jj_3R_174()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_412()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_183() { - if (jj_scan_token(COMMA)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_217()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_182()) return true; - return false; - } - - private boolean jj_3R_181() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_433() { - if (jj_3R_451()) return true; - return false; - } - - private boolean jj_3R_414() { - if (jj_scan_token(MINUS)) return true; - return false; - } - - private boolean jj_3R_413() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3R_125() { - if (jj_scan_token(LT)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_181()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_182()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_183()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_419() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_433()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_434()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_435()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_402() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_413()) { - jj_scanpos = xsp; - if (jj_3R_414()) return true; - } - if (jj_3R_376()) return true; - return false; - } - - private boolean jj_3R_418() { - if (jj_3R_117()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_372() { - if (jj_3R_376()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_402()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_355() { - if (jj_scan_token(FOR)) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_418()) { - jj_scanpos = xsp; - if (jj_3R_419()) return true; - } - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_306()) return true; - return false; - } - - private boolean jj_3R_407() { - if (jj_3R_187()) return true; - return false; - } - - private boolean jj_3_21() { - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3_20() { - if (jj_3R_102()) return true; - return false; - } - - private boolean jj_3R_124() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_101() { - if (jj_scan_token(LSHIFT)) return true; - return false; - } - - private boolean jj_3_19() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_101()) { - jj_scanpos = xsp; - if (jj_3_20()) { - jj_scanpos = xsp; - if (jj_3_21()) return true; - } - } - if (jj_3R_372()) return true; - return false; - } - - private boolean jj_3R_85() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_124()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(IDENTIFIER)) return true; - xsp = jj_scanpos; - if (jj_3R_407()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_408()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_398() { - if (jj_3R_206()) return true; - return false; - } - - private boolean jj_3R_373() { - if (jj_scan_token(INSTANCEOF)) return true; - if (jj_3R_87()) return true; - return false; - } - - private boolean jj_3R_354() { - if (jj_scan_token(DO)) return true; - if (jj_3R_306()) return true; - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_370() { - if (jj_3R_372()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_19()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_383() { - if (jj_scan_token(SEMICOLON)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_398()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_395() { - if (jj_scan_token(GE)) return true; - return false; - } - - private boolean jj_3R_394() { - if (jj_scan_token(LE)) return true; - return false; - } - - private boolean jj_3R_393() { - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_392() { - if (jj_scan_token(LT)) return true; - return false; - } - - private boolean jj_3R_377() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_392()) { - jj_scanpos = xsp; - if (jj_3R_393()) { - jj_scanpos = xsp; - if (jj_3R_394()) { - jj_scanpos = xsp; - if (jj_3R_395()) return true; - } - } - } - if (jj_3R_370()) return true; - return false; - } - - private boolean jj_3R_353() { - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_306()) return true; - return false; - } - - private boolean jj_3R_382() { - if (jj_3R_85()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_3()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_368() { - if (jj_3R_370()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_377()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_381() { - if (jj_3R_397()) return true; - return false; - } - - private boolean jj_3R_369() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_3R_345()) return true; - return false; - } - - private boolean jj_3R_299() { - if (jj_scan_token(ENUM)) return true; - if (jj_3R_119()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_381()) jj_scanpos = xsp; - if (jj_scan_token(LBRACE)) return true; - xsp = jj_scanpos; - if (jj_3R_382()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(88)) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_383()) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_364() { - if (jj_3R_368()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_373()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_352() { - if (jj_scan_token(IF)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_306()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_417()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_405() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_375() { - if (jj_scan_token(NE)) return true; - return false; - } - - private boolean jj_3R_374() { - if (jj_scan_token(EQ)) return true; - return false; - } - - private boolean jj_3R_371() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_374()) { - jj_scanpos = xsp; - if (jj_3R_375()) return true; - } - if (jj_3R_364()) return true; - return false; - } - - private boolean jj_3R_365() { - if (jj_scan_token(XOR)) return true; - if (jj_3R_315()) return true; - return false; - } - - private boolean jj_3R_346() { - if (jj_scan_token(BIT_OR)) return true; - if (jj_3R_293()) return true; - return false; - } - - private boolean jj_3R_406() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_198()) return true; - return false; - } - - private boolean jj_3R_345() { - if (jj_3R_364()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_371()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_450() { - if (jj_scan_token(_DEFAULT)) return true; - return false; - } - - private boolean jj_3R_449() { - if (jj_scan_token(CASE)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_397() { - if (jj_scan_token(IMPLEMENTS)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_405()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_198()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_406()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_403() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_316() { - if (jj_scan_token(SC_AND)) return true; - if (jj_3R_264()) return true; - return false; - } - - private boolean jj_3R_315() { - if (jj_3R_345()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_369()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_432() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_449()) { - jj_scanpos = xsp; - if (jj_3R_450()) return true; - } - if (jj_scan_token(COLON)) return true; - if (jj_3R_184()) return true; - return false; - } - - private boolean jj_3R_295() { - if (jj_scan_token(SC_OR)) return true; - if (jj_3R_233()) return true; - return false; - } - - private boolean jj_3R_404() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_198()) return true; - return false; - } - - private boolean jj_3R_396() { - if (jj_scan_token(EXTENDS)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_403()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_198()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_404()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_293() { - if (jj_3R_315()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_365()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_416() { - if (jj_3R_432()) return true; - return false; - } - - private boolean jj_3R_351() { - if (jj_scan_token(SWITCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_416()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_319() { - if (jj_scan_token(INTERFACE)) return true; - return false; - } - - private boolean jj_3R_264() { - if (jj_3R_293()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_346()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_380() { - if (jj_3R_397()) return true; - return false; - } - - private boolean jj_3R_173() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_172()) return true; - return false; - } - - private boolean jj_3R_379() { - if (jj_3R_396()) return true; - return false; - } - - private boolean jj_3R_378() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3R_456() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3R_233() { - if (jj_3R_264()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_316()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_298() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) { - jj_scanpos = xsp; - if (jj_3R_319()) return true; - } - if (jj_3R_119()) return true; - xsp = jj_scanpos; - if (jj_3R_378()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_379()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_380()) jj_scanpos = xsp; - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_448() { - if (jj_scan_token(ARROW)) return true; - if (jj_3R_296()) return true; - return false; - } - - private boolean jj_3R_447() { - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_456()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(78)) { - jj_scanpos = xsp; - if (jj_scan_token(43)) return true; - } - return false; - } - - private boolean jj_3R_446() { - if (jj_3R_99()) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_445() { - if (jj_scan_token(DECR)) return true; - return false; - } - - private boolean jj_3R_200() { - if (jj_3R_233()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_295()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_444() { - if (jj_scan_token(INCR)) return true; - return false; - } - - private boolean jj_3R_431() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_444()) { - jj_scanpos = xsp; - if (jj_3R_445()) { - jj_scanpos = xsp; - if (jj_3R_446()) { - jj_scanpos = xsp; - if (jj_3R_447()) { - jj_scanpos = xsp; - if (jj_3R_448()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_367() { - if (jj_3R_294()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_431()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_366() { - if (jj_3R_242()) return true; - return false; - } - - private boolean jj_3R_268() { - if (jj_scan_token(HOOK)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3R_151() { - if (jj_3R_200()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_268()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_39() { - if (jj_3R_118()) return true; - return false; - } - - private boolean jj_3R_350() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_39()) { - jj_scanpos = xsp; - if (jj_3R_366()) { - jj_scanpos = xsp; - if (jj_3R_367()) return true; - } - } - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_150() { - if (jj_scan_token(ORASSIGN)) return true; - return false; - } - - private boolean jj_3R_149() { - if (jj_scan_token(XORASSIGN)) return true; - return false; - } - - private boolean jj_3R_148() { - if (jj_scan_token(ANDASSIGN)) return true; - return false; - } - - private boolean jj_3R_147() { - if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_146() { - if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_145() { - if (jj_scan_token(LSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_144() { - if (jj_scan_token(MINUSASSIGN)) return true; - return false; - } - - private boolean jj_3R_143() { - if (jj_scan_token(PLUSASSIGN)) return true; - return false; - } - - private boolean jj_3R_142() { - if (jj_scan_token(REMASSIGN)) return true; - return false; - } - - private boolean jj_3R_141() { - if (jj_scan_token(SLASHASSIGN)) return true; - return false; - } - - private boolean jj_3R_140() { - if (jj_scan_token(STARASSIGN)) return true; - return false; - } - - private boolean jj_3R_139() { - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_318() { - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3R_99() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_139()) { - jj_scanpos = xsp; - if (jj_3R_140()) { - jj_scanpos = xsp; - if (jj_3R_141()) { - jj_scanpos = xsp; - if (jj_3R_142()) { - jj_scanpos = xsp; - if (jj_3R_143()) { - jj_scanpos = xsp; - if (jj_3R_144()) { - jj_scanpos = xsp; - if (jj_3R_145()) { - jj_scanpos = xsp; - if (jj_3R_146()) { - jj_scanpos = xsp; - if (jj_3R_147()) { - jj_scanpos = xsp; - if (jj_3R_148()) { - jj_scanpos = xsp; - if (jj_3R_149()) { - jj_scanpos = xsp; - if (jj_3R_150()) return true; - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_84() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_83() { - if (jj_scan_token(STRICTFP)) return true; - return false; - } - - private boolean jj_3R_297() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3R_317() { - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_82() { - if (jj_scan_token(VOLATILE)) return true; - return false; - } - - private boolean jj_3R_81() { - if (jj_scan_token(TRANSIENT)) return true; - return false; - } - - private boolean jj_3R_114() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_80() { - if (jj_scan_token(NATIVE)) return true; - return false; - } - - private boolean jj_3R_79() { - if (jj_scan_token(SYNCHRONIZED)) return true; - return false; - } - - private boolean jj_3R_270() { - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_297()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(78)) { - jj_scanpos = xsp; - if (jj_scan_token(43)) return true; - } - return false; - } - - private boolean jj_3R_296() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_317()) { - jj_scanpos = xsp; - if (jj_3R_318()) return true; - } - return false; - } - - private boolean jj_3R_78() { - if (jj_scan_token(ABSTRACT)) return true; - return false; - } - - private boolean jj_3R_415() { - if (jj_scan_token(COLON)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_77() { - if (jj_scan_token(FINAL)) return true; - return false; - } - - private boolean jj_3R_76() { - if (jj_scan_token(PRIVATE)) return true; - return false; - } - - private boolean jj_3R_75() { - if (jj_scan_token(PROTECTED)) return true; - return false; - } - - private boolean jj_3R_74() { - if (jj_scan_token(STATIC)) return true; - return false; - } - - private boolean jj_3R_349() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_34() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_114()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_73() { - if (jj_scan_token(PUBLIC)) return true; - return false; - } - - private boolean jj_3_2() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_73()) { - jj_scanpos = xsp; - if (jj_3R_74()) { - jj_scanpos = xsp; - if (jj_3R_75()) { - jj_scanpos = xsp; - if (jj_3R_76()) { - jj_scanpos = xsp; - if (jj_3R_77()) { - jj_scanpos = xsp; - if (jj_3R_78()) { - jj_scanpos = xsp; - if (jj_3R_79()) { - jj_scanpos = xsp; - if (jj_3R_80()) { - jj_scanpos = xsp; - if (jj_3R_81()) { - jj_scanpos = xsp; - if (jj_3R_82()) { - jj_scanpos = xsp; - if (jj_3R_83()) { - jj_scanpos = xsp; - if (jj_3R_84()) return true; - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_116() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_2()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_18() { - if (jj_3R_99()) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_269() { - if (jj_scan_token(ARROW)) return true; - if (jj_3R_296()) return true; - return false; - } - - private boolean jj_3R_411() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_119()) return true; - return false; - } - - private boolean jj_3R_239() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_18()) { - jj_scanpos = xsp; - if (jj_3R_269()) { - jj_scanpos = xsp; - if (jj_3R_270()) return true; - } - } - return false; - } - - private boolean jj_3_38() { - if (jj_3R_117()) return true; - return false; - } - - private boolean jj_3R_117() { - if (jj_3R_116()) return true; - if (jj_3R_87()) return true; - if (jj_3R_172()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_173()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_100() { - if (jj_3R_151()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_239()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_37() { - if (jj_3R_116()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) { - jj_scanpos = xsp; - if (jj_scan_token(40)) return true; - } - return false; - } - - private boolean jj_3R_283() { - if (jj_3R_306()) return true; - return false; - } - - private boolean jj_3R_282() { - if (jj_3R_117()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_281() { - if (jj_3R_116()) return true; - if (jj_3R_298()) return true; - return false; - } - - private boolean jj_3R_246() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_281()) { - jj_scanpos = xsp; - if (jj_3R_282()) { - jj_scanpos = xsp; - if (jj_3R_283()) return true; - } - } - return false; - } - - private boolean jj_3R_122() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_72() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_122()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(PACKAGE)) return true; - if (jj_3R_119()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_1() { - if (jj_3R_72()) return true; - return false; - } - - private boolean jj_3R_401() { - if (jj_3R_119()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_411()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_128() { - if (jj_scan_token(LBRACE)) return true; - if (jj_3R_184()) return true; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_227() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_115() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_306()) return true; - return false; - } - - private boolean jj_3R_348() { - if (jj_scan_token(ASSERT)) return true; - if (jj_3R_100()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_415()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_17() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_119() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_17()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_339() { - if (jj_3R_361()) return true; - return false; - } - - private boolean jj_3R_338() { - if (jj_3R_360()) return true; - return false; - } - - private boolean jj_3R_337() { - if (jj_3R_359()) return true; - return false; - } - - private boolean jj_3R_170() { - if (jj_3R_87()) return true; - return false; - } - - private boolean jj_3R_336() { - if (jj_3R_358()) return true; - return false; - } - - private boolean jj_3R_169() { - if (jj_scan_token(VOID)) return true; - return false; - } - - private boolean jj_3R_335() { - if (jj_3R_357()) return true; - return false; - } - - private boolean jj_3R_334() { - if (jj_3R_356()) return true; - return false; - } - - private boolean jj_3R_333() { - if (jj_3R_355()) return true; - return false; - } - - private boolean jj_3R_332() { - if (jj_3R_354()) return true; - return false; - } - - private boolean jj_3R_331() { - if (jj_3R_353()) return true; - return false; - } - - private boolean jj_3R_111() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_169()) { - jj_scanpos = xsp; - if (jj_3R_170()) return true; - } - return false; - } - - private boolean jj_3R_330() { - if (jj_3R_352()) return true; - return false; - } - - private boolean jj_3R_329() { - if (jj_3R_351()) return true; - return false; - } - - private boolean jj_3R_328() { - if (jj_3R_350()) return true; - return false; - } - - private boolean jj_3R_327() { - if (jj_3R_349()) return true; - return false; - } - - private boolean jj_3R_326() { - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3R_163() { - if (jj_scan_token(DOUBLE)) return true; - return false; - } - - private boolean jj_3R_325() { - if (jj_3R_348()) return true; - return false; - } - - private boolean jj_3R_162() { - if (jj_scan_token(FLOAT)) return true; - return false; - } - - private boolean jj_3R_161() { - if (jj_scan_token(LONG)) return true; - return false; - } - - private boolean jj_3_36() { - if (jj_3R_115()) return true; - return false; - } - - private boolean jj_3R_160() { - if (jj_scan_token(INT)) return true; - return false; - } - - private boolean jj_3R_363() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_159() { - if (jj_scan_token(SHORT)) return true; - return false; - } - - private boolean jj_3R_362() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_158() { - if (jj_scan_token(BYTE)) return true; - return false; - } - - private boolean jj_3R_157() { - if (jj_scan_token(CHAR)) return true; - return false; - } - - private boolean jj_3R_156() { - if (jj_scan_token(BOOLEAN)) return true; - return false; - } - - private boolean jj_3R_306() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_36()) { - jj_scanpos = xsp; - if (jj_3R_325()) { - jj_scanpos = xsp; - if (jj_3R_326()) { - jj_scanpos = xsp; - if (jj_3R_327()) { - jj_scanpos = xsp; - if (jj_3R_328()) { - jj_scanpos = xsp; - if (jj_3R_329()) { - jj_scanpos = xsp; - if (jj_3R_330()) { - jj_scanpos = xsp; - if (jj_3R_331()) { - jj_scanpos = xsp; - if (jj_3R_332()) { - jj_scanpos = xsp; - if (jj_3R_333()) { - jj_scanpos = xsp; - if (jj_3R_334()) { - jj_scanpos = xsp; - if (jj_3R_335()) { - jj_scanpos = xsp; - if (jj_3R_336()) { - jj_scanpos = xsp; - if (jj_3R_337()) { - jj_scanpos = xsp; - if (jj_3R_338()) { - jj_scanpos = xsp; - if (jj_3R_339()) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_344() { - if (jj_scan_token(SUPER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_363()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_107() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_156()) { - jj_scanpos = xsp; - if (jj_3R_157()) { - jj_scanpos = xsp; - if (jj_3R_158()) { - jj_scanpos = xsp; - if (jj_3R_159()) { - jj_scanpos = xsp; - if (jj_3R_160()) { - jj_scanpos = xsp; - if (jj_3R_161()) { - jj_scanpos = xsp; - if (jj_3R_162()) { - jj_scanpos = xsp; - if (jj_3R_163()) return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_342() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_343() { - if (jj_scan_token(EXTENDS)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_362()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_314() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_343()) { - jj_scanpos = xsp; - if (jj_3R_344()) return true; - } - return false; - } - - private boolean jj_3R_312() { - Token xsp; - if (jj_3R_342()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_342()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_185()) return true; - return false; - } - - private boolean jj_3_33() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_32() { - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3_35() { - Token xsp; - if (jj_3_33()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3_33()) { - jj_scanpos = xsp; - break; - } - } - while (true) { - xsp = jj_scanpos; - if (jj_3_34()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_229() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_199()) return true; - return false; - } - - private boolean jj_3R_311() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_289() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_311()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3_35()) { - jj_scanpos = xsp; - if (jj_3R_312()) return true; - } - return false; - } - - private boolean jj_3R_313() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_263() { - if (jj_scan_token(HOOK)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_314()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_292() { - if (jj_3R_187()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_32()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_232() { - if (jj_3R_263()) return true; - return false; - } - - private boolean jj_3R_231() { - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_460() { - if (jj_3R_462()) return true; - return false; - } - - private boolean jj_3R_230() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_199() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_230()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_231()) { - jj_scanpos = xsp; - if (jj_3R_232()) return true; - } - return false; - } - - private boolean jj_3R_291() { - if (jj_3R_289()) return true; - return false; - } - - private boolean jj_3R_96() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_98() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_290() { - if (jj_3R_97()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_313()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_138() { - if (jj_scan_token(132)) return true; - return false; - } - - private boolean jj_3R_262() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_290()) jj_scanpos = xsp; - if (jj_3R_198()) return true; - xsp = jj_scanpos; - if (jj_3R_291()) { - jj_scanpos = xsp; - if (jj_3R_292()) return true; - } - return false; - } - - private boolean jj_3R_95() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_284() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3_13() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_96()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_137() { - if (jj_scan_token(LT)) return true; - if (jj_3R_199()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_229()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_97() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_137()) { - jj_scanpos = xsp; - if (jj_3R_138()) return true; - } - return false; - } - - private boolean jj_3_16() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3_15() { - if (jj_scan_token(DOT)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_98()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(IDENTIFIER)) return true; - xsp = jj_scanpos; - if (jj_3_16()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_261() { - if (jj_3R_107()) return true; - if (jj_3R_289()) return true; - return false; - } - - private boolean jj_3_12() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_95()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_386() { - if (jj_scan_token(THROWS)) return true; - if (jj_3R_401()) return true; - return false; - } - - private boolean jj_3_14() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_260() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_198() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_14()) jj_scanpos = xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_15()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_225() { - if (jj_scan_token(NEW)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_260()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_261()) { - jj_scanpos = xsp; - if (jj_3R_262()) return true; - } - return false; - } - - private boolean jj_3R_462() { - if (jj_scan_token(_DEFAULT)) return true; - if (jj_3R_121()) return true; - return false; - } - - private boolean jj_3R_136() { - if (jj_3R_198()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_13()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_135() { - if (jj_3R_107()) return true; - Token xsp; - if (jj_3_12()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3_12()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_94() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_135()) { - jj_scanpos = xsp; - if (jj_3R_136()) return true; - } - return false; - } - - private boolean jj_3R_247() { - if (jj_3R_100()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_284()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_455() { - if (jj_3R_87()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_scan_token(RPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_460()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_219() { - if (jj_3R_247()) return true; - return false; - } - - private boolean jj_3_47() { - if (jj_3R_87()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_443() { - if (jj_3R_302()) return true; - return false; - } - - private boolean jj_3R_442() { - if (jj_3R_300()) return true; - return false; - } - - private boolean jj_3R_187() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_219()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_126() { - if (jj_3R_107()) return true; - return false; - } - - private boolean jj_3R_441() { - if (jj_3R_299()) return true; - return false; - } - - private boolean jj_3_11() { - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_440() { - if (jj_3R_298()) return true; - return false; - } - - private boolean jj_3R_87() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_11()) { - jj_scanpos = xsp; - if (jj_3R_126()) return true; - } - return false; - } - - private boolean jj_3R_439() { - if (jj_3R_455()) return true; - return false; - } - - private boolean jj_3R_286() { - if (jj_scan_token(NULL)) return true; - return false; - } - - private boolean jj_3R_308() { - if (jj_scan_token(FALSE)) return true; - return false; - } - - private boolean jj_3R_307() { - if (jj_scan_token(TRUE)) return true; - return false; - } - - private boolean jj_3_46() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_121()) return true; - return false; - } - - private boolean jj_3R_426() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_427() { - if (jj_3R_116()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_439()) { - jj_scanpos = xsp; - if (jj_3R_440()) { - jj_scanpos = xsp; - if (jj_3R_441()) { - jj_scanpos = xsp; - if (jj_3R_442()) { - jj_scanpos = xsp; - if (jj_3R_443()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_127() { - if (jj_scan_token(STATIC)) return true; - return false; - } - - private boolean jj_3R_89() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_127()) jj_scanpos = xsp; - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3R_285() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_307()) { - jj_scanpos = xsp; - if (jj_3R_308()) return true; - } - return false; - } - - private boolean jj_3R_409() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_426()) { - jj_scanpos = xsp; - if (jj_3R_427()) return true; - } - return false; - } - - private boolean jj_3R_254() { - if (jj_3R_286()) return true; - return false; - } - - private boolean jj_3R_218() { - if (jj_3R_246()) return true; - return false; - } - - private boolean jj_3R_253() { - if (jj_3R_285()) return true; - return false; - } - - private boolean jj_3R_184() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_218()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_399() { - if (jj_3R_409()) return true; - return false; - } - - private boolean jj_3_9() { - if (jj_3R_92()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3R_252() { - if (jj_scan_token(STRING_LITERAL)) return true; - return false; - } - - private boolean jj_3R_251() { - if (jj_scan_token(CHARACTER_LITERAL)) return true; - return false; - } - - private boolean jj_3R_384() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_399()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_93() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_189() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3_10() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_93()) jj_scanpos = xsp; - if (jj_scan_token(THIS)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_250() { - if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; - return false; - } - - private boolean jj_3R_188() { - if (jj_3R_92()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3R_249() { - if (jj_scan_token(LONG_LITERAL)) return true; - return false; - } - - private boolean jj_3R_132() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_188()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_189()) jj_scanpos = xsp; - if (jj_scan_token(SUPER)) return true; - if (jj_3R_187()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_186() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_248() { - if (jj_scan_token(INTEGER_LITERAL)) return true; - return false; - } - - private boolean jj_3R_131() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_186()) jj_scanpos = xsp; - if (jj_scan_token(THIS)) return true; - if (jj_3R_187()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_300() { - if (jj_scan_token(AT)) return true; - if (jj_scan_token(INTERFACE)) return true; - if (jj_3R_119()) return true; - if (jj_3R_384()) return true; - return false; - } - - private boolean jj_3R_112() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_220() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_248()) { - jj_scanpos = xsp; - if (jj_3R_249()) { - jj_scanpos = xsp; - if (jj_3R_250()) { - jj_scanpos = xsp; - if (jj_3R_251()) { - jj_scanpos = xsp; - if (jj_3R_252()) { - jj_scanpos = xsp; - if (jj_3R_253()) { - jj_scanpos = xsp; - if (jj_3R_254()) return true; - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_91() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_131()) { - jj_scanpos = xsp; - if (jj_3R_132()) return true; - } - return false; - } - - private boolean jj_3R_166() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_3R_100()) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_31() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_112()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_324() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_323()) return true; - return false; - } - - private boolean jj_3R_347() { - if (jj_3R_121()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_46()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_238() { - if (jj_3R_187()) return true; - return false; - } - - private boolean jj_3R_237() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_278() { - if (jj_3R_304()) return true; - return false; - } - - private boolean jj_3_8() { - if (jj_3R_91()) return true; - return false; - } - - private boolean jj_3R_204() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_237()) jj_scanpos = xsp; - if (jj_3R_227()) return true; - xsp = jj_scanpos; - if (jj_3R_238()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_212() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_347()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(88)) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3_7() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_90()) return true; - return false; - } - - private boolean jj_3R_203() { - if (jj_3R_225()) return true; - return false; - } - - private boolean jj_3R_167() { - if (jj_scan_token(ELLIPSIS)) return true; - return false; - } - - private boolean jj_3R_202() { - if (jj_scan_token(THIS)) return true; - return false; - } - - private boolean jj_3R_177() { - if (jj_3R_151()) return true; - return false; - } - - private boolean jj_3R_287() { - if (jj_3R_309()) return true; - return false; - } - - private boolean jj_3R_176() { - if (jj_3R_212()) return true; - return false; - } - - private boolean jj_3R_175() { - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_387() { - if (jj_3R_91()) return true; - return false; - } - - private boolean jj_3R_340() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_110()) return true; - return false; - } - - private boolean jj_3R_165() { - if (jj_scan_token(DOT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_202()) { - jj_scanpos = xsp; - if (jj_3R_203()) { - jj_scanpos = xsp; - if (jj_3R_204()) return true; - } - } - return false; - } - - private boolean jj_3R_320() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3R_301() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_320()) jj_scanpos = xsp; - if (jj_3R_227()) return true; - if (jj_3R_385()) return true; - xsp = jj_scanpos; - if (jj_3R_386()) jj_scanpos = xsp; - if (jj_scan_token(LBRACE)) return true; - xsp = jj_scanpos; - if (jj_3R_387()) jj_scanpos = xsp; - if (jj_3R_184()) return true; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_121() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_175()) { - jj_scanpos = xsp; - if (jj_3R_176()) { - jj_scanpos = xsp; - if (jj_3R_177()) return true; - } - } - return false; - } - - private boolean jj_3R_109() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_165()) { - jj_scanpos = xsp; - if (jj_3R_166()) return true; - } - return false; - } - - private boolean jj_3R_410() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_110()) return true; - return false; - } - - private boolean jj_3R_323() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_121()) return true; - return false; - } - - private boolean jj_3R_164() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(SUPER)) return true; - return false; - } - - private boolean jj_3_30() { - if (jj_3R_109()) return true; - return false; - } - - private boolean jj_3R_226() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3R_304() { - if (jj_3R_323()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_324()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_108() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_30()) { - jj_scanpos = xsp; - if (jj_3R_164()) return true; - } - return false; - } - - private boolean jj_3R_228() { - if (jj_3R_187()) return true; - return false; - } - - private boolean jj_3R_110() { - if (jj_3R_116()) return true; - if (jj_3R_87()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_167()) jj_scanpos = xsp; - if (jj_3R_168()) return true; - return false; - } - - private boolean jj_3R_197() { - if (jj_3R_227()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_228()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_29() { - if (jj_3R_111()) return true; - if (jj_scan_token(DOUBLECOLON)) return true; - return false; - } - - private boolean jj_3R_214() { - if (jj_scan_token(AT)) return true; - if (jj_3R_119()) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_121()) return true; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_389() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_28() { - if (jj_3R_111()) return true; - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(CLASS)) return true; - return false; - } - - private boolean jj_3R_341() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_168()) return true; - return false; - } - - private boolean jj_3R_120() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_205() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_288() { - if (jj_3R_310()) return true; - return false; - } - - private boolean jj_3R_310() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_168()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_341()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_196() { - if (jj_3R_111()) return true; - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_226()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(78)) { - jj_scanpos = xsp; - if (jj_scan_token(43)) return true; - } - return false; - } - - private boolean jj_3R_215() { - if (jj_scan_token(AT)) return true; - if (jj_3R_119()) return true; - return false; - } - - private boolean jj_3R_322() { - if (jj_3R_90()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_7()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_195() { - if (jj_3R_111()) return true; - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(CLASS)) return true; - return false; - } - - private boolean jj_3R_194() { - if (jj_3R_225()) return true; - return false; - } - - private boolean jj_3_27() { - if (jj_3R_110()) return true; - return false; - } - - private boolean jj_3_45() { - if (jj_scan_token(AT)) return true; - if (jj_3R_119()) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_309() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_110()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_340()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_43() { - if (jj_scan_token(SEMICOLON)) return true; - if (jj_3R_117()) return true; - return false; - } - - private boolean jj_3_44() { - if (jj_scan_token(AT)) return true; - if (jj_3R_119()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_120()) { - jj_scanpos = xsp; - if (jj_scan_token(82)) return true; - } - return false; - } - - private boolean jj_3R_213() { - if (jj_scan_token(AT)) return true; - if (jj_3R_119()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_278()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_400() { - if (jj_3R_110()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_410()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_180() { - if (jj_3R_215()) return true; - return false; - } - - private boolean jj_3R_259() { - if (jj_3R_100()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_288()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_258() { - if (jj_3R_110()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_287()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_179() { - if (jj_3R_214()) return true; - return false; - } - - private boolean jj_3R_224() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_258()) { - jj_scanpos = xsp; - if (jj_3R_259()) return true; - } - return false; - } - - private boolean jj_3R_385() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_400()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_178() { - if (jj_3R_213()) return true; - return false; - } - - private boolean jj_3R_257() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3R_193() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_224()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_222() { - if (jj_scan_token(DOUBLECOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_257()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(78)) { - jj_scanpos = xsp; - if (jj_scan_token(43)) return true; - } - return false; - } - - private boolean jj_3R_123() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_178()) { - jj_scanpos = xsp; - if (jj_3R_179()) { - jj_scanpos = xsp; - if (jj_3R_180()) return true; - } - } - return false; - } - - private boolean jj_3R_223() { - if (jj_3R_187()) return true; - return false; - } - - private boolean jj_3R_152() { - return false; - } - - private boolean jj_3R_391() { - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3R_390() { - if (jj_scan_token(THROWS)) return true; - if (jj_3R_401()) return true; - return false; - } - - private boolean jj_3R_321() { - if (jj_3R_125()) return true; - return false; - } - - private boolean jj_3R_303() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_321()) jj_scanpos = xsp; - if (jj_3R_111()) return true; - if (jj_3R_119()) return true; - if (jj_3R_385()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_389()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_390()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_391()) { - jj_scanpos = xsp; - if (jj_scan_token(87)) return true; - } - return false; - } - - private boolean jj_3R_153() { - return false; - } - - private boolean jj_3R_102() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_152()) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_256() { - if (jj_3R_187()) return true; - return false; - } - - private boolean jj_3R_221() { - if (jj_scan_token(DOT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_255()) jj_scanpos = xsp; - if (jj_3R_227()) return true; - xsp = jj_scanpos; - if (jj_3R_256()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_255() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3_26() { - if (jj_3R_109()) return true; - return false; - } - - private boolean jj_3R_192() { - if (jj_scan_token(SUPER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_221()) { - jj_scanpos = xsp; - if (jj_3R_222()) { - jj_scanpos = xsp; - if (jj_3R_223()) return true; - } - } - return false; - } - - private boolean jj_3R_103() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_153()) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_191() { - if (jj_scan_token(THIS)) return true; - return false; - } - - private boolean jj_3R_185() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_322()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(88)) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_190() { - if (jj_3R_220()) return true; - return false; - } - - private boolean jj_3R_134() { - if (jj_3R_109()) return true; - return false; - } - - private boolean jj_3R_130() { - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_129() { - if (jj_3R_185()) return true; - return false; - } - - private boolean jj_3R_207() { - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_90()) return true; - return false; - } - - private boolean jj_3R_453() { - if (jj_3R_117()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_43()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_133() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_190()) { - jj_scanpos = xsp; - if (jj_3R_191()) { - jj_scanpos = xsp; - if (jj_3R_192()) { - jj_scanpos = xsp; - if (jj_3R_193()) { - jj_scanpos = xsp; - if (jj_3R_194()) { - jj_scanpos = xsp; - if (jj_3R_195()) { - jj_scanpos = xsp; - if (jj_3R_196()) { - jj_scanpos = xsp; - if (jj_3R_197()) return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3_25() { - if (jj_3R_108()) return true; - return false; - } - - private boolean jj_3R_90() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_129()) { - jj_scanpos = xsp; - if (jj_3R_130()) return true; - } - return false; - } - - private boolean jj_3R_454() { - if (jj_scan_token(BIT_OR)) return true; - if (jj_3R_87()) return true; - return false; - } - - private boolean jj_3R_438() { - if (jj_scan_token(FINALLY)) return true; - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3R_425() { - if (jj_scan_token(FINALLY)) return true; - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3_42() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_436() { - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_453()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_42()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_437() { - if (jj_scan_token(CATCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_116()) return true; - if (jj_3R_87()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_454()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_168()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_128()) return true; - return false; - } - - private boolean jj_3R_168() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_205()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_92() { - if (jj_3R_133()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_134()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - /** - * Generated Token Manager. - */ - public ASTParserTokenManager token_source; - JavaCharStream jj_input_stream; - /** - * Current token. - */ - public Token token; - /** - * Next token. - */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - /** - * Whether we are looking ahead. - */ - private boolean jj_lookingAhead = false; - private boolean jj_semLA; - private int jj_gen; - final private int[] jj_la1 = new int[175]; - static private int[] jj_la1_0; - static private int[] jj_la1_1; - static private int[] jj_la1_2; - static private int[] jj_la1_3; - static private int[] jj_la1_4; - - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - jj_la1_init_4(); - } - - private static void jj_la1_init_0() { - jj_la1_0 = new int[]{0x0, 0x48101000, 0x1, 0x0, 0x0, 0x0, 0x40001000, 0x8100000, 0x48101000, 0x100000, 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4a995000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x4a995000, 0x800000, 0x8100000, 0x2094000, 0x4a995000, 0x0, 0x0, 0x0, 0x22094000, 0x22094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x42095000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x6359f000, 0x0, 0x2094000, 0x0, 0x0, 0x2094000, 0x0, 0x0, 0x0, 0x0, 0x2094000, 0x0, 0x0, 0x10000000, 0x10000000, 0x2094000, 0x2094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x0, 0x0, 0x22094000, 0x0, 0x0, 0x2094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x62095000, 0x0, 0x0, 0x0, 0x20000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0x20000000, 0x22094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2094000, 0x0, 0x0, 0x0, 0x0, 0x2349e000, 0x0, 0x2349e000, 0x0, 0x22094000, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x820000, 0x820000, 0x4000000, 0x62095000, 0x22094000, 0x22094000, 0x62095000, 0x22094000, 0x0, 0x0, 0x0, 0x22094000, 0x0, 0x40000, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x22094000, 0x22094000, 0x0, 0x4a195000, 0xa194000, 0x4a195000, 0x800000,}; - } - - private static void jj_la1_init_1() { - jj_la1_1 = new int[]{0x20, 0x8899c500, 0x0, 0x0, 0x80000, 0x0, 0x8899c400, 0x100, 0x8899c500, 0x100, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0xc89dc781, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc89dc781, 0x0, 0x100, 0x40040281, 0xc89dc781, 0x0, 0x0, 0x0, 0x51241a81, 0x51241a81, 0x0, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x889dc681, 0x0, 0x0, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x51241a81, 0xfbffdf8b, 0x80000, 0x40281, 0x0, 0x0, 0x40281, 0x0, 0x0, 0x0, 0x0, 0x40281, 0x0, 0x0, 0x200000, 0x200000, 0x40281, 0x40040281, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x40281, 0x0, 0x0, 0x0, 0x800, 0x0, 0x0, 0x0, 0x51241a81, 0xd9bdde81, 0x0, 0x800, 0x0, 0x11201800, 0x0, 0x0, 0x0, 0x0, 0x1000800, 0x0, 0x10001000, 0x10000000, 0x51241a81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40281, 0x0, 0x0, 0x0, 0x0, 0x73e61a8b, 0x0, 0x73e61a8b, 0x0, 0x51241a81, 0x0, 0x800, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0xd9bdde81, 0x51241a81, 0x51241a81, 0xd9bdde81, 0x51241a81, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x51241a81, 0x51241a81, 0x0, 0x889dc781, 0x40381, 0x889dc781, 0x0,}; - } - - private static void jj_la1_init_2() { - jj_la1_2 = new int[]{0x0, 0x4800000, 0x0, 0x4000000, 0x0, 0x2000000, 0x4000000, 0x4000000, 0x4800000, 0x0, 0x10000000, 0x0, 0x0, 0x4000000, 0x1000000, 0x4000000, 0x1000000, 0x0, 0x4004000, 0x1000000, 0x14884000, 0x800000, 0x4000000, 0x20000, 0x80000, 0x4000000, 0x1000000, 0x4000000, 0x0, 0x4000000, 0x0, 0x4000000, 0x14884000, 0x0, 0x4000000, 0x10004000, 0x14804000, 0x1000000, 0x8000000, 0x200000, 0x600a7086, 0x600a7086, 0x1000000, 0x10000000, 0x200000, 0x0, 0x880000, 0x1000000, 0x4004000, 0x1000000, 0x1000000, 0x0, 0x10000000, 0x0, 0x10000000, 0x10000000, 0x10027086, 0x48a7087, 0x0, 0x0, 0x4000000, 0x4000000, 0x4000, 0x4000000, 0x1000000, 0x10000000, 0x4000000, 0x80004000, 0x4000000, 0x4000000, 0x0, 0x0, 0x0, 0x4000, 0x4000000, 0x1000000, 0x4000000, 0x1000000, 0x10000000, 0x4000, 0x0, 0x8000000, 0x8000000, 0x80000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x60027086, 0x60000000, 0x60000000, 0x27086, 0x0, 0x4000000, 0x4000, 0x10000000, 0x20000, 0x10000000, 0x4000, 0x2020000, 0x1000000, 0x1000000, 0x60027086, 0x64027086, 0x10000000, 0x4000, 0x20000, 0x23086, 0x4000, 0x2000000, 0x10000000, 0x20000, 0x0, 0x2200000, 0x3086, 0x0, 0x60027086, 0x1000000, 0x4000000, 0x4000000, 0x10000000, 0x4220000, 0x10004000, 0x4000000, 0x4000000, 0x200000, 0x200000, 0x8a7087, 0x0, 0x8a7087, 0x1000000, 0x600a7086, 0x10000000, 0x4000, 0x8000000, 0x8000000, 0x27086, 0x0, 0x0, 0x0, 0x64027086, 0x60027086, 0x60027086, 0x64827086, 0x60027086, 0x1000000, 0x4000, 0x4000, 0x60027086, 0x20000, 0x0, 0x0, 0x0, 0x4000000, 0x4000, 0x1000000, 0x640a7086, 0x640a7086, 0x1000000, 0x4804000, 0x4004000, 0x4804000, 0x0,}; - } - - private static void jj_la1_init_3() { - jj_la1_3 = new int[]{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x780, 0x780, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x180, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000000, 0xdffc0000, 0x1ffc0000, 0x0, 0x20, 0x40, 0x4000, 0x8000, 0x2000, 0x12, 0x12, 0x0, 0xc, 0xc, 0x20000, 0x600, 0x600, 0x11800, 0x11800, 0x600, 0x780, 0x0, 0x0, 0x0, 0x180, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000000, 0x0, 0x0, 0x780, 0x780, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x780, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x180, 0x1, 0x180, 0x0, 0x780, 0x0, 0x0, 0xdffc0180, 0xdffc0180, 0x100, 0x0, 0x0, 0x0, 0x780, 0x780, 0x780, 0x780, 0x780, 0x0, 0x0, 0x0, 0x780, 0x0, 0x0, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x780, 0x780, 0x0, 0x0, 0x0, 0x0, 0x0,}; - } - - private static void jj_la1_init_4() { - jj_la1_4 = new int[]{0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x10, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,}; - } - - final private JJCalls[] jj_2_rtns = new JJCalls[47]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** - * Constructor with InputStream. - */ - public ASTParser(java.io.InputStream stream) { - this(stream, null); - } - - /** - * Constructor with InputStream and supplied encoding - */ - public ASTParser(java.io.InputStream stream, String encoding) { - try { - jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); - } catch (java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source = new ASTParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 175; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { - jj_input_stream.ReInit(stream, encoding, 1, 1); - } catch (java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 175; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Constructor. - */ - public ASTParser(java.io.Reader stream) { - jj_input_stream = new JavaCharStream(stream, 1, 1); - token_source = new ASTParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 175; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 175; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Constructor with generated Token Manager. - */ - public ASTParser(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 175; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** - * Reinitialise. - */ - public void ReInit(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 175; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - static private final class LookaheadSuccess extends java.lang.Error { - } - - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; - Token tok = token; - while (tok != null && tok != jj_scanpos) { - i++; - tok = tok.next; - } - if (tok != null) jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; - return false; - } - - - /** - * Get the next Token. - */ - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - - /** - * Get the specific Token. - */ - final public Token getToken(int index) { - Token t = jj_lookingAhead ? jj_scanpos : token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk() { - if ((jj_nt = token.next) == null) - return (jj_ntk = (token.next = token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List jj_expentries = new java.util.ArrayList(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: - for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext(); ) { - int[] oldentry = (int[]) (it.next()); - if (oldentry.length == jj_expentry.length) { - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - /** - * Generate ParseException. - */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[133]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 175; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1 << j)) != 0) { - la1tokens[j] = true; - } - if ((jj_la1_1[i] & (1 << j)) != 0) { - la1tokens[32 + j] = true; - } - if ((jj_la1_2[i] & (1 << j)) != 0) { - la1tokens[64 + j] = true; - } - if ((jj_la1_3[i] & (1 << j)) != 0) { - la1tokens[96 + j] = true; - } - if ((jj_la1_4[i] & (1 << j)) != 0) { - la1tokens[128 + j] = true; - } - } - } - } - for (int i = 0; i < 133; i++) { - if (la1tokens[i]) { - jj_expentry = new int[1]; - jj_expentry[0] = i; - jj_expentries.add(jj_expentry); - } - } - jj_endpos = 0; - jj_rescan_token(); - jj_add_error_token(0, 0); - int[][] exptokseq = new int[jj_expentries.size()][]; - for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.get(i); - } - return new ParseException(token, exptokseq, tokenImage); - } - - /** - * Enable tracing. - */ - final public void enable_tracing() { - } - - /** - * Disable tracing. - */ - final public void disable_tracing() { - } - - private void jj_rescan_token() { - jj_rescan = true; - for (int i = 0; i < 47; i++) { - try { - JJCalls p = jj_2_rtns[i]; - do { - if (p.gen > jj_gen) { - jj_la = p.arg; - jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: - jj_3_1(); - break; - case 1: - jj_3_2(); - break; - case 2: - jj_3_3(); - break; - case 3: - jj_3_4(); - break; - case 4: - jj_3_5(); - break; - case 5: - jj_3_6(); - break; - case 6: - jj_3_7(); - break; - case 7: - jj_3_8(); - break; - case 8: - jj_3_9(); - break; - case 9: - jj_3_10(); - break; - case 10: - jj_3_11(); - break; - case 11: - jj_3_12(); - break; - case 12: - jj_3_13(); - break; - case 13: - jj_3_14(); - break; - case 14: - jj_3_15(); - break; - case 15: - jj_3_16(); - break; - case 16: - jj_3_17(); - break; - case 17: - jj_3_18(); - break; - case 18: - jj_3_19(); - break; - case 19: - jj_3_20(); - break; - case 20: - jj_3_21(); - break; - case 21: - jj_3_22(); - break; - case 22: - jj_3_23(); - break; - case 23: - jj_3_24(); - break; - case 24: - jj_3_25(); - break; - case 25: - jj_3_26(); - break; - case 26: - jj_3_27(); - break; - case 27: - jj_3_28(); - break; - case 28: - jj_3_29(); - break; - case 29: - jj_3_30(); - break; - case 30: - jj_3_31(); - break; - case 31: - jj_3_32(); - break; - case 32: - jj_3_33(); - break; - case 33: - jj_3_34(); - break; - case 34: - jj_3_35(); - break; - case 35: - jj_3_36(); - break; - case 36: - jj_3_37(); - break; - case 37: - jj_3_38(); - break; - case 38: - jj_3_39(); - break; - case 39: - jj_3_40(); - break; - case 40: - jj_3_41(); - break; - case 41: - jj_3_42(); - break; - case 42: - jj_3_43(); - break; - case 43: - jj_3_44(); - break; - case 44: - jj_3_45(); - break; - case 45: - jj_3_46(); - break; - case 46: - jj_3_47(); - break; - } - } - p = p.next; - } while (p != null); - } catch (LookaheadSuccess ls) { - } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { - p = p.next = new JJCalls(); - break; - } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; - p.first = token; - p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } + private boolean jj_3_32() { + if (jj_3R_113()) return true; + return false; + } + + private boolean jj_3_35() { + Token xsp; + if (jj_3_33()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3_33()) { jj_scanpos = xsp; break; } + } + while (true) { + xsp = jj_scanpos; + if (jj_3_34()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_229() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_199()) return true; + return false; + } + + private boolean jj_3R_311() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_289() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_311()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3_35()) { + jj_scanpos = xsp; + if (jj_3R_312()) return true; + } + return false; + } + + private boolean jj_3R_313() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_263() { + if (jj_scan_token(HOOK)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_314()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_292() { + if (jj_3R_187()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_32()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_232() { + if (jj_3R_263()) return true; + return false; + } + + private boolean jj_3R_231() { + if (jj_3R_94()) return true; + return false; + } + + private boolean jj_3R_460() { + if (jj_3R_462()) return true; + return false; + } + + private boolean jj_3R_230() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_199() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_230()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_231()) { + jj_scanpos = xsp; + if (jj_3R_232()) return true; + } + return false; + } + + private boolean jj_3R_291() { + if (jj_3R_289()) return true; + return false; + } + + private boolean jj_3R_96() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_98() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_290() { + if (jj_3R_97()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_313()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_138() { + if (jj_scan_token(132)) return true; + return false; + } + + private boolean jj_3R_262() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_290()) jj_scanpos = xsp; + if (jj_3R_198()) return true; + xsp = jj_scanpos; + if (jj_3R_291()) { + jj_scanpos = xsp; + if (jj_3R_292()) return true; + } + return false; + } + + private boolean jj_3R_95() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_284() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3_13() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_96()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_137() { + if (jj_scan_token(LT)) return true; + if (jj_3R_199()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_229()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_97() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_137()) { + jj_scanpos = xsp; + if (jj_3R_138()) return true; + } + return false; + } + + private boolean jj_3_16() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3_15() { + if (jj_scan_token(DOT)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_98()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(IDENTIFIER)) return true; + xsp = jj_scanpos; + if (jj_3_16()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_261() { + if (jj_3R_107()) return true; + if (jj_3R_289()) return true; + return false; + } + + private boolean jj_3_12() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_95()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_386() { + if (jj_scan_token(THROWS)) return true; + if (jj_3R_401()) return true; + return false; + } + + private boolean jj_3_14() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3R_260() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_198() { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_14()) jj_scanpos = xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_15()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_225() { + if (jj_scan_token(NEW)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_260()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_261()) { + jj_scanpos = xsp; + if (jj_3R_262()) return true; + } + return false; + } + + private boolean jj_3R_462() { + if (jj_scan_token(_DEFAULT)) return true; + if (jj_3R_121()) return true; + return false; + } + + private boolean jj_3R_136() { + if (jj_3R_198()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_13()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_135() { + if (jj_3R_107()) return true; + Token xsp; + if (jj_3_12()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3_12()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_94() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_135()) { + jj_scanpos = xsp; + if (jj_3R_136()) return true; + } + return false; + } + + private boolean jj_3R_247() { + if (jj_3R_100()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_284()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_455() { + if (jj_3R_87()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_scan_token(RPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_460()) jj_scanpos = xsp; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_219() { + if (jj_3R_247()) return true; + return false; + } + + private boolean jj_3_47() { + if (jj_3R_87()) return true; + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3R_443() { + if (jj_3R_302()) return true; + return false; + } + + private boolean jj_3R_442() { + if (jj_3R_300()) return true; + return false; + } + + private boolean jj_3R_187() { + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_219()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_126() { + if (jj_3R_107()) return true; + return false; + } + + private boolean jj_3R_441() { + if (jj_3R_299()) return true; + return false; + } + + private boolean jj_3_11() { + if (jj_3R_94()) return true; + return false; + } + + private boolean jj_3R_440() { + if (jj_3R_298()) return true; + return false; + } + + private boolean jj_3R_87() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_11()) { + jj_scanpos = xsp; + if (jj_3R_126()) return true; + } + return false; + } + + private boolean jj_3R_439() { + if (jj_3R_455()) return true; + return false; + } + + private boolean jj_3R_286() { + if (jj_scan_token(NULL)) return true; + return false; + } + + private boolean jj_3R_308() { + if (jj_scan_token(FALSE)) return true; + return false; + } + + private boolean jj_3R_307() { + if (jj_scan_token(TRUE)) return true; + return false; + } + + private boolean jj_3_46() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_121()) return true; + return false; + } + + private boolean jj_3R_426() { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_427() { + if (jj_3R_116()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_439()) { + jj_scanpos = xsp; + if (jj_3R_440()) { + jj_scanpos = xsp; + if (jj_3R_441()) { + jj_scanpos = xsp; + if (jj_3R_442()) { + jj_scanpos = xsp; + if (jj_3R_443()) return true; + } + } + } + } + return false; + } + + private boolean jj_3R_127() { + if (jj_scan_token(STATIC)) return true; + return false; + } + + private boolean jj_3R_89() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_127()) jj_scanpos = xsp; + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3R_285() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_307()) { + jj_scanpos = xsp; + if (jj_3R_308()) return true; + } + return false; + } + + private boolean jj_3R_409() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_426()) { + jj_scanpos = xsp; + if (jj_3R_427()) return true; + } + return false; + } + + private boolean jj_3R_254() { + if (jj_3R_286()) return true; + return false; + } + + private boolean jj_3R_218() { + if (jj_3R_246()) return true; + return false; + } + + private boolean jj_3R_253() { + if (jj_3R_285()) return true; + return false; + } + + private boolean jj_3R_184() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_218()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_399() { + if (jj_3R_409()) return true; + return false; + } + + private boolean jj_3_9() { + if (jj_3R_92()) return true; + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_252() { + if (jj_scan_token(STRING_LITERAL)) return true; + return false; + } + + private boolean jj_3R_251() { + if (jj_scan_token(CHARACTER_LITERAL)) return true; + return false; + } + + private boolean jj_3R_384() { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_399()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_93() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3R_189() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3_10() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_93()) jj_scanpos = xsp; + if (jj_scan_token(THIS)) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3R_250() { + if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; + return false; + } + + private boolean jj_3R_188() { + if (jj_3R_92()) return true; + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_249() { + if (jj_scan_token(LONG_LITERAL)) return true; + return false; + } + + private boolean jj_3R_132() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_188()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_189()) jj_scanpos = xsp; + if (jj_scan_token(SUPER)) return true; + if (jj_3R_187()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_186() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3R_248() { + if (jj_scan_token(INTEGER_LITERAL)) return true; + return false; + } + + private boolean jj_3R_131() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_186()) jj_scanpos = xsp; + if (jj_scan_token(THIS)) return true; + if (jj_3R_187()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_300() { + if (jj_scan_token(AT)) return true; + if (jj_scan_token(INTERFACE)) return true; + if (jj_3R_119()) return true; + if (jj_3R_384()) return true; + return false; + } + + private boolean jj_3R_112() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3R_220() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_248()) { + jj_scanpos = xsp; + if (jj_3R_249()) { + jj_scanpos = xsp; + if (jj_3R_250()) { + jj_scanpos = xsp; + if (jj_3R_251()) { + jj_scanpos = xsp; + if (jj_3R_252()) { + jj_scanpos = xsp; + if (jj_3R_253()) { + jj_scanpos = xsp; + if (jj_3R_254()) return true; + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_91() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_131()) { + jj_scanpos = xsp; + if (jj_3R_132()) return true; + } + return false; + } + + private boolean jj_3R_166() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_3R_100()) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3_31() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_112()) jj_scanpos = xsp; + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + private boolean jj_3R_324() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_323()) return true; + return false; + } + + private boolean jj_3R_347() { + if (jj_3R_121()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_46()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_238() { + if (jj_3R_187()) return true; + return false; + } + + private boolean jj_3R_237() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3R_278() { + if (jj_3R_304()) return true; + return false; + } + + private boolean jj_3_8() { + if (jj_3R_91()) return true; + return false; + } + + private boolean jj_3R_204() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_237()) jj_scanpos = xsp; + if (jj_3R_227()) return true; + xsp = jj_scanpos; + if (jj_3R_238()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_212() { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_347()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(88)) jj_scanpos = xsp; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3_7() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_90()) return true; + return false; + } + + private boolean jj_3R_203() { + if (jj_3R_225()) return true; + return false; + } + + private boolean jj_3R_167() { + if (jj_scan_token(ELLIPSIS)) return true; + return false; + } + + private boolean jj_3R_202() { + if (jj_scan_token(THIS)) return true; + return false; + } + + private boolean jj_3R_177() { + if (jj_3R_151()) return true; + return false; + } + + private boolean jj_3R_287() { + if (jj_3R_309()) return true; + return false; + } + + private boolean jj_3R_176() { + if (jj_3R_212()) return true; + return false; + } + + private boolean jj_3R_175() { + if (jj_3R_123()) return true; + return false; + } + + private boolean jj_3R_387() { + if (jj_3R_91()) return true; + return false; + } + + private boolean jj_3R_340() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_110()) return true; + return false; + } + + private boolean jj_3R_165() { + if (jj_scan_token(DOT)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_202()) { + jj_scanpos = xsp; + if (jj_3R_203()) { + jj_scanpos = xsp; + if (jj_3R_204()) return true; + } + } + return false; + } + + private boolean jj_3R_320() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3R_301() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_320()) jj_scanpos = xsp; + if (jj_3R_227()) return true; + if (jj_3R_385()) return true; + xsp = jj_scanpos; + if (jj_3R_386()) jj_scanpos = xsp; + if (jj_scan_token(LBRACE)) return true; + xsp = jj_scanpos; + if (jj_3R_387()) jj_scanpos = xsp; + if (jj_3R_184()) return true; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_121() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_175()) { + jj_scanpos = xsp; + if (jj_3R_176()) { + jj_scanpos = xsp; + if (jj_3R_177()) return true; + } + } + return false; + } + + private boolean jj_3R_109() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_165()) { + jj_scanpos = xsp; + if (jj_3R_166()) return true; + } + return false; + } + + private boolean jj_3R_410() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_110()) return true; + return false; + } + + private boolean jj_3R_323() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(ASSIGN)) return true; + if (jj_3R_121()) return true; + return false; + } + + private boolean jj_3R_164() { + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(SUPER)) return true; + return false; + } + + private boolean jj_3_30() { + if (jj_3R_109()) return true; + return false; + } + + private boolean jj_3R_226() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3R_304() { + if (jj_3R_323()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_324()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_108() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_30()) { + jj_scanpos = xsp; + if (jj_3R_164()) return true; + } + return false; + } + + private boolean jj_3R_228() { + if (jj_3R_187()) return true; + return false; + } + + private boolean jj_3R_110() { + if (jj_3R_116()) return true; + if (jj_3R_87()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_167()) jj_scanpos = xsp; + if (jj_3R_168()) return true; + return false; + } + + private boolean jj_3R_197() { + if (jj_3R_227()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_228()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3_29() { + if (jj_3R_111()) return true; + if (jj_scan_token(DOUBLECOLON)) return true; + return false; + } + + private boolean jj_3R_214() { + if (jj_scan_token(AT)) return true; + if (jj_3R_119()) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_121()) return true; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_389() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3_28() { + if (jj_3R_111()) return true; + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(CLASS)) return true; + return false; + } + + private boolean jj_3R_341() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_168()) return true; + return false; + } + + private boolean jj_3R_120() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(ASSIGN)) return true; + return false; + } + + private boolean jj_3R_205() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_scan_token(RBRACKET)) return true; + return false; + } + + private boolean jj_3R_288() { + if (jj_3R_310()) return true; + return false; + } + + private boolean jj_3R_310() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_168()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_341()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_196() { + if (jj_3R_111()) return true; + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_226()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(78)) { + jj_scanpos = xsp; + if (jj_scan_token(43)) return true; + } + return false; + } + + private boolean jj_3R_215() { + if (jj_scan_token(AT)) return true; + if (jj_3R_119()) return true; + return false; + } + + private boolean jj_3R_322() { + if (jj_3R_90()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_7()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_195() { + if (jj_3R_111()) return true; + if (jj_scan_token(DOT)) return true; + if (jj_scan_token(CLASS)) return true; + return false; + } + + private boolean jj_3R_194() { + if (jj_3R_225()) return true; + return false; + } + + private boolean jj_3_27() { + if (jj_3R_110()) return true; + return false; + } + + private boolean jj_3_45() { + if (jj_scan_token(AT)) return true; + if (jj_3R_119()) return true; + if (jj_scan_token(LPAREN)) return true; + return false; + } + + private boolean jj_3R_309() { + if (jj_scan_token(COMMA)) return true; + if (jj_3R_110()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_340()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3_43() { + if (jj_scan_token(SEMICOLON)) return true; + if (jj_3R_117()) return true; + return false; + } + + private boolean jj_3_44() { + if (jj_scan_token(AT)) return true; + if (jj_3R_119()) return true; + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_120()) { + jj_scanpos = xsp; + if (jj_scan_token(82)) return true; + } + return false; + } + + private boolean jj_3R_213() { + if (jj_scan_token(AT)) return true; + if (jj_3R_119()) return true; + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_278()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_400() { + if (jj_3R_110()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_410()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_180() { + if (jj_3R_215()) return true; + return false; + } + + private boolean jj_3R_259() { + if (jj_3R_100()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_288()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_258() { + if (jj_3R_110()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_287()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_179() { + if (jj_3R_214()) return true; + return false; + } + + private boolean jj_3R_224() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_258()) { + jj_scanpos = xsp; + if (jj_3R_259()) return true; + } + return false; + } + + private boolean jj_3R_385() { + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_400()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_178() { + if (jj_3R_213()) return true; + return false; + } + + private boolean jj_3R_257() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3R_193() { + if (jj_scan_token(LPAREN)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_224()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_222() { + if (jj_scan_token(DOUBLECOLON)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_257()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(78)) { + jj_scanpos = xsp; + if (jj_scan_token(43)) return true; + } + return false; + } + + private boolean jj_3R_123() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_178()) { + jj_scanpos = xsp; + if (jj_3R_179()) { + jj_scanpos = xsp; + if (jj_3R_180()) return true; + } + } + return false; + } + + private boolean jj_3R_223() { + if (jj_3R_187()) return true; + return false; + } + + private boolean jj_3R_152() { + return false; + } + + private boolean jj_3R_391() { + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3R_390() { + if (jj_scan_token(THROWS)) return true; + if (jj_3R_401()) return true; + return false; + } + + private boolean jj_3R_321() { + if (jj_3R_125()) return true; + return false; + } + + private boolean jj_3R_303() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_321()) jj_scanpos = xsp; + if (jj_3R_111()) return true; + if (jj_3R_119()) return true; + if (jj_3R_385()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_389()) { jj_scanpos = xsp; break; } + } + xsp = jj_scanpos; + if (jj_3R_390()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_391()) { + jj_scanpos = xsp; + if (jj_scan_token(87)) return true; + } + return false; + } + + private boolean jj_3R_153() { + return false; + } + + private boolean jj_3R_102() { + jj_lookingAhead = true; + jj_semLA = getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT; + jj_lookingAhead = false; + if (!jj_semLA || jj_3R_152()) return true; + if (jj_scan_token(GT)) return true; + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_256() { + if (jj_3R_187()) return true; + return false; + } + + private boolean jj_3R_221() { + if (jj_scan_token(DOT)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_255()) jj_scanpos = xsp; + if (jj_3R_227()) return true; + xsp = jj_scanpos; + if (jj_3R_256()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_255() { + if (jj_3R_97()) return true; + return false; + } + + private boolean jj_3_26() { + if (jj_3R_109()) return true; + return false; + } + + private boolean jj_3R_192() { + if (jj_scan_token(SUPER)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_221()) { + jj_scanpos = xsp; + if (jj_3R_222()) { + jj_scanpos = xsp; + if (jj_3R_223()) return true; + } + } + return false; + } + + private boolean jj_3R_103() { + jj_lookingAhead = true; + jj_semLA = getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT; + jj_lookingAhead = false; + if (!jj_semLA || jj_3R_153()) return true; + if (jj_scan_token(GT)) return true; + if (jj_scan_token(GT)) return true; + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3R_191() { + if (jj_scan_token(THIS)) return true; + return false; + } + + private boolean jj_3R_185() { + if (jj_scan_token(LBRACE)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_322()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(88)) jj_scanpos = xsp; + if (jj_scan_token(RBRACE)) return true; + return false; + } + + private boolean jj_3R_190() { + if (jj_3R_220()) return true; + return false; + } + + private boolean jj_3R_134() { + if (jj_3R_109()) return true; + return false; + } + + private boolean jj_3R_130() { + if (jj_3R_100()) return true; + return false; + } + + private boolean jj_3R_129() { + if (jj_3R_185()) return true; + return false; + } + + private boolean jj_3R_207() { + if (jj_scan_token(ASSIGN)) return true; + if (jj_3R_90()) return true; + return false; + } + + private boolean jj_3R_453() { + if (jj_3R_117()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_43()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_133() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_190()) { + jj_scanpos = xsp; + if (jj_3R_191()) { + jj_scanpos = xsp; + if (jj_3R_192()) { + jj_scanpos = xsp; + if (jj_3R_193()) { + jj_scanpos = xsp; + if (jj_3R_194()) { + jj_scanpos = xsp; + if (jj_3R_195()) { + jj_scanpos = xsp; + if (jj_3R_196()) { + jj_scanpos = xsp; + if (jj_3R_197()) return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3_25() { + if (jj_3R_108()) return true; + return false; + } + + private boolean jj_3R_90() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_129()) { + jj_scanpos = xsp; + if (jj_3R_130()) return true; + } + return false; + } + + private boolean jj_3R_454() { + if (jj_scan_token(BIT_OR)) return true; + if (jj_3R_87()) return true; + return false; + } + + private boolean jj_3R_438() { + if (jj_scan_token(FINALLY)) return true; + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3R_425() { + if (jj_scan_token(FINALLY)) return true; + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3_42() { + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_436() { + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_453()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3_42()) jj_scanpos = xsp; + if (jj_scan_token(RPAREN)) return true; + return false; + } + + private boolean jj_3R_437() { + if (jj_scan_token(CATCH)) return true; + if (jj_scan_token(LPAREN)) return true; + if (jj_3R_116()) return true; + if (jj_3R_87()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_454()) { jj_scanpos = xsp; break; } + } + if (jj_3R_168()) return true; + if (jj_scan_token(RPAREN)) return true; + if (jj_3R_128()) return true; + return false; + } + + private boolean jj_3R_168() { + if (jj_scan_token(IDENTIFIER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_205()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_92() { + if (jj_3R_133()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_134()) { jj_scanpos = xsp; break; } + } + return false; + } + + /** Generated Token Manager. */ + public ASTParserTokenManager token_source; + JavaCharStream jj_input_stream; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; + private int jj_ntk; + private Token jj_scanpos, jj_lastpos; + private int jj_la; + /** Whether we are looking ahead. */ + private boolean jj_lookingAhead = false; + private boolean jj_semLA; + private int jj_gen; + final private int[] jj_la1 = new int[175]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static private int[] jj_la1_3; + static private int[] jj_la1_4; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + jj_la1_init_3(); + jj_la1_init_4(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0x0,0x48101000,0x1,0x0,0x0,0x0,0x40001000,0x8100000,0x48101000,0x100000,0x0,0x10000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4a995000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10000000,0x0,0x0,0x0,0x4a995000,0x800000,0x8100000,0x2094000,0x4a995000,0x0,0x0,0x0,0x22094000,0x22094000,0x0,0x0,0x0,0x0,0x0,0x0,0x42095000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x22094000,0x6359f000,0x0,0x2094000,0x0,0x0,0x2094000,0x0,0x0,0x0,0x0,0x2094000,0x0,0x0,0x10000000,0x10000000,0x2094000,0x2094000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x22094000,0x0,0x0,0x22094000,0x0,0x0,0x2094000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x22094000,0x62095000,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x20000000,0x22094000,0x0,0x0,0x0,0x0,0x0,0x2094000,0x0,0x0,0x0,0x0,0x2349e000,0x0,0x2349e000,0x0,0x22094000,0x0,0x0,0x0,0x0,0x22094000,0x820000,0x820000,0x4000000,0x62095000,0x22094000,0x22094000,0x62095000,0x22094000,0x0,0x0,0x0,0x22094000,0x0,0x40000,0x0,0x80000000,0x0,0x0,0x0,0x22094000,0x22094000,0x0,0x4a195000,0xa194000,0x4a195000,0x800000,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0x20,0x8899c500,0x0,0x0,0x80000,0x0,0x8899c400,0x100,0x8899c500,0x100,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x10,0x0,0x0,0xc89dc781,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc89dc781,0x0,0x100,0x40040281,0xc89dc781,0x0,0x0,0x0,0x51241a81,0x51241a81,0x0,0x0,0x0,0x4000000,0x0,0x0,0x889dc681,0x0,0x0,0x0,0x0,0x4000000,0x0,0x0,0x51241a81,0xfbffdf8b,0x80000,0x40281,0x0,0x0,0x40281,0x0,0x0,0x0,0x0,0x40281,0x0,0x0,0x200000,0x200000,0x40281,0x40040281,0x0,0x0,0x0,0x0,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x51241a81,0x0,0x0,0x51241a81,0x0,0x0,0x40281,0x0,0x0,0x0,0x800,0x0,0x0,0x0,0x51241a81,0xd9bdde81,0x0,0x800,0x0,0x11201800,0x0,0x0,0x0,0x0,0x1000800,0x0,0x10001000,0x10000000,0x51241a81,0x0,0x0,0x0,0x0,0x0,0x40281,0x0,0x0,0x0,0x0,0x73e61a8b,0x0,0x73e61a8b,0x0,0x51241a81,0x0,0x800,0x0,0x0,0x51241a81,0x0,0x0,0x0,0xd9bdde81,0x51241a81,0x51241a81,0xd9bdde81,0x51241a81,0x0,0x0,0x0,0x51241a81,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x51241a81,0x51241a81,0x0,0x889dc781,0x40381,0x889dc781,0x0,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x0,0x4800000,0x0,0x4000000,0x0,0x2000000,0x4000000,0x4000000,0x4800000,0x0,0x10000000,0x0,0x0,0x4000000,0x1000000,0x4000000,0x1000000,0x0,0x4004000,0x1000000,0x14884000,0x800000,0x4000000,0x20000,0x80000,0x4000000,0x1000000,0x4000000,0x0,0x4000000,0x0,0x4000000,0x14884000,0x0,0x4000000,0x10004000,0x14804000,0x1000000,0x8000000,0x200000,0x600a7086,0x600a7086,0x1000000,0x10000000,0x200000,0x0,0x880000,0x1000000,0x4004000,0x1000000,0x1000000,0x0,0x10000000,0x0,0x10000000,0x10000000,0x10027086,0x48a7087,0x0,0x0,0x4000000,0x4000000,0x4000,0x4000000,0x1000000,0x10000000,0x4000000,0x80004000,0x4000000,0x4000000,0x0,0x0,0x0,0x4000,0x4000000,0x1000000,0x4000000,0x1000000,0x10000000,0x4000,0x0,0x8000000,0x8000000,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10000000,0x10000000,0x0,0x0,0x0,0x0,0x0,0x0,0x60027086,0x60000000,0x60000000,0x27086,0x0,0x4000000,0x4000,0x10000000,0x20000,0x10000000,0x4000,0x2020000,0x1000000,0x1000000,0x60027086,0x64027086,0x10000000,0x4000,0x20000,0x23086,0x4000,0x2000000,0x10000000,0x20000,0x0,0x2200000,0x3086,0x0,0x60027086,0x1000000,0x4000000,0x4000000,0x10000000,0x4220000,0x10004000,0x4000000,0x4000000,0x200000,0x200000,0x8a7087,0x0,0x8a7087,0x1000000,0x600a7086,0x10000000,0x4000,0x8000000,0x8000000,0x27086,0x0,0x0,0x0,0x64027086,0x60027086,0x60027086,0x64827086,0x60027086,0x1000000,0x4000,0x4000,0x60027086,0x20000,0x0,0x0,0x0,0x4000000,0x4000,0x1000000,0x640a7086,0x640a7086,0x1000000,0x4804000,0x4004000,0x4804000,0x0,}; + } + private static void jj_la1_init_3() { + jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x780,0x780,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x180,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0000000,0xdffc0000,0x1ffc0000,0x0,0x20,0x40,0x4000,0x8000,0x2000,0x12,0x12,0x0,0xc,0xc,0x20000,0x600,0x600,0x11800,0x11800,0x600,0x780,0x0,0x0,0x0,0x180,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x0,0x780,0x780,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x780,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x180,0x1,0x180,0x0,0x780,0x0,0x0,0xdffc0180,0xdffc0180,0x100,0x0,0x0,0x0,0x780,0x780,0x780,0x780,0x780,0x0,0x0,0x0,0x780,0x0,0x0,0x4000,0x0,0x0,0x0,0x0,0x780,0x780,0x0,0x0,0x0,0x0,0x0,}; + } + private static void jj_la1_init_4() { + jj_la1_4 = new int[] {0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x10,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[47]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with InputStream. */ + public ASTParser(java.io.InputStream stream) { + this(stream, null); + } + /** Constructor with InputStream and supplied encoding */ + public ASTParser(java.io.InputStream stream, String encoding) { + try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source = new ASTParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 175; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream) { + ReInit(stream, null); + } + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream, String encoding) { + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 175; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor. */ + public ASTParser(java.io.Reader stream) { + jj_input_stream = new JavaCharStream(stream, 1, 1); + token_source = new ASTParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 175; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader stream) { + jj_input_stream.ReInit(stream, 1, 1); + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 175; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor with generated Token Manager. */ + public ASTParser(ASTParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 175; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(ASTParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 175; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + private Token jj_consume_token(int kind) { + Token oldToken; + if ((oldToken = token).next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) c.first = null; + c = c.next; + } + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + static private final class LookaheadSuccess extends java.lang.Error { } + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; Token tok = token; + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } + if (tok != null) jj_add_error_token(kind, i); + } + if (jj_scanpos.kind != kind) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + return false; + } + + +/** Get the next Token. */ + final public Token getNextToken() { + if (token.next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + jj_gen++; + return token; + } + +/** Get the specific Token. */ + final public Token getToken(int index) { + Token t = jj_lookingAhead ? jj_scanpos : token; + for (int i = 0; i < index; i++) { + if (t.next != null) t = t.next; + else t = t.next = token_source.getNextToken(); + } + return t; + } + + private int jj_ntk() { + if ((jj_nt=token.next) == null) + return (jj_ntk = (token.next=token_source.getNextToken()).kind); + else + return (jj_ntk = jj_nt.kind); + } + + private java.util.List jj_expentries = new java.util.ArrayList(); + private int[] jj_expentry; + private int jj_kind = -1; + private int[] jj_lasttokens = new int[100]; + private int jj_endpos; + + private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) return; + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { + int[] oldentry = (int[])(it.next()); + if (oldentry.length == jj_expentry.length) { + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + continue jj_entries_loop; + } + } + jj_expentries.add(jj_expentry); + break jj_entries_loop; + } + } + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[133]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 175; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1< jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); break; + case 1: jj_3_2(); break; + case 2: jj_3_3(); break; + case 3: jj_3_4(); break; + case 4: jj_3_5(); break; + case 5: jj_3_6(); break; + case 6: jj_3_7(); break; + case 7: jj_3_8(); break; + case 8: jj_3_9(); break; + case 9: jj_3_10(); break; + case 10: jj_3_11(); break; + case 11: jj_3_12(); break; + case 12: jj_3_13(); break; + case 13: jj_3_14(); break; + case 14: jj_3_15(); break; + case 15: jj_3_16(); break; + case 16: jj_3_17(); break; + case 17: jj_3_18(); break; + case 18: jj_3_19(); break; + case 19: jj_3_20(); break; + case 20: jj_3_21(); break; + case 21: jj_3_22(); break; + case 22: jj_3_23(); break; + case 23: jj_3_24(); break; + case 24: jj_3_25(); break; + case 25: jj_3_26(); break; + case 26: jj_3_27(); break; + case 27: jj_3_28(); break; + case 28: jj_3_29(); break; + case 29: jj_3_30(); break; + case 30: jj_3_31(); break; + case 31: jj_3_32(); break; + case 32: jj_3_33(); break; + case 33: jj_3_34(); break; + case 34: jj_3_35(); break; + case 35: jj_3_36(); break; + case 36: jj_3_37(); break; + case 37: jj_3_38(); break; + case 38: jj_3_39(); break; + case 39: jj_3_40(); break; + case 40: jj_3_41(); break; + case 41: jj_3_42(); break; + case 42: jj_3_43(); break; + case 43: jj_3_44(); break; + case 44: jj_3_45(); break; + case 45: jj_3_46(); break; + case 46: jj_3_47(); break; + } + } + p = p.next; + } while (p != null); + } catch(LookaheadSuccess ls) { } + } + jj_rescan = false; + } + + private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { p = p.next = new JJCalls(); break; } + p = p.next; + } + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserConstants.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserConstants.java index 2a961fb562..3692dfc71e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserConstants.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserConstants.java @@ -20,649 +20,395 @@ */ public interface ASTParserConstants { - /** - * End of File. - */ - int EOF = 0; - /** - * RegularExpression Id. - */ - int SINGLE_LINE_COMMENT = 6; - /** - * RegularExpression Id. - */ - int JAVA_DOC_COMMENT = 9; - /** - * RegularExpression Id. - */ - int MULTI_LINE_COMMENT = 10; - /** - * RegularExpression Id. - */ - int ABSTRACT = 12; - /** - * RegularExpression Id. - */ - int ASSERT = 13; - /** - * RegularExpression Id. - */ - int BOOLEAN = 14; - /** - * RegularExpression Id. - */ - int BREAK = 15; - /** - * RegularExpression Id. - */ - int BYTE = 16; - /** - * RegularExpression Id. - */ - int CASE = 17; - /** - * RegularExpression Id. - */ - int CATCH = 18; - /** - * RegularExpression Id. - */ - int CHAR = 19; - /** - * RegularExpression Id. - */ - int CLASS = 20; - /** - * RegularExpression Id. - */ - int CONST = 21; - /** - * RegularExpression Id. - */ - int CONTINUE = 22; - /** - * RegularExpression Id. - */ - int _DEFAULT = 23; - /** - * RegularExpression Id. - */ - int DO = 24; - /** - * RegularExpression Id. - */ - int DOUBLE = 25; - /** - * RegularExpression Id. - */ - int ELSE = 26; - /** - * RegularExpression Id. - */ - int ENUM = 27; - /** - * RegularExpression Id. - */ - int EXTENDS = 28; - /** - * RegularExpression Id. - */ - int FALSE = 29; - /** - * RegularExpression Id. - */ - int FINAL = 30; - /** - * RegularExpression Id. - */ - int FINALLY = 31; - /** - * RegularExpression Id. - */ - int FLOAT = 32; - /** - * RegularExpression Id. - */ - int FOR = 33; - /** - * RegularExpression Id. - */ - int GOTO = 34; - /** - * RegularExpression Id. - */ - int IF = 35; - /** - * RegularExpression Id. - */ - int IMPLEMENTS = 36; - /** - * RegularExpression Id. - */ - int IMPORT = 37; - /** - * RegularExpression Id. - */ - int INSTANCEOF = 38; - /** - * RegularExpression Id. - */ - int INT = 39; - /** - * RegularExpression Id. - */ - int INTERFACE = 40; - /** - * RegularExpression Id. - */ - int LONG = 41; - /** - * RegularExpression Id. - */ - int NATIVE = 42; - /** - * RegularExpression Id. - */ - int NEW = 43; - /** - * RegularExpression Id. - */ - int NULL = 44; - /** - * RegularExpression Id. - */ - int PACKAGE = 45; - /** - * RegularExpression Id. - */ - int PRIVATE = 46; - /** - * RegularExpression Id. - */ - int PROTECTED = 47; - /** - * RegularExpression Id. - */ - int PUBLIC = 48; - /** - * RegularExpression Id. - */ - int RETURN = 49; - /** - * RegularExpression Id. - */ - int SHORT = 50; - /** - * RegularExpression Id. - */ - int STATIC = 51; - /** - * RegularExpression Id. - */ - int STRICTFP = 52; - /** - * RegularExpression Id. - */ - int SUPER = 53; - /** - * RegularExpression Id. - */ - int SWITCH = 54; - /** - * RegularExpression Id. - */ - int SYNCHRONIZED = 55; - /** - * RegularExpression Id. - */ - int THIS = 56; - /** - * RegularExpression Id. - */ - int THROW = 57; - /** - * RegularExpression Id. - */ - int THROWS = 58; - /** - * RegularExpression Id. - */ - int TRANSIENT = 59; - /** - * RegularExpression Id. - */ - int TRUE = 60; - /** - * RegularExpression Id. - */ - int TRY = 61; - /** - * RegularExpression Id. - */ - int VOID = 62; - /** - * RegularExpression Id. - */ - int VOLATILE = 63; - /** - * RegularExpression Id. - */ - int WHILE = 64; - /** - * RegularExpression Id. - */ - int LONG_LITERAL = 65; - /** - * RegularExpression Id. - */ - int INTEGER_LITERAL = 66; - /** - * RegularExpression Id. - */ - int DECIMAL_LITERAL = 67; - /** - * RegularExpression Id. - */ - int HEX_LITERAL = 68; - /** - * RegularExpression Id. - */ - int OCTAL_LITERAL = 69; - /** - * RegularExpression Id. - */ - int BINARY_LITERAL = 70; - /** - * RegularExpression Id. - */ - int FLOATING_POINT_LITERAL = 71; - /** - * RegularExpression Id. - */ - int DECIMAL_FLOATING_POINT_LITERAL = 72; - /** - * RegularExpression Id. - */ - int DECIMAL_EXPONENT = 73; - /** - * RegularExpression Id. - */ - int HEXADECIMAL_FLOATING_POINT_LITERAL = 74; - /** - * RegularExpression Id. - */ - int HEXADECIMAL_EXPONENT = 75; - /** - * RegularExpression Id. - */ - int CHARACTER_LITERAL = 76; - /** - * RegularExpression Id. - */ - int STRING_LITERAL = 77; - /** - * RegularExpression Id. - */ - int IDENTIFIER = 78; - /** - * RegularExpression Id. - */ - int LETTER = 79; - /** - * RegularExpression Id. - */ - int PART_LETTER = 80; - /** - * RegularExpression Id. - */ - int LPAREN = 81; - /** - * RegularExpression Id. - */ - int RPAREN = 82; - /** - * RegularExpression Id. - */ - int LBRACE = 83; - /** - * RegularExpression Id. - */ - int RBRACE = 84; - /** - * RegularExpression Id. - */ - int LBRACKET = 85; - /** - * RegularExpression Id. - */ - int RBRACKET = 86; - /** - * RegularExpression Id. - */ - int SEMICOLON = 87; - /** - * RegularExpression Id. - */ - int COMMA = 88; - /** - * RegularExpression Id. - */ - int DOT = 89; - /** - * RegularExpression Id. - */ - int AT = 90; - /** - * RegularExpression Id. - */ - int ASSIGN = 91; - /** - * RegularExpression Id. - */ - int LT = 92; - /** - * RegularExpression Id. - */ - int BANG = 93; - /** - * RegularExpression Id. - */ - int TILDE = 94; - /** - * RegularExpression Id. - */ - int HOOK = 95; - /** - * RegularExpression Id. - */ - int COLON = 96; - /** - * RegularExpression Id. - */ - int EQ = 97; - /** - * RegularExpression Id. - */ - int LE = 98; - /** - * RegularExpression Id. - */ - int GE = 99; - /** - * RegularExpression Id. - */ - int NE = 100; - /** - * RegularExpression Id. - */ - int SC_OR = 101; - /** - * RegularExpression Id. - */ - int SC_AND = 102; - /** - * RegularExpression Id. - */ - int INCR = 103; - /** - * RegularExpression Id. - */ - int DECR = 104; - /** - * RegularExpression Id. - */ - int PLUS = 105; - /** - * RegularExpression Id. - */ - int MINUS = 106; - /** - * RegularExpression Id. - */ - int STAR = 107; - /** - * RegularExpression Id. - */ - int SLASH = 108; - /** - * RegularExpression Id. - */ - int BIT_AND = 109; - /** - * RegularExpression Id. - */ - int BIT_OR = 110; - /** - * RegularExpression Id. - */ - int XOR = 111; - /** - * RegularExpression Id. - */ - int REM = 112; - /** - * RegularExpression Id. - */ - int LSHIFT = 113; - /** - * RegularExpression Id. - */ - int PLUSASSIGN = 114; - /** - * RegularExpression Id. - */ - int MINUSASSIGN = 115; - /** - * RegularExpression Id. - */ - int STARASSIGN = 116; - /** - * RegularExpression Id. - */ - int SLASHASSIGN = 117; - /** - * RegularExpression Id. - */ - int ANDASSIGN = 118; - /** - * RegularExpression Id. - */ - int ORASSIGN = 119; - /** - * RegularExpression Id. - */ - int XORASSIGN = 120; - /** - * RegularExpression Id. - */ - int REMASSIGN = 121; - /** - * RegularExpression Id. - */ - int LSHIFTASSIGN = 122; - /** - * RegularExpression Id. - */ - int RSIGNEDSHIFTASSIGN = 123; - /** - * RegularExpression Id. - */ - int RUNSIGNEDSHIFTASSIGN = 124; - /** - * RegularExpression Id. - */ - int ELLIPSIS = 125; - /** - * RegularExpression Id. - */ - int ARROW = 126; - /** - * RegularExpression Id. - */ - int DOUBLECOLON = 127; - /** - * RegularExpression Id. - */ - int RUNSIGNEDSHIFT = 128; - /** - * RegularExpression Id. - */ - int RSIGNEDSHIFT = 129; - /** - * RegularExpression Id. - */ - int GT = 130; + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int SINGLE_LINE_COMMENT = 6; + /** RegularExpression Id. */ + int JAVA_DOC_COMMENT = 9; + /** RegularExpression Id. */ + int MULTI_LINE_COMMENT = 10; + /** RegularExpression Id. */ + int ABSTRACT = 12; + /** RegularExpression Id. */ + int ASSERT = 13; + /** RegularExpression Id. */ + int BOOLEAN = 14; + /** RegularExpression Id. */ + int BREAK = 15; + /** RegularExpression Id. */ + int BYTE = 16; + /** RegularExpression Id. */ + int CASE = 17; + /** RegularExpression Id. */ + int CATCH = 18; + /** RegularExpression Id. */ + int CHAR = 19; + /** RegularExpression Id. */ + int CLASS = 20; + /** RegularExpression Id. */ + int CONST = 21; + /** RegularExpression Id. */ + int CONTINUE = 22; + /** RegularExpression Id. */ + int _DEFAULT = 23; + /** RegularExpression Id. */ + int DO = 24; + /** RegularExpression Id. */ + int DOUBLE = 25; + /** RegularExpression Id. */ + int ELSE = 26; + /** RegularExpression Id. */ + int ENUM = 27; + /** RegularExpression Id. */ + int EXTENDS = 28; + /** RegularExpression Id. */ + int FALSE = 29; + /** RegularExpression Id. */ + int FINAL = 30; + /** RegularExpression Id. */ + int FINALLY = 31; + /** RegularExpression Id. */ + int FLOAT = 32; + /** RegularExpression Id. */ + int FOR = 33; + /** RegularExpression Id. */ + int GOTO = 34; + /** RegularExpression Id. */ + int IF = 35; + /** RegularExpression Id. */ + int IMPLEMENTS = 36; + /** RegularExpression Id. */ + int IMPORT = 37; + /** RegularExpression Id. */ + int INSTANCEOF = 38; + /** RegularExpression Id. */ + int INT = 39; + /** RegularExpression Id. */ + int INTERFACE = 40; + /** RegularExpression Id. */ + int LONG = 41; + /** RegularExpression Id. */ + int NATIVE = 42; + /** RegularExpression Id. */ + int NEW = 43; + /** RegularExpression Id. */ + int NULL = 44; + /** RegularExpression Id. */ + int PACKAGE = 45; + /** RegularExpression Id. */ + int PRIVATE = 46; + /** RegularExpression Id. */ + int PROTECTED = 47; + /** RegularExpression Id. */ + int PUBLIC = 48; + /** RegularExpression Id. */ + int RETURN = 49; + /** RegularExpression Id. */ + int SHORT = 50; + /** RegularExpression Id. */ + int STATIC = 51; + /** RegularExpression Id. */ + int STRICTFP = 52; + /** RegularExpression Id. */ + int SUPER = 53; + /** RegularExpression Id. */ + int SWITCH = 54; + /** RegularExpression Id. */ + int SYNCHRONIZED = 55; + /** RegularExpression Id. */ + int THIS = 56; + /** RegularExpression Id. */ + int THROW = 57; + /** RegularExpression Id. */ + int THROWS = 58; + /** RegularExpression Id. */ + int TRANSIENT = 59; + /** RegularExpression Id. */ + int TRUE = 60; + /** RegularExpression Id. */ + int TRY = 61; + /** RegularExpression Id. */ + int VOID = 62; + /** RegularExpression Id. */ + int VOLATILE = 63; + /** RegularExpression Id. */ + int WHILE = 64; + /** RegularExpression Id. */ + int LONG_LITERAL = 65; + /** RegularExpression Id. */ + int INTEGER_LITERAL = 66; + /** RegularExpression Id. */ + int DECIMAL_LITERAL = 67; + /** RegularExpression Id. */ + int HEX_LITERAL = 68; + /** RegularExpression Id. */ + int OCTAL_LITERAL = 69; + /** RegularExpression Id. */ + int BINARY_LITERAL = 70; + /** RegularExpression Id. */ + int FLOATING_POINT_LITERAL = 71; + /** RegularExpression Id. */ + int DECIMAL_FLOATING_POINT_LITERAL = 72; + /** RegularExpression Id. */ + int DECIMAL_EXPONENT = 73; + /** RegularExpression Id. */ + int HEXADECIMAL_FLOATING_POINT_LITERAL = 74; + /** RegularExpression Id. */ + int HEXADECIMAL_EXPONENT = 75; + /** RegularExpression Id. */ + int CHARACTER_LITERAL = 76; + /** RegularExpression Id. */ + int STRING_LITERAL = 77; + /** RegularExpression Id. */ + int IDENTIFIER = 78; + /** RegularExpression Id. */ + int LETTER = 79; + /** RegularExpression Id. */ + int PART_LETTER = 80; + /** RegularExpression Id. */ + int LPAREN = 81; + /** RegularExpression Id. */ + int RPAREN = 82; + /** RegularExpression Id. */ + int LBRACE = 83; + /** RegularExpression Id. */ + int RBRACE = 84; + /** RegularExpression Id. */ + int LBRACKET = 85; + /** RegularExpression Id. */ + int RBRACKET = 86; + /** RegularExpression Id. */ + int SEMICOLON = 87; + /** RegularExpression Id. */ + int COMMA = 88; + /** RegularExpression Id. */ + int DOT = 89; + /** RegularExpression Id. */ + int AT = 90; + /** RegularExpression Id. */ + int ASSIGN = 91; + /** RegularExpression Id. */ + int LT = 92; + /** RegularExpression Id. */ + int BANG = 93; + /** RegularExpression Id. */ + int TILDE = 94; + /** RegularExpression Id. */ + int HOOK = 95; + /** RegularExpression Id. */ + int COLON = 96; + /** RegularExpression Id. */ + int EQ = 97; + /** RegularExpression Id. */ + int LE = 98; + /** RegularExpression Id. */ + int GE = 99; + /** RegularExpression Id. */ + int NE = 100; + /** RegularExpression Id. */ + int SC_OR = 101; + /** RegularExpression Id. */ + int SC_AND = 102; + /** RegularExpression Id. */ + int INCR = 103; + /** RegularExpression Id. */ + int DECR = 104; + /** RegularExpression Id. */ + int PLUS = 105; + /** RegularExpression Id. */ + int MINUS = 106; + /** RegularExpression Id. */ + int STAR = 107; + /** RegularExpression Id. */ + int SLASH = 108; + /** RegularExpression Id. */ + int BIT_AND = 109; + /** RegularExpression Id. */ + int BIT_OR = 110; + /** RegularExpression Id. */ + int XOR = 111; + /** RegularExpression Id. */ + int REM = 112; + /** RegularExpression Id. */ + int LSHIFT = 113; + /** RegularExpression Id. */ + int PLUSASSIGN = 114; + /** RegularExpression Id. */ + int MINUSASSIGN = 115; + /** RegularExpression Id. */ + int STARASSIGN = 116; + /** RegularExpression Id. */ + int SLASHASSIGN = 117; + /** RegularExpression Id. */ + int ANDASSIGN = 118; + /** RegularExpression Id. */ + int ORASSIGN = 119; + /** RegularExpression Id. */ + int XORASSIGN = 120; + /** RegularExpression Id. */ + int REMASSIGN = 121; + /** RegularExpression Id. */ + int LSHIFTASSIGN = 122; + /** RegularExpression Id. */ + int RSIGNEDSHIFTASSIGN = 123; + /** RegularExpression Id. */ + int RUNSIGNEDSHIFTASSIGN = 124; + /** RegularExpression Id. */ + int ELLIPSIS = 125; + /** RegularExpression Id. */ + int ARROW = 126; + /** RegularExpression Id. */ + int DOUBLECOLON = 127; + /** RegularExpression Id. */ + int RUNSIGNEDSHIFT = 128; + /** RegularExpression Id. */ + int RSIGNEDSHIFT = 129; + /** RegularExpression Id. */ + int GT = 130; - /** - * Lexical state. - */ - int DEFAULT = 0; - /** - * Lexical state. - */ - int IN_JAVA_DOC_COMMENT = 1; - /** - * Lexical state. - */ - int IN_MULTI_LINE_COMMENT = 2; + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int IN_JAVA_DOC_COMMENT = 1; + /** Lexical state. */ + int IN_MULTI_LINE_COMMENT = 2; - /** - * Literal token values. - */ - String[] tokenImage = { - "", - "\" \"", - "\"\\t\"", - "\"\\n\"", - "\"\\r\"", - "\"\\f\"", - "", - "", - "\"/*\"", - "\"*/\"", - "\"*/\"", - "", - "\"abstract\"", - "\"assert\"", - "\"boolean\"", - "\"break\"", - "\"byte\"", - "\"case\"", - "\"catch\"", - "\"char\"", - "\"class\"", - "\"const\"", - "\"continue\"", - "\"default\"", - "\"do\"", - "\"double\"", - "\"else\"", - "\"enum\"", - "\"extends\"", - "\"false\"", - "\"final\"", - "\"finally\"", - "\"float\"", - "\"for\"", - "\"goto\"", - "\"if\"", - "\"implements\"", - "\"import\"", - "\"instanceof\"", - "\"int\"", - "\"interface\"", - "\"long\"", - "\"native\"", - "\"new\"", - "\"null\"", - "\"package\"", - "\"private\"", - "\"protected\"", - "\"public\"", - "\"return\"", - "\"short\"", - "\"static\"", - "\"strictfp\"", - "\"super\"", - "\"switch\"", - "\"synchronized\"", - "\"this\"", - "\"throw\"", - "\"throws\"", - "\"transient\"", - "\"true\"", - "\"try\"", - "\"void\"", - "\"volatile\"", - "\"while\"", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "\"(\"", - "\")\"", - "\"{\"", - "\"}\"", - "\"[\"", - "\"]\"", - "\";\"", - "\",\"", - "\".\"", - "\"@\"", - "\"=\"", - "\"<\"", - "\"!\"", - "\"~\"", - "\"?\"", - "\":\"", - "\"==\"", - "\"<=\"", - "\">=\"", - "\"!=\"", - "\"||\"", - "\"&&\"", - "\"++\"", - "\"--\"", - "\"+\"", - "\"-\"", - "\"*\"", - "\"/\"", - "\"&\"", - "\"|\"", - "\"^\"", - "\"%\"", - "\"<<\"", - "\"+=\"", - "\"-=\"", - "\"*=\"", - "\"/=\"", - "\"&=\"", - "\"|=\"", - "\"^=\"", - "\"%=\"", - "\"<<=\"", - "\">>=\"", - "\">>>=\"", - "\"...\"", - "\"->\"", - "\"::\"", - "\">>>\"", - "\">>\"", - "\">\"", - "\"\\u001a\"", - "\"<>\"", - }; + /** Literal token values. */ + String[] tokenImage = { + "", + "\" \"", + "\"\\t\"", + "\"\\n\"", + "\"\\r\"", + "\"\\f\"", + "", + "", + "\"/*\"", + "\"*/\"", + "\"*/\"", + "", + "\"abstract\"", + "\"assert\"", + "\"boolean\"", + "\"break\"", + "\"byte\"", + "\"case\"", + "\"catch\"", + "\"char\"", + "\"class\"", + "\"const\"", + "\"continue\"", + "\"default\"", + "\"do\"", + "\"double\"", + "\"else\"", + "\"enum\"", + "\"extends\"", + "\"false\"", + "\"final\"", + "\"finally\"", + "\"float\"", + "\"for\"", + "\"goto\"", + "\"if\"", + "\"implements\"", + "\"import\"", + "\"instanceof\"", + "\"int\"", + "\"interface\"", + "\"long\"", + "\"native\"", + "\"new\"", + "\"null\"", + "\"package\"", + "\"private\"", + "\"protected\"", + "\"public\"", + "\"return\"", + "\"short\"", + "\"static\"", + "\"strictfp\"", + "\"super\"", + "\"switch\"", + "\"synchronized\"", + "\"this\"", + "\"throw\"", + "\"throws\"", + "\"transient\"", + "\"true\"", + "\"try\"", + "\"void\"", + "\"volatile\"", + "\"while\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"(\"", + "\")\"", + "\"{\"", + "\"}\"", + "\"[\"", + "\"]\"", + "\";\"", + "\",\"", + "\".\"", + "\"@\"", + "\"=\"", + "\"<\"", + "\"!\"", + "\"~\"", + "\"?\"", + "\":\"", + "\"==\"", + "\"<=\"", + "\">=\"", + "\"!=\"", + "\"||\"", + "\"&&\"", + "\"++\"", + "\"--\"", + "\"+\"", + "\"-\"", + "\"*\"", + "\"/\"", + "\"&\"", + "\"|\"", + "\"^\"", + "\"%\"", + "\"<<\"", + "\"+=\"", + "\"-=\"", + "\"*=\"", + "\"/=\"", + "\"&=\"", + "\"|=\"", + "\"^=\"", + "\"%=\"", + "\"<<=\"", + "\">>=\"", + "\">>>=\"", + "\"...\"", + "\"->\"", + "\"::\"", + "\">>>\"", + "\">>\"", + "\">\"", + "\"\\u001a\"", + "\"<>\"", + }; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserTokenManager.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserTokenManager.java index 7f8b3e6fb9..8c157641c1 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserTokenManager.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ASTParserTokenManager.java @@ -12,10 +12,8 @@ * along with Java 1.8 parser and Abstract Syntax Tree. If not, see . */ package com.github.javaparser; - import java.io.*; import java.util.*; - import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.comments.*; @@ -23,2507 +21,2539 @@ import com.github.javaparser.ast.stmt.*; import com.github.javaparser.ast.type.*; -/** - * Token Manager. - */ -public class ASTParserTokenManager implements ASTParserConstants { - - /** - * Debug output. - */ - public java.io.PrintStream debugStream = System.out; - - /** - * Set debug output. - */ - public void setDebugStream(java.io.PrintStream ds) { - debugStream = ds; - } - - private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2) { - switch (pos) { - case 0: - if ((active0 & 0xfffffffffffff000L) != 0L || (active1 & 0x1L) != 0L) { - jjmatchedKind = 78; - return 43; - } - if ((active0 & 0x100L) != 0L || (active1 & 0x20100000000000L) != 0L) - return 45; - if ((active1 & 0x2000000002000000L) != 0L) - return 1; - return -1; - case 1: - if ((active0 & 0x803000000L) != 0L) - return 43; - if ((active0 & 0xfffffff7fcfff000L) != 0L || (active1 & 0x1L) != 0L) { - if (jjmatchedPos != 1) { - jjmatchedKind = 78; - jjmatchedPos = 1; - } - return 43; - } - if ((active0 & 0x100L) != 0L) - return 50; - return -1; - case 2: - if ((active0 & 0x2000098200000000L) != 0L) - return 43; - if ((active0 & 0xdffff675fefff000L) != 0L || (active1 & 0x1L) != 0L) { - if (jjmatchedPos != 2) { - jjmatchedKind = 78; - jjmatchedPos = 2; - } - return 43; - } - return -1; - case 3: - if ((active0 & 0x8effe571f2f4f000L) != 0L || (active1 & 0x1L) != 0L) { - jjmatchedKind = 78; - jjmatchedPos = 3; - return 43; - } - if ((active0 & 0x510012040c0b0000L) != 0L) - return 43; - return -1; - case 4: - if ((active0 & 0x88dbe57012c07000L) != 0L) { - if (jjmatchedPos != 4) { - jjmatchedKind = 78; - jjmatchedPos = 4; - } - return 43; - } - if ((active0 & 0x6240001e0348000L) != 0L || (active1 & 0x1L) != 0L) - return 43; - return -1; - case 5: - if ((active0 & 0x44b042002002000L) != 0L) - return 43; - if ((active0 & 0x8890e15090c05000L) != 0L) { - jjmatchedKind = 78; - jjmatchedPos = 5; - return 43; - } - return -1; - case 6: - if ((active0 & 0x600090804000L) != 0L) - return 43; - if ((active0 & 0x8890815000401000L) != 0L) { - jjmatchedKind = 78; - jjmatchedPos = 6; - return 43; - } - return -1; - case 7: - if ((active0 & 0x880815000000000L) != 0L) { - jjmatchedKind = 78; - jjmatchedPos = 7; - return 43; - } - if ((active0 & 0x8010000000401000L) != 0L) - return 43; - return -1; - case 8: - if ((active0 & 0x800810000000000L) != 0L) - return 43; - if ((active0 & 0x80005000000000L) != 0L) { - jjmatchedKind = 78; - jjmatchedPos = 8; - return 43; - } - return -1; - case 9: - if ((active0 & 0x5000000000L) != 0L) - return 43; - if ((active0 & 0x80000000000000L) != 0L) { - jjmatchedKind = 78; - jjmatchedPos = 9; - return 43; - } - return -1; - case 10: - if ((active0 & 0x80000000000000L) != 0L) { - jjmatchedKind = 78; - jjmatchedPos = 10; - return 43; - } - return -1; - default: - return -1; - } - } - - private final int jjStartNfa_0(int pos, long active0, long active1, long active2) { - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); - } - - private int jjStopAtPos(int pos, int kind) { - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; - } +/** Token Manager. */ +public class ASTParserTokenManager implements ASTParserConstants +{ - private int jjMoveStringLiteralDfa0_0() { - switch (curChar) { - case 26: - return jjStopAtPos(0, 131); - case 33: - jjmatchedKind = 93; - return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000L, 0x0L); - case 37: - jjmatchedKind = 112; - return jjMoveStringLiteralDfa1_0(0x0L, 0x200000000000000L, 0x0L); - case 38: - jjmatchedKind = 109; - return jjMoveStringLiteralDfa1_0(0x0L, 0x40004000000000L, 0x0L); - case 40: - return jjStopAtPos(0, 81); - case 41: - return jjStopAtPos(0, 82); - case 42: - jjmatchedKind = 107; - return jjMoveStringLiteralDfa1_0(0x0L, 0x10000000000000L, 0x0L); - case 43: - jjmatchedKind = 105; - return jjMoveStringLiteralDfa1_0(0x0L, 0x4008000000000L, 0x0L); - case 44: - return jjStopAtPos(0, 88); - case 45: - jjmatchedKind = 106; - return jjMoveStringLiteralDfa1_0(0x0L, 0x4008010000000000L, 0x0L); - case 46: - jjmatchedKind = 89; - return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000000000000L, 0x0L); - case 47: - jjmatchedKind = 108; - return jjMoveStringLiteralDfa1_0(0x100L, 0x20000000000000L, 0x0L); - case 58: - jjmatchedKind = 96; - return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000000L, 0x0L); - case 59: - return jjStopAtPos(0, 87); - case 60: - jjmatchedKind = 92; - return jjMoveStringLiteralDfa1_0(0x0L, 0x402000400000000L, 0x10L); - case 61: - jjmatchedKind = 91; - return jjMoveStringLiteralDfa1_0(0x0L, 0x200000000L, 0x0L); - case 62: - jjmatchedKind = 130; - return jjMoveStringLiteralDfa1_0(0x0L, 0x1800000800000000L, 0x3L); - case 63: - return jjStopAtPos(0, 95); - case 64: - return jjStopAtPos(0, 90); - case 91: - return jjStopAtPos(0, 85); - case 93: - return jjStopAtPos(0, 86); - case 94: - jjmatchedKind = 111; - return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000000000L, 0x0L); - case 97: - return jjMoveStringLiteralDfa1_0(0x3000L, 0x0L, 0x0L); - case 98: - return jjMoveStringLiteralDfa1_0(0x1c000L, 0x0L, 0x0L); - case 99: - return jjMoveStringLiteralDfa1_0(0x7e0000L, 0x0L, 0x0L); - case 100: - return jjMoveStringLiteralDfa1_0(0x3800000L, 0x0L, 0x0L); - case 101: - return jjMoveStringLiteralDfa1_0(0x1c000000L, 0x0L, 0x0L); - case 102: - return jjMoveStringLiteralDfa1_0(0x3e0000000L, 0x0L, 0x0L); - case 103: - return jjMoveStringLiteralDfa1_0(0x400000000L, 0x0L, 0x0L); - case 105: - return jjMoveStringLiteralDfa1_0(0x1f800000000L, 0x0L, 0x0L); - case 108: - return jjMoveStringLiteralDfa1_0(0x20000000000L, 0x0L, 0x0L); - case 110: - return jjMoveStringLiteralDfa1_0(0x1c0000000000L, 0x0L, 0x0L); - case 112: - return jjMoveStringLiteralDfa1_0(0x1e00000000000L, 0x0L, 0x0L); - case 114: - return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x0L, 0x0L); - case 115: - return jjMoveStringLiteralDfa1_0(0xfc000000000000L, 0x0L, 0x0L); - case 116: - return jjMoveStringLiteralDfa1_0(0x3f00000000000000L, 0x0L, 0x0L); - case 118: - return jjMoveStringLiteralDfa1_0(0xc000000000000000L, 0x0L, 0x0L); - case 119: - return jjMoveStringLiteralDfa1_0(0x0L, 0x1L, 0x0L); - case 123: - return jjStopAtPos(0, 83); - case 124: - jjmatchedKind = 110; - return jjMoveStringLiteralDfa1_0(0x0L, 0x80002000000000L, 0x0L); - case 125: - return jjStopAtPos(0, 84); - case 126: - return jjStopAtPos(0, 94); - default: - return jjMoveNfa_0(0, 0); - } - } - - private int jjMoveStringLiteralDfa1_0(long active0, long active1, long active2) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0, active1, active2); + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2) +{ + switch (pos) + { + case 0: + if ((active0 & 0xfffffffffffff000L) != 0L || (active1 & 0x1L) != 0L) + { + jjmatchedKind = 78; + return 43; + } + if ((active0 & 0x100L) != 0L || (active1 & 0x20100000000000L) != 0L) + return 45; + if ((active1 & 0x2000000002000000L) != 0L) return 1; - } - switch (curChar) { - case 38: - if ((active1 & 0x4000000000L) != 0L) - return jjStopAtPos(1, 102); - break; - case 42: - if ((active0 & 0x100L) != 0L) - return jjStartNfaWithStates_0(1, 8, 50); - break; - case 43: - if ((active1 & 0x8000000000L) != 0L) - return jjStopAtPos(1, 103); - break; - case 45: - if ((active1 & 0x10000000000L) != 0L) - return jjStopAtPos(1, 104); - break; - case 46: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000000L, active2, 0L); - case 58: - if ((active1 & 0x8000000000000000L) != 0L) - return jjStopAtPos(1, 127); - break; - case 60: - if ((active1 & 0x2000000000000L) != 0L) { - jjmatchedKind = 113; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x400000000000000L, active2, 0L); - case 61: - if ((active1 & 0x200000000L) != 0L) - return jjStopAtPos(1, 97); - else if ((active1 & 0x400000000L) != 0L) - return jjStopAtPos(1, 98); - else if ((active1 & 0x800000000L) != 0L) - return jjStopAtPos(1, 99); - else if ((active1 & 0x1000000000L) != 0L) - return jjStopAtPos(1, 100); - else if ((active1 & 0x4000000000000L) != 0L) - return jjStopAtPos(1, 114); - else if ((active1 & 0x8000000000000L) != 0L) - return jjStopAtPos(1, 115); - else if ((active1 & 0x10000000000000L) != 0L) - return jjStopAtPos(1, 116); - else if ((active1 & 0x20000000000000L) != 0L) - return jjStopAtPos(1, 117); - else if ((active1 & 0x40000000000000L) != 0L) - return jjStopAtPos(1, 118); - else if ((active1 & 0x80000000000000L) != 0L) - return jjStopAtPos(1, 119); - else if ((active1 & 0x100000000000000L) != 0L) - return jjStopAtPos(1, 120); - else if ((active1 & 0x200000000000000L) != 0L) - return jjStopAtPos(1, 121); - break; - case 62: - if ((active1 & 0x4000000000000000L) != 0L) - return jjStopAtPos(1, 126); - else if ((active2 & 0x2L) != 0L) { - jjmatchedKind = 129; - jjmatchedPos = 1; - } else if ((active2 & 0x10L) != 0L) - return jjStopAtPos(1, 132); - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1800000000000000L, active2, 0x1L); - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x240020060000L, active1, 0L, active2, 0L); - case 98: - return jjMoveStringLiteralDfa2_0(active0, 0x1000L, active1, 0L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x2080000800000L, active1, 0L, active2, 0L); - case 102: - if ((active0 & 0x800000000L) != 0L) - return jjStartNfaWithStates_0(1, 35, 43); - break; - case 104: - return jjMoveStringLiteralDfa2_0(active0, 0x704000000080000L, active1, 0x1L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa2_0(active0, 0xc0000000L, active1, 0L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa2_0(active0, 0x104100000L, active1, 0L, active2, 0L); - case 109: - return jjMoveStringLiteralDfa2_0(active0, 0x3000000000L, active1, 0L, active2, 0L); - case 110: - return jjMoveStringLiteralDfa2_0(active0, 0x1c008000000L, active1, 0L, active2, 0L); - case 111: - if ((active0 & 0x1000000L) != 0L) { - jjmatchedKind = 24; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0xc000020602604000L, active1, 0L, active2, 0L); - case 114: - return jjMoveStringLiteralDfa2_0(active0, 0x3800c00000008000L, active1, 0L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa2_0(active0, 0x2000L, active1, 0L, active2, 0L); - case 116: - return jjMoveStringLiteralDfa2_0(active0, 0x18000000000000L, active1, 0L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x21100000000000L, active1, 0L, active2, 0L); - case 119: - return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L, active2, 0L); - case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x10000000L, active1, 0L, active2, 0L); - case 121: - return jjMoveStringLiteralDfa2_0(active0, 0x80000000010000L, active1, 0L, active2, 0L); - case 124: - if ((active1 & 0x2000000000L) != 0L) - return jjStopAtPos(1, 101); - break; - default: - break; - } - return jjStartNfa_0(0, active0, active1, active2); - } - - private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1, long old2, long active2) { - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(0, old0, old1, old2); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0, active1, active2); - return 2; - } - switch (curChar) { - case 46: - if ((active1 & 0x2000000000000000L) != 0L) - return jjStopAtPos(2, 125); - break; - case 61: - if ((active1 & 0x400000000000000L) != 0L) - return jjStopAtPos(2, 122); - else if ((active1 & 0x800000000000000L) != 0L) - return jjStopAtPos(2, 123); - break; - case 62: - if ((active2 & 0x1L) != 0L) { - jjmatchedKind = 128; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x1000000000000000L, active2, 0L); - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0x808000000180000L, active1, 0L, active2, 0L); - case 98: - return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0L, active2, 0L); - case 99: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x8000L, active1, 0L, active2, 0L); - case 102: - return jjMoveStringLiteralDfa3_0(active0, 0x800000L, active1, 0L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x4140400000000000L, active1, 0x1L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x8000100020000000L, active1, 0L, active2, 0L); - case 110: - return jjMoveStringLiteralDfa3_0(active0, 0x800200c0600000L, active1, 0L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x4800100004000L, active1, 0L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa3_0(active0, 0x20003000000000L, active1, 0L, active2, 0L); - case 114: - if ((active0 & 0x200000000L) != 0L) - return jjStartNfaWithStates_0(2, 33, 43); - return jjMoveStringLiteralDfa3_0(active0, 0x610000000000000L, active1, 0L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa3_0(active0, 0x4004023000L, active1, 0L, active2, 0L); - case 116: - if ((active0 & 0x8000000000L) != 0L) { - jjmatchedKind = 39; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x2050410050000L, active1, 0L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x100000000a000000L, active1, 0L, active2, 0L); - case 119: - if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_0(2, 43, 43); - break; - case 121: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 61, 43); - break; - default: - break; - } - return jjStartNfa_0(1, active0, active1, active2); - } - - private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1, long old2, long active2) { - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(1, old0, old1, old2); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0, active1, 0L); - return 3; - } - switch (curChar) { - case 61: - if ((active1 & 0x1000000000000000L) != 0L) - return jjStopAtPos(3, 124); - break; - case 97: - return jjMoveStringLiteralDfa4_0(active0, 0x80000001c0808000L, active1, 0L); - case 98: - return jjMoveStringLiteralDfa4_0(active0, 0x2000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa4_0(active0, 0x80000000040000L, active1, 0L); - case 100: - if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 62, 43); - break; - case 101: - if ((active0 & 0x10000L) != 0L) - return jjStartNfaWithStates_0(3, 16, 43); - else if ((active0 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(3, 17, 43); - else if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(3, 26, 43); - else if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 60, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x20010010002000L, active1, 0L); - case 103: - if ((active0 & 0x20000000000L) != 0L) - return jjStartNfaWithStates_0(3, 41, 43); - break; - case 105: - return jjMoveStringLiteralDfa4_0(active0, 0x10040000000000L, active1, 0L); - case 107: - return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L); - case 108: - if ((active0 & 0x100000000000L) != 0L) - return jjStartNfaWithStates_0(3, 44, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x1001000004000L, active1, 0x1L); - case 109: - if ((active0 & 0x8000000L) != 0L) - return jjStartNfaWithStates_0(3, 27, 43); - break; - case 110: - return jjMoveStringLiteralDfa4_0(active0, 0x800000000000000L, active1, 0L); - case 111: - if ((active0 & 0x400000000L) != 0L) - return jjStartNfaWithStates_0(3, 34, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x600002000000000L, active1, 0L); - case 114: - if ((active0 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(3, 19, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L); - case 115: - if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 56, 43); - return jjMoveStringLiteralDfa4_0(active0, 0x20300000L, active1, 0L); - case 116: - return jjMoveStringLiteralDfa4_0(active0, 0x48804000401000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000L, active1, 0L); - case 118: - return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L); - default: - break; - } - return jjStartNfa_0(2, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(2, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0, active1, 0L); - return 4; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x604000000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa5_0(active0, 0x50000000000000L, active1, 0L); - case 101: - if ((active0 & 0x20000000L) != 0L) - return jjStartNfaWithStates_0(4, 29, 43); - else if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_0(4, 64, 43); - return jjMoveStringLiteralDfa5_0(active0, 0x801000004000L, active1, 0L); - case 104: - if ((active0 & 0x40000L) != 0L) - return jjStartNfaWithStates_0(4, 18, 43); - return jjMoveStringLiteralDfa5_0(active0, 0x80000000000000L, active1, 0L); - case 105: - return jjMoveStringLiteralDfa5_0(active0, 0x9000000400000L, active1, 0L); - case 107: - if ((active0 & 0x8000L) != 0L) - return jjStartNfaWithStates_0(4, 15, 43); - break; - case 108: - if ((active0 & 0x40000000L) != 0L) { - jjmatchedKind = 30; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0x82000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa5_0(active0, 0x10000000L, active1, 0L); - case 114: - if ((active0 & 0x20000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 53, 43); - return jjMoveStringLiteralDfa5_0(active0, 0x2012000003000L, active1, 0L); - case 115: - if ((active0 & 0x100000L) != 0L) - return jjStartNfaWithStates_0(4, 20, 43); - return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L); - case 116: - if ((active0 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(4, 21, 43); - else if ((active0 & 0x100000000L) != 0L) - return jjStartNfaWithStates_0(4, 32, 43); - else if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 50, 43); - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa5_0(active0, 0x800000L, active1, 0L); - case 118: - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); - case 119: - if ((active0 & 0x200000000000000L) != 0L) { - jjmatchedKind = 57; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); - default: - break; - } - return jjStartNfa_0(3, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(3, old0, old1, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0, 0L, 0L); - return 5; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa6_0(active0, 0x5000L); - case 99: - if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 48, 43); - else if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 51, 43); - return jjMoveStringLiteralDfa6_0(active0, 0x800000000000L); - case 100: - return jjMoveStringLiteralDfa6_0(active0, 0x10000000L); - case 101: - if ((active0 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(5, 25, 43); - else if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_0(5, 42, 43); - break; - case 102: - return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); - case 103: - return jjMoveStringLiteralDfa6_0(active0, 0x200000000000L); - case 104: - if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 54, 43); - break; - case 105: - return jjMoveStringLiteralDfa6_0(active0, 0x8800000000000000L); - case 108: - return jjMoveStringLiteralDfa6_0(active0, 0x80800000L); - case 109: - return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L); - case 110: - if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 49, 43); - return jjMoveStringLiteralDfa6_0(active0, 0x4000400000L); - case 114: - return jjMoveStringLiteralDfa6_0(active0, 0x80000000000000L); - case 115: - if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 58, 43); - break; - case 116: - if ((active0 & 0x2000L) != 0L) - return jjStartNfaWithStates_0(5, 13, 43); - else if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_0(5, 37, 43); - return jjMoveStringLiteralDfa6_0(active0, 0x10400000000000L); - default: - break; - } - return jjStartNfa_0(4, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa6_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(4, old0, 0L, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0, 0L, 0L); - return 6; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa7_0(active0, 0x10000000000L); - case 99: - return jjMoveStringLiteralDfa7_0(active0, 0x4000001000L); - case 101: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_0(6, 45, 43); - else if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(6, 46, 43); - return jjMoveStringLiteralDfa7_0(active0, 0x800001000000000L); - case 102: - return jjMoveStringLiteralDfa7_0(active0, 0x10000000000000L); - case 108: - return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L); - case 110: - if ((active0 & 0x4000L) != 0L) - return jjStartNfaWithStates_0(6, 14, 43); - break; - case 111: - return jjMoveStringLiteralDfa7_0(active0, 0x80000000000000L); - case 115: - if ((active0 & 0x10000000L) != 0L) - return jjStartNfaWithStates_0(6, 28, 43); - break; - case 116: - if ((active0 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(6, 23, 43); - return jjMoveStringLiteralDfa7_0(active0, 0x800000000000L); - case 117: - return jjMoveStringLiteralDfa7_0(active0, 0x400000L); - case 121: - if ((active0 & 0x80000000L) != 0L) - return jjStartNfaWithStates_0(6, 31, 43); - break; - default: - break; - } - return jjStartNfa_0(5, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa7_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(5, old0, 0L, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0, 0L, 0L); - return 7; - } - switch (curChar) { - case 99: - return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L); - case 101: - if ((active0 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(7, 22, 43); - else if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 63, 43); - return jjMoveStringLiteralDfa8_0(active0, 0x804000000000L); - case 110: - return jjMoveStringLiteralDfa8_0(active0, 0x880001000000000L); - case 112: - if ((active0 & 0x10000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 52, 43); - break; - case 116: - if ((active0 & 0x1000L) != 0L) - return jjStartNfaWithStates_0(7, 12, 43); - break; - default: - break; - } - return jjStartNfa_0(6, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa8_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(6, old0, 0L, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0, 0L, 0L); - return 8; - } - switch (curChar) { - case 100: - if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(8, 47, 43); - break; - case 101: - if ((active0 & 0x10000000000L) != 0L) - return jjStartNfaWithStates_0(8, 40, 43); - break; - case 105: - return jjMoveStringLiteralDfa9_0(active0, 0x80000000000000L); - case 111: - return jjMoveStringLiteralDfa9_0(active0, 0x4000000000L); - case 116: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(8, 59, 43); - return jjMoveStringLiteralDfa9_0(active0, 0x1000000000L); - default: - break; - } - return jjStartNfa_0(7, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa9_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(7, old0, 0L, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0, 0L, 0L); - return 9; - } - switch (curChar) { - case 102: - if ((active0 & 0x4000000000L) != 0L) - return jjStartNfaWithStates_0(9, 38, 43); - break; - case 115: - if ((active0 & 0x1000000000L) != 0L) - return jjStartNfaWithStates_0(9, 36, 43); - break; - case 122: - return jjMoveStringLiteralDfa10_0(active0, 0x80000000000000L); - default: - break; - } - return jjStartNfa_0(8, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa10_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(8, old0, 0L, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(9, active0, 0L, 0L); - return 10; - } - switch (curChar) { - case 101: - return jjMoveStringLiteralDfa11_0(active0, 0x80000000000000L); - default: - break; - } - return jjStartNfa_0(9, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa11_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(9, old0, 0L, 0L); - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(10, active0, 0L, 0L); - return 11; - } - switch (curChar) { - case 100: - if ((active0 & 0x80000000000000L) != 0L) - return jjStartNfaWithStates_0(11, 55, 43); - break; - default: - break; - } - return jjStartNfa_0(10, active0, 0L, 0L); - } - - private int jjStartNfaWithStates_0(int pos, int kind, int state) { - jjmatchedKind = kind; - jjmatchedPos = pos; - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return pos + 1; - } - return jjMoveNfa_0(state, pos + 1); - } - - static final long[] jjbitVec0 = { - 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec2 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec3 = { - 0xfff0000000200002L, 0xffffffffffffdfffL, 0xfffff00f7fffffffL, 0x12000000007fffffL - }; - static final long[] jjbitVec4 = { - 0x0L, 0x0L, 0x420043c00000000L, 0xff7fffffff7fffffL - }; - static final long[] jjbitVec5 = { - 0x7fffffffffffffL, 0xffffffffffff0000L, 0xffffffffffffffffL, 0x401f0003ffc3L - }; - static final long[] jjbitVec6 = { - 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xfbfffffffff7fffL - }; - static final long[] jjbitVec7 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc03L, 0x33fffffffff7fffL - }; - static final long[] jjbitVec8 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L - }; - static final long[] jjbitVec9 = { - 0x7fffffe00000000L, 0xfffec000000007ffL, 0xffffffffffffffffL, 0x9c00c060002fffffL - }; - static final long[] jjbitVec10 = { - 0xfffffffd0000L, 0xe000L, 0x2003fffffffffL, 0x0L - }; - static final long[] jjbitVec11 = { - 0x23fffffffffffff0L, 0x3ff010000L, 0x23c5fdfffff99fe0L, 0xf0003b0000000L - }; - static final long[] jjbitVec12 = { - 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbbfe0L, 0x2000300010000L - }; - static final long[] jjbitVec13 = { - 0x23edfdfffff99fe0L, 0x20003b0000000L, 0x3bfc718d63dc7e8L, 0x200000000000000L - }; - static final long[] jjbitVec14 = { - 0x3effdfffffddfe0L, 0x300000000L, 0x23effdfffffddfe0L, 0x340000000L - }; - static final long[] jjbitVec15 = { - 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL - }; - static final long[] jjbitVec16 = { - 0x800dfffffffffffeL, 0x7fL, 0x200decaefef02596L, 0x3000005fL - }; - static final long[] jjbitVec17 = { - 0x1L, 0x7fffffffeffL, 0xf00L, 0x0L - }; - static final long[] jjbitVec18 = { - 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x1ffffffffff003fL - }; - static final long[] jjbitVec19 = { - 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL - }; - static final long[] jjbitVec20 = { - 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL - }; - static final long[] jjbitVec21 = { - 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL - }; - static final long[] jjbitVec22 = { - 0xffffffffffffffffL, 0x7f9fffffffffffL, 0xffffffff07fffffeL, 0x1c7ffffffffffL - }; - static final long[] jjbitVec23 = { - 0x3ffff0003dfffL, 0x1dfff0003ffffL, 0xfffffffffffffL, 0x18800000L - }; - static final long[] jjbitVec24 = { - 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L - }; - static final long[] jjbitVec25 = { - 0x1fffffffL, 0x1f3fffffff0000L, 0x0L, 0x0L - }; - static final long[] jjbitVec26 = { - 0xffffffffffffffffL, 0xfffffffffffL, 0x0L, 0x0L - }; - static final long[] jjbitVec27 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL - }; - static final long[] jjbitVec28 = { - 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL - }; - static final long[] jjbitVec29 = { - 0x8000000000000000L, 0x8002000000100001L, 0x3ffff00000000L, 0x0L - }; - static final long[] jjbitVec30 = { - 0xe3fbbd503e2ffc84L, 0xffffffff000003e0L, 0xfL, 0x0L - }; - static final long[] jjbitVec31 = { - 0x1f3e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffee07fffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec32 = { - 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0xffff000000000000L - }; - static final long[] jjbitVec33 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffL, 0x0L - }; - static final long[] jjbitVec34 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L - }; - static final long[] jjbitVec35 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L - }; - static final long[] jjbitVec36 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L - }; - static final long[] jjbitVec37 = { - 0x6L, 0x0L, 0x0L, 0x0L - }; - static final long[] jjbitVec38 = { - 0xffff3fffffffffffL, 0x7ffffffffffL, 0x0L, 0x0L - }; - static final long[] jjbitVec39 = { - 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L - }; - static final long[] jjbitVec40 = { - 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0x1fff0000000000ffL - }; - static final long[] jjbitVec41 = { - 0x18000000000000L, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL - }; - static final long[] jjbitVec42 = { - 0x87fffffe00000010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x631cfcfcfcL - }; - static final long[] jjbitVec43 = { - 0x0L, 0x0L, 0x420243cffffffffL, 0xff7fffffff7fffffL - }; - static final long[] jjbitVec44 = { - 0xffffffffffffffffL, 0x400ffffe0ffffffL, 0xfffffffbffffd740L, 0xfbfffffffff7fffL - }; - static final long[] jjbitVec45 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc7bL, 0x33fffffffff7fffL - }; - static final long[] jjbitVec46 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L - }; - static final long[] jjbitVec47 = { - 0x7fffffe003f000fL, 0xffffc3ff01ffffffL, 0xffffffffffffffffL, 0x9ffffdffbfefffffL - }; - static final long[] jjbitVec48 = { - 0xffffffffffff8000L, 0xe7ffL, 0x3ffffffffffffL, 0x0L - }; - static final long[] jjbitVec49 = { - 0xf3fffffffffffffeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0xfffcfb080399fL - }; - static final long[] jjbitVec50 = { - 0xd36dfdfffff987eeL, 0x1fffc05e003987L, 0xf3edfdfffffbbfeeL, 0x2ffcf00013bbfL - }; - static final long[] jjbitVec51 = { - 0xf3edfdfffff99feeL, 0x2ffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0x200ff8000803dc7L - }; - static final long[] jjbitVec52 = { - 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xf3effdfffffddfecL, 0xffc340603ddfL - }; - static final long[] jjbitVec53 = { - 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL - }; - static final long[] jjbitVec54 = { - 0x87fffffffffffffeL, 0x3ff7fffL, 0x3bffecaefef02596L, 0x33ff3f5fL - }; - static final long[] jjbitVec55 = { - 0xc2a003ff03000001L, 0xfffe07fffffffeffL, 0x1ffffffffeff0fdfL, 0x40L - }; - static final long[] jjbitVec56 = { - 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x1ffffffffff003fL - }; - static final long[] jjbitVec57 = { - 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL - }; - static final long[] jjbitVec58 = { - 0x1fffff001fdfffL, 0xddfff000fffffL, 0xffffffffffffffffL, 0x3ff388fffffL - }; - static final long[] jjbitVec59 = { - 0xffffffff03ff3800L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L - }; - static final long[] jjbitVec60 = { - 0xfff0fff1fffffffL, 0x1f3fffffffffc0L, 0x0L, 0x0L - }; - static final long[] jjbitVec61 = { - 0x80007c000000f000L, 0x8002fc0f00100001L, 0x3ffff00000000L, 0x7e21fff0000L - }; - static final long[] jjbitVec62 = { - 0x1f3efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffee67fffffL, 0xffffffffffffffffL - }; - static final long[] jjbitVec63 = { - 0x10000000000006L, 0x0L, 0x0L, 0x0L - }; - static final long[] jjbitVec64 = { - 0x3L, 0x0L, 0x0L, 0x0L - }; - static final long[] jjbitVec65 = { - 0x0L, 0x800000000000000L, 0x0L, 0x0L - }; - static final long[] jjbitVec66 = { - 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L - }; - static final long[] jjbitVec67 = { - 0x18000f0000ffffL, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x9fffffffffffffffL - }; - static final long[] jjbitVec68 = { - 0x87fffffe03ff0010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0xe0000631cfcfcfcL - }; - - private int jjMoveNfa_0(int startState, int curPos) { - int startsAt = 0; - jjnewStateCnt = 130; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (; ; ) { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) { - long l = 1L << curChar; - do { - switch (jjstateSet[--i]) { - case 45: - if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 50; - else if (curChar == 47) { - if (kind > 6) - kind = 6; - jjCheckNAddStates(0, 2); - } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) { - if (kind > 66) - kind = 66; - jjCheckNAddStates(3, 17); - } else if (curChar == 47) - jjAddStates(18, 19); - else if (curChar == 36) { - if (kind > 78) - kind = 78; - jjCheckNAdd(43); - } else if (curChar == 34) - jjCheckNAddStates(20, 23); - else if (curChar == 39) - jjAddStates(24, 26); - else if (curChar == 46) - jjCheckNAdd(1); - if (curChar == 48) - jjAddStates(27, 34); - break; - case 1: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(35, 38); - break; - case 2: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(2, 3); - break; - case 3: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(39, 41); - break; - case 5: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(6); - break; - case 6: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(42, 44); - break; - case 7: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(7, 8); - break; - case 8: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddTwoStates(6, 9); - break; - case 10: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(45, 48); - break; - case 11: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(49, 53); - break; - case 12: - if (curChar == 39) - jjAddStates(24, 26); - break; - case 13: - if ((0xffffff7fffffdbffL & l) != 0L) - jjCheckNAdd(14); - break; - case 14: - if (curChar == 39 && kind > 76) - kind = 76; - break; - case 16: - if ((0x8400000000L & l) != 0L) - jjCheckNAdd(14); - break; - case 17: - if ((0xff000000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 14); - break; - case 18: - if ((0xff000000000000L & l) != 0L) - jjCheckNAdd(14); - break; - case 19: - if ((0xf000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 20; - break; - case 20: - if ((0xff000000000000L & l) != 0L) - jjCheckNAdd(18); - break; - case 22: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 23; - break; - case 23: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 24; - break; - case 24: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 25: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAdd(14); - break; - case 27: - if (curChar == 34) - jjCheckNAddStates(20, 23); - break; - case 28: - if ((0xfffffffbffffdbffL & l) != 0L) - jjCheckNAddStates(20, 23); - break; - case 30: - if ((0x8400000000L & l) != 0L) - jjCheckNAddStates(20, 23); - break; - case 32: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 33; - break; - case 33: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 34; - break; - case 34: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 35; - break; - case 35: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(20, 23); - break; - case 37: - if (curChar == 34 && kind > 77) - kind = 77; - break; - case 38: - if ((0xff000000000000L & l) != 0L) - jjCheckNAddStates(54, 58); - break; - case 39: - if ((0xff000000000000L & l) != 0L) - jjCheckNAddStates(20, 23); - break; - case 40: - if ((0xf000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 41; - break; - case 41: - if ((0xff000000000000L & l) != 0L) - jjCheckNAdd(39); - break; - case 42: - if (curChar != 36) - break; - if (kind > 78) - kind = 78; - jjCheckNAdd(43); - break; - case 43: - if ((0x3ff00100fffc1ffL & l) == 0L) - break; - if (kind > 78) - kind = 78; - jjCheckNAdd(43); - break; - case 44: - if (curChar == 47) - jjAddStates(18, 19); - break; - case 46: - if ((0xffffffffffffdbffL & l) == 0L) - break; - if (kind > 6) - kind = 6; - jjCheckNAddStates(0, 2); - break; - case 47: - if ((0x2400L & l) != 0L && kind > 6) - kind = 6; - break; - case 48: - if (curChar == 10 && kind > 6) - kind = 6; - break; - case 49: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 48; - break; - case 50: - if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 51; - break; - case 51: - if ((0xffff7fffffffffffL & l) != 0L && kind > 7) - kind = 7; - break; - case 52: - if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 50; - break; - case 53: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(3, 17); - break; - case 54: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(54, 55); - break; - case 55: - case 98: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAdd(56); - break; - case 57: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(57, 58); - break; - case 58: - case 109: - if ((0x3ff000000000000L & l) != 0L && kind > 66) - kind = 66; - break; - case 59: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(59, 60); - break; - case 60: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(59, 61); - break; - case 61: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(62, 65); - break; - case 63: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(64); - break; - case 64: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(66, 68); - break; - case 65: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(65, 66); - break; - case 66: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(64, 9); - break; - case 67: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(69, 72); - break; - case 68: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(73, 77); - break; - case 69: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(69, 70); - break; - case 70: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(71, 72); - break; - case 71: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(78, 80); - break; - case 73: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(74); - break; - case 74: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(81, 83); - break; - case 75: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(75, 76); - break; - case 76: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddTwoStates(74, 9); - break; - case 77: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(84, 87); - break; - case 78: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(88, 91); - break; - case 79: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(79, 80); - break; - case 80: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(81, 82); - break; - case 81: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(92, 94); - break; - case 82: - if (curChar != 46) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(95, 97); - break; - case 83: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(98, 101); - break; - case 84: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(84, 85); - break; - case 85: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(95, 97); - break; - case 87: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(88); - break; - case 88: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(102, 104); - break; - case 89: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(89, 90); - break; - case 90: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddTwoStates(88, 9); - break; - case 91: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(105, 108); - break; - case 92: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddStates(109, 113); - break; - case 93: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(114, 117); - break; - case 94: - if (curChar == 48) - jjAddStates(27, 34); - break; - case 96: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(118, 120); - break; - case 97: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(97, 98); - break; - case 99: - if ((0xff000000000000L & l) != 0L) - jjCheckNAddStates(121, 123); - break; - case 100: - if ((0xff000000000000L & l) != 0L) - jjCheckNAddTwoStates(100, 101); - break; - case 101: - if ((0xff000000000000L & l) != 0L) - jjCheckNAdd(56); - break; - case 103: - if ((0x3000000000000L & l) != 0L) - jjCheckNAddStates(124, 126); - break; - case 104: - if ((0x3000000000000L & l) != 0L) - jjCheckNAddTwoStates(104, 105); - break; - case 105: - if ((0x3000000000000L & l) != 0L) - jjCheckNAdd(56); - break; - case 107: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(108, 109); - break; - case 108: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(108, 109); - break; - case 110: - if ((0xff000000000000L & l) == 0L) - break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(111, 112); - break; - case 111: - if ((0xff000000000000L & l) != 0L) - jjCheckNAddTwoStates(111, 112); - break; - case 112: - if ((0xff000000000000L & l) != 0L && kind > 66) - kind = 66; - break; - case 114: - if ((0x3000000000000L & l) == 0L) - break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(115, 116); - break; - case 115: - if ((0x3000000000000L & l) != 0L) - jjCheckNAddTwoStates(115, 116); - break; - case 116: - if ((0x3000000000000L & l) != 0L && kind > 66) - kind = 66; - break; - case 118: - if ((0x3ff000000000000L & l) != 0L) - jjAddStates(127, 128); - break; - case 119: - if (curChar == 46) - jjCheckNAdd(120); - break; - case 120: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(120, 121); - break; - case 122: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(123); - break; - case 123: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddTwoStates(123, 9); - break; - case 125: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(129, 131); - break; - case 126: - if (curChar == 46) - jjCheckNAdd(127); - break; - case 128: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(129); - break; - case 129: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 71) - kind = 71; - jjCheckNAddTwoStates(129, 9); - break; - default: - break; - } - } while (i != startsAt); - } else if (curChar < 128) { - long l = 1L << (curChar & 077); - do { - switch (jjstateSet[--i]) { - case 0: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 78) - kind = 78; - jjCheckNAdd(43); - break; - case 2: - if (curChar == 95) - jjAddStates(132, 133); - break; - case 4: - if ((0x2000000020L & l) != 0L) - jjAddStates(134, 135); - break; - case 7: - if (curChar == 95) - jjAddStates(136, 137); - break; - case 9: - if ((0x5000000050L & l) != 0L && kind > 71) - kind = 71; - break; - case 13: - if ((0xffffffffefffffffL & l) != 0L) - jjCheckNAdd(14); - break; - case 15: - if (curChar == 92) - jjAddStates(138, 140); - break; - case 16: - if ((0x14404410000000L & l) != 0L) - jjCheckNAdd(14); - break; - case 21: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 22; - break; - case 22: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 23; - break; - case 23: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 24; - break; - case 24: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 25: - if ((0x7e0000007eL & l) != 0L) - jjCheckNAdd(14); - break; - case 26: - if (curChar == 92) - jjstateSet[jjnewStateCnt++] = 21; - break; - case 28: - if ((0xffffffffefffffffL & l) != 0L) - jjCheckNAddStates(20, 23); - break; - case 29: - if (curChar == 92) - jjAddStates(141, 143); - break; - case 30: - if ((0x14404410000000L & l) != 0L) - jjCheckNAddStates(20, 23); - break; - case 31: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 32; - break; - case 32: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 33; - break; - case 33: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 34; - break; - case 34: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 35; - break; - case 35: - if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(20, 23); - break; - case 36: - if (curChar == 92) - jjstateSet[jjnewStateCnt++] = 31; - break; - case 43: - if ((0x87fffffe87fffffeL & l) == 0L) - break; - if (kind > 78) - kind = 78; - jjCheckNAdd(43); - break; - case 46: - if (kind > 6) - kind = 6; - jjAddStates(0, 2); - break; - case 51: - if (kind > 7) - kind = 7; - break; - case 54: - if (curChar == 95) - jjAddStates(144, 145); - break; - case 56: - if ((0x100000001000L & l) != 0L && kind > 65) - kind = 65; - break; - case 57: - if (curChar == 95) - jjAddStates(146, 147); - break; - case 59: - if (curChar == 95) - jjAddStates(148, 149); - break; - case 62: - if ((0x2000000020L & l) != 0L) - jjAddStates(150, 151); - break; - case 65: - if (curChar == 95) - jjAddStates(152, 153); - break; - case 69: - if (curChar == 95) - jjAddStates(154, 155); - break; - case 72: - if ((0x2000000020L & l) != 0L) - jjAddStates(156, 157); - break; - case 75: - if (curChar == 95) - jjAddStates(158, 159); - break; - case 79: - if (curChar == 95) - jjAddStates(160, 161); - break; - case 84: - if (curChar == 95) - jjAddStates(162, 163); - break; - case 86: - if ((0x2000000020L & l) != 0L) - jjAddStates(164, 165); - break; - case 89: - if (curChar == 95) - jjAddStates(166, 167); - break; - case 95: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; - break; - case 96: - if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(118, 120); - break; - case 97: - if ((0x7e8000007eL & l) != 0L) - jjCheckNAddTwoStates(97, 98); - break; - case 98: - if ((0x7e0000007eL & l) != 0L) - jjCheckNAdd(56); - break; - case 100: - if (curChar == 95) - jjAddStates(168, 169); - break; - case 102: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 103; - break; - case 104: - if (curChar == 95) - jjAddStates(170, 171); - break; - case 106: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 107; - break; - case 107: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(108, 109); - break; - case 108: - if ((0x7e8000007eL & l) != 0L) - jjCheckNAddTwoStates(108, 109); - break; - case 109: - if ((0x7e0000007eL & l) != 0L && kind > 66) - kind = 66; - break; - case 111: - if (curChar == 95) - jjAddStates(172, 173); - break; - case 113: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 114; - break; - case 115: - if (curChar == 95) - jjAddStates(174, 175); - break; - case 117: - if ((0x100000001000000L & l) != 0L) - jjCheckNAddTwoStates(118, 119); - break; - case 118: - if ((0x7e0000007eL & l) != 0L) - jjCheckNAddTwoStates(118, 119); - break; - case 120: - if ((0x7e0000007eL & l) != 0L) - jjAddStates(176, 177); - break; - case 121: - if ((0x1000000010000L & l) != 0L) - jjAddStates(178, 179); - break; - case 124: - if ((0x100000001000000L & l) != 0L) - jjCheckNAdd(125); - break; - case 125: - if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(129, 131); - break; - case 127: - if ((0x1000000010000L & l) != 0L) - jjAddStates(180, 181); - break; - default: - break; - } - } while (i != startsAt); - } else { - int hiByte = (int) (curChar >> 8); - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do { - switch (jjstateSet[--i]) { - case 0: - if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) - break; - if (kind > 78) - kind = 78; - jjCheckNAdd(43); - break; - case 13: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - jjstateSet[jjnewStateCnt++] = 14; - break; - case 28: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - jjAddStates(20, 23); - break; - case 43: - if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) - break; - if (kind > 78) - kind = 78; - jjCheckNAdd(43); - break; - case 46: - if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) - break; - if (kind > 6) - kind = 6; - jjAddStates(0, 2); - break; - case 51: - if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 7) - kind = 7; - break; - default: - break; - } - } while (i != startsAt); + return -1; + case 1: + if ((active0 & 0x803000000L) != 0L) + return 43; + if ((active0 & 0xfffffff7fcfff000L) != 0L || (active1 & 0x1L) != 0L) + { + if (jjmatchedPos != 1) + { + jjmatchedKind = 78; + jjmatchedPos = 1; } - if (kind != 0x7fffffff) { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; + return 43; + } + if ((active0 & 0x100L) != 0L) + return 50; + return -1; + case 2: + if ((active0 & 0x2000098200000000L) != 0L) + return 43; + if ((active0 & 0xdffff675fefff000L) != 0L || (active1 & 0x1L) != 0L) + { + if (jjmatchedPos != 2) + { + jjmatchedKind = 78; + jjmatchedPos = 2; } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 130 - (jjnewStateCnt = startsAt))) - return curPos; - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return curPos; + return 43; + } + return -1; + case 3: + if ((active0 & 0x8effe571f2f4f000L) != 0L || (active1 & 0x1L) != 0L) + { + jjmatchedKind = 78; + jjmatchedPos = 3; + return 43; + } + if ((active0 & 0x510012040c0b0000L) != 0L) + return 43; + return -1; + case 4: + if ((active0 & 0x88dbe57012c07000L) != 0L) + { + if (jjmatchedPos != 4) + { + jjmatchedKind = 78; + jjmatchedPos = 4; } - } - } - - private int jjMoveStringLiteralDfa0_2() { - switch (curChar) { - case 42: - return jjMoveStringLiteralDfa1_2(0x400L); - default: - return 1; - } - } - - private int jjMoveStringLiteralDfa1_2(long active0) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return 1; - } - switch (curChar) { - case 47: - if ((active0 & 0x400L) != 0L) - return jjStopAtPos(1, 10); - break; - default: - return 2; - } - return 2; - } - - private int jjMoveStringLiteralDfa0_1() { - switch (curChar) { - case 42: - return jjMoveStringLiteralDfa1_1(0x200L); - default: - return 1; - } - } - - private int jjMoveStringLiteralDfa1_1(long active0) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return 1; - } - switch (curChar) { - case 47: - if ((active0 & 0x200L) != 0L) - return jjStopAtPos(1, 9); - break; - default: - return 2; - } - return 2; - } - - static final int[] jjnextStates = { - 46, 47, 49, 54, 55, 56, 57, 58, 59, 62, 9, 69, 72, 79, 82, 93, - 78, 68, 45, 52, 28, 29, 36, 37, 13, 15, 26, 95, 99, 102, 106, 110, - 113, 117, 124, 2, 4, 9, 11, 1, 4, 9, 7, 9, 10, 6, 7, 9, - 10, 1, 2, 4, 9, 11, 28, 29, 39, 36, 37, 61, 62, 9, 59, 62, - 9, 68, 65, 9, 67, 64, 65, 9, 67, 61, 59, 62, 9, 68, 69, 72, - 78, 75, 9, 77, 74, 75, 9, 77, 71, 69, 72, 78, 79, 82, 93, 83, - 86, 9, 84, 86, 9, 92, 89, 9, 91, 88, 89, 9, 91, 83, 84, 86, - 9, 92, 81, 79, 82, 93, 97, 98, 56, 100, 101, 56, 104, 105, 56, 118, - 119, 125, 126, 127, 2, 3, 5, 6, 7, 8, 16, 17, 19, 30, 38, 40, - 54, 55, 57, 58, 59, 60, 63, 64, 65, 66, 69, 70, 73, 74, 75, 76, - 79, 80, 84, 85, 87, 88, 89, 90, 100, 101, 104, 105, 111, 112, 115, 116, - 120, 121, 122, 123, 128, 129, - }; - - private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec2[i2] & l2) != 0L); - default: - if ((jjbitVec0[i1] & l1) != 0L) - return true; - return false; - } - } - - private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec4[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec6[i2] & l2) != 0L); - case 4: - return ((jjbitVec7[i2] & l2) != 0L); - case 5: - return ((jjbitVec8[i2] & l2) != 0L); - case 6: - return ((jjbitVec9[i2] & l2) != 0L); - case 7: - return ((jjbitVec10[i2] & l2) != 0L); - case 9: - return ((jjbitVec11[i2] & l2) != 0L); - case 10: - return ((jjbitVec12[i2] & l2) != 0L); - case 11: - return ((jjbitVec13[i2] & l2) != 0L); - case 12: - return ((jjbitVec14[i2] & l2) != 0L); - case 13: - return ((jjbitVec15[i2] & l2) != 0L); - case 14: - return ((jjbitVec16[i2] & l2) != 0L); - case 15: - return ((jjbitVec17[i2] & l2) != 0L); - case 16: - return ((jjbitVec18[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec21[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec23[i2] & l2) != 0L); - case 24: - return ((jjbitVec24[i2] & l2) != 0L); - case 25: - return ((jjbitVec25[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec29[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec31[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec37[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec39[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec41[i2] & l2) != 0L); - case 255: - return ((jjbitVec42[i2] & l2) != 0L); - default: - if ((jjbitVec3[i1] & l1) != 0L) - return true; - return false; - } - } - - private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec43[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec44[i2] & l2) != 0L); - case 4: - return ((jjbitVec45[i2] & l2) != 0L); - case 5: - return ((jjbitVec46[i2] & l2) != 0L); - case 6: - return ((jjbitVec47[i2] & l2) != 0L); - case 7: - return ((jjbitVec48[i2] & l2) != 0L); - case 9: - return ((jjbitVec49[i2] & l2) != 0L); - case 10: - return ((jjbitVec50[i2] & l2) != 0L); - case 11: - return ((jjbitVec51[i2] & l2) != 0L); - case 12: - return ((jjbitVec52[i2] & l2) != 0L); - case 13: - return ((jjbitVec53[i2] & l2) != 0L); - case 14: - return ((jjbitVec54[i2] & l2) != 0L); - case 15: - return ((jjbitVec55[i2] & l2) != 0L); - case 16: - return ((jjbitVec56[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec57[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec58[i2] & l2) != 0L); - case 24: - return ((jjbitVec59[i2] & l2) != 0L); - case 25: - return ((jjbitVec60[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec61[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec62[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec63[i2] & l2) != 0L); - case 220: - return ((jjbitVec64[i2] & l2) != 0L); - case 221: - return ((jjbitVec65[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec66[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec67[i2] & l2) != 0L); - case 255: - return ((jjbitVec68[i2] & l2) != 0L); - default: - if ((jjbitVec3[i1] & l1) != 0L) - return true; - return false; - } - } - - /** - * Token literal values. - */ - public static final String[] jjstrLiteralImages = { - "", null, null, null, null, null, null, null, null, null, null, null, - "\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156", - "\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150", - "\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164", - "\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145", - "\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145", - "\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162", - "\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163", - "\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164", - "\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167", - "\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145", - "\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156", - "\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160", - "\163\165\160\145\162", "\163\167\151\164\143\150", - "\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163", - "\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144", - "\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, "\50", "\51", "\173", "\175", "\133", - "\135", "\73", "\54", "\56", "\100", "\75", "\74", "\41", "\176", "\77", "\72", - "\75\75", "\74\75", "\76\75", "\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", - "\55", "\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\53\75", "\55\75", - "\52\75", "\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", - "\76\76\76\75", "\56\56\56", "\55\76", "\72\72", "\76\76\76", "\76\76", "\76", "\32", - "\74\76",}; - - /** - * Lexer state names. - */ - public static final String[] lexStateNames = { - "DEFAULT", - "IN_JAVA_DOC_COMMENT", - "IN_MULTI_LINE_COMMENT", - }; - - /** - * Lex State array. - */ - public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - }; - static final long[] jjtoToken = { - 0xfffffffffffff001L, 0xfffffffffffe7087L, 0x1fL, - }; - static final long[] jjtoSkip = { - 0x67eL, 0x0L, 0x0L, - }; - static final long[] jjtoSpecial = { - 0x640L, 0x0L, 0x0L, - }; - static final long[] jjtoMore = { - 0x980L, 0x0L, 0x0L, - }; - protected JavaCharStream input_stream; - private final int[] jjrounds = new int[130]; - private final int[] jjstateSet = new int[260]; - private final StringBuilder jjimage = new StringBuilder(); - private StringBuilder image = jjimage; - private int jjimageLen; - private int lengthOfMatch; - protected char curChar; + return 43; + } + if ((active0 & 0x6240001e0348000L) != 0L || (active1 & 0x1L) != 0L) + return 43; + return -1; + case 5: + if ((active0 & 0x44b042002002000L) != 0L) + return 43; + if ((active0 & 0x8890e15090c05000L) != 0L) + { + jjmatchedKind = 78; + jjmatchedPos = 5; + return 43; + } + return -1; + case 6: + if ((active0 & 0x600090804000L) != 0L) + return 43; + if ((active0 & 0x8890815000401000L) != 0L) + { + jjmatchedKind = 78; + jjmatchedPos = 6; + return 43; + } + return -1; + case 7: + if ((active0 & 0x880815000000000L) != 0L) + { + jjmatchedKind = 78; + jjmatchedPos = 7; + return 43; + } + if ((active0 & 0x8010000000401000L) != 0L) + return 43; + return -1; + case 8: + if ((active0 & 0x800810000000000L) != 0L) + return 43; + if ((active0 & 0x80005000000000L) != 0L) + { + jjmatchedKind = 78; + jjmatchedPos = 8; + return 43; + } + return -1; + case 9: + if ((active0 & 0x5000000000L) != 0L) + return 43; + if ((active0 & 0x80000000000000L) != 0L) + { + jjmatchedKind = 78; + jjmatchedPos = 9; + return 43; + } + return -1; + case 10: + if ((active0 & 0x80000000000000L) != 0L) + { + jjmatchedKind = 78; + jjmatchedPos = 10; + return 43; + } + return -1; + default : + return -1; + } +} +private final int jjStartNfa_0(int pos, long active0, long active1, long active2) +{ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); +} +private int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +private int jjMoveStringLiteralDfa0_0() +{ + switch(curChar) + { + case 26: + return jjStopAtPos(0, 131); + case 33: + jjmatchedKind = 93; + return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000L, 0x0L); + case 37: + jjmatchedKind = 112; + return jjMoveStringLiteralDfa1_0(0x0L, 0x200000000000000L, 0x0L); + case 38: + jjmatchedKind = 109; + return jjMoveStringLiteralDfa1_0(0x0L, 0x40004000000000L, 0x0L); + case 40: + return jjStopAtPos(0, 81); + case 41: + return jjStopAtPos(0, 82); + case 42: + jjmatchedKind = 107; + return jjMoveStringLiteralDfa1_0(0x0L, 0x10000000000000L, 0x0L); + case 43: + jjmatchedKind = 105; + return jjMoveStringLiteralDfa1_0(0x0L, 0x4008000000000L, 0x0L); + case 44: + return jjStopAtPos(0, 88); + case 45: + jjmatchedKind = 106; + return jjMoveStringLiteralDfa1_0(0x0L, 0x4008010000000000L, 0x0L); + case 46: + jjmatchedKind = 89; + return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000000000000L, 0x0L); + case 47: + jjmatchedKind = 108; + return jjMoveStringLiteralDfa1_0(0x100L, 0x20000000000000L, 0x0L); + case 58: + jjmatchedKind = 96; + return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000000L, 0x0L); + case 59: + return jjStopAtPos(0, 87); + case 60: + jjmatchedKind = 92; + return jjMoveStringLiteralDfa1_0(0x0L, 0x402000400000000L, 0x10L); + case 61: + jjmatchedKind = 91; + return jjMoveStringLiteralDfa1_0(0x0L, 0x200000000L, 0x0L); + case 62: + jjmatchedKind = 130; + return jjMoveStringLiteralDfa1_0(0x0L, 0x1800000800000000L, 0x3L); + case 63: + return jjStopAtPos(0, 95); + case 64: + return jjStopAtPos(0, 90); + case 91: + return jjStopAtPos(0, 85); + case 93: + return jjStopAtPos(0, 86); + case 94: + jjmatchedKind = 111; + return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000000000L, 0x0L); + case 97: + return jjMoveStringLiteralDfa1_0(0x3000L, 0x0L, 0x0L); + case 98: + return jjMoveStringLiteralDfa1_0(0x1c000L, 0x0L, 0x0L); + case 99: + return jjMoveStringLiteralDfa1_0(0x7e0000L, 0x0L, 0x0L); + case 100: + return jjMoveStringLiteralDfa1_0(0x3800000L, 0x0L, 0x0L); + case 101: + return jjMoveStringLiteralDfa1_0(0x1c000000L, 0x0L, 0x0L); + case 102: + return jjMoveStringLiteralDfa1_0(0x3e0000000L, 0x0L, 0x0L); + case 103: + return jjMoveStringLiteralDfa1_0(0x400000000L, 0x0L, 0x0L); + case 105: + return jjMoveStringLiteralDfa1_0(0x1f800000000L, 0x0L, 0x0L); + case 108: + return jjMoveStringLiteralDfa1_0(0x20000000000L, 0x0L, 0x0L); + case 110: + return jjMoveStringLiteralDfa1_0(0x1c0000000000L, 0x0L, 0x0L); + case 112: + return jjMoveStringLiteralDfa1_0(0x1e00000000000L, 0x0L, 0x0L); + case 114: + return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x0L, 0x0L); + case 115: + return jjMoveStringLiteralDfa1_0(0xfc000000000000L, 0x0L, 0x0L); + case 116: + return jjMoveStringLiteralDfa1_0(0x3f00000000000000L, 0x0L, 0x0L); + case 118: + return jjMoveStringLiteralDfa1_0(0xc000000000000000L, 0x0L, 0x0L); + case 119: + return jjMoveStringLiteralDfa1_0(0x0L, 0x1L, 0x0L); + case 123: + return jjStopAtPos(0, 83); + case 124: + jjmatchedKind = 110; + return jjMoveStringLiteralDfa1_0(0x0L, 0x80002000000000L, 0x0L); + case 125: + return jjStopAtPos(0, 84); + case 126: + return jjStopAtPos(0, 94); + default : + return jjMoveNfa_0(0, 0); + } +} +private int jjMoveStringLiteralDfa1_0(long active0, long active1, long active2) +{ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0, active1, active2); + return 1; + } + switch(curChar) + { + case 38: + if ((active1 & 0x4000000000L) != 0L) + return jjStopAtPos(1, 102); + break; + case 42: + if ((active0 & 0x100L) != 0L) + return jjStartNfaWithStates_0(1, 8, 50); + break; + case 43: + if ((active1 & 0x8000000000L) != 0L) + return jjStopAtPos(1, 103); + break; + case 45: + if ((active1 & 0x10000000000L) != 0L) + return jjStopAtPos(1, 104); + break; + case 46: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000000L, active2, 0L); + case 58: + if ((active1 & 0x8000000000000000L) != 0L) + return jjStopAtPos(1, 127); + break; + case 60: + if ((active1 & 0x2000000000000L) != 0L) + { + jjmatchedKind = 113; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x400000000000000L, active2, 0L); + case 61: + if ((active1 & 0x200000000L) != 0L) + return jjStopAtPos(1, 97); + else if ((active1 & 0x400000000L) != 0L) + return jjStopAtPos(1, 98); + else if ((active1 & 0x800000000L) != 0L) + return jjStopAtPos(1, 99); + else if ((active1 & 0x1000000000L) != 0L) + return jjStopAtPos(1, 100); + else if ((active1 & 0x4000000000000L) != 0L) + return jjStopAtPos(1, 114); + else if ((active1 & 0x8000000000000L) != 0L) + return jjStopAtPos(1, 115); + else if ((active1 & 0x10000000000000L) != 0L) + return jjStopAtPos(1, 116); + else if ((active1 & 0x20000000000000L) != 0L) + return jjStopAtPos(1, 117); + else if ((active1 & 0x40000000000000L) != 0L) + return jjStopAtPos(1, 118); + else if ((active1 & 0x80000000000000L) != 0L) + return jjStopAtPos(1, 119); + else if ((active1 & 0x100000000000000L) != 0L) + return jjStopAtPos(1, 120); + else if ((active1 & 0x200000000000000L) != 0L) + return jjStopAtPos(1, 121); + break; + case 62: + if ((active1 & 0x4000000000000000L) != 0L) + return jjStopAtPos(1, 126); + else if ((active2 & 0x2L) != 0L) + { + jjmatchedKind = 129; + jjmatchedPos = 1; + } + else if ((active2 & 0x10L) != 0L) + return jjStopAtPos(1, 132); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1800000000000000L, active2, 0x1L); + case 97: + return jjMoveStringLiteralDfa2_0(active0, 0x240020060000L, active1, 0L, active2, 0L); + case 98: + return jjMoveStringLiteralDfa2_0(active0, 0x1000L, active1, 0L, active2, 0L); + case 101: + return jjMoveStringLiteralDfa2_0(active0, 0x2080000800000L, active1, 0L, active2, 0L); + case 102: + if ((active0 & 0x800000000L) != 0L) + return jjStartNfaWithStates_0(1, 35, 43); + break; + case 104: + return jjMoveStringLiteralDfa2_0(active0, 0x704000000080000L, active1, 0x1L, active2, 0L); + case 105: + return jjMoveStringLiteralDfa2_0(active0, 0xc0000000L, active1, 0L, active2, 0L); + case 108: + return jjMoveStringLiteralDfa2_0(active0, 0x104100000L, active1, 0L, active2, 0L); + case 109: + return jjMoveStringLiteralDfa2_0(active0, 0x3000000000L, active1, 0L, active2, 0L); + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x1c008000000L, active1, 0L, active2, 0L); + case 111: + if ((active0 & 0x1000000L) != 0L) + { + jjmatchedKind = 24; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0xc000020602604000L, active1, 0L, active2, 0L); + case 114: + return jjMoveStringLiteralDfa2_0(active0, 0x3800c00000008000L, active1, 0L, active2, 0L); + case 115: + return jjMoveStringLiteralDfa2_0(active0, 0x2000L, active1, 0L, active2, 0L); + case 116: + return jjMoveStringLiteralDfa2_0(active0, 0x18000000000000L, active1, 0L, active2, 0L); + case 117: + return jjMoveStringLiteralDfa2_0(active0, 0x21100000000000L, active1, 0L, active2, 0L); + case 119: + return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L, active2, 0L); + case 120: + return jjMoveStringLiteralDfa2_0(active0, 0x10000000L, active1, 0L, active2, 0L); + case 121: + return jjMoveStringLiteralDfa2_0(active0, 0x80000000010000L, active1, 0L, active2, 0L); + case 124: + if ((active1 & 0x2000000000L) != 0L) + return jjStopAtPos(1, 101); + break; + default : + break; + } + return jjStartNfa_0(0, active0, active1, active2); +} +private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1, long old2, long active2) +{ + if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) + return jjStartNfa_0(0, old0, old1, old2); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0, active1, active2); + return 2; + } + switch(curChar) + { + case 46: + if ((active1 & 0x2000000000000000L) != 0L) + return jjStopAtPos(2, 125); + break; + case 61: + if ((active1 & 0x400000000000000L) != 0L) + return jjStopAtPos(2, 122); + else if ((active1 & 0x800000000000000L) != 0L) + return jjStopAtPos(2, 123); + break; + case 62: + if ((active2 & 0x1L) != 0L) + { + jjmatchedKind = 128; + jjmatchedPos = 2; + } + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x1000000000000000L, active2, 0L); + case 97: + return jjMoveStringLiteralDfa3_0(active0, 0x808000000180000L, active1, 0L, active2, 0L); + case 98: + return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0L, active2, 0L); + case 99: + return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L, active2, 0L); + case 101: + return jjMoveStringLiteralDfa3_0(active0, 0x8000L, active1, 0L, active2, 0L); + case 102: + return jjMoveStringLiteralDfa3_0(active0, 0x800000L, active1, 0L, active2, 0L); + case 105: + return jjMoveStringLiteralDfa3_0(active0, 0x4140400000000000L, active1, 0x1L, active2, 0L); + case 108: + return jjMoveStringLiteralDfa3_0(active0, 0x8000100020000000L, active1, 0L, active2, 0L); + case 110: + return jjMoveStringLiteralDfa3_0(active0, 0x800200c0600000L, active1, 0L, active2, 0L); + case 111: + return jjMoveStringLiteralDfa3_0(active0, 0x4800100004000L, active1, 0L, active2, 0L); + case 112: + return jjMoveStringLiteralDfa3_0(active0, 0x20003000000000L, active1, 0L, active2, 0L); + case 114: + if ((active0 & 0x200000000L) != 0L) + return jjStartNfaWithStates_0(2, 33, 43); + return jjMoveStringLiteralDfa3_0(active0, 0x610000000000000L, active1, 0L, active2, 0L); + case 115: + return jjMoveStringLiteralDfa3_0(active0, 0x4004023000L, active1, 0L, active2, 0L); + case 116: + if ((active0 & 0x8000000000L) != 0L) + { + jjmatchedKind = 39; + jjmatchedPos = 2; + } + return jjMoveStringLiteralDfa3_0(active0, 0x2050410050000L, active1, 0L, active2, 0L); + case 117: + return jjMoveStringLiteralDfa3_0(active0, 0x100000000a000000L, active1, 0L, active2, 0L); + case 119: + if ((active0 & 0x80000000000L) != 0L) + return jjStartNfaWithStates_0(2, 43, 43); + break; + case 121: + if ((active0 & 0x2000000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 61, 43); + break; + default : + break; + } + return jjStartNfa_0(1, active0, active1, active2); +} +private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1, long old2, long active2) +{ + if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) + return jjStartNfa_0(1, old0, old1, old2); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0, active1, 0L); + return 3; + } + switch(curChar) + { + case 61: + if ((active1 & 0x1000000000000000L) != 0L) + return jjStopAtPos(3, 124); + break; + case 97: + return jjMoveStringLiteralDfa4_0(active0, 0x80000001c0808000L, active1, 0L); + case 98: + return jjMoveStringLiteralDfa4_0(active0, 0x2000000L, active1, 0L); + case 99: + return jjMoveStringLiteralDfa4_0(active0, 0x80000000040000L, active1, 0L); + case 100: + if ((active0 & 0x4000000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 62, 43); + break; + case 101: + if ((active0 & 0x10000L) != 0L) + return jjStartNfaWithStates_0(3, 16, 43); + else if ((active0 & 0x20000L) != 0L) + return jjStartNfaWithStates_0(3, 17, 43); + else if ((active0 & 0x4000000L) != 0L) + return jjStartNfaWithStates_0(3, 26, 43); + else if ((active0 & 0x1000000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 60, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x20010010002000L, active1, 0L); + case 103: + if ((active0 & 0x20000000000L) != 0L) + return jjStartNfaWithStates_0(3, 41, 43); + break; + case 105: + return jjMoveStringLiteralDfa4_0(active0, 0x10040000000000L, active1, 0L); + case 107: + return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L); + case 108: + if ((active0 & 0x100000000000L) != 0L) + return jjStartNfaWithStates_0(3, 44, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x1001000004000L, active1, 0x1L); + case 109: + if ((active0 & 0x8000000L) != 0L) + return jjStartNfaWithStates_0(3, 27, 43); + break; + case 110: + return jjMoveStringLiteralDfa4_0(active0, 0x800000000000000L, active1, 0L); + case 111: + if ((active0 & 0x400000000L) != 0L) + return jjStartNfaWithStates_0(3, 34, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x600002000000000L, active1, 0L); + case 114: + if ((active0 & 0x80000L) != 0L) + return jjStartNfaWithStates_0(3, 19, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L); + case 115: + if ((active0 & 0x100000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 56, 43); + return jjMoveStringLiteralDfa4_0(active0, 0x20300000L, active1, 0L); + case 116: + return jjMoveStringLiteralDfa4_0(active0, 0x48804000401000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000L, active1, 0L); + case 118: + return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L); + default : + break; + } + return jjStartNfa_0(2, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) +{ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(2, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0, active1, 0L); + return 4; + } + switch(curChar) + { + case 97: + return jjMoveStringLiteralDfa5_0(active0, 0x604000000000L, active1, 0L); + case 99: + return jjMoveStringLiteralDfa5_0(active0, 0x50000000000000L, active1, 0L); + case 101: + if ((active0 & 0x20000000L) != 0L) + return jjStartNfaWithStates_0(4, 29, 43); + else if ((active1 & 0x1L) != 0L) + return jjStartNfaWithStates_0(4, 64, 43); + return jjMoveStringLiteralDfa5_0(active0, 0x801000004000L, active1, 0L); + case 104: + if ((active0 & 0x40000L) != 0L) + return jjStartNfaWithStates_0(4, 18, 43); + return jjMoveStringLiteralDfa5_0(active0, 0x80000000000000L, active1, 0L); + case 105: + return jjMoveStringLiteralDfa5_0(active0, 0x9000000400000L, active1, 0L); + case 107: + if ((active0 & 0x8000L) != 0L) + return jjStartNfaWithStates_0(4, 15, 43); + break; + case 108: + if ((active0 & 0x40000000L) != 0L) + { + jjmatchedKind = 30; + jjmatchedPos = 4; + } + return jjMoveStringLiteralDfa5_0(active0, 0x82000000L, active1, 0L); + case 110: + return jjMoveStringLiteralDfa5_0(active0, 0x10000000L, active1, 0L); + case 114: + if ((active0 & 0x20000000000000L) != 0L) + return jjStartNfaWithStates_0(4, 53, 43); + return jjMoveStringLiteralDfa5_0(active0, 0x2012000003000L, active1, 0L); + case 115: + if ((active0 & 0x100000L) != 0L) + return jjStartNfaWithStates_0(4, 20, 43); + return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L); + case 116: + if ((active0 & 0x200000L) != 0L) + return jjStartNfaWithStates_0(4, 21, 43); + else if ((active0 & 0x100000000L) != 0L) + return jjStartNfaWithStates_0(4, 32, 43); + else if ((active0 & 0x4000000000000L) != 0L) + return jjStartNfaWithStates_0(4, 50, 43); + return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa5_0(active0, 0x800000L, active1, 0L); + case 118: + return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); + case 119: + if ((active0 & 0x200000000000000L) != 0L) + { + jjmatchedKind = 57; + jjmatchedPos = 4; + } + return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); + default : + break; + } + return jjStartNfa_0(3, active0, active1, 0L); +} +private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) +{ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(3, old0, old1, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0, 0L, 0L); + return 5; + } + switch(curChar) + { + case 97: + return jjMoveStringLiteralDfa6_0(active0, 0x5000L); + case 99: + if ((active0 & 0x1000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 48, 43); + else if ((active0 & 0x8000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 51, 43); + return jjMoveStringLiteralDfa6_0(active0, 0x800000000000L); + case 100: + return jjMoveStringLiteralDfa6_0(active0, 0x10000000L); + case 101: + if ((active0 & 0x2000000L) != 0L) + return jjStartNfaWithStates_0(5, 25, 43); + else if ((active0 & 0x40000000000L) != 0L) + return jjStartNfaWithStates_0(5, 42, 43); + break; + case 102: + return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); + case 103: + return jjMoveStringLiteralDfa6_0(active0, 0x200000000000L); + case 104: + if ((active0 & 0x40000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 54, 43); + break; + case 105: + return jjMoveStringLiteralDfa6_0(active0, 0x8800000000000000L); + case 108: + return jjMoveStringLiteralDfa6_0(active0, 0x80800000L); + case 109: + return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L); + case 110: + if ((active0 & 0x2000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 49, 43); + return jjMoveStringLiteralDfa6_0(active0, 0x4000400000L); + case 114: + return jjMoveStringLiteralDfa6_0(active0, 0x80000000000000L); + case 115: + if ((active0 & 0x400000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 58, 43); + break; + case 116: + if ((active0 & 0x2000L) != 0L) + return jjStartNfaWithStates_0(5, 13, 43); + else if ((active0 & 0x2000000000L) != 0L) + return jjStartNfaWithStates_0(5, 37, 43); + return jjMoveStringLiteralDfa6_0(active0, 0x10400000000000L); + default : + break; + } + return jjStartNfa_0(4, active0, 0L, 0L); +} +private int jjMoveStringLiteralDfa6_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(4, old0, 0L, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(5, active0, 0L, 0L); + return 6; + } + switch(curChar) + { + case 97: + return jjMoveStringLiteralDfa7_0(active0, 0x10000000000L); + case 99: + return jjMoveStringLiteralDfa7_0(active0, 0x4000001000L); + case 101: + if ((active0 & 0x200000000000L) != 0L) + return jjStartNfaWithStates_0(6, 45, 43); + else if ((active0 & 0x400000000000L) != 0L) + return jjStartNfaWithStates_0(6, 46, 43); + return jjMoveStringLiteralDfa7_0(active0, 0x800001000000000L); + case 102: + return jjMoveStringLiteralDfa7_0(active0, 0x10000000000000L); + case 108: + return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L); + case 110: + if ((active0 & 0x4000L) != 0L) + return jjStartNfaWithStates_0(6, 14, 43); + break; + case 111: + return jjMoveStringLiteralDfa7_0(active0, 0x80000000000000L); + case 115: + if ((active0 & 0x10000000L) != 0L) + return jjStartNfaWithStates_0(6, 28, 43); + break; + case 116: + if ((active0 & 0x800000L) != 0L) + return jjStartNfaWithStates_0(6, 23, 43); + return jjMoveStringLiteralDfa7_0(active0, 0x800000000000L); + case 117: + return jjMoveStringLiteralDfa7_0(active0, 0x400000L); + case 121: + if ((active0 & 0x80000000L) != 0L) + return jjStartNfaWithStates_0(6, 31, 43); + break; + default : + break; + } + return jjStartNfa_0(5, active0, 0L, 0L); +} +private int jjMoveStringLiteralDfa7_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(5, old0, 0L, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(6, active0, 0L, 0L); + return 7; + } + switch(curChar) + { + case 99: + return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L); + case 101: + if ((active0 & 0x400000L) != 0L) + return jjStartNfaWithStates_0(7, 22, 43); + else if ((active0 & 0x8000000000000000L) != 0L) + return jjStartNfaWithStates_0(7, 63, 43); + return jjMoveStringLiteralDfa8_0(active0, 0x804000000000L); + case 110: + return jjMoveStringLiteralDfa8_0(active0, 0x880001000000000L); + case 112: + if ((active0 & 0x10000000000000L) != 0L) + return jjStartNfaWithStates_0(7, 52, 43); + break; + case 116: + if ((active0 & 0x1000L) != 0L) + return jjStartNfaWithStates_0(7, 12, 43); + break; + default : + break; + } + return jjStartNfa_0(6, active0, 0L, 0L); +} +private int jjMoveStringLiteralDfa8_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(6, old0, 0L, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(7, active0, 0L, 0L); + return 8; + } + switch(curChar) + { + case 100: + if ((active0 & 0x800000000000L) != 0L) + return jjStartNfaWithStates_0(8, 47, 43); + break; + case 101: + if ((active0 & 0x10000000000L) != 0L) + return jjStartNfaWithStates_0(8, 40, 43); + break; + case 105: + return jjMoveStringLiteralDfa9_0(active0, 0x80000000000000L); + case 111: + return jjMoveStringLiteralDfa9_0(active0, 0x4000000000L); + case 116: + if ((active0 & 0x800000000000000L) != 0L) + return jjStartNfaWithStates_0(8, 59, 43); + return jjMoveStringLiteralDfa9_0(active0, 0x1000000000L); + default : + break; + } + return jjStartNfa_0(7, active0, 0L, 0L); +} +private int jjMoveStringLiteralDfa9_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(7, old0, 0L, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(8, active0, 0L, 0L); + return 9; + } + switch(curChar) + { + case 102: + if ((active0 & 0x4000000000L) != 0L) + return jjStartNfaWithStates_0(9, 38, 43); + break; + case 115: + if ((active0 & 0x1000000000L) != 0L) + return jjStartNfaWithStates_0(9, 36, 43); + break; + case 122: + return jjMoveStringLiteralDfa10_0(active0, 0x80000000000000L); + default : + break; + } + return jjStartNfa_0(8, active0, 0L, 0L); +} +private int jjMoveStringLiteralDfa10_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(8, old0, 0L, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(9, active0, 0L, 0L); + return 10; + } + switch(curChar) + { + case 101: + return jjMoveStringLiteralDfa11_0(active0, 0x80000000000000L); + default : + break; + } + return jjStartNfa_0(9, active0, 0L, 0L); +} +private int jjMoveStringLiteralDfa11_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(9, old0, 0L, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(10, active0, 0L, 0L); + return 11; + } + switch(curChar) + { + case 100: + if ((active0 & 0x80000000000000L) != 0L) + return jjStartNfaWithStates_0(11, 55, 43); + break; + default : + break; + } + return jjStartNfa_0(10, active0, 0L, 0L); +} +private int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +static final long[] jjbitVec0 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec2 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec3 = { + 0xfff0000000200002L, 0xffffffffffffdfffL, 0xfffff00f7fffffffL, 0x12000000007fffffL +}; +static final long[] jjbitVec4 = { + 0x0L, 0x0L, 0x420043c00000000L, 0xff7fffffff7fffffL +}; +static final long[] jjbitVec5 = { + 0x7fffffffffffffL, 0xffffffffffff0000L, 0xffffffffffffffffL, 0x401f0003ffc3L +}; +static final long[] jjbitVec6 = { + 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xfbfffffffff7fffL +}; +static final long[] jjbitVec7 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc03L, 0x33fffffffff7fffL +}; +static final long[] jjbitVec8 = { + 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L +}; +static final long[] jjbitVec9 = { + 0x7fffffe00000000L, 0xfffec000000007ffL, 0xffffffffffffffffL, 0x9c00c060002fffffL +}; +static final long[] jjbitVec10 = { + 0xfffffffd0000L, 0xe000L, 0x2003fffffffffL, 0x0L +}; +static final long[] jjbitVec11 = { + 0x23fffffffffffff0L, 0x3ff010000L, 0x23c5fdfffff99fe0L, 0xf0003b0000000L +}; +static final long[] jjbitVec12 = { + 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbbfe0L, 0x2000300010000L +}; +static final long[] jjbitVec13 = { + 0x23edfdfffff99fe0L, 0x20003b0000000L, 0x3bfc718d63dc7e8L, 0x200000000000000L +}; +static final long[] jjbitVec14 = { + 0x3effdfffffddfe0L, 0x300000000L, 0x23effdfffffddfe0L, 0x340000000L +}; +static final long[] jjbitVec15 = { + 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL +}; +static final long[] jjbitVec16 = { + 0x800dfffffffffffeL, 0x7fL, 0x200decaefef02596L, 0x3000005fL +}; +static final long[] jjbitVec17 = { + 0x1L, 0x7fffffffeffL, 0xf00L, 0x0L +}; +static final long[] jjbitVec18 = { + 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x1ffffffffff003fL +}; +static final long[] jjbitVec19 = { + 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL +}; +static final long[] jjbitVec20 = { + 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL +}; +static final long[] jjbitVec21 = { + 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL +}; +static final long[] jjbitVec22 = { + 0xffffffffffffffffL, 0x7f9fffffffffffL, 0xffffffff07fffffeL, 0x1c7ffffffffffL +}; +static final long[] jjbitVec23 = { + 0x3ffff0003dfffL, 0x1dfff0003ffffL, 0xfffffffffffffL, 0x18800000L +}; +static final long[] jjbitVec24 = { + 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L +}; +static final long[] jjbitVec25 = { + 0x1fffffffL, 0x1f3fffffff0000L, 0x0L, 0x0L +}; +static final long[] jjbitVec26 = { + 0xffffffffffffffffL, 0xfffffffffffL, 0x0L, 0x0L +}; +static final long[] jjbitVec27 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL +}; +static final long[] jjbitVec28 = { + 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL +}; +static final long[] jjbitVec29 = { + 0x8000000000000000L, 0x8002000000100001L, 0x3ffff00000000L, 0x0L +}; +static final long[] jjbitVec30 = { + 0xe3fbbd503e2ffc84L, 0xffffffff000003e0L, 0xfL, 0x0L +}; +static final long[] jjbitVec31 = { + 0x1f3e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffee07fffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec32 = { + 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0xffff000000000000L +}; +static final long[] jjbitVec33 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffL, 0x0L +}; +static final long[] jjbitVec34 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L +}; +static final long[] jjbitVec35 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L +}; +static final long[] jjbitVec36 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L +}; +static final long[] jjbitVec37 = { + 0x6L, 0x0L, 0x0L, 0x0L +}; +static final long[] jjbitVec38 = { + 0xffff3fffffffffffL, 0x7ffffffffffL, 0x0L, 0x0L +}; +static final long[] jjbitVec39 = { + 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L +}; +static final long[] jjbitVec40 = { + 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0x1fff0000000000ffL +}; +static final long[] jjbitVec41 = { + 0x18000000000000L, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL +}; +static final long[] jjbitVec42 = { + 0x87fffffe00000010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x631cfcfcfcL +}; +static final long[] jjbitVec43 = { + 0x0L, 0x0L, 0x420243cffffffffL, 0xff7fffffff7fffffL +}; +static final long[] jjbitVec44 = { + 0xffffffffffffffffL, 0x400ffffe0ffffffL, 0xfffffffbffffd740L, 0xfbfffffffff7fffL +}; +static final long[] jjbitVec45 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc7bL, 0x33fffffffff7fffL +}; +static final long[] jjbitVec46 = { + 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L +}; +static final long[] jjbitVec47 = { + 0x7fffffe003f000fL, 0xffffc3ff01ffffffL, 0xffffffffffffffffL, 0x9ffffdffbfefffffL +}; +static final long[] jjbitVec48 = { + 0xffffffffffff8000L, 0xe7ffL, 0x3ffffffffffffL, 0x0L +}; +static final long[] jjbitVec49 = { + 0xf3fffffffffffffeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0xfffcfb080399fL +}; +static final long[] jjbitVec50 = { + 0xd36dfdfffff987eeL, 0x1fffc05e003987L, 0xf3edfdfffffbbfeeL, 0x2ffcf00013bbfL +}; +static final long[] jjbitVec51 = { + 0xf3edfdfffff99feeL, 0x2ffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0x200ff8000803dc7L +}; +static final long[] jjbitVec52 = { + 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xf3effdfffffddfecL, 0xffc340603ddfL +}; +static final long[] jjbitVec53 = { + 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL +}; +static final long[] jjbitVec54 = { + 0x87fffffffffffffeL, 0x3ff7fffL, 0x3bffecaefef02596L, 0x33ff3f5fL +}; +static final long[] jjbitVec55 = { + 0xc2a003ff03000001L, 0xfffe07fffffffeffL, 0x1ffffffffeff0fdfL, 0x40L +}; +static final long[] jjbitVec56 = { + 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x1ffffffffff003fL +}; +static final long[] jjbitVec57 = { + 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL +}; +static final long[] jjbitVec58 = { + 0x1fffff001fdfffL, 0xddfff000fffffL, 0xffffffffffffffffL, 0x3ff388fffffL +}; +static final long[] jjbitVec59 = { + 0xffffffff03ff3800L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L +}; +static final long[] jjbitVec60 = { + 0xfff0fff1fffffffL, 0x1f3fffffffffc0L, 0x0L, 0x0L +}; +static final long[] jjbitVec61 = { + 0x80007c000000f000L, 0x8002fc0f00100001L, 0x3ffff00000000L, 0x7e21fff0000L +}; +static final long[] jjbitVec62 = { + 0x1f3efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffee67fffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec63 = { + 0x10000000000006L, 0x0L, 0x0L, 0x0L +}; +static final long[] jjbitVec64 = { + 0x3L, 0x0L, 0x0L, 0x0L +}; +static final long[] jjbitVec65 = { + 0x0L, 0x800000000000000L, 0x0L, 0x0L +}; +static final long[] jjbitVec66 = { + 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L +}; +static final long[] jjbitVec67 = { + 0x18000f0000ffffL, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x9fffffffffffffffL +}; +static final long[] jjbitVec68 = { + 0x87fffffe03ff0010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0xe0000631cfcfcfcL +}; +private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 130; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + do + { + switch(jjstateSet[--i]) + { + case 45: + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 50; + else if (curChar == 47) + { + if (kind > 6) + kind = 6; + jjCheckNAddStates(0, 2); + } + break; + case 0: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 66) + kind = 66; + jjCheckNAddStates(3, 17); + } + else if (curChar == 47) + jjAddStates(18, 19); + else if (curChar == 36) + { + if (kind > 78) + kind = 78; + jjCheckNAdd(43); + } + else if (curChar == 34) + jjCheckNAddStates(20, 23); + else if (curChar == 39) + jjAddStates(24, 26); + else if (curChar == 46) + jjCheckNAdd(1); + if (curChar == 48) + jjAddStates(27, 34); + break; + case 1: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(35, 38); + break; + case 2: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(2, 3); + break; + case 3: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(39, 41); + break; + case 5: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(6); + break; + case 6: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(42, 44); + break; + case 7: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(7, 8); + break; + case 8: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(6, 9); + break; + case 10: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(45, 48); + break; + case 11: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(49, 53); + break; + case 12: + if (curChar == 39) + jjAddStates(24, 26); + break; + case 13: + if ((0xffffff7fffffdbffL & l) != 0L) + jjCheckNAdd(14); + break; + case 14: + if (curChar == 39 && kind > 76) + kind = 76; + break; + case 16: + if ((0x8400000000L & l) != 0L) + jjCheckNAdd(14); + break; + case 17: + if ((0xff000000000000L & l) != 0L) + jjCheckNAddTwoStates(18, 14); + break; + case 18: + if ((0xff000000000000L & l) != 0L) + jjCheckNAdd(14); + break; + case 19: + if ((0xf000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 20; + break; + case 20: + if ((0xff000000000000L & l) != 0L) + jjCheckNAdd(18); + break; + case 22: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 23; + break; + case 23: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 24; + break; + case 24: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 25; + break; + case 25: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAdd(14); + break; + case 27: + if (curChar == 34) + jjCheckNAddStates(20, 23); + break; + case 28: + if ((0xfffffffbffffdbffL & l) != 0L) + jjCheckNAddStates(20, 23); + break; + case 30: + if ((0x8400000000L & l) != 0L) + jjCheckNAddStates(20, 23); + break; + case 32: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 33: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 34: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 35: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(20, 23); + break; + case 37: + if (curChar == 34 && kind > 77) + kind = 77; + break; + case 38: + if ((0xff000000000000L & l) != 0L) + jjCheckNAddStates(54, 58); + break; + case 39: + if ((0xff000000000000L & l) != 0L) + jjCheckNAddStates(20, 23); + break; + case 40: + if ((0xf000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 41; + break; + case 41: + if ((0xff000000000000L & l) != 0L) + jjCheckNAdd(39); + break; + case 42: + if (curChar != 36) + break; + if (kind > 78) + kind = 78; + jjCheckNAdd(43); + break; + case 43: + if ((0x3ff00100fffc1ffL & l) == 0L) + break; + if (kind > 78) + kind = 78; + jjCheckNAdd(43); + break; + case 44: + if (curChar == 47) + jjAddStates(18, 19); + break; + case 46: + if ((0xffffffffffffdbffL & l) == 0L) + break; + if (kind > 6) + kind = 6; + jjCheckNAddStates(0, 2); + break; + case 47: + if ((0x2400L & l) != 0L && kind > 6) + kind = 6; + break; + case 48: + if (curChar == 10 && kind > 6) + kind = 6; + break; + case 49: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 48; + break; + case 50: + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 51; + break; + case 51: + if ((0xffff7fffffffffffL & l) != 0L && kind > 7) + kind = 7; + break; + case 52: + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 50; + break; + case 53: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 66) + kind = 66; + jjCheckNAddStates(3, 17); + break; + case 54: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(54, 55); + break; + case 55: + case 98: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAdd(56); + break; + case 57: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(57, 58); + break; + case 58: + case 109: + if ((0x3ff000000000000L & l) != 0L && kind > 66) + kind = 66; + break; + case 59: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(59, 60); + break; + case 60: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(59, 61); + break; + case 61: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(62, 65); + break; + case 63: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(64); + break; + case 64: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(66, 68); + break; + case 65: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(65, 66); + break; + case 66: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(64, 9); + break; + case 67: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(69, 72); + break; + case 68: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(73, 77); + break; + case 69: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(69, 70); + break; + case 70: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(71, 72); + break; + case 71: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(78, 80); + break; + case 73: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(74); + break; + case 74: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(81, 83); + break; + case 75: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(75, 76); + break; + case 76: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(74, 9); + break; + case 77: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(84, 87); + break; + case 78: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(88, 91); + break; + case 79: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(79, 80); + break; + case 80: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(81, 82); + break; + case 81: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(92, 94); + break; + case 82: + if (curChar != 46) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(95, 97); + break; + case 83: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(98, 101); + break; + case 84: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(84, 85); + break; + case 85: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(95, 97); + break; + case 87: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(88); + break; + case 88: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(102, 104); + break; + case 89: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(89, 90); + break; + case 90: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(88, 9); + break; + case 91: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(105, 108); + break; + case 92: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddStates(109, 113); + break; + case 93: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(114, 117); + break; + case 94: + if (curChar == 48) + jjAddStates(27, 34); + break; + case 96: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(118, 120); + break; + case 97: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(97, 98); + break; + case 99: + if ((0xff000000000000L & l) != 0L) + jjCheckNAddStates(121, 123); + break; + case 100: + if ((0xff000000000000L & l) != 0L) + jjCheckNAddTwoStates(100, 101); + break; + case 101: + if ((0xff000000000000L & l) != 0L) + jjCheckNAdd(56); + break; + case 103: + if ((0x3000000000000L & l) != 0L) + jjCheckNAddStates(124, 126); + break; + case 104: + if ((0x3000000000000L & l) != 0L) + jjCheckNAddTwoStates(104, 105); + break; + case 105: + if ((0x3000000000000L & l) != 0L) + jjCheckNAdd(56); + break; + case 107: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 66) + kind = 66; + jjCheckNAddTwoStates(108, 109); + break; + case 108: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(108, 109); + break; + case 110: + if ((0xff000000000000L & l) == 0L) + break; + if (kind > 66) + kind = 66; + jjCheckNAddTwoStates(111, 112); + break; + case 111: + if ((0xff000000000000L & l) != 0L) + jjCheckNAddTwoStates(111, 112); + break; + case 112: + if ((0xff000000000000L & l) != 0L && kind > 66) + kind = 66; + break; + case 114: + if ((0x3000000000000L & l) == 0L) + break; + if (kind > 66) + kind = 66; + jjCheckNAddTwoStates(115, 116); + break; + case 115: + if ((0x3000000000000L & l) != 0L) + jjCheckNAddTwoStates(115, 116); + break; + case 116: + if ((0x3000000000000L & l) != 0L && kind > 66) + kind = 66; + break; + case 118: + if ((0x3ff000000000000L & l) != 0L) + jjAddStates(127, 128); + break; + case 119: + if (curChar == 46) + jjCheckNAdd(120); + break; + case 120: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(120, 121); + break; + case 122: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(123); + break; + case 123: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(123, 9); + break; + case 125: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(129, 131); + break; + case 126: + if (curChar == 46) + jjCheckNAdd(127); + break; + case 128: + if ((0x280000000000L & l) != 0L) + jjCheckNAdd(129); + break; + case 129: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(129, 9); + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 0: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 78) + kind = 78; + jjCheckNAdd(43); + break; + case 2: + if (curChar == 95) + jjAddStates(132, 133); + break; + case 4: + if ((0x2000000020L & l) != 0L) + jjAddStates(134, 135); + break; + case 7: + if (curChar == 95) + jjAddStates(136, 137); + break; + case 9: + if ((0x5000000050L & l) != 0L && kind > 71) + kind = 71; + break; + case 13: + if ((0xffffffffefffffffL & l) != 0L) + jjCheckNAdd(14); + break; + case 15: + if (curChar == 92) + jjAddStates(138, 140); + break; + case 16: + if ((0x14404410000000L & l) != 0L) + jjCheckNAdd(14); + break; + case 21: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 22; + break; + case 22: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 23; + break; + case 23: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 24; + break; + case 24: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 25; + break; + case 25: + if ((0x7e0000007eL & l) != 0L) + jjCheckNAdd(14); + break; + case 26: + if (curChar == 92) + jjstateSet[jjnewStateCnt++] = 21; + break; + case 28: + if ((0xffffffffefffffffL & l) != 0L) + jjCheckNAddStates(20, 23); + break; + case 29: + if (curChar == 92) + jjAddStates(141, 143); + break; + case 30: + if ((0x14404410000000L & l) != 0L) + jjCheckNAddStates(20, 23); + break; + case 31: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 32; + break; + case 32: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 33: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 34: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 35: + if ((0x7e0000007eL & l) != 0L) + jjCheckNAddStates(20, 23); + break; + case 36: + if (curChar == 92) + jjstateSet[jjnewStateCnt++] = 31; + break; + case 43: + if ((0x87fffffe87fffffeL & l) == 0L) + break; + if (kind > 78) + kind = 78; + jjCheckNAdd(43); + break; + case 46: + if (kind > 6) + kind = 6; + jjAddStates(0, 2); + break; + case 51: + if (kind > 7) + kind = 7; + break; + case 54: + if (curChar == 95) + jjAddStates(144, 145); + break; + case 56: + if ((0x100000001000L & l) != 0L && kind > 65) + kind = 65; + break; + case 57: + if (curChar == 95) + jjAddStates(146, 147); + break; + case 59: + if (curChar == 95) + jjAddStates(148, 149); + break; + case 62: + if ((0x2000000020L & l) != 0L) + jjAddStates(150, 151); + break; + case 65: + if (curChar == 95) + jjAddStates(152, 153); + break; + case 69: + if (curChar == 95) + jjAddStates(154, 155); + break; + case 72: + if ((0x2000000020L & l) != 0L) + jjAddStates(156, 157); + break; + case 75: + if (curChar == 95) + jjAddStates(158, 159); + break; + case 79: + if (curChar == 95) + jjAddStates(160, 161); + break; + case 84: + if (curChar == 95) + jjAddStates(162, 163); + break; + case 86: + if ((0x2000000020L & l) != 0L) + jjAddStates(164, 165); + break; + case 89: + if (curChar == 95) + jjAddStates(166, 167); + break; + case 95: + if ((0x100000001000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 96; + break; + case 96: + if ((0x7e0000007eL & l) != 0L) + jjCheckNAddStates(118, 120); + break; + case 97: + if ((0x7e8000007eL & l) != 0L) + jjCheckNAddTwoStates(97, 98); + break; + case 98: + if ((0x7e0000007eL & l) != 0L) + jjCheckNAdd(56); + break; + case 100: + if (curChar == 95) + jjAddStates(168, 169); + break; + case 102: + if ((0x400000004L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 103; + break; + case 104: + if (curChar == 95) + jjAddStates(170, 171); + break; + case 106: + if ((0x100000001000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 107; + break; + case 107: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 66) + kind = 66; + jjCheckNAddTwoStates(108, 109); + break; + case 108: + if ((0x7e8000007eL & l) != 0L) + jjCheckNAddTwoStates(108, 109); + break; + case 109: + if ((0x7e0000007eL & l) != 0L && kind > 66) + kind = 66; + break; + case 111: + if (curChar == 95) + jjAddStates(172, 173); + break; + case 113: + if ((0x400000004L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 114; + break; + case 115: + if (curChar == 95) + jjAddStates(174, 175); + break; + case 117: + if ((0x100000001000000L & l) != 0L) + jjCheckNAddTwoStates(118, 119); + break; + case 118: + if ((0x7e0000007eL & l) != 0L) + jjCheckNAddTwoStates(118, 119); + break; + case 120: + if ((0x7e0000007eL & l) != 0L) + jjAddStates(176, 177); + break; + case 121: + if ((0x1000000010000L & l) != 0L) + jjAddStates(178, 179); + break; + case 124: + if ((0x100000001000000L & l) != 0L) + jjCheckNAdd(125); + break; + case 125: + if ((0x7e0000007eL & l) != 0L) + jjCheckNAddStates(129, 131); + break; + case 127: + if ((0x1000000010000L & l) != 0L) + jjAddStates(180, 181); + break; + default : break; + } + } while(i != startsAt); + } + else + { + int hiByte = (int)(curChar >> 8); + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 0: + if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) + break; + if (kind > 78) + kind = 78; + jjCheckNAdd(43); + break; + case 13: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + jjstateSet[jjnewStateCnt++] = 14; + break; + case 28: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + jjAddStates(20, 23); + break; + case 43: + if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) + break; + if (kind > 78) + kind = 78; + jjCheckNAdd(43); + break; + case 46: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 6) + kind = 6; + jjAddStates(0, 2); + break; + case 51: + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 7) + kind = 7; + break; + default : break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 130 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +private int jjMoveStringLiteralDfa0_2() +{ + switch(curChar) + { + case 42: + return jjMoveStringLiteralDfa1_2(0x400L); + default : + return 1; + } +} +private int jjMoveStringLiteralDfa1_2(long active0) +{ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 47: + if ((active0 & 0x400L) != 0L) + return jjStopAtPos(1, 10); + break; + default : + return 2; + } + return 2; +} +private int jjMoveStringLiteralDfa0_1() +{ + switch(curChar) + { + case 42: + return jjMoveStringLiteralDfa1_1(0x200L); + default : + return 1; + } +} +private int jjMoveStringLiteralDfa1_1(long active0) +{ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 47: + if ((active0 & 0x200L) != 0L) + return jjStopAtPos(1, 9); + break; + default : + return 2; + } + return 2; +} +static final int[] jjnextStates = { + 46, 47, 49, 54, 55, 56, 57, 58, 59, 62, 9, 69, 72, 79, 82, 93, + 78, 68, 45, 52, 28, 29, 36, 37, 13, 15, 26, 95, 99, 102, 106, 110, + 113, 117, 124, 2, 4, 9, 11, 1, 4, 9, 7, 9, 10, 6, 7, 9, + 10, 1, 2, 4, 9, 11, 28, 29, 39, 36, 37, 61, 62, 9, 59, 62, + 9, 68, 65, 9, 67, 64, 65, 9, 67, 61, 59, 62, 9, 68, 69, 72, + 78, 75, 9, 77, 74, 75, 9, 77, 71, 69, 72, 78, 79, 82, 93, 83, + 86, 9, 84, 86, 9, 92, 89, 9, 91, 88, 89, 9, 91, 83, 84, 86, + 9, 92, 81, 79, 82, 93, 97, 98, 56, 100, 101, 56, 104, 105, 56, 118, + 119, 125, 126, 127, 2, 3, 5, 6, 7, 8, 16, 17, 19, 30, 38, 40, + 54, 55, 57, 58, 59, 60, 63, 64, 65, 66, 69, 70, 73, 74, 75, 76, + 79, 80, 84, 85, 87, 88, 89, 90, 100, 101, 104, 105, 111, 112, 115, 116, + 120, 121, 122, 123, 128, 129, +}; +private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec2[i2] & l2) != 0L); + default : + if ((jjbitVec0[i1] & l1) != 0L) + return true; + return false; + } +} +private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec4[i2] & l2) != 0L); + case 2: + return ((jjbitVec5[i2] & l2) != 0L); + case 3: + return ((jjbitVec6[i2] & l2) != 0L); + case 4: + return ((jjbitVec7[i2] & l2) != 0L); + case 5: + return ((jjbitVec8[i2] & l2) != 0L); + case 6: + return ((jjbitVec9[i2] & l2) != 0L); + case 7: + return ((jjbitVec10[i2] & l2) != 0L); + case 9: + return ((jjbitVec11[i2] & l2) != 0L); + case 10: + return ((jjbitVec12[i2] & l2) != 0L); + case 11: + return ((jjbitVec13[i2] & l2) != 0L); + case 12: + return ((jjbitVec14[i2] & l2) != 0L); + case 13: + return ((jjbitVec15[i2] & l2) != 0L); + case 14: + return ((jjbitVec16[i2] & l2) != 0L); + case 15: + return ((jjbitVec17[i2] & l2) != 0L); + case 16: + return ((jjbitVec18[i2] & l2) != 0L); + case 17: + return ((jjbitVec19[i2] & l2) != 0L); + case 18: + return ((jjbitVec20[i2] & l2) != 0L); + case 19: + return ((jjbitVec21[i2] & l2) != 0L); + case 20: + return ((jjbitVec0[i2] & l2) != 0L); + case 22: + return ((jjbitVec22[i2] & l2) != 0L); + case 23: + return ((jjbitVec23[i2] & l2) != 0L); + case 24: + return ((jjbitVec24[i2] & l2) != 0L); + case 25: + return ((jjbitVec25[i2] & l2) != 0L); + case 29: + return ((jjbitVec26[i2] & l2) != 0L); + case 30: + return ((jjbitVec27[i2] & l2) != 0L); + case 31: + return ((jjbitVec28[i2] & l2) != 0L); + case 32: + return ((jjbitVec29[i2] & l2) != 0L); + case 33: + return ((jjbitVec30[i2] & l2) != 0L); + case 48: + return ((jjbitVec31[i2] & l2) != 0L); + case 49: + return ((jjbitVec32[i2] & l2) != 0L); + case 77: + return ((jjbitVec33[i2] & l2) != 0L); + case 159: + return ((jjbitVec34[i2] & l2) != 0L); + case 164: + return ((jjbitVec35[i2] & l2) != 0L); + case 215: + return ((jjbitVec36[i2] & l2) != 0L); + case 216: + return ((jjbitVec37[i2] & l2) != 0L); + case 250: + return ((jjbitVec38[i2] & l2) != 0L); + case 251: + return ((jjbitVec39[i2] & l2) != 0L); + case 253: + return ((jjbitVec40[i2] & l2) != 0L); + case 254: + return ((jjbitVec41[i2] & l2) != 0L); + case 255: + return ((jjbitVec42[i2] & l2) != 0L); + default : + if ((jjbitVec3[i1] & l1) != 0L) + return true; + return false; + } +} +private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec43[i2] & l2) != 0L); + case 2: + return ((jjbitVec5[i2] & l2) != 0L); + case 3: + return ((jjbitVec44[i2] & l2) != 0L); + case 4: + return ((jjbitVec45[i2] & l2) != 0L); + case 5: + return ((jjbitVec46[i2] & l2) != 0L); + case 6: + return ((jjbitVec47[i2] & l2) != 0L); + case 7: + return ((jjbitVec48[i2] & l2) != 0L); + case 9: + return ((jjbitVec49[i2] & l2) != 0L); + case 10: + return ((jjbitVec50[i2] & l2) != 0L); + case 11: + return ((jjbitVec51[i2] & l2) != 0L); + case 12: + return ((jjbitVec52[i2] & l2) != 0L); + case 13: + return ((jjbitVec53[i2] & l2) != 0L); + case 14: + return ((jjbitVec54[i2] & l2) != 0L); + case 15: + return ((jjbitVec55[i2] & l2) != 0L); + case 16: + return ((jjbitVec56[i2] & l2) != 0L); + case 17: + return ((jjbitVec19[i2] & l2) != 0L); + case 18: + return ((jjbitVec20[i2] & l2) != 0L); + case 19: + return ((jjbitVec57[i2] & l2) != 0L); + case 20: + return ((jjbitVec0[i2] & l2) != 0L); + case 22: + return ((jjbitVec22[i2] & l2) != 0L); + case 23: + return ((jjbitVec58[i2] & l2) != 0L); + case 24: + return ((jjbitVec59[i2] & l2) != 0L); + case 25: + return ((jjbitVec60[i2] & l2) != 0L); + case 29: + return ((jjbitVec26[i2] & l2) != 0L); + case 30: + return ((jjbitVec27[i2] & l2) != 0L); + case 31: + return ((jjbitVec28[i2] & l2) != 0L); + case 32: + return ((jjbitVec61[i2] & l2) != 0L); + case 33: + return ((jjbitVec30[i2] & l2) != 0L); + case 48: + return ((jjbitVec62[i2] & l2) != 0L); + case 49: + return ((jjbitVec32[i2] & l2) != 0L); + case 77: + return ((jjbitVec33[i2] & l2) != 0L); + case 159: + return ((jjbitVec34[i2] & l2) != 0L); + case 164: + return ((jjbitVec35[i2] & l2) != 0L); + case 215: + return ((jjbitVec36[i2] & l2) != 0L); + case 216: + return ((jjbitVec63[i2] & l2) != 0L); + case 220: + return ((jjbitVec64[i2] & l2) != 0L); + case 221: + return ((jjbitVec65[i2] & l2) != 0L); + case 250: + return ((jjbitVec38[i2] & l2) != 0L); + case 251: + return ((jjbitVec66[i2] & l2) != 0L); + case 253: + return ((jjbitVec40[i2] & l2) != 0L); + case 254: + return ((jjbitVec67[i2] & l2) != 0L); + case 255: + return ((jjbitVec68[i2] & l2) != 0L); + default : + if ((jjbitVec3[i1] & l1) != 0L) + return true; + return false; + } +} - /** - * Constructor. - */ - public ASTParserTokenManager(JavaCharStream stream) { - if (JavaCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - input_stream = stream; - } +/** Token literal values. */ +public static final String[] jjstrLiteralImages = { +"", null, null, null, null, null, null, null, null, null, null, null, +"\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156", +"\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150", +"\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164", +"\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145", +"\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145", +"\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162", +"\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163", +"\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164", +"\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167", +"\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145", +"\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156", +"\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160", +"\163\165\160\145\162", "\163\167\151\164\143\150", +"\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163", +"\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144", +"\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null, +null, null, null, null, null, null, null, "\50", "\51", "\173", "\175", "\133", +"\135", "\73", "\54", "\56", "\100", "\75", "\74", "\41", "\176", "\77", "\72", +"\75\75", "\74\75", "\76\75", "\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", +"\55", "\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\53\75", "\55\75", +"\52\75", "\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", +"\76\76\76\75", "\56\56\56", "\55\76", "\72\72", "\76\76\76", "\76\76", "\76", "\32", +"\74\76", }; - /** - * Constructor. - */ - public ASTParserTokenManager(JavaCharStream stream, int lexState) { - this(stream); - SwitchTo(lexState); - } +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", + "IN_JAVA_DOC_COMMENT", + "IN_MULTI_LINE_COMMENT", +}; - /** - * Reinitialise parser. - */ - public void ReInit(JavaCharStream stream) { - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); - } +/** Lex State array. */ +public static final int[] jjnewLexState = { + -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, +}; +static final long[] jjtoToken = { + 0xfffffffffffff001L, 0xfffffffffffe7087L, 0x1fL, +}; +static final long[] jjtoSkip = { + 0x67eL, 0x0L, 0x0L, +}; +static final long[] jjtoSpecial = { + 0x640L, 0x0L, 0x0L, +}; +static final long[] jjtoMore = { + 0x980L, 0x0L, 0x0L, +}; +protected JavaCharStream input_stream; +private final int[] jjrounds = new int[130]; +private final int[] jjstateSet = new int[260]; +private final StringBuilder jjimage = new StringBuilder(); +private StringBuilder image = jjimage; +private int jjimageLen; +private int lengthOfMatch; +protected char curChar; +/** Constructor. */ +public ASTParserTokenManager(JavaCharStream stream){ + if (JavaCharStream.staticFlag) + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); + input_stream = stream; +} - private void ReInitRounds() { - int i; - jjround = 0x80000001; - for (i = 130; i-- > 0; ) - jjrounds[i] = 0x80000000; - } +/** Constructor. */ +public ASTParserTokenManager(JavaCharStream stream, int lexState){ + this(stream); + SwitchTo(lexState); +} - /** - * Reinitialise parser. - */ - public void ReInit(JavaCharStream stream, int lexState) { - ReInit(stream); - SwitchTo(lexState); - } +/** Reinitialise parser. */ +public void ReInit(JavaCharStream stream) +{ + jjmatchedPos = jjnewStateCnt = 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); +} +private void ReInitRounds() +{ + int i; + jjround = 0x80000001; + for (i = 130; i-- > 0;) + jjrounds[i] = 0x80000000; +} - /** - * Switch to specified lex state. - */ - public void SwitchTo(int lexState) { - if (lexState >= 3 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; - } +/** Reinitialise parser. */ +public void ReInit(JavaCharStream stream, int lexState) +{ + ReInit(stream); + SwitchTo(lexState); +} - protected Token jjFillToken() { - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = ASTParser.GTToken.newToken(jjmatchedKind, curTokenImage); +/** Switch to specified lex state. */ +public void SwitchTo(int lexState) +{ + if (lexState >= 3 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; +} - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; +protected Token jjFillToken() +{ + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = ASTParser.GTToken.newToken(jjmatchedKind, curTokenImage); - return t; - } + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; - int curLexState = 0; - int defaultLexState = 0; - int jjnewStateCnt; - int jjround; - int jjmatchedPos; - int jjmatchedKind; + return t; +} - /** - * Get the next Token. - */ - public Token getNextToken() { - Token specialToken = null; - Token matchedToken; - int curPos = 0; +int curLexState = 0; +int defaultLexState = 0; +int jjnewStateCnt; +int jjround; +int jjmatchedPos; +int jjmatchedKind; - EOFLoop: - for (; ; ) { - try { - curChar = input_stream.BeginToken(); - } catch (java.io.IOException e) { - jjmatchedKind = 0; - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - return matchedToken; - } - image = jjimage; - image.setLength(0); - jjimageLen = 0; +/** Get the next Token. */ +public Token getNextToken() +{ + Token specialToken = null; + Token matchedToken; + int curPos = 0; - for (; ; ) { - switch (curLexState) { - case 0: - try { - input_stream.backup(0); - while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) - curChar = input_stream.BeginToken(); - } catch (java.io.IOException e1) { - continue EOFLoop; - } - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - break; - case 1: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_1(); - if (jjmatchedPos == 0 && jjmatchedKind > 11) { - jjmatchedKind = 11; - } - break; - case 2: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_2(); - if (jjmatchedPos == 0 && jjmatchedKind > 11) { - jjmatchedKind = 11; - } - break; - } - if (jjmatchedKind != 0x7fffffff) { - if (jjmatchedPos + 1 < curPos) - input_stream.backup(curPos - jjmatchedPos - 1); - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - TokenLexicalActions(matchedToken); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - return matchedToken; - } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - matchedToken = jjFillToken(); - if (specialToken == null) - specialToken = matchedToken; - else { - matchedToken.specialToken = specialToken; - specialToken = (specialToken.next = matchedToken); - } - SkipLexicalActions(matchedToken); - } else - SkipLexicalActions(null); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - continue EOFLoop; - } - MoreLexicalActions(); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - curPos = 0; - jjmatchedKind = 0x7fffffff; - try { - curChar = input_stream.readChar(); - continue; - } catch (java.io.IOException e1) { - } - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { - input_stream.readChar(); - input_stream.backup(1); - } catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } - } - } + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(java.io.IOException e) + { + jjmatchedKind = 0; + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + return matchedToken; + } + image = jjimage; + image.setLength(0); + jjimageLen = 0; - void SkipLexicalActions(Token matchedToken) { - switch (jjmatchedKind) { - default: - break; + for (;;) + { + switch(curLexState) + { + case 0: + try { input_stream.backup(0); + while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) + curChar = input_stream.BeginToken(); + } + catch (java.io.IOException e1) { continue EOFLoop; } + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 11) + { + jjmatchedKind = 11; + } + break; + case 2: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_2(); + if (jjmatchedPos == 0 && jjmatchedKind > 11) + { + jjmatchedKind = 11; + } + break; + } + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + TokenLexicalActions(matchedToken); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + return matchedToken; } - } - - void MoreLexicalActions() { - jjimageLen += (lengthOfMatch = jjmatchedPos + 1); - switch (jjmatchedKind) { - case 7: - image.append(input_stream.GetSuffix(jjimageLen)); - jjimageLen = 0; - input_stream.backup(1); - break; - default: - break; + else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + if (specialToken == null) + specialToken = matchedToken; + else + { + matchedToken.specialToken = specialToken; + specialToken = (specialToken.next = matchedToken); + } + SkipLexicalActions(matchedToken); + } + else + SkipLexicalActions(null); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + continue EOFLoop; } - } - - void TokenLexicalActions(Token matchedToken) { - switch (jjmatchedKind) { - case 128: - image.append(jjstrLiteralImages[128]); - lengthOfMatch = jjstrLiteralImages[128].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken) matchedToken).realKind = RUNSIGNEDSHIFT; - input_stream.backup(2); - break; - case 129: - image.append(jjstrLiteralImages[129]); - lengthOfMatch = jjstrLiteralImages[129].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken) matchedToken).realKind = RSIGNEDSHIFT; - input_stream.backup(1); - break; - default: - break; + MoreLexicalActions(); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + curPos = 0; + jjmatchedKind = 0x7fffffff; + try { + curChar = input_stream.readChar(); + continue; } - } - - private void jjCheckNAdd(int state) { - if (jjrounds[state] != jjround) { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; + catch (java.io.IOException e1) { } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; } - } - - private void jjAddStates(int start, int end) { - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); - } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } + } +} - private void jjCheckNAddTwoStates(int state1, int state2) { - jjCheckNAdd(state1); - jjCheckNAdd(state2); - } +void SkipLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + default : + break; + } +} +void MoreLexicalActions() +{ + jjimageLen += (lengthOfMatch = jjmatchedPos + 1); + switch(jjmatchedKind) + { + case 7 : + image.append(input_stream.GetSuffix(jjimageLen)); + jjimageLen = 0; + input_stream.backup(1); + break; + default : + break; + } +} +void TokenLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + case 128 : + image.append(jjstrLiteralImages[128]); + lengthOfMatch = jjstrLiteralImages[128].length(); + matchedToken.kind = GT; + ((ASTParser.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT; + input_stream.backup(2); + break; + case 129 : + image.append(jjstrLiteralImages[129]); + lengthOfMatch = jjstrLiteralImages[129].length(); + matchedToken.kind = GT; + ((ASTParser.GTToken)matchedToken).realKind = RSIGNEDSHIFT; + input_stream.backup(1); + break; + default : + break; + } +} +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} - private void jjCheckNAddStates(int start, int end) { - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); - } +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/JavaCharStream.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/JavaCharStream.java index 9a03beec9d..62a6544b3a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/JavaCharStream.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/JavaCharStream.java @@ -20,605 +20,610 @@ */ public -class JavaCharStream { - /** - * Whether parser is static. - */ - public static final boolean staticFlag = false; - - static final int hexval(char c) throws java.io.IOException { - switch (c) { - case '0': - return 0; - case '1': - return 1; - case '2': - return 2; - case '3': - return 3; - case '4': - return 4; - case '5': - return 5; - case '6': - return 6; - case '7': - return 7; - case '8': - return 8; - case '9': - return 9; - - case 'a': - case 'A': - return 10; - case 'b': - case 'B': - return 11; - case 'c': - case 'C': - return 12; - case 'd': - case 'D': - return 13; - case 'e': - case 'E': - return 14; - case 'f': - case 'F': - return 15; - } - - throw new java.io.IOException(); // Should never come here - } - - /** - * Position in buffer. - */ - public int bufpos = -1; - int bufsize; - int available; - int tokenBegin; - protected int bufline[]; - protected int bufcolumn[]; - - protected int column = 0; - protected int line = 1; - - protected boolean prevCharIsCR = false; - protected boolean prevCharIsLF = false; - - protected java.io.Reader inputStream; - - protected char[] nextCharBuf; - protected char[] buffer; - protected int maxNextCharInd = 0; - protected int nextCharInd = -1; - protected int inBuf = 0; - protected int tabSize = 8; - - protected void setTabSize(int i) { - tabSize = i; - } - - protected int getTabSize(int i) { - return tabSize; - } - - protected void ExpandBuff(boolean wrapAround) { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; - - try { - if (wrapAround) { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; - - bufpos += (bufsize - tokenBegin); - } else { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; - - bufpos -= tokenBegin; - } - } catch (Throwable t) { - throw new Error(t.getMessage()); - } - - available = (bufsize += 2048); - tokenBegin = 0; - } - - protected void FillBuff() throws java.io.IOException { - int i; - if (maxNextCharInd == 4096) - maxNextCharInd = nextCharInd = 0; - - try { - if ((i = inputStream.read(nextCharBuf, maxNextCharInd, - 4096 - maxNextCharInd)) == -1) { - inputStream.close(); - throw new java.io.IOException(); - } else - maxNextCharInd += i; - return; - } catch (java.io.IOException e) { - if (bufpos != 0) { - --bufpos; - backup(0); - } else { - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - throw e; - } - } - - protected char ReadByte() throws java.io.IOException { - if (++nextCharInd >= maxNextCharInd) - FillBuff(); - - return nextCharBuf[nextCharInd]; - } - - /** - * @return starting character for token. - */ - public char BeginToken() throws java.io.IOException { - if (inBuf > 0) { - --inBuf; - - if (++bufpos == bufsize) - bufpos = 0; - - tokenBegin = bufpos; - return buffer[bufpos]; - } - - tokenBegin = 0; - bufpos = -1; - - return readChar(); - } - - protected void AdjustBuffSize() { - if (available == bufsize) { - if (tokenBegin > 2048) { - bufpos = 0; - available = tokenBegin; - } else - ExpandBuff(false); - } else if (available > tokenBegin) - available = bufsize; - else if ((tokenBegin - available) < 2048) - ExpandBuff(true); - else - available = tokenBegin; - } - - protected void UpdateLineColumn(char c) { - column++; - - if (prevCharIsLF) { - prevCharIsLF = false; - line += (column = 1); - } else if (prevCharIsCR) { - prevCharIsCR = false; - if (c == '\n') { - prevCharIsLF = true; - } else - line += (column = 1); - } - - switch (c) { - case '\r': - prevCharIsCR = true; - break; - case '\n': - prevCharIsLF = true; - break; - case '\t': - column--; - column += (tabSize - (column % tabSize)); - break; - default: - break; - } - +class JavaCharStream +{ + /** Whether parser is static. */ + public static final boolean staticFlag = false; + + static final int hexval(char c) throws java.io.IOException { + switch(c) + { + case '0' : + return 0; + case '1' : + return 1; + case '2' : + return 2; + case '3' : + return 3; + case '4' : + return 4; + case '5' : + return 5; + case '6' : + return 6; + case '7' : + return 7; + case '8' : + return 8; + case '9' : + return 9; + + case 'a' : + case 'A' : + return 10; + case 'b' : + case 'B' : + return 11; + case 'c' : + case 'C' : + return 12; + case 'd' : + case 'D' : + return 13; + case 'e' : + case 'E' : + return 14; + case 'f' : + case 'F' : + return 15; + } + + throw new java.io.IOException(); // Should never come here + } + +/** Position in buffer. */ + public int bufpos = -1; + int bufsize; + int available; + int tokenBegin; + protected int bufline[]; + protected int bufcolumn[]; + + protected int column = 0; + protected int line = 1; + + protected boolean prevCharIsCR = false; + protected boolean prevCharIsLF = false; + + protected java.io.Reader inputStream; + + protected char[] nextCharBuf; + protected char[] buffer; + protected int maxNextCharInd = 0; + protected int nextCharInd = -1; + protected int inBuf = 0; + protected int tabSize = 8; + + protected void setTabSize(int i) { tabSize = i; } + protected int getTabSize(int i) { return tabSize; } + + protected void ExpandBuff(boolean wrapAround) + { + char[] newbuffer = new char[bufsize + 2048]; + int newbufline[] = new int[bufsize + 2048]; + int newbufcolumn[] = new int[bufsize + 2048]; + + try + { + if (wrapAround) + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); + bufcolumn = newbufcolumn; + + bufpos += (bufsize - tokenBegin); + } + else + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + bufcolumn = newbufcolumn; + + bufpos -= tokenBegin; + } + } + catch (Throwable t) + { + throw new Error(t.getMessage()); + } + + available = (bufsize += 2048); + tokenBegin = 0; + } + + protected void FillBuff() throws java.io.IOException + { + int i; + if (maxNextCharInd == 4096) + maxNextCharInd = nextCharInd = 0; + + try { + if ((i = inputStream.read(nextCharBuf, maxNextCharInd, + 4096 - maxNextCharInd)) == -1) + { + inputStream.close(); + throw new java.io.IOException(); + } + else + maxNextCharInd += i; + return; + } + catch(java.io.IOException e) { + if (bufpos != 0) + { + --bufpos; + backup(0); + } + else + { bufline[bufpos] = line; bufcolumn[bufpos] = column; - } - - /** - * Read a character. - */ - public char readChar() throws java.io.IOException { - if (inBuf > 0) { - --inBuf; - - if (++bufpos == bufsize) - bufpos = 0; - - return buffer[bufpos]; - } - - char c; - + } + throw e; + } + } + + protected char ReadByte() throws java.io.IOException + { + if (++nextCharInd >= maxNextCharInd) + FillBuff(); + + return nextCharBuf[nextCharInd]; + } + +/** @return starting character for token. */ + public char BeginToken() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; + + if (++bufpos == bufsize) + bufpos = 0; + + tokenBegin = bufpos; + return buffer[bufpos]; + } + + tokenBegin = 0; + bufpos = -1; + + return readChar(); + } + + protected void AdjustBuffSize() + { + if (available == bufsize) + { + if (tokenBegin > 2048) + { + bufpos = 0; + available = tokenBegin; + } + else + ExpandBuff(false); + } + else if (available > tokenBegin) + available = bufsize; + else if ((tokenBegin - available) < 2048) + ExpandBuff(true); + else + available = tokenBegin; + } + + protected void UpdateLineColumn(char c) + { + column++; + + if (prevCharIsLF) + { + prevCharIsLF = false; + line += (column = 1); + } + else if (prevCharIsCR) + { + prevCharIsCR = false; + if (c == '\n') + { + prevCharIsLF = true; + } + else + line += (column = 1); + } + + switch (c) + { + case '\r' : + prevCharIsCR = true; + break; + case '\n' : + prevCharIsLF = true; + break; + case '\t' : + column--; + column += (tabSize - (column % tabSize)); + break; + default : + break; + } + + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + +/** Read a character. */ + public char readChar() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; + + if (++bufpos == bufsize) + bufpos = 0; + + return buffer[bufpos]; + } + + char c; + + if (++bufpos == available) + AdjustBuffSize(); + + if ((buffer[bufpos] = c = ReadByte()) == '\\') + { + UpdateLineColumn(c); + + int backSlashCnt = 1; + + for (;;) // Read all the backslashes + { if (++bufpos == available) - AdjustBuffSize(); + AdjustBuffSize(); - if ((buffer[bufpos] = c = ReadByte()) == '\\') { + try + { + if ((buffer[bufpos] = c = ReadByte()) != '\\') + { UpdateLineColumn(c); - - int backSlashCnt = 1; - - for (; ; ) // Read all the backslashes + // found a non-backslash char. + if ((c == 'u') && ((backSlashCnt & 1) == 1)) { - if (++bufpos == available) - AdjustBuffSize(); - - try { - if ((buffer[bufpos] = c = ReadByte()) != '\\') { - UpdateLineColumn(c); - // found a non-backslash char. - if ((c == 'u') && ((backSlashCnt & 1) == 1)) { - if (--bufpos < 0) - bufpos = bufsize - 1; - - break; - } - - backup(backSlashCnt); - return '\\'; - } - } catch (java.io.IOException e) { - // We are returning one backslash so we should only backup (count-1) - if (backSlashCnt > 1) - backup(backSlashCnt - 1); - - return '\\'; - } - - UpdateLineColumn(c); - backSlashCnt++; - } - - // Here, we have seen an odd number of backslash's followed by a 'u' - try { - while ((c = ReadByte()) == 'u') - ++column; + if (--bufpos < 0) + bufpos = bufsize - 1; - buffer[bufpos] = c = (char) (hexval(c) << 12 | - hexval(ReadByte()) << 8 | - hexval(ReadByte()) << 4 | - hexval(ReadByte())); - - column += 4; - } catch (java.io.IOException e) { - throw new Error("Invalid escape character at line " + line + - " column " + column + "."); + break; } - if (backSlashCnt == 1) - return c; - else { - backup(backSlashCnt - 1); - return '\\'; - } - } else { - UpdateLineColumn(c); - return c; + backup(backSlashCnt); + return '\\'; + } } - } - - @Deprecated - /** - * @deprecated - * @see #getEndColumn - */ - public int getColumn() { - return bufcolumn[bufpos]; - } - - @Deprecated - /** - * @deprecated - * @see #getEndLine - */ - public int getLine() { - return bufline[bufpos]; - } - - /** - * Get end column. - */ - public int getEndColumn() { - return bufcolumn[bufpos]; - } - - /** - * Get end line. - */ - public int getEndLine() { - return bufline[bufpos]; - } - - /** - * @return column of token start - */ - public int getBeginColumn() { - return bufcolumn[tokenBegin]; - } - - /** - * @return line number of token start - */ - public int getBeginLine() { - return bufline[tokenBegin]; - } - - /** - * Retreat. - */ - public void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) - bufpos += bufsize; - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn) { - this(dstream, startline, startcolumn, 4096); - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.Reader dstream) { - this(dstream, 1, 1, 4096); - } + catch(java.io.IOException e) + { + // We are returning one backslash so we should only backup (count-1) + if (backSlashCnt > 1) + backup(backSlashCnt-1); - /** - * Reinitialise. - */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; + return '\\'; } - prevCharIsLF = prevCharIsCR = false; - tokenBegin = inBuf = maxNextCharInd = 0; - nextCharInd = bufpos = -1; - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn) { - ReInit(dstream, startline, startcolumn, 4096); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.Reader dstream) { - ReInit(dstream, 1, 1, 4096); - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException { - this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) { - this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException { - this(dstream, encoding, startline, startcolumn, 4096); - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn) { - this(dstream, startline, startcolumn, 4096); - } - - /** - * Constructor. - */ - public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException { - this(dstream, encoding, 1, 1, 4096); - } - /** - * Constructor. - */ - public JavaCharStream(java.io.InputStream dstream) { - this(dstream, 1, 1, 4096); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException { - ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) { - ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException { - ReInit(dstream, encoding, startline, startcolumn, 4096); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn) { - ReInit(dstream, startline, startcolumn, 4096); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException { - ReInit(dstream, encoding, 1, 1, 4096); - } - - /** - * Reinitialise. - */ - public void ReInit(java.io.InputStream dstream) { - ReInit(dstream, 1, 1, 4096); - } - - /** - * @return token image as String - */ - public String GetImage() { - if (bufpos >= tokenBegin) - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + UpdateLineColumn(c); + backSlashCnt++; + } + + // Here, we have seen an odd number of backslash's followed by a 'u' + try + { + while ((c = ReadByte()) == 'u') + ++column; + + buffer[bufpos] = c = (char)(hexval(c) << 12 | + hexval(ReadByte()) << 8 | + hexval(ReadByte()) << 4 | + hexval(ReadByte())); + + column += 4; + } + catch(java.io.IOException e) + { + throw new Error("Invalid escape character at line " + line + + " column " + column + "."); + } + + if (backSlashCnt == 1) + return c; + else + { + backup(backSlashCnt - 1); + return '\\'; + } + } + else + { + UpdateLineColumn(c); + return c; + } + } + + @Deprecated + /** + * @deprecated + * @see #getEndColumn + */ + public int getColumn() { + return bufcolumn[bufpos]; + } + + @Deprecated + /** + * @deprecated + * @see #getEndLine + */ + public int getLine() { + return bufline[bufpos]; + } + +/** Get end column. */ + public int getEndColumn() { + return bufcolumn[bufpos]; + } + +/** Get end line. */ + public int getEndLine() { + return bufline[bufpos]; + } + +/** @return column of token start */ + public int getBeginColumn() { + return bufcolumn[tokenBegin]; + } + +/** @return line number of token start */ + public int getBeginLine() { + return bufline[tokenBegin]; + } + +/** Retreat. */ + public void backup(int amount) { + + inBuf += amount; + if ((bufpos -= amount) < 0) + bufpos += bufsize; + } + +/** Constructor. */ + public JavaCharStream(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + +/** Constructor. */ + public JavaCharStream(java.io.Reader dstream, + int startline, int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.Reader dstream) + { + this(dstream, 1, 1, 4096); + } +/** Reinitialise. */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + if (buffer == null || buffersize != buffer.length) + { + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + prevCharIsLF = prevCharIsCR = false; + tokenBegin = inBuf = maxNextCharInd = 0; + nextCharInd = bufpos = -1; + } + +/** Reinitialise. */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } + +/** Reinitialise. */ + public void ReInit(java.io.Reader dstream) + { + ReInit(dstream, 1, 1, 4096); + } +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException + { + this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) + { + this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException + { + this(dstream, encoding, startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, int startline, + int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { + this(dstream, encoding, 1, 1, 4096); + } + +/** Constructor. */ + public JavaCharStream(java.io.InputStream dstream) + { + this(dstream, 1, 1, 4096); + } + +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException + { + ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) + { + ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); + } +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException + { + ReInit(dstream, encoding, startline, startcolumn, 4096); + } +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { + ReInit(dstream, encoding, 1, 1, 4096); + } + +/** Reinitialise. */ + public void ReInit(java.io.InputStream dstream) + { + ReInit(dstream, 1, 1, 4096); + } + + /** @return token image as String */ + public String GetImage() + { + if (bufpos >= tokenBegin) + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + else + return new String(buffer, tokenBegin, bufsize - tokenBegin) + + new String(buffer, 0, bufpos + 1); + } + + /** @return suffix */ + public char[] GetSuffix(int len) + { + char[] ret = new char[len]; + + if ((bufpos + 1) >= len) + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); + else + { + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, + len - bufpos - 1); + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); + } + + return ret; + } + + /** Set buffers back to null when finished. */ + public void Done() + { + nextCharBuf = null; + buffer = null; + bufline = null; + bufcolumn = null; + } + + /** + * Method to adjust line and column numbers for the start of a token. + */ + public void adjustBeginLineColumn(int newLine, int newCol) + { + int start = tokenBegin; + int len; + + if (bufpos >= tokenBegin) + { + len = bufpos - tokenBegin + inBuf + 1; + } + else + { + len = bufsize - tokenBegin + bufpos + 1 + inBuf; + } + + int i = 0, j = 0, k = 0; + int nextColDiff = 0, columnDiff = 0; + + while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) + { + bufline[j] = newLine; + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; + bufcolumn[j] = newCol + columnDiff; + columnDiff = nextColDiff; + i++; + } + + if (i < len) + { + bufline[j] = newLine++; + bufcolumn[j] = newCol + columnDiff; + + while (i++ < len) + { + if (bufline[j = start % bufsize] != bufline[++start % bufsize]) + bufline[j] = newLine++; else - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); - } - - /** - * @return suffix - */ - public char[] GetSuffix(int len) { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - else { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); - } - - return ret; - } - - /** - * Set buffers back to null when finished. - */ - public void Done() { - nextCharBuf = null; - buffer = null; - bufline = null; - bufcolumn = null; + bufline[j] = newLine; + } } - /** - * Method to adjust line and column numbers for the start of a token. - */ - public void adjustBeginLineColumn(int newLine, int newCol) { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) { - len = bufpos - tokenBegin + inBuf + 1; - } else { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; - } - - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; - } - - if (i < len) { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) - bufline[j] = newLine++; - else - bufline[j] = newLine; - } - } - - line = bufline[j]; - column = bufcolumn[j]; - } + line = bufline[j]; + column = bufcolumn[j]; + } } /* JavaCC - OriginalChecksum=5111a95355f2f1cc405246f828703097 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ParseException.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ParseException.java index 932d2be89b..31d07cd515 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ParseException.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/ParseException.java @@ -19,181 +19,181 @@ * You can explicitly create objects of this exception type by * calling the method generateParseException in the generated * parser. - *

    + * * You can modify this class to customize your error reporting * mechanisms so long as you retain the public fields. */ public class ParseException extends Exception { - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; - /** - * This constructor is used by the method "generateParseException" - * in the generated parser. Calling this constructor generates - * a new object of this type with the fields "currentToken", - * "expectedTokenSequences", and "tokenImage" set. - */ - public ParseException(Token currentTokenVal, - int[][] expectedTokenSequencesVal, - String[] tokenImageVal - ) { - super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); - currentToken = currentTokenVal; - expectedTokenSequences = expectedTokenSequencesVal; - tokenImage = tokenImageVal; - } + /** + * This constructor is used by the method "generateParseException" + * in the generated parser. Calling this constructor generates + * a new object of this type with the fields "currentToken", + * "expectedTokenSequences", and "tokenImage" set. + */ + public ParseException(Token currentTokenVal, + int[][] expectedTokenSequencesVal, + String[] tokenImageVal + ) + { + super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); + currentToken = currentTokenVal; + expectedTokenSequences = expectedTokenSequencesVal; + tokenImage = tokenImageVal; + } - /** - * The following constructors are for use by you for whatever - * purpose you can think of. Constructing the exception in this - * manner makes the exception behave in the normal way - i.e., as - * documented in the class "Throwable". The fields "errorToken", - * "expectedTokenSequences", and "tokenImage" do not contain - * relevant information. The JavaCC generated code does not use - * these constructors. - */ + /** + * The following constructors are for use by you for whatever + * purpose you can think of. Constructing the exception in this + * manner makes the exception behave in the normal way - i.e., as + * documented in the class "Throwable". The fields "errorToken", + * "expectedTokenSequences", and "tokenImage" do not contain + * relevant information. The JavaCC generated code does not use + * these constructors. + */ - public ParseException() { - super(); - } + public ParseException() { + super(); + } - /** - * Constructor with message. - */ - public ParseException(String message) { - super(message); - } + /** Constructor with message. */ + public ParseException(String message) { + super(message); + } - /** - * This is the last token that has been consumed successfully. If - * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. - */ - public Token currentToken; + /** + * This is the last token that has been consumed successfully. If + * this object has been created due to a parse error, the token + * followng this token will (therefore) be the first error token. + */ + public Token currentToken; - /** - * Each entry in this array is an array of integers. Each array - * of integers represents a sequence of tokens (by their ordinal - * values) that is expected at this point of the parse. - */ - public int[][] expectedTokenSequences; + /** + * Each entry in this array is an array of integers. Each array + * of integers represents a sequence of tokens (by their ordinal + * values) that is expected at this point of the parse. + */ + public int[][] expectedTokenSequences; - /** - * This is a reference to the "tokenImage" array of the generated - * parser within which the parse error occurred. This array is - * defined in the generated ...Constants interface. - */ - public String[] tokenImage; + /** + * This is a reference to the "tokenImage" array of the generated + * parser within which the parse error occurred. This array is + * defined in the generated ...Constants interface. + */ + public String[] tokenImage; - /** - * It uses "currentToken" and "expectedTokenSequences" to generate a parse - * error message and returns it. If this object has been created - * due to a parse error, and you do not catch it (it gets thrown - * from the parser) the correct error message - * gets displayed. - */ - private static String initialise(Token currentToken, - int[][] expectedTokenSequences, - String[] tokenImage) { - String eol = System.getProperty("line.separator", "\n"); - StringBuffer expected = new StringBuffer(); - int maxSize = 0; - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; - } - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); - } - if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { - expected.append("..."); - } - expected.append(eol).append(" "); - } - String retval = "Encountered \""; - Token tok = currentToken.next; - for (int i = 0; i < maxSize; i++) { - if (i != 0) retval += " "; - if (tok.kind == 0) { - retval += tokenImage[0]; - break; - } - retval += " " + tokenImage[tok.kind]; - retval += " \""; - retval += add_escapes(tok.image); - retval += " \""; - tok = tok.next; - } - retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; - retval += "." + eol; - if (expectedTokenSequences.length == 1) { - retval += "Was expecting:" + eol + " "; - } else { - retval += "Was expecting one of:" + eol + " "; - } - retval += expected.toString(); - return retval; + /** + * It uses "currentToken" and "expectedTokenSequences" to generate a parse + * error message and returns it. If this object has been created + * due to a parse error, and you do not catch it (it gets thrown + * from the parser) the correct error message + * gets displayed. + */ + private static String initialise(Token currentToken, + int[][] expectedTokenSequences, + String[] tokenImage) { + String eol = System.getProperty("line.separator", "\n"); + StringBuffer expected = new StringBuffer(); + int maxSize = 0; + for (int i = 0; i < expectedTokenSequences.length; i++) { + if (maxSize < expectedTokenSequences[i].length) { + maxSize = expectedTokenSequences[i].length; + } + for (int j = 0; j < expectedTokenSequences[i].length; j++) { + expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); + } + if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { + expected.append("..."); + } + expected.append(eol).append(" "); + } + String retval = "Encountered \""; + Token tok = currentToken.next; + for (int i = 0; i < maxSize; i++) { + if (i != 0) retval += " "; + if (tok.kind == 0) { + retval += tokenImage[0]; + break; + } + retval += " " + tokenImage[tok.kind]; + retval += " \""; + retval += add_escapes(tok.image); + retval += " \""; + tok = tok.next; } + retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; + retval += "." + eol; + if (expectedTokenSequences.length == 1) { + retval += "Was expecting:" + eol + " "; + } else { + retval += "Was expecting one of:" + eol + " "; + } + retval += expected.toString(); + return retval; + } - /** - * The end of line string for this machine. - */ - protected String eol = System.getProperty("line.separator", "\n"); + /** + * The end of line string for this machine. + */ + protected String eol = System.getProperty("line.separator", "\n"); - /** - * Used to convert raw characters to their escaped version - * when these raw version cannot be used as part of an ASCII - * string literal. - */ - static String add_escapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case 0: - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } + /** + * Used to convert raw characters to their escaped version + * when these raw version cannot be used as part of an ASCII + * string literal. + */ + static String add_escapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case 0 : + continue; + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; } - return retval.toString(); - } + } + return retval.toString(); + } } /* JavaCC - OriginalChecksum=62ba72b2159703420d5ce7232a0226fb (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/Token.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/Token.java index a4ebfd3a41..8aa85f4dd8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/Token.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/Token.java @@ -20,128 +20,124 @@ public class Token implements java.io.Serializable { - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; - - /** - * An integer that describes the kind of this token. This numbering - * system is determined by JavaCCParser, and a table of these numbers is - * stored in the file ...Constants.java. - */ - public int kind; - - /** - * The line number of the first character of this Token. - */ - public int beginLine; - /** - * The column number of the first character of this Token. - */ - public int beginColumn; - /** - * The line number of the last character of this Token. - */ - public int endLine; - /** - * The column number of the last character of this Token. - */ - public int endColumn; - - /** - * The string image of the token. - */ - public String image; - - /** - * A reference to the next regular (non-special) token from the input - * stream. If this is the last token from the input stream, or if the - * token manager has not read tokens beyond this one, this field is - * set to null. This is true only if this token is also a regular - * token. Otherwise, see below for a description of the contents of - * this field. - */ - public Token next; - - /** - * This field is used to access special tokens that occur prior to this - * token, but after the immediately preceding regular (non-special) token. - * If there are no such special tokens, this field is set to null. - * When there are more than one such special token, this field refers - * to the last of these special tokens, which in turn refers to the next - * previous special token through its specialToken field, and so on - * until the first special token (whose specialToken field is null). - * The next fields of special tokens refer to other special tokens that - * immediately follow it (without an intervening regular token). If there - * is no such token, this field is null. - */ - public Token specialToken; - - /** - * An optional attribute value of the Token. - * Tokens which are not used as syntactic sugar will often contain - * meaningful values that will be used later on by the compiler or - * interpreter. This attribute value is often different from the image. - * Any subclass of Token that actually wants to return a non-null value can - * override this method as appropriate. - */ - public Object getValue() { - return null; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /** + * An integer that describes the kind of this token. This numbering + * system is determined by JavaCCParser, and a table of these numbers is + * stored in the file ...Constants.java. + */ + public int kind; + + /** The line number of the first character of this Token. */ + public int beginLine; + /** The column number of the first character of this Token. */ + public int beginColumn; + /** The line number of the last character of this Token. */ + public int endLine; + /** The column number of the last character of this Token. */ + public int endColumn; + + /** + * The string image of the token. + */ + public String image; + + /** + * A reference to the next regular (non-special) token from the input + * stream. If this is the last token from the input stream, or if the + * token manager has not read tokens beyond this one, this field is + * set to null. This is true only if this token is also a regular + * token. Otherwise, see below for a description of the contents of + * this field. + */ + public Token next; + + /** + * This field is used to access special tokens that occur prior to this + * token, but after the immediately preceding regular (non-special) token. + * If there are no such special tokens, this field is set to null. + * When there are more than one such special token, this field refers + * to the last of these special tokens, which in turn refers to the next + * previous special token through its specialToken field, and so on + * until the first special token (whose specialToken field is null). + * The next fields of special tokens refer to other special tokens that + * immediately follow it (without an intervening regular token). If there + * is no such token, this field is null. + */ + public Token specialToken; + + /** + * An optional attribute value of the Token. + * Tokens which are not used as syntactic sugar will often contain + * meaningful values that will be used later on by the compiler or + * interpreter. This attribute value is often different from the image. + * Any subclass of Token that actually wants to return a non-null value can + * override this method as appropriate. + */ + public Object getValue() { + return null; + } + + /** + * No-argument constructor + */ + public Token() {} + + /** + * Constructs a new token for the specified Image. + */ + public Token(int kind) + { + this(kind, null); + } + + /** + * Constructs a new token for the specified Image and Kind. + */ + public Token(int kind, String image) + { + this.kind = kind; + this.image = image; + } + + /** + * Returns the image. + */ + public String toString() + { + return image; + } + + /** + * Returns a new Token object, by default. However, if you want, you + * can create and return subclass objects based on the value of ofKind. + * Simply add the cases to the switch for all those special cases. + * For example, if you have a subclass of Token called IDToken that + * you want to create if ofKind is ID, simply add something like : + * + * case MyParserConstants.ID : return new IDToken(ofKind, image); + * + * to the following switch statement. Then you can cast matchedToken + * variable to the appropriate type and use sit in your lexical actions. + */ + public static Token newToken(int ofKind, String image) + { + switch(ofKind) + { + default : return new Token(ofKind, image); } + } - /** - * No-argument constructor - */ - public Token() { - } - - /** - * Constructs a new token for the specified Image. - */ - public Token(int kind) { - this(kind, null); - } - - /** - * Constructs a new token for the specified Image and Kind. - */ - public Token(int kind, String image) { - this.kind = kind; - this.image = image; - } - - /** - * Returns the image. - */ - public String toString() { - return image; - } - - /** - * Returns a new Token object, by default. However, if you want, you - * can create and return subclass objects based on the value of ofKind. - * Simply add the cases to the switch for all those special cases. - * For example, if you have a subclass of Token called IDToken that - * you want to create if ofKind is ID, simply add something like : - *

    - * case MyParserConstants.ID : return new IDToken(ofKind, image); - *

    - * to the following switch statement. Then you can cast matchedToken - * variable to the appropriate type and use sit in your lexical actions. - */ - public static Token newToken(int ofKind, String image) { - switch (ofKind) { - default: - return new Token(ofKind, image); - } - } - - public static Token newToken(int ofKind) { - return newToken(ofKind, null); - } + public static Token newToken(int ofKind) + { + return newToken(ofKind, null); + } } /* JavaCC - OriginalChecksum=a2058282d76ebf324ed236272a3341cb (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/TokenMgrError.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/TokenMgrError.java index 02afe0d7f9..09197e805c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/TokenMgrError.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/generated/com/github/javaparser/TokenMgrError.java @@ -14,152 +14,146 @@ */ package com.github.javaparser; -/** - * Token Manager Error. - */ -public class TokenMgrError extends Error { +/** Token Manager Error. */ +public class TokenMgrError extends Error +{ - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ + /* + * Ordinals for various reasons why an Error of this type can be thrown. + */ - /** - * Lexical error occurred. - */ - static final int LEXICAL_ERROR = 0; + /** + * Lexical error occurred. + */ + static final int LEXICAL_ERROR = 0; - /** - * An attempt was made to create a second instance of a static token manager. - */ - static final int STATIC_LEXER_ERROR = 1; + /** + * An attempt was made to create a second instance of a static token manager. + */ + static final int STATIC_LEXER_ERROR = 1; - /** - * Tried to change to an invalid lexical state. - */ - static final int INVALID_LEXICAL_STATE = 2; + /** + * Tried to change to an invalid lexical state. + */ + static final int INVALID_LEXICAL_STATE = 2; - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - static final int LOOP_DETECTED = 3; + /** + * Detected (and bailed out of) an infinite loop in the token manager. + */ + static final int LOOP_DETECTED = 3; - /** - * Indicates the reason why the exception is thrown. It will have - * one of the above 4 values. - */ - int errorCode; + /** + * Indicates the reason why the exception is thrown. It will have + * one of the above 4 values. + */ + int errorCode; - /** - * Replaces unprintable characters by their escaped (or unicode escaped) - * equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case 0: - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); + /** + * Replaces unprintable characters by their escaped (or unicode escaped) + * equivalents in the given string + */ + protected static final String addEscapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case 0 : + continue; + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } } + return retval.toString(); + } - /** - * Returns a detailed message for the Error when it is thrown by the - * token manager to indicate a lexical error. - * Parameters : - * EOFSeen : indicates if EOF caused the lexical error - * curLexState : lexical state in which this error occurred - * errorLine : line number when the error occurred - * errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred - * curchar : the offending character - * Note: You can customize the lexical error message by modifying this method. - */ - protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { - return ("Lexical error at line " + - errorLine + ", column " + - errorColumn + ". Encountered: " + - (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") + - "after : \"" + addEscapes(errorAfter) + "\""); - } + /** + * Returns a detailed message for the Error when it is thrown by the + * token manager to indicate a lexical error. + * Parameters : + * EOFSeen : indicates if EOF caused the lexical error + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred + * curchar : the offending character + * Note: You can customize the lexical error message by modifying this method. + */ + protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { + return("Lexical error at line " + + errorLine + ", column " + + errorColumn + ". Encountered: " + + (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + + "after : \"" + addEscapes(errorAfter) + "\""); + } - /** - * You can also modify the body of this method to customize your error messages. - * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - * of end-users concern, so you can return something like : - *

    - * "Internal Error : Please file a bug report .... " - *

    - * from this method for such cases in the release version of your parser. - */ - public String getMessage() { - return super.getMessage(); - } + /** + * You can also modify the body of this method to customize your error messages. + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + * of end-users concern, so you can return something like : + * + * "Internal Error : Please file a bug report .... " + * + * from this method for such cases in the release version of your parser. + */ + public String getMessage() { + return super.getMessage(); + } - /* - * Constructors of various flavors follow. - */ + /* + * Constructors of various flavors follow. + */ - /** - * No arg constructor. - */ - public TokenMgrError() { - } + /** No arg constructor. */ + public TokenMgrError() { + } - /** - * Constructor with message and reason. - */ - public TokenMgrError(String message, int reason) { - super(message); - errorCode = reason; - } + /** Constructor with message and reason. */ + public TokenMgrError(String message, int reason) { + super(message); + errorCode = reason; + } - /** - * Full Constructor. - */ - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { - this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); - } + /** Full Constructor. */ + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { + this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); + } } /* JavaCC - OriginalChecksum=f06c7e964b5c13a732337c2f3fb4f836 (do not edit this line) */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ASTHelper.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ASTHelper.java index c3d7fbe993..7e706cd644 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ASTHelper.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ASTHelper.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser; import com.github.javaparser.ast.CompilationUnit; @@ -50,7 +50,7 @@ /** * This class helps to construct new nodes. - * + * * @author Júlio Vilmar Gesser */ public final class ASTHelper { @@ -80,8 +80,9 @@ private ASTHelper() { /** * Creates a new {@link NameExpr} from a qualified name.
    * The qualified name can contains "." (dot) characters. - * - * @param qualifiedName qualified name + * + * @param qualifiedName + * qualified name * @return instanceof {@link NameExpr} */ public static NameExpr createNameExpr(String qualifiedName) { @@ -95,9 +96,11 @@ public static NameExpr createNameExpr(String qualifiedName) { /** * Creates a new {@link Parameter}. - * - * @param type type of the parameter - * @param name name of the parameter + * + * @param type + * type of the parameter + * @param name + * name of the parameter * @return instance of {@link Parameter} */ public static Parameter createParameter(Type type, String name) { @@ -106,10 +109,13 @@ public static Parameter createParameter(Type type, String name) { /** * Creates a {@link FieldDeclaration}. - * - * @param modifiers modifiers - * @param type type - * @param variable variable declarator + * + * @param modifiers + * modifiers + * @param type + * type + * @param variable + * variable declarator * @return instance of {@link FieldDeclaration} */ public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, VariableDeclarator variable) { @@ -121,10 +127,13 @@ public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, /** * Creates a {@link FieldDeclaration}. - * - * @param modifiers modifiers - * @param type type - * @param name field name + * + * @param modifiers + * modifiers + * @param type + * type + * @param name + * field name * @return instance of {@link FieldDeclaration} */ public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, String name) { @@ -135,9 +144,11 @@ public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, /** * Creates a {@link VariableDeclarationExpr}. - * - * @param type type - * @param name name + * + * @param type + * type + * @param name + * name * @return instance of {@link VariableDeclarationExpr} */ public static VariableDeclarationExpr createVariableDeclarationExpr(Type type, String name) { @@ -149,9 +160,11 @@ public static VariableDeclarationExpr createVariableDeclarationExpr(Type type, S /** * Adds the given parameter to the method. The list of parameters will be * initialized if it is null. - * - * @param method method - * @param parameter parameter + * + * @param method + * method + * @param parameter + * parameter */ public static void addParameter(MethodDeclaration method, Parameter parameter) { List parameters = method.getParameters(); @@ -165,9 +178,11 @@ public static void addParameter(MethodDeclaration method, Parameter parameter) { /** * Adds the given argument to the method call. The list of arguments will be * initialized if it is null. - * - * @param call method call - * @param arg argument value + * + * @param call + * method call + * @param arg + * argument value */ public static void addArgument(MethodCallExpr call, Expression arg) { List args = call.getArgs(); @@ -181,9 +196,11 @@ public static void addArgument(MethodCallExpr call, Expression arg) { /** * Adds the given type declaration to the compilation unit. The list of * types will be initialized if it is null. - * - * @param cu compilation unit - * @param type type declaration + * + * @param cu + * compilation unit + * @param type + * type declaration */ public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) { List types = cu.getTypes(); @@ -197,9 +214,11 @@ public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) /** * Creates a new {@link ReferenceType} for a class or interface. - * - * @param name name of the class or interface - * @param arrayCount number of arrays or 0 if is not a array. + * + * @param name + * name of the class or interface + * @param arrayCount + * number of arrays or 0 if is not a array. * @return instanceof {@link ReferenceType} */ public static ReferenceType createReferenceType(String name, int arrayCount) { @@ -208,9 +227,11 @@ public static ReferenceType createReferenceType(String name, int arrayCount) { /** * Creates a new {@link ReferenceType} for the given primitive type. - * - * @param type primitive type - * @param arrayCount number of arrays or 0 if is not a array. + * + * @param type + * primitive type + * @param arrayCount + * number of arrays or 0 if is not a array. * @return instanceof {@link ReferenceType} */ public static ReferenceType createReferenceType(PrimitiveType type, int arrayCount) { @@ -220,9 +241,9 @@ public static ReferenceType createReferenceType(PrimitiveType type, int arrayCou /** * Adds the given statement to the specified block. The list of statements * will be initialized if it is null. - * + * * @param block to have expression added to - * @param stmt to be added + * @param stmt to be added */ public static void addStmt(BlockStmt block, Statement stmt) { List stmts = block.getStmts(); @@ -236,9 +257,9 @@ public static void addStmt(BlockStmt block, Statement stmt) { /** * Adds the given expression to the specified block. The list of statements * will be initialized if it is null. - * + * * @param block to have expression added to - * @param expr to be added + * @param expr to be added */ public static void addStmt(BlockStmt block, Expression expr) { addStmt(block, new ExpressionStmt(expr)); @@ -247,9 +268,11 @@ public static void addStmt(BlockStmt block, Expression expr) { /** * Adds the given declaration to the specified type. The list of members * will be initialized if it is null. - * - * @param type type declaration - * @param decl member declaration + * + * @param type + * type declaration + * @param decl + * member declaration */ public static void addMember(TypeDeclaration type, BodyDeclaration decl) { List members = type.getMembers(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/JavaParser.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/JavaParser.java index 812875321f..431255051c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/JavaParser.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/JavaParser.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser; import static com.github.javaparser.PositionUtils.areInOrder; @@ -50,7 +50,6 @@ import java.util.List; // FIXME this file does not seem to be generated by javacc. Is the doc wrong, or the javacc config? - /** *

    + * * The main reason for this interface is to permit users to manipulate homogeneously all nodes with a getName method. - * - * @since 2.0.1 + * + * @since 2.0.1 */ public interface NamedNode { String getName(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/Node.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/Node.java index 583ebdd8bd..f5f9cb2387 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/Node.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/Node.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -30,11 +30,11 @@ /** * Abstract class for all nodes of the AST. - *

    + * * Each Node can have one associated comment which describe it and * a number of "orphan comments" which it contains but are not specifically * associated to any element. - * + * * @author Julio Vilmar Gesser */ public abstract class Node implements Cloneable { @@ -71,27 +71,34 @@ public Node(final int beginLine, final int beginColumn, final int endLine, final /** * Accept method for visitor support. - * - * @param the type the return value of the visitor - * @param the type the argument passed to the visitor - * @param v the visitor implementation - * @param arg the argument passed to the visitor + * + * @param + * the type the return value of the visitor + * @param + * the type the argument passed to the visitor + * @param v + * the visitor implementation + * @param arg + * the argument passed to the visitor * @return the result of the visit */ public abstract R accept(GenericVisitor v, A arg); /** * Accept method for visitor support. - * - * @param the type the argument passed for the visitor - * @param v the visitor implementation - * @param arg any value relevant for the visitor + * + * @param + * the type the argument passed for the visitor + * @param v + * the visitor implementation + * @param arg + * any value relevant for the visitor */ public abstract void accept(VoidVisitor v, A arg); /** * Return the begin column of this node. - * + * * @return the begin column of this node */ public final int getBeginColumn() { @@ -100,7 +107,7 @@ public final int getBeginColumn() { /** * Return the begin line of this node. - * + * * @return the begin line of this node */ public final int getBeginLine() { @@ -127,7 +134,7 @@ public final Object getData() { /** * Return the end column of this node. - * + * * @return the end column of this node */ public final int getEndColumn() { @@ -136,7 +143,7 @@ public final int getEndColumn() { /** * Return the end line of this node. - * + * * @return the end line of this node */ public final int getEndLine() { @@ -145,8 +152,9 @@ public final int getEndLine() { /** * Sets the begin column of this node. - * - * @param beginColumn the begin column of this node + * + * @param beginColumn + * the begin column of this node */ public final void setBeginColumn(final int beginColumn) { this.beginColumn = beginColumn; @@ -154,8 +162,9 @@ public final void setBeginColumn(final int beginColumn) { /** * Sets the begin line of this node. - * - * @param beginLine the begin line of this node + * + * @param beginLine + * the begin line of this node */ public final void setBeginLine(final int beginLine) { this.beginLine = beginLine; @@ -170,7 +179,8 @@ public final void setComment(final Comment comment) { if (comment != null && (this instanceof Comment)) { throw new RuntimeException("A comment can not be commented"); } - if (this.comment != null) { + if (this.comment != null) + { this.comment.setCommentedNode(null); } this.comment = comment; @@ -190,8 +200,9 @@ public final void setData(final Object data) { /** * Sets the end column of this node. - * - * @param endColumn the end column of this node + * + * @param endColumn + * the end column of this node */ public final void setEndColumn(final int endColumn) { this.endColumn = endColumn; @@ -199,8 +210,9 @@ public final void setEndColumn(final int endColumn) { /** * Sets the end line of this node. - * - * @param endLine the end line of this node + * + * @param endLine + * the end line of this node */ public final void setEndLine(final int endLine) { this.endLine = endLine; @@ -208,7 +220,7 @@ public final void setEndLine(final int endLine) { /** * Return the String representation of this node. - * + * * @return the String representation of this node */ @Override @@ -266,13 +278,12 @@ public void addOrphanComment(Comment comment) { /** * This is a list of Comment which are inside the node and are not associated * with any meaningful AST Node. - *

    + * * For example, comments at the end of methods (immediately before the parenthesis) * or at the end of CompilationUnit are orphan comments. - *

    + * * When more than one comments preceed a statement, the one immediately preceeding it * it is associated with the statements, while the others are "orphan". - * * @return all comments that cannot be attributed to a concept */ public List getOrphanComments() { @@ -283,7 +294,6 @@ public List getOrphanComments() { * This is the list of Comment which are contained in the Node either because * they are properly associated to one of its children or because they are floating * around inside the Node - * * @return all Comments within the node as a list */ public List getAllContainedComments() { @@ -359,7 +369,8 @@ public boolean isPositionedBefore(int line, int column) { } } - public boolean hasComment() { + public boolean hasComment() + { return comment != null; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/PackageDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/PackageDeclaration.java index 451dafc008..d0aaf5b1e5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/PackageDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/PackageDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -39,7 +39,6 @@ * PackageDeclaration ::= ( }{@link AnnotationExpr}{@code )* "package" }{@link NameExpr}{@code ) ";" * } * - * * @author Julio Vilmar Gesser */ public final class PackageDeclaration extends Node { @@ -79,7 +78,7 @@ public void accept(VoidVisitor v, A arg) { /** * Retrieves the list of annotations declared before the package * declaration. Return null if there are no annotations. - * + * * @return list of annotations or null */ public List getAnnotations() { @@ -88,7 +87,7 @@ public List getAnnotations() { /** * Return the name of the package. - * + * * @return the name of the package */ public NameExpr getName() { @@ -96,7 +95,8 @@ public NameExpr getName() { } /** - * @param annotations the annotations to set + * @param annotations + * the annotations to set */ public void setAnnotations(List annotations) { this.annotations = annotations; @@ -105,8 +105,9 @@ public void setAnnotations(List annotations) { /** * Sets the name of this package declaration. - * - * @param name the name to set + * + * @param name + * the name to set */ public void setName(NameExpr name) { this.name = name; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TreeVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TreeVisitor.java index 060fafdc90..f3b2672d07 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TreeVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TreeVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,14 +18,14 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; public abstract class TreeVisitor { - public void visitDepthFirst(Node node) { + public void visitDepthFirst(Node node){ process(node); - for (Node child : node.getChildrenNodes()) { + for (Node child : node.getChildrenNodes()){ visitDepthFirst(child); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TypeParameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TypeParameter.java index 650e38d619..c43d3793d4 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TypeParameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/TypeParameter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -38,31 +38,30 @@ * TypeParameter ::= ( "extends" }{@link ClassOrInterfaceType}{@code ( "&" }{@link ClassOrInterfaceType}{@code )* )? * } * - * * @author Julio Vilmar Gesser */ public final class TypeParameter extends Node implements NamedNode { - private String name; + private String name; private List annotations; - private List typeBound; + private List typeBound; - public TypeParameter() { - } + public TypeParameter() { + } - public TypeParameter(final String name, final List typeBound) { - setName(name); - setTypeBound(typeBound); - } + public TypeParameter(final String name, final List typeBound) { + setName(name); + setTypeBound(typeBound); + } - public TypeParameter(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String name, final List typeBound) { - super(beginLine, beginColumn, endLine, endColumn); - setName(name); - setTypeBound(typeBound); - } + public TypeParameter(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String name, final List typeBound) { + super(beginLine, beginColumn, endLine, endColumn); + setName(name); + setTypeBound(typeBound); + } public TypeParameter(int beginLine, int beginColumn, int endLine, int endColumn, String name, List typeBound, List annotations) { @@ -72,53 +71,53 @@ public TypeParameter(int beginLine, int beginColumn, int endLine, this.annotations = annotations; } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - /** - * Return the name of the paramenter. - * - * @return the name of the paramenter - */ - public String getName() { - return name; - } - - /** - * Return the list of {@link ClassOrInterfaceType} that this parameter - * extends. Return null null if there are no type. - * - * @return list of types that this paramente extends or null - */ - public List getTypeBound() { - return typeBound; - } - - /** - * Sets the name of this type parameter. - * - * @param name the name to set - */ - public void setName(final String name) { - this.name = name; - } - - /** - * Sets the list o types. - * - * @param typeBound the typeBound to set - */ - public void setTypeBound(final List typeBound) { - this.typeBound = typeBound; - setAsParentNodeOf(typeBound); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + /** + * Return the name of the paramenter. + * + * @return the name of the paramenter + */ + public String getName() { + return name; + } + + /** + * Return the list of {@link ClassOrInterfaceType} that this parameter + * extends. Return null null if there are no type. + * + * @return list of types that this paramente extends or null + */ + public List getTypeBound() { + return typeBound; + } + + /** + * Sets the name of this type parameter. + * + * @param name + * the name to set + */ + public void setName(final String name) { + this.name = name; + } + + /** + * Sets the list o types. + * + * @param typeBound + * the typeBound to set + */ + public void setTypeBound(final List typeBound) { + this.typeBound = typeBound; + setAsParentNodeOf(typeBound); + } public List getAnnotations() { return annotations; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotableNode.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotableNode.java index 47a4a8c59b..47c8c4fe8e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotableNode.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotableNode.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.expr.AnnotationExpr; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationDeclaration.java index 52c879b6ed..51f25617a8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java index c4a494b4e8..a81e6cc712 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; @@ -87,9 +87,9 @@ public Expression getDefaultValue() { /** * Return the modifiers of this member declaration. - * - * @return modifiers + * * @see ModifierSet + * @return modifiers */ public int getModifiers() { return modifiers; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BaseParameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BaseParameter.java index c8365b4678..e14deb1772 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BaseParameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BaseParameter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.Node; @@ -30,33 +30,33 @@ public abstract class BaseParameter extends Node { private int modifiers; private List annotations; - + private VariableDeclaratorId id; - + public BaseParameter() { } - + public BaseParameter(VariableDeclaratorId id) { setId(id); - } + } - public BaseParameter(int modifiers, VariableDeclaratorId id) { + public BaseParameter(int modifiers, VariableDeclaratorId id) { setModifiers(modifiers); setId(id); - } - - public BaseParameter(int modifiers, List annotations, VariableDeclaratorId id) { + } + + public BaseParameter(int modifiers, List annotations, VariableDeclaratorId id) { setModifiers(modifiers); setAnnotations(annotations); setId(id); - } + } - public BaseParameter(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, VariableDeclaratorId id) { - super(beginLine, beginColumn, endLine, endColumn); + public BaseParameter(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, VariableDeclaratorId id) { + super(beginLine, beginColumn, endLine, endColumn); setModifiers(modifiers); setAnnotations(annotations); setId(id); - } + } public List getAnnotations() { return annotations; @@ -68,9 +68,9 @@ public VariableDeclaratorId getId() { /** * Return the modifiers of this parameter declaration. - * - * @return modifiers + * * @see ModifierSet + * @return modifiers */ public int getModifiers() { return modifiers; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BodyDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BodyDeclaration.java index a1824b3980..bbf138b775 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BodyDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/BodyDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.Node; @@ -38,16 +38,16 @@ public BodyDeclaration() { } public BodyDeclaration(List annotations) { - setAnnotations(annotations); + setAnnotations(annotations); } public BodyDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations) { super(beginLine, beginColumn, endLine, endColumn); - setAnnotations(annotations); + setAnnotations(annotations); } public final List getAnnotations() { - if (annotations == null) { + if (annotations==null){ annotations = new ArrayList(); } return annotations; @@ -55,6 +55,6 @@ public final List getAnnotations() { public final void setAnnotations(List annotations) { this.annotations = annotations; - setAsParentNodeOf(this.annotations); + setAsParentNodeOf(this.annotations); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java index 93aa901e4b..e098f6edbf 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; @@ -36,90 +36,88 @@ */ public final class ClassOrInterfaceDeclaration extends TypeDeclaration implements DocumentableNode { - private boolean interface_; - - private List typeParameters; - - // Can contain more than one item if this is an interface - private List extendsList; - - private List implementsList; - - public ClassOrInterfaceDeclaration() { - } - - public ClassOrInterfaceDeclaration(final int modifiers, final boolean isInterface, final String name) { - super(modifiers, name); - setInterface(isInterface); - } - - public ClassOrInterfaceDeclaration(final int modifiers, - final List annotations, final boolean isInterface, final String name, - final List typeParameters, final List extendsList, - final List implementsList, final List members) { - super(annotations, modifiers, name, members); - setInterface(isInterface); - setTypeParameters(typeParameters); - setExtends(extendsList); - setImplements(implementsList); - } - - public ClassOrInterfaceDeclaration(final int beginLine, final int beginColumn, final int endLine, - final int endColumn, final int modifiers, - final List annotations, final boolean isInterface, final String name, - final List typeParameters, final List extendsList, - final List implementsList, final List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, modifiers, name, members); - setInterface(isInterface); - setTypeParameters(typeParameters); - setExtends(extendsList); - setImplements(implementsList); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getExtends() { - return extendsList; - } - - public List getImplements() { - return implementsList; - } - - public List getTypeParameters() { - return typeParameters; - } + private boolean interface_; + + private List typeParameters; + + // Can contain more than one item if this is an interface + private List extendsList; + + private List implementsList; + + public ClassOrInterfaceDeclaration() { + } + + public ClassOrInterfaceDeclaration(final int modifiers, final boolean isInterface, final String name) { + super(modifiers, name); + setInterface(isInterface); + } + + public ClassOrInterfaceDeclaration(final int modifiers, + final List annotations, final boolean isInterface, final String name, + final List typeParameters, final List extendsList, + final List implementsList, final List members) { + super(annotations, modifiers, name, members); + setInterface(isInterface); + setTypeParameters(typeParameters); + setExtends(extendsList); + setImplements(implementsList); + } + + public ClassOrInterfaceDeclaration(final int beginLine, final int beginColumn, final int endLine, + final int endColumn, final int modifiers, + final List annotations, final boolean isInterface, final String name, + final List typeParameters, final List extendsList, + final List implementsList, final List members) { + super(beginLine, beginColumn, endLine, endColumn, annotations, modifiers, name, members); + setInterface(isInterface); + setTypeParameters(typeParameters); + setExtends(extendsList); + setImplements(implementsList); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public List getExtends() { + return extendsList; + } + + public List getImplements() { + return implementsList; + } + + public List getTypeParameters() { + return typeParameters; + } public boolean isInterface() { - return interface_; - } - - public void setExtends(final List extendsList) { - this.extendsList = extendsList; - setAsParentNodeOf(this.extendsList); - } - - public void setImplements(final List implementsList) { - this.implementsList = implementsList; - setAsParentNodeOf(this.implementsList); - } - - public void setInterface(final boolean interface_) { - this.interface_ = interface_; - } - - public void setTypeParameters(final List typeParameters) { - this.typeParameters = typeParameters; - setAsParentNodeOf(this.typeParameters); - } + return interface_; + } + + public void setExtends(final List extendsList) { + this.extendsList = extendsList; + setAsParentNodeOf(this.extendsList); + } + + public void setImplements(final List implementsList) { + this.implementsList = implementsList; + setAsParentNodeOf(this.implementsList); + } + + public void setInterface(final boolean interface_) { + this.interface_ = interface_; + } + + public void setTypeParameters(final List typeParameters) { + this.typeParameters = typeParameters; + setAsParentNodeOf(this.typeParameters); + } @Override public void setJavaDoc(JavadocComment javadocComment) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ConstructorDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ConstructorDeclaration.java index ac30d0bbbe..892810c59f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ConstructorDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ConstructorDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -100,9 +100,9 @@ public BlockStmt getBlock() { /** * Return the modifiers of this member declaration. - * - * @return modifiers + * * @see ModifierSet + * @return modifiers */ public int getModifiers() { return modifiers; @@ -168,7 +168,7 @@ public void setTypeParameters(List typeParameters) { /** * The declaration returned has this schema: - *

    + * * [accessSpecifier] className ([paramType [paramName]]) * [throws exceptionsList] */ @@ -184,7 +184,8 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includi sb.append(getName()); sb.append("("); boolean firstParam = true; - for (Parameter param : getParameters()) { + for (Parameter param : getParameters()) + { if (firstParam) { firstParam = false; } else { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyMemberDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyMemberDeclaration.java index 6625f0e445..1c19d097fe 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyMemberDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyMemberDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyTypeDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyTypeDeclaration.java index d365169d73..59e8686004 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyTypeDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EmptyTypeDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumConstantDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumConstantDeclaration.java index 8eacc5d202..d7c425cda5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumConstantDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumConstantDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; @@ -87,12 +87,12 @@ public String getName() { public void setArgs(List args) { this.args = args; - setAsParentNodeOf(this.args); + setAsParentNodeOf(this.args); } public void setClassBody(List classBody) { this.classBody = classBody; - setAsParentNodeOf(this.classBody); + setAsParentNodeOf(this.classBody); } public void setName(String name) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumDeclaration.java index 28d788ebf1..34b8ee4e54 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/EnumDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; @@ -79,12 +79,12 @@ public List getImplements() { public void setEntries(List entries) { this.entries = entries; - setAsParentNodeOf(this.entries); + setAsParentNodeOf(this.entries); } public void setImplements(List implementsList) { this.implementsList = implementsList; - setAsParentNodeOf(this.implementsList); + setAsParentNodeOf(this.implementsList); } @Override diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/FieldDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/FieldDeclaration.java index f1e310e216..2f48ed8f50 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/FieldDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/FieldDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; @@ -46,31 +46,31 @@ public FieldDeclaration() { } public FieldDeclaration(int modifiers, Type type, VariableDeclarator variable) { - setModifiers(modifiers); - setType(type); - List aux = new ArrayList(); - aux.add(variable); - setVariables(aux); + setModifiers(modifiers); + setType(type); + List aux = new ArrayList(); + aux.add(variable); + setVariables(aux); } public FieldDeclaration(int modifiers, Type type, List variables) { - setModifiers(modifiers); - setType(type); - setVariables(variables); + setModifiers(modifiers); + setType(type); + setVariables(variables); } public FieldDeclaration(int modifiers, List annotations, Type type, List variables) { super(annotations); setModifiers(modifiers); - setType(type); - setVariables(variables); + setType(type); + setVariables(variables); } public FieldDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, Type type, List variables) { super(beginLine, beginColumn, endLine, endColumn, annotations); setModifiers(modifiers); - setType(type); - setVariables(variables); + setType(type); + setVariables(variables); } @Override @@ -85,9 +85,9 @@ public void accept(VoidVisitor v, A arg) { /** * Return the modifiers of this member declaration. - * - * @return modifiers + * * @see ModifierSet + * @return modifiers */ public int getModifiers() { return modifiers; @@ -107,12 +107,12 @@ public void setModifiers(int modifiers) { public void setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); } public void setVariables(List variables) { this.variables = variables; - setAsParentNodeOf(this.variables); + setAsParentNodeOf(this.variables); } @Override diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/InitializerDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/InitializerDeclaration.java index 65ce6a9f36..ea1df9a987 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/InitializerDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/InitializerDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.DocumentableNode; @@ -71,7 +71,7 @@ public boolean isStatic() { public void setBlock(BlockStmt block) { this.block = block; - setAsParentNodeOf(this.block); + setAsParentNodeOf(this.block); } public void setStatic(boolean isStatic) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MethodDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MethodDeclaration.java index eecbea2404..7f9ca0b7df 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MethodDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MethodDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.AccessSpecifier; @@ -41,168 +41,166 @@ */ public final class MethodDeclaration extends BodyDeclaration implements DocumentableNode, WithDeclaration, NamedNode { - private int modifiers; + private int modifiers; - private List typeParameters; + private List typeParameters; - private Type type; + private Type type; - private NameExpr name; + private NameExpr name; - private List parameters; + private List parameters; - private int arrayCount; + private int arrayCount; - private List throws_; + private List throws_; - private BlockStmt body; + private BlockStmt body; private boolean isDefault = false; public MethodDeclaration() { - } - - public MethodDeclaration(final int modifiers, final Type type, final String name) { - setModifiers(modifiers); - setType(type); - setName(name); - } - - public MethodDeclaration(final int modifiers, final Type type, final String name, final List parameters) { - setModifiers(modifiers); - setType(type); - setName(name); - setParameters(parameters); - } - - public MethodDeclaration(final int modifiers, final List annotations, - final List typeParameters, final Type type, final String name, - final List parameters, final int arrayCount, final List throws_, final BlockStmt block) { - super(annotations); - setModifiers(modifiers); - setTypeParameters(typeParameters); - setType(type); - setName(name); - setParameters(parameters); - setArrayCount(arrayCount); - setThrows(throws_); - setBody(block); - } - - public MethodDeclaration(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final int modifiers, final List annotations, - final List typeParameters, final Type type, final String name, - final List parameters, final int arrayCount, final List throws_, final BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn, annotations); - setModifiers(modifiers); - setTypeParameters(typeParameters); - setType(type); - setName(name); - setParameters(parameters); - setArrayCount(arrayCount); - setThrows(throws_); - setBody(block); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - // FIXME this is called "Block" in the constructor. Pick one. - public BlockStmt getBody() { - return body; - } - - /** - * Return the modifiers of this member declaration. - * - * @return modifiers - * @see ModifierSet - */ - public int getModifiers() { - return modifiers; - } - - public String getName() { - return name.getName(); - } + } + + public MethodDeclaration(final int modifiers, final Type type, final String name) { + setModifiers(modifiers); + setType(type); + setName(name); + } + + public MethodDeclaration(final int modifiers, final Type type, final String name, final List parameters) { + setModifiers(modifiers); + setType(type); + setName(name); + setParameters(parameters); + } + + public MethodDeclaration(final int modifiers, final List annotations, + final List typeParameters, final Type type, final String name, + final List parameters, final int arrayCount, final List throws_, final BlockStmt block) { + super(annotations); + setModifiers(modifiers); + setTypeParameters(typeParameters); + setType(type); + setName(name); + setParameters(parameters); + setArrayCount(arrayCount); + setThrows(throws_); + setBody(block); + } + + public MethodDeclaration(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final int modifiers, final List annotations, + final List typeParameters, final Type type, final String name, + final List parameters, final int arrayCount, final List throws_, final BlockStmt block) { + super(beginLine, beginColumn, endLine, endColumn, annotations); + setModifiers(modifiers); + setTypeParameters(typeParameters); + setType(type); + setName(name); + setParameters(parameters); + setArrayCount(arrayCount); + setThrows(throws_); + setBody(block); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public int getArrayCount() { + return arrayCount; + } + + // FIXME this is called "Block" in the constructor. Pick one. + public BlockStmt getBody() { + return body; + } + + /** + * Return the modifiers of this member declaration. + * + * @see ModifierSet + * @return modifiers + */ + public int getModifiers() { + return modifiers; + } + + public String getName() { + return name.getName(); + } public NameExpr getNameExpr() { return name; } - public List getParameters() { + public List getParameters() { if (parameters == null) { parameters = new ArrayList(); } - return parameters; - } + return parameters; + } - public List getThrows() { + public List getThrows() { if (throws_ == null) { throws_ = new ArrayList(); } - return throws_; - } + return throws_; + } - public Type getType() { - return type; - } + public Type getType() { + return type; + } - public List getTypeParameters() { - return typeParameters; - } + public List getTypeParameters() { + return typeParameters; + } - public void setArrayCount(final int arrayCount) { - this.arrayCount = arrayCount; - } + public void setArrayCount(final int arrayCount) { + this.arrayCount = arrayCount; + } - public void setBody(final BlockStmt body) { - this.body = body; - setAsParentNodeOf(this.body); - } + public void setBody(final BlockStmt body) { + this.body = body; + setAsParentNodeOf(this.body); + } - public void setModifiers(final int modifiers) { - this.modifiers = modifiers; - } + public void setModifiers(final int modifiers) { + this.modifiers = modifiers; + } - public void setName(final String name) { - this.name = new NameExpr(name); - } + public void setName(final String name) { + this.name = new NameExpr(name); + } public void setNameExpr(final NameExpr name) { this.name = name; } public void setParameters(final List parameters) { - this.parameters = parameters; - setAsParentNodeOf(this.parameters); - } + this.parameters = parameters; + setAsParentNodeOf(this.parameters); + } - public void setThrows(final List throws_) { - this.throws_ = throws_; - setAsParentNodeOf(this.throws_); - } + public void setThrows(final List throws_) { + this.throws_ = throws_; + setAsParentNodeOf(this.throws_); + } - public void setType(final Type type) { - this.type = type; - setAsParentNodeOf(this.type); - } + public void setType(final Type type) { + this.type = type; + setAsParentNodeOf(this.type); + } - public void setTypeParameters(final List typeParameters) { - this.typeParameters = typeParameters; - setAsParentNodeOf(typeParameters); - } + public void setTypeParameters(final List typeParameters) { + this.typeParameters = typeParameters; + setAsParentNodeOf(typeParameters); + } public boolean isDefault() { @@ -223,14 +221,13 @@ public String getDeclarationAsString() { public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows) { return getDeclarationAsString(includingModifiers, includingThrows, true); } - + /** * The declaration returned has this schema: - *

    + * * [accessSpecifier] [static] [abstract] [final] [native] * [synchronized] returnType methodName ([paramType [paramName]]) * [throws exceptionsList] - * * @return method declaration as String */ @Override @@ -240,19 +237,19 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includi AccessSpecifier accessSpecifier = ModifierSet.getAccessSpecifier(getModifiers()); sb.append(accessSpecifier.getCodeRepresenation()); sb.append(accessSpecifier == AccessSpecifier.DEFAULT ? "" : " "); - if (ModifierSet.isStatic(getModifiers())) { + if (ModifierSet.isStatic(getModifiers())){ sb.append("static "); } - if (ModifierSet.isAbstract(getModifiers())) { + if (ModifierSet.isAbstract(getModifiers())){ sb.append("abstract "); } - if (ModifierSet.isFinal(getModifiers())) { + if (ModifierSet.isFinal(getModifiers())){ sb.append("final "); } - if (ModifierSet.isNative(getModifiers())) { + if (ModifierSet.isNative(getModifiers())){ sb.append("native "); } - if (ModifierSet.isSynchronized(getModifiers())) { + if (ModifierSet.isSynchronized(getModifiers())){ sb.append("synchronized "); } } @@ -262,7 +259,8 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includi sb.append(getName()); sb.append("("); boolean firstParam = true; - for (Parameter param : getParameters()) { + for (Parameter param : getParameters()) + { if (firstParam) { firstParam = false; } else { @@ -273,7 +271,7 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includi } else { sb.append(param.getType().toStringWithoutComments()); if (param.isVarArgs()) { - sb.append("..."); + sb.append("..."); } } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ModifierSet.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ModifierSet.java index b67180a37c..6981ced303 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ModifierSet.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/ModifierSet.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.AccessSpecifier; @@ -57,11 +57,11 @@ public final class ModifierSet { public static final int STRICTFP = Modifier.STRICT; public static AccessSpecifier getAccessSpecifier(int modifiers) { - if (isPublic(modifiers)) { + if (isPublic(modifiers)){ return AccessSpecifier.PUBLIC; - } else if (isProtected(modifiers)) { + } else if (isProtected(modifiers)){ return AccessSpecifier.PROTECTED; - } else if (isPrivate(modifiers)) { + } else if (isPrivate(modifiers)){ return AccessSpecifier.PRIVATE; } else { return AccessSpecifier.DEFAULT; @@ -100,7 +100,6 @@ public static boolean isProtected(int modifiers) { * Is the element accessible from within the package? * It is the level of access which is applied if no modifiers are chosen, * it is sometimes called "default". - * * @param modifiers indicator * @return true if modifier denotes package level access */ @@ -134,9 +133,8 @@ public static boolean isVolatile(int modifiers) { /** * Removes the given modifier. - * * @param modifiers existing modifiers - * @param mod modifier to be removed + * @param mod modifier to be removed * @return result for removing modifier */ public static int removeModifier(int modifiers, int mod) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MultiTypeParameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MultiTypeParameter.java index 5ed92ae94b..6dad24c71f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MultiTypeParameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/MultiTypeParameter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -30,9 +30,8 @@ public class MultiTypeParameter extends BaseParameter { private List types; - - public MultiTypeParameter() { - } + + public MultiTypeParameter() {} public MultiTypeParameter(int modifiers, List annotations, List types, VariableDeclaratorId id) { super(modifiers, annotations, id); @@ -42,13 +41,13 @@ public MultiTypeParameter(int modifiers, List annotations, List< public MultiTypeParameter(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, List types, VariableDeclaratorId id) { super(beginLine, beginColumn, endLine, endColumn, modifiers, annotations, id); this.types = types; - } + } @Override public R accept(GenericVisitor v, A arg) { return v.visit(this, arg); } - + @Override public void accept(VoidVisitor v, A arg) { v.visit(this, arg); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/Parameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/Parameter.java index c5cc20b827..6113d702a3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/Parameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/Parameter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -40,12 +40,12 @@ public Parameter() { } public Parameter(Type type, VariableDeclaratorId id) { - super(id); + super(id); setType(type); } public Parameter(int modifiers, Type type, VariableDeclaratorId id) { - super(modifiers, id); + super(modifiers, id); setType(type); } @@ -75,7 +75,7 @@ public boolean isVarArgs() { public void setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); } public void setVarArgs(boolean isVarArgs) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/TypeDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/TypeDeclaration.java index 7b120bc994..bd7c09327c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/TypeDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/TypeDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.NamedNode; @@ -32,75 +32,75 @@ */ public abstract class TypeDeclaration extends BodyDeclaration implements NamedNode { - private NameExpr name; - - private int modifiers; - - private List members; - - public TypeDeclaration() { - } - - public TypeDeclaration(int modifiers, String name) { - setName(name); - setModifiers(modifiers); - } - - public TypeDeclaration(List annotations, - int modifiers, String name, - List members) { - super(annotations); - setName(name); - setModifiers(modifiers); - setMembers(members); - } - - public TypeDeclaration(int beginLine, int beginColumn, int endLine, - int endColumn, List annotations, - int modifiers, String name, - List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations); - setName(name); - setModifiers(modifiers); - setMembers(members); - } - - public final List getMembers() { - return members; - } - - /** - * Return the modifiers of this type declaration. - * - * @return modifiers - * @see ModifierSet - */ - public final int getModifiers() { - return modifiers; - } - - public final String getName() { - return name.getName(); - } - - public void setMembers(List members) { - this.members = members; - setAsParentNodeOf(this.members); - } - - public final void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public final void setName(String name) { - this.name = new NameExpr(name); - } + private NameExpr name; + + private int modifiers; + + private List members; + + public TypeDeclaration() { + } + + public TypeDeclaration(int modifiers, String name) { + setName(name); + setModifiers(modifiers); + } + + public TypeDeclaration(List annotations, + int modifiers, String name, + List members) { + super(annotations); + setName(name); + setModifiers(modifiers); + setMembers(members); + } + + public TypeDeclaration(int beginLine, int beginColumn, int endLine, + int endColumn, List annotations, + int modifiers, String name, + List members) { + super(beginLine, beginColumn, endLine, endColumn, annotations); + setName(name); + setModifiers(modifiers); + setMembers(members); + } + + public final List getMembers() { + return members; + } + + /** + * Return the modifiers of this type declaration. + * + * @see ModifierSet + * @return modifiers + */ + public final int getModifiers() { + return modifiers; + } + + public final String getName() { + return name.getName(); + } + + public void setMembers(List members) { + this.members = members; + setAsParentNodeOf(this.members); + } + + public final void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public final void setName(String name) { + this.name = new NameExpr(name); + } public final void setNameExpr(NameExpr nameExpr) { - this.name = nameExpr; + this.name = nameExpr; } public final NameExpr getNameExpr() { - return name; + return name; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclarator.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclarator.java index 4e4d399393..50097b8630 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclarator.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclarator.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.Node; @@ -43,8 +43,8 @@ public VariableDeclarator(VariableDeclaratorId id) { } public VariableDeclarator(VariableDeclaratorId id, Expression init) { - setId(id); - setInit(init); + setId(id); + setInit(init); } public VariableDeclarator(int beginLine, int beginColumn, int endLine, int endColumn, VariableDeclaratorId id, Expression init) { @@ -73,11 +73,11 @@ public Expression getInit() { public void setId(VariableDeclaratorId id) { this.id = id; - setAsParentNodeOf(this.id); + setAsParentNodeOf(this.id); } public void setInit(Expression init) { this.init = init; - setAsParentNodeOf(this.init); + setAsParentNodeOf(this.init); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclaratorId.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclaratorId.java index 500060568c..c56bd8e7f1 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclaratorId.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/VariableDeclaratorId.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; import com.github.javaparser.ast.NamedNode; @@ -39,7 +39,7 @@ public VariableDeclaratorId() { } public VariableDeclaratorId(String name) { - setName(name); + setName(name); } public VariableDeclaratorId(int beginLine, int beginColumn, int endLine, int endColumn, String name, int arrayCount) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/WithDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/WithDeclaration.java index 0b4d9df962..8f1725ce60 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/WithDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/body/WithDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.body; /** @@ -32,7 +32,6 @@ public interface WithDeclaration { /** * As {@link WithDeclaration#getDeclarationAsString(boolean, boolean, boolean)} including * the modifiers, the throws clause and the parameters with both type and name. - * * @return String representation of declaration */ String getDeclarationAsString(); @@ -40,9 +39,8 @@ public interface WithDeclaration { /** * As {@link WithDeclaration#getDeclarationAsString(boolean, boolean, boolean)} including * the parameters with both type and name. - * * @param includingModifiers flag to include the modifiers (if present) in the string produced - * @param includingThrows flag to include the throws clause (if present) in the string produced + * @param includingThrows flag to include the throws clause (if present) in the string produced * @return String representation of declaration based on parameter flags */ String getDeclarationAsString(boolean includingModifiers, boolean includingThrows); @@ -50,9 +48,8 @@ public interface WithDeclaration { /** * A simple representation of the element declaration. * It should fit one string. - * - * @param includingModifiers flag to include the modifiers (if present) in the string produced - * @param includingThrows flag to include the throws clause (if present) in the string produced + * @param includingModifiers flag to include the modifiers (if present) in the string produced + * @param includingThrows flag to include the throws clause (if present) in the string produced * @param includingParameterName flag to include the parameter name (while the parameter type is always included) in the string produced * @return String representation of declaration based on parameter flags */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/BlockComment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/BlockComment.java index f6b8f15b37..6b2d039263 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/BlockComment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/BlockComment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -30,7 +30,7 @@ *

    * Block comments can have multi lines and are delimited by "/*" and * "*/". - * + * * @author Julio Vilmar Gesser */ public final class BlockComment extends Comment { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/Comment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/Comment.java index 4247b9277d..135972b928 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/Comment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/Comment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,18 +18,18 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.ast.Node; /** * Abstract class for all AST nodes that represent comments. - * - * @author Julio Vilmar Gesser + * * @see BlockComment * @see LineComment * @see JavadocComment + * @author Julio Vilmar Gesser */ public abstract class Comment extends Node { @@ -50,7 +50,7 @@ public Comment(int beginLine, int beginColumn, int endLine, int endColumn, Strin /** * Return the text of the comment. - * + * * @return text of the comment */ public final String getContent() { @@ -59,44 +59,54 @@ public final String getContent() { /** * Sets the text of the comment. - * - * @param content the text of the comment to set + * + * @param content + * the text of the comment to set */ public void setContent(String content) { this.content = content; } - public boolean isLineComment() { + public boolean isLineComment() + { return false; } - public LineComment asLineComment() { - if (isLineComment()) { + public LineComment asLineComment() + { + if (isLineComment()) + { return (LineComment) this; } else { throw new UnsupportedOperationException("Not a line comment"); } } - public Node getCommentedNode() { + public Node getCommentedNode() + { return this.commentedNode; } - public void setCommentedNode(Node commentedNode) { - if (commentedNode == null) { + public void setCommentedNode(Node commentedNode) + { + if (commentedNode==null) + { this.commentedNode = commentedNode; return; } - if (commentedNode == this) { + if (commentedNode==this) + { throw new IllegalArgumentException(); } - if (commentedNode instanceof Comment) { + if (commentedNode instanceof Comment) + { throw new IllegalArgumentException(); } this.commentedNode = commentedNode; } - public boolean isOrphan() { + public boolean isOrphan() + { return this.commentedNode == null; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsCollection.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsCollection.java index 5cfc5dbc08..ac94c61d5a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsCollection.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsCollection.java @@ -32,45 +32,45 @@ public class CommentsCollection { private List blockComments = new LinkedList(); private List javadocComments = new LinkedList(); - public List getLineComments() { + public List getLineComments(){ return lineComments; } - public List getBlockComments() { + public List getBlockComments(){ return blockComments; } - public List getJavadocComments() { + public List getJavadocComments(){ return javadocComments; } - public void addComment(LineComment lineComment) { + public void addComment(LineComment lineComment){ this.lineComments.add(lineComment); } - public void addComment(BlockComment blockComment) { + public void addComment(BlockComment blockComment){ this.blockComments.add(blockComment); } - public void addComment(JavadocComment javadocComment) { + public void addComment(JavadocComment javadocComment){ this.javadocComments.add(javadocComment); } - public boolean contains(Comment comment) { - for (Comment c : getAll()) { + public boolean contains(Comment comment){ + for (Comment c : getAll()){ // we tollerate a difference of one element in the end column: // it depends how \r and \n are calculated... - if (c.getBeginLine() == comment.getBeginLine() && - c.getBeginColumn() == comment.getBeginColumn() && - c.getEndLine() == comment.getEndLine() && - Math.abs(c.getEndColumn() - comment.getEndColumn()) < 2) { + if ( c.getBeginLine()==comment.getBeginLine() && + c.getBeginColumn()==comment.getBeginColumn() && + c.getEndLine()==comment.getEndLine() && + Math.abs(c.getEndColumn()-comment.getEndColumn())<2 ){ return true; } } return false; } - public List getAll() { + public List getAll(){ List comments = new LinkedList(); comments.addAll(lineComments); comments.addAll(blockComments); @@ -78,24 +78,24 @@ public List getAll() { return comments; } - public int size() { - return lineComments.size() + blockComments.size() + javadocComments.size(); + public int size(){ + return lineComments.size()+blockComments.size()+javadocComments.size(); } - public CommentsCollection minus(CommentsCollection other) { + public CommentsCollection minus(CommentsCollection other){ CommentsCollection result = new CommentsCollection(); - for (LineComment comment : lineComments) { - if (!other.contains(comment)) { + for (LineComment comment : lineComments){ + if (!other.contains(comment)){ result.lineComments.add(comment); } } - for (BlockComment comment : blockComments) { - if (!other.contains(comment)) { + for (BlockComment comment : blockComments){ + if (!other.contains(comment)){ result.blockComments.add(comment); } } - for (JavadocComment comment : javadocComments) { - if (!other.contains(comment)) { + for (JavadocComment comment : javadocComments){ + if (!other.contains(comment)){ result.javadocComments.add(comment); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsParser.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsParser.java index 47857ec38e..3d3a59d45f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsParser.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/CommentsParser.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import java.io.*; @@ -51,7 +51,7 @@ public CommentsCollection parse(final InputStream in, final String charsetName) CommentsCollection comments = new CommentsCollection(); int r; - Deque prevTwoChars = new LinkedList(Arrays.asList('z', 'z')); + Deque prevTwoChars = new LinkedList(Arrays.asList('z','z')); State state = State.CODE; LineComment currentLineComment = null; @@ -59,17 +59,17 @@ public CommentsCollection parse(final InputStream in, final String charsetName) StringBuffer currentContent = null; int currLine = 1; - int currCol = 1; + int currCol = 1; - while ((r = br.read()) != -1) { - char c = (char) r; - if (c == '\r') { + while ((r=br.read()) != -1){ + char c = (char)r; + if (c=='\r'){ lastWasASlashR = true; - } else if (c == '\n' && lastWasASlashR) { - lastWasASlashR = false; + } else if (c=='\n'&&lastWasASlashR){ + lastWasASlashR=false; continue; } else { - lastWasASlashR = false; + lastWasASlashR=false; } switch (state) { case CODE: @@ -94,7 +94,7 @@ public CommentsCollection parse(final InputStream in, final String charsetName) } break; case IN_LINE_COMMENT: - if (c == '\n' || c == '\r') { + if (c=='\n' || c=='\r'){ currentLineComment.setContent(currentContent.toString()); currentLineComment.setEndLine(currLine); currentLineComment.setEndColumn(currCol); @@ -105,28 +105,28 @@ public CommentsCollection parse(final InputStream in, final String charsetName) } break; case IN_BLOCK_COMMENT: - if (prevTwoChars.peekLast().equals('*') && c == '/' && !prevTwoChars.peekFirst().equals('/')) { + if (prevTwoChars.peekLast().equals('*') && c=='/' && !prevTwoChars.peekFirst().equals('/')){ // delete last character - String content = currentContent.deleteCharAt(currentContent.toString().length() - 1).toString(); + String content = currentContent.deleteCharAt(currentContent.toString().length()-1).toString(); - if (content.startsWith("*")) { + if (content.startsWith("*")){ JavadocComment javadocComment = new JavadocComment(); javadocComment.setContent(content.substring(1)); javadocComment.setBeginLine(currentBlockComment.getBeginLine()); javadocComment.setBeginColumn(currentBlockComment.getBeginColumn()); javadocComment.setEndLine(currLine); - javadocComment.setEndColumn(currCol + 1); + javadocComment.setEndColumn(currCol+1); comments.addComment(javadocComment); } else { currentBlockComment.setContent(content); currentBlockComment.setEndLine(currLine); - currentBlockComment.setEndColumn(currCol + 1); + currentBlockComment.setEndColumn(currCol+1); comments.addComment(currentBlockComment); } state = State.CODE; } else { - currentContent.append(c == '\r' ? '\n' : c); + currentContent.append(c=='\r'?'\n':c); } break; case IN_STRING: @@ -142,23 +142,23 @@ public CommentsCollection parse(final InputStream in, final String charsetName) default: throw new RuntimeException("Unexpected"); } - switch (c) { + switch (c){ case '\n': case '\r': - currLine += 1; + currLine+=1; currCol = 1; break; case '\t': - currCol += COLUMNS_PER_TAB; + currCol+=COLUMNS_PER_TAB; break; default: - currCol += 1; + currCol+=1; } prevTwoChars.remove(); prevTwoChars.add(c); } - if (state == State.IN_LINE_COMMENT) { + if (state==State.IN_LINE_COMMENT){ currentLineComment.setContent(currentContent.toString()); currentLineComment.setEndLine(currLine); currentLineComment.setEndColumn(currCol); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/JavadocComment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/JavadocComment.java index 2176a1b984..a070321ffe 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/JavadocComment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/JavadocComment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.ast.visitor.GenericVisitor; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/LineComment.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/LineComment.java index 4e31c4f924..b3df1df0e8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/LineComment.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/comments/LineComment.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.comments; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,7 +29,7 @@ * AST node that represent line comments. *

    * Line comments are started with "//" and finish at the end of the line ("\n"). - * + * * @author Julio Vilmar Gesser */ public final class LineComment extends Comment { @@ -55,7 +55,8 @@ public
    void accept(VoidVisitor v, A arg) { v.visit(this, arg); } - public boolean isLineComment() { + public boolean isLineComment() + { return true; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AnnotationExpr.java index e7e2d22b7f..8c65e926f7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; /** @@ -26,22 +26,21 @@ */ public abstract class AnnotationExpr extends Expression { - protected NameExpr name; + protected NameExpr name; - public AnnotationExpr() { - } + public AnnotationExpr() {} - public AnnotationExpr(int beginLine, int beginColumn, int endLine, - int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } + public AnnotationExpr(int beginLine, int beginColumn, int endLine, + int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } - public NameExpr getName() { - return name; - } + public NameExpr getName() { + return name; + } - public void setName(NameExpr name) { - this.name = name; - setAsParentNodeOf(name); - } + public void setName(NameExpr name) { + this.name = name; + setAsParentNodeOf(name); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayAccessExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayAccessExpr.java index 7868eee564..7026d15eb5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayAccessExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayAccessExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -67,11 +67,11 @@ public Expression getName() { public void setIndex(Expression index) { this.index = index; - setAsParentNodeOf(this.index); + setAsParentNodeOf(this.index); } public void setName(Expression name) { this.name = name; - setAsParentNodeOf(this.name); + setAsParentNodeOf(this.name); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayCreationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayCreationExpr.java index 22054d2411..1ca425b510 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayCreationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayCreationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.type.Type; @@ -107,17 +107,17 @@ public void setArrayCount(int arrayCount) { public void setDimensions(List dimensions) { this.dimensions = dimensions; - setAsParentNodeOf(this.dimensions); + setAsParentNodeOf(this.dimensions); } public void setInitializer(ArrayInitializerExpr initializer) { this.initializer = initializer; - setAsParentNodeOf(this.initializer); + setAsParentNodeOf(this.initializer); } public void setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); } public List> getArraysAnnotations() { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayInitializerExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayInitializerExpr.java index 070872b008..f7fa424cff 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayInitializerExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ArrayInitializerExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -37,7 +37,7 @@ public ArrayInitializerExpr() { } public ArrayInitializerExpr(List values) { - setValues(values); + setValues(values); } public ArrayInitializerExpr(int beginLine, int beginColumn, int endLine, int endColumn, List values) { @@ -61,6 +61,6 @@ public List getValues() { public void setValues(List values) { this.values = values; - setAsParentNodeOf(this.values); + setAsParentNodeOf(this.values); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AssignExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AssignExpr.java index bb6b35b8c6..b3d508fe97 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AssignExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/AssignExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -94,11 +94,11 @@ public void setOperator(Operator op) { public void setTarget(Expression target) { this.target = target; - setAsParentNodeOf(this.target); + setAsParentNodeOf(this.target); } public void setValue(Expression value) { this.value = value; - setAsParentNodeOf(this.value); + setAsParentNodeOf(this.value); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BinaryExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BinaryExpr.java index e86f1cf8ba..4ace4bec4d 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BinaryExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BinaryExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -61,16 +61,16 @@ public BinaryExpr() { } public BinaryExpr(Expression left, Expression right, Operator op) { - setLeft(left); - setRight(right); - setOperator(op); + setLeft(left); + setRight(right); + setOperator(op); } public BinaryExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression left, Expression right, Operator op) { super(beginLine, beginColumn, endLine, endColumn); - setLeft(left); - setRight(right); - setOperator(op); + setLeft(left); + setRight(right); + setOperator(op); } @Override @@ -97,7 +97,7 @@ public Expression getRight() { public void setLeft(Expression left) { this.left = left; - setAsParentNodeOf(this.left); + setAsParentNodeOf(this.left); } public void setOperator(Operator op) { @@ -106,6 +106,6 @@ public void setOperator(Operator op) { public void setRight(Expression right) { this.right = right; - setAsParentNodeOf(this.right); + setAsParentNodeOf(this.right); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BooleanLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BooleanLiteralExpr.java index 93d6698c30..e92244a622 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BooleanLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/BooleanLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -35,7 +35,7 @@ public BooleanLiteralExpr() { } public BooleanLiteralExpr(boolean value) { - setValue(value); + setValue(value); } public BooleanLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, boolean value) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CastExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CastExpr.java index e866a75a2b..843386968b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CastExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CastExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.type.Type; @@ -38,14 +38,14 @@ public CastExpr() { } public CastExpr(Type type, Expression expr) { - setType(type); - setExpr(expr); + setType(type); + setExpr(expr); } public CastExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, Expression expr) { super(beginLine, beginColumn, endLine, endColumn); setType(type); - setExpr(expr); + setExpr(expr); } @Override @@ -68,11 +68,11 @@ public Type getType() { public void setExpr(Expression expr) { this.expr = expr; - setAsParentNodeOf(this.expr); + setAsParentNodeOf(this.expr); } public void setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CharLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CharLiteralExpr.java index 0152ecf6e0..061805d47f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CharLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/CharLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ClassExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ClassExpr.java index 88e9d25a9f..bd33c6730a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ClassExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ClassExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.type.Type; @@ -36,7 +36,7 @@ public ClassExpr() { } public ClassExpr(Type type) { - setType(type); + setType(type); } public ClassExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type) { @@ -60,6 +60,6 @@ public Type getType() { public void setType(Type type) { this.type = type; - setAsParentNodeOf(this.type); + setAsParentNodeOf(this.type); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ConditionalExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ConditionalExpr.java index 0cc7fc204d..31db61cca2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ConditionalExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ConditionalExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -75,16 +75,16 @@ public Expression getThenExpr() { public void setCondition(Expression condition) { this.condition = condition; - setAsParentNodeOf(this.condition); + setAsParentNodeOf(this.condition); } public void setElseExpr(Expression elseExpr) { this.elseExpr = elseExpr; - setAsParentNodeOf(this.elseExpr); + setAsParentNodeOf(this.elseExpr); } public void setThenExpr(Expression thenExpr) { this.thenExpr = thenExpr; - setAsParentNodeOf(this.thenExpr); + setAsParentNodeOf(this.thenExpr); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/DoubleLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/DoubleLiteralExpr.java index fe2a69d787..ce6962d7bf 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/DoubleLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/DoubleLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,25 +29,23 @@ */ public final class DoubleLiteralExpr extends StringLiteralExpr { - public DoubleLiteralExpr() { - } + public DoubleLiteralExpr() { + } - public DoubleLiteralExpr(final String value) { - super(value); - } + public DoubleLiteralExpr(final String value) { + super(value); + } - public DoubleLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } + public DoubleLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String value) { + super(beginLine, beginColumn, endLine, endColumn, value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/EnclosedExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/EnclosedExpr.java index 297f4b98b6..72f9de2a19 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/EnclosedExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/EnclosedExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,37 +29,35 @@ */ public final class EnclosedExpr extends Expression { - private Expression inner; + private Expression inner; - public EnclosedExpr() { - } + public EnclosedExpr() { + } - public EnclosedExpr(final Expression inner) { - setInner(inner); - } + public EnclosedExpr(final Expression inner) { + setInner(inner); + } - public EnclosedExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression inner) { - super(beginLine, beginColumn, endLine, endColumn); - setInner(inner); - } + public EnclosedExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression inner) { + super(beginLine, beginColumn, endLine, endColumn); + setInner(inner); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getInner() { - return inner; - } + public Expression getInner() { + return inner; + } - public void setInner(final Expression inner) { - this.inner = inner; - setAsParentNodeOf(this.inner); - } + public void setInner(final Expression inner) { + this.inner = inner; + setAsParentNodeOf(this.inner); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/Expression.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/Expression.java index 0aa154de6a..8b36d6b1dd 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/Expression.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/Expression.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.Node; @@ -28,11 +28,11 @@ */ public abstract class Expression extends Node { - public Expression() { - } + public Expression() { + } - public Expression(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } + public Expression(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/FieldAccessExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/FieldAccessExpr.java index fd72b8ecb5..b57bf7fe07 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/FieldAccessExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/FieldAccessExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.type.Type; @@ -32,69 +32,67 @@ */ public final class FieldAccessExpr extends Expression { - private Expression scope; + private Expression scope; - private List typeArgs; + private List typeArgs; - private NameExpr field; + private NameExpr field; - public FieldAccessExpr() { - } + public FieldAccessExpr() { + } - public FieldAccessExpr(final Expression scope, final String field) { - setScope(scope); - setField(field); - } + public FieldAccessExpr(final Expression scope, final String field) { + setScope(scope); + setField(field); + } - public FieldAccessExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression scope, final List typeArgs, final String field) { - super(beginLine, beginColumn, endLine, endColumn); - setScope(scope); - setTypeArgs(typeArgs); - setField(field); - } + public FieldAccessExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression scope, final List typeArgs, final String field) { + super(beginLine, beginColumn, endLine, endColumn); + setScope(scope); + setTypeArgs(typeArgs); + setField(field); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getField() { - return field.getName(); - } + public String getField() { + return field.getName(); + } - public NameExpr getFieldExpr() { - return field; - } + public NameExpr getFieldExpr() { + return field; + } - public Expression getScope() { - return scope; - } + public Expression getScope() { + return scope; + } - public List getTypeArgs() { - return typeArgs; - } + public List getTypeArgs() { + return typeArgs; + } - public void setField(final String field) { - this.field = new NameExpr(field); - } + public void setField(final String field) { + this.field = new NameExpr(field); + } - public void setFieldExpr(NameExpr field) { - this.field = field; - } + public void setFieldExpr(NameExpr field) { + this.field = field; + } - public void setScope(final Expression scope) { - this.scope = scope; - setAsParentNodeOf(this.scope); - } + public void setScope(final Expression scope) { + this.scope = scope; + setAsParentNodeOf(this.scope); + } - public void setTypeArgs(final List typeArgs) { - this.typeArgs = typeArgs; - setAsParentNodeOf(this.typeArgs); - } + public void setTypeArgs(final List typeArgs) { + this.typeArgs = typeArgs; + setAsParentNodeOf(this.typeArgs); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/InstanceOfExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/InstanceOfExpr.java index 99a618903b..9a9786512d 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/InstanceOfExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/InstanceOfExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.type.Type; @@ -30,50 +30,48 @@ */ public final class InstanceOfExpr extends Expression { - private Expression expr; + private Expression expr; - private Type type; + private Type type; - public InstanceOfExpr() { - } + public InstanceOfExpr() { + } - public InstanceOfExpr(final Expression expr, final Type type) { - setExpr(expr); - setType(type); - } + public InstanceOfExpr(final Expression expr, final Type type) { + setExpr(expr); + setType(type); + } - public InstanceOfExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression expr, final Type type) { - super(beginLine, beginColumn, endLine, endColumn); - setExpr(expr); - setType(type); - } + public InstanceOfExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression expr, final Type type) { + super(beginLine, beginColumn, endLine, endColumn); + setExpr(expr); + setType(type); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public Type getType() { - return type; - } + public Type getType() { + return type; + } - public void setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - } + public void setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + } - public void setType(final Type type) { - this.type = type; - setAsParentNodeOf(this.type); - } + public void setType(final Type type) { + this.type = type; + setAsParentNodeOf(this.type); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralExpr.java index 14f8108432..b326c57700 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,35 +29,33 @@ */ public class IntegerLiteralExpr extends StringLiteralExpr { - private static final String UNSIGNED_MIN_VALUE = "2147483648"; + private static final String UNSIGNED_MIN_VALUE = "2147483648"; - protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE; + protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE; - public IntegerLiteralExpr() { - } + public IntegerLiteralExpr() { + } - public IntegerLiteralExpr(final String value) { - super(value); - } + public IntegerLiteralExpr(final String value) { + super(value); + } - public IntegerLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } + public IntegerLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String value) { + super(beginLine, beginColumn, endLine, endColumn, value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public final boolean isMinValue() { - return value != null && // - value.length() == 10 && // - value.equals(UNSIGNED_MIN_VALUE); - } + public final boolean isMinValue() { + return value != null && // + value.length() == 10 && // + value.equals(UNSIGNED_MIN_VALUE); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java index 50de28d972..238b56431b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/IntegerLiteralMinValueExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,22 +29,20 @@ */ public final class IntegerLiteralMinValueExpr extends IntegerLiteralExpr { - public IntegerLiteralMinValueExpr() { - super(MIN_VALUE); - } + public IntegerLiteralMinValueExpr() { + super(MIN_VALUE); + } - public IntegerLiteralMinValueExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn, MIN_VALUE); - } + public IntegerLiteralMinValueExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn, MIN_VALUE); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LambdaExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LambdaExpr.java index 28589f1005..4e4e934442 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LambdaExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LambdaExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; @@ -30,65 +30,65 @@ import java.util.List; /** - * Lambda expressions. - * + * Lambda expressions. * @author Raquel Pau + * */ public class LambdaExpr extends Expression { - private List parameters; + private List parameters; - private boolean parametersEnclosed; + private boolean parametersEnclosed; - private Statement body; + private Statement body; - public LambdaExpr() { - } + public LambdaExpr() { + } - public LambdaExpr(int beginLine, int beginColumn, int endLine, + public LambdaExpr(int beginLine, int beginColumn, int endLine, int endColumn, List parameters, Statement body, boolean parametersEnclosed) { - super(beginLine, beginColumn, endLine, endColumn); - setParameters(parameters); - setBody(body); + super(beginLine, beginColumn, endLine, endColumn); + setParameters(parameters); + setBody(body); setParametersEnclosed(parametersEnclosed); - } - - public List getParameters() { - return parameters; - } - - public void setParameters(List parameters) { - this.parameters = parameters; - setAsParentNodeOf(this.parameters); - } - - public Statement getBody() { - return body; - } - - public void setBody(Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public boolean isParametersEnclosed() { - return parametersEnclosed; - } - - public void setParametersEnclosed(boolean parametersEnclosed) { - this.parametersEnclosed = parametersEnclosed; - } + } + + public List getParameters() { + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + setAsParentNodeOf(this.parameters); + } + + public Statement getBody() { + return body; + } + + public void setBody(Statement body) { + this.body = body; + setAsParentNodeOf(this.body); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public boolean isParametersEnclosed() { + return parametersEnclosed; + } + + public void setParametersEnclosed(boolean parametersEnclosed) { + this.parametersEnclosed = parametersEnclosed; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LiteralExpr.java index 425c840e0d..7827f78664 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; /** @@ -26,10 +26,10 @@ */ public abstract class LiteralExpr extends Expression { - public LiteralExpr() { - } + public LiteralExpr() { + } - public LiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } + public LiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralExpr.java index e95d55e660..15ea255bac 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,36 +29,34 @@ */ public class LongLiteralExpr extends StringLiteralExpr { - private static final String UNSIGNED_MIN_VALUE = "9223372036854775808"; + private static final String UNSIGNED_MIN_VALUE = "9223372036854775808"; - protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE + "L"; + protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE + "L"; - public LongLiteralExpr() { - } + public LongLiteralExpr() { + } - public LongLiteralExpr(final String value) { - super(value); - } + public LongLiteralExpr(final String value) { + super(value); + } - public LongLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } + public LongLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String value) { + super(beginLine, beginColumn, endLine, endColumn, value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public final boolean isMinValue() { - return value != null && // - value.length() == 20 && // - value.startsWith(UNSIGNED_MIN_VALUE) && // - (value.charAt(19) == 'L' || value.charAt(19) == 'l'); - } + public final boolean isMinValue() { + return value != null && // + value.length() == 20 && // + value.startsWith(UNSIGNED_MIN_VALUE) && // + (value.charAt(19) == 'L' || value.charAt(19) == 'l'); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java index 0d20854d75..f351f7a593 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/LongLiteralMinValueExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,22 +29,20 @@ */ public final class LongLiteralMinValueExpr extends LongLiteralExpr { - public LongLiteralMinValueExpr() { - super(MIN_VALUE); - } + public LongLiteralMinValueExpr() { + super(MIN_VALUE); + } - public LongLiteralMinValueExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn, MIN_VALUE); - } + public LongLiteralMinValueExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn, MIN_VALUE); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java index 90863a7375..c1a354530a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,27 +29,25 @@ */ public final class MarkerAnnotationExpr extends AnnotationExpr { - public MarkerAnnotationExpr() { - } + public MarkerAnnotationExpr() { + } - public MarkerAnnotationExpr(final NameExpr name) { - setName(name); - } + public MarkerAnnotationExpr(final NameExpr name) { + setName(name); + } - public MarkerAnnotationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final NameExpr name) { - super(beginLine, beginColumn, endLine, endColumn); - setName(name); - } + public MarkerAnnotationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final NameExpr name) { + super(beginLine, beginColumn, endLine, endColumn); + setName(name); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MemberValuePair.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MemberValuePair.java index bd851aa230..e0fa80c666 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MemberValuePair.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MemberValuePair.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.NamedNode; @@ -31,49 +31,47 @@ */ public final class MemberValuePair extends Node implements NamedNode { - private String name; + private String name; - private Expression value; + private Expression value; - public MemberValuePair() { - } + public MemberValuePair() { + } - public MemberValuePair(final String name, final Expression value) { - setName(name); - setValue(value); - } + public MemberValuePair(final String name, final Expression value) { + setName(name); + setValue(value); + } - public MemberValuePair(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String name, final Expression value) { - super(beginLine, beginColumn, endLine, endColumn); - setName(name); - setValue(value); - } + public MemberValuePair(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String name, final Expression value) { + super(beginLine, beginColumn, endLine, endColumn); + setName(name); + setValue(value); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public Expression getValue() { - return value; - } + public Expression getValue() { + return value; + } - public void setName(final String name) { - this.name = name; - } + public void setName(final String name) { + this.name = name; + } - public void setValue(final Expression value) { - this.value = value; - setAsParentNodeOf(this.value); - } + public void setValue(final Expression value) { + this.value = value; + setAsParentNodeOf(this.value); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodCallExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodCallExpr.java index 516e44790c..9d5d10f065 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodCallExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodCallExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.type.Type; @@ -32,87 +32,85 @@ */ public final class MethodCallExpr extends Expression { - private Expression scope; - - private List typeArgs; - - private NameExpr name; - - private List args; - - public MethodCallExpr() { - } - - public MethodCallExpr(final Expression scope, final String name) { - setScope(scope); - setName(name); - } - - public MethodCallExpr(final Expression scope, final String name, final List args) { - setScope(scope); - setName(name); - setArgs(args); - } - - public MethodCallExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression scope, final List typeArgs, final String name, final List args) { - super(beginLine, beginColumn, endLine, endColumn); - setScope(scope); - setTypeArgs(typeArgs); - setName(name); - setArgs(args); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public String getName() { - return name.getName(); - } - - public NameExpr getNameExpr() { - return name; - } - - public Expression getScope() { - return scope; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setArgs(final List args) { - this.args = args; - setAsParentNodeOf(this.args); - } - - public void setName(final String name) { - this.name = new NameExpr(name); - } - - public void setNameExpr(NameExpr name) { - this.name = name; - } - - public void setScope(final Expression scope) { - this.scope = scope; - setAsParentNodeOf(this.scope); - } - - public void setTypeArgs(final List typeArgs) { - this.typeArgs = typeArgs; - setAsParentNodeOf(this.typeArgs); - } + private Expression scope; + + private List typeArgs; + + private NameExpr name; + + private List args; + + public MethodCallExpr() { + } + + public MethodCallExpr(final Expression scope, final String name) { + setScope(scope); + setName(name); + } + + public MethodCallExpr(final Expression scope, final String name, final List args) { + setScope(scope); + setName(name); + setArgs(args); + } + + public MethodCallExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression scope, final List typeArgs, final String name, final List args) { + super(beginLine, beginColumn, endLine, endColumn); + setScope(scope); + setTypeArgs(typeArgs); + setName(name); + setArgs(args); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public List getArgs() { + return args; + } + + public String getName() { + return name.getName(); + } + + public NameExpr getNameExpr() { + return name; + } + + public Expression getScope() { + return scope; + } + + public List getTypeArgs() { + return typeArgs; + } + + public void setArgs(final List args) { + this.args = args; + setAsParentNodeOf(this.args); + } + + public void setName(final String name) { + this.name = new NameExpr(name); + } + + public void setNameExpr(NameExpr name) { + this.name = name; + } + + public void setScope(final Expression scope) { + this.scope = scope; + setAsParentNodeOf(this.scope); + } + + public void setTypeArgs(final List typeArgs) { + this.typeArgs = typeArgs; + setAsParentNodeOf(this.typeArgs); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodReferenceExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodReferenceExpr.java index 6c30e9848d..918ad3f2a5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodReferenceExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/MethodReferenceExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.TypeParameter; @@ -30,12 +30,12 @@ /** * Method reference expressions introduced in Java 8 specifically designed to simplify lambda Expressions. * These are some examples: - *

    - * System.out::println; - *

    - * (test ? stream.map(String::trim) : stream)::toArray; * + * System.out::println; + * + * (test ? stream.map(String::trim) : stream)::toArray; * @author Raquel Pau + * */ public class MethodReferenceExpr extends Expression { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NameExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NameExpr.java index 75665338ed..5cdbbbb6c4 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NameExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NameExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.NamedNode; @@ -30,37 +30,35 @@ */ public class NameExpr extends Expression implements NamedNode { - private String name; + private String name; - public NameExpr() { - } + public NameExpr() { + } - public NameExpr(final String name) { - this.name = name; - } + public NameExpr(final String name) { + this.name = name; + } - public NameExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String name) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - } + public NameExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String name) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public final String getName() { - return name; - } + public final String getName() { + return name; + } - public final void setName(final String name) { - this.name = name; - } + public final void setName(final String name) { + this.name = name; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NormalAnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NormalAnnotationExpr.java index 125d8bd0ee..2b2adfd72f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NormalAnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NormalAnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -31,39 +31,37 @@ */ public final class NormalAnnotationExpr extends AnnotationExpr { - private List pairs; + private List pairs; - public NormalAnnotationExpr() { - } + public NormalAnnotationExpr() { + } - public NormalAnnotationExpr(final NameExpr name, final List pairs) { - setName(name); - setPairs(pairs); - } + public NormalAnnotationExpr(final NameExpr name, final List pairs) { + setName(name); + setPairs(pairs); + } - public NormalAnnotationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final NameExpr name, final List pairs) { - super(beginLine, beginColumn, endLine, endColumn); - setName(name); - setPairs(pairs); - } + public NormalAnnotationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final NameExpr name, final List pairs) { + super(beginLine, beginColumn, endLine, endColumn); + setName(name); + setPairs(pairs); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public List getPairs() { - return pairs; - } + public List getPairs() { + return pairs; + } - public void setPairs(final List pairs) { - this.pairs = pairs; - setAsParentNodeOf(this.pairs); - } + public void setPairs(final List pairs) { + this.pairs = pairs; + setAsParentNodeOf(this.pairs); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NullLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NullLiteralExpr.java index aae98c4eef..c7bc177d50 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NullLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/NullLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,20 +29,18 @@ */ public final class NullLiteralExpr extends LiteralExpr { - public NullLiteralExpr() { - } + public NullLiteralExpr() { + } - public NullLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } + public NullLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ObjectCreationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ObjectCreationExpr.java index 51a8878e1a..228dabc2cd 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ObjectCreationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ObjectCreationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.body.BodyDeclaration; @@ -34,88 +34,86 @@ */ public final class ObjectCreationExpr extends Expression { - private Expression scope; - - private ClassOrInterfaceType type; - - private List typeArgs; - - private List args; - - private List anonymousClassBody; - - public ObjectCreationExpr() { - } - - public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final List args) { - setScope(scope); - setType(type); - setArgs(args); - } - - public ObjectCreationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression scope, final ClassOrInterfaceType type, final List typeArgs, - final List args, final List anonymousBody) { - super(beginLine, beginColumn, endLine, endColumn); - setScope(scope); - setType(type); - setTypeArgs(typeArgs); - setArgs(args); - setAnonymousClassBody(anonymousBody); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getAnonymousClassBody() { - return anonymousClassBody; - } - - public List getArgs() { - return args; - } - - public Expression getScope() { - return scope; - } - - public ClassOrInterfaceType getType() { - return type; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setAnonymousClassBody(final List anonymousClassBody) { - this.anonymousClassBody = anonymousClassBody; - setAsParentNodeOf(this.anonymousClassBody); - } - - public void setArgs(final List args) { - this.args = args; - setAsParentNodeOf(this.args); - } - - public void setScope(final Expression scope) { - this.scope = scope; - setAsParentNodeOf(this.scope); - } - - public void setType(final ClassOrInterfaceType type) { - this.type = type; - setAsParentNodeOf(this.type); - } - - public void setTypeArgs(final List typeArgs) { - this.typeArgs = typeArgs; - setAsParentNodeOf(this.typeArgs); - } + private Expression scope; + + private ClassOrInterfaceType type; + + private List typeArgs; + + private List args; + + private List anonymousClassBody; + + public ObjectCreationExpr() { + } + + public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final List args) { + setScope(scope); + setType(type); + setArgs(args); + } + + public ObjectCreationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression scope, final ClassOrInterfaceType type, final List typeArgs, + final List args, final List anonymousBody) { + super(beginLine, beginColumn, endLine, endColumn); + setScope(scope); + setType(type); + setTypeArgs(typeArgs); + setArgs(args); + setAnonymousClassBody(anonymousBody); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public List getAnonymousClassBody() { + return anonymousClassBody; + } + + public List getArgs() { + return args; + } + + public Expression getScope() { + return scope; + } + + public ClassOrInterfaceType getType() { + return type; + } + + public List getTypeArgs() { + return typeArgs; + } + + public void setAnonymousClassBody(final List anonymousClassBody) { + this.anonymousClassBody = anonymousClassBody; + setAsParentNodeOf(this.anonymousClassBody); + } + + public void setArgs(final List args) { + this.args = args; + setAsParentNodeOf(this.args); + } + + public void setScope(final Expression scope) { + this.scope = scope; + setAsParentNodeOf(this.scope); + } + + public void setType(final ClassOrInterfaceType type) { + this.type = type; + setAsParentNodeOf(this.type); + } + + public void setTypeArgs(final List typeArgs) { + this.typeArgs = typeArgs; + setAsParentNodeOf(this.typeArgs); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/QualifiedNameExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/QualifiedNameExpr.java index 68531f86b7..00a65aa7f9 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/QualifiedNameExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/QualifiedNameExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,38 +29,36 @@ */ public final class QualifiedNameExpr extends NameExpr { - private NameExpr qualifier; + private NameExpr qualifier; - public QualifiedNameExpr() { - } + public QualifiedNameExpr() { + } - public QualifiedNameExpr(final NameExpr scope, final String name) { - super(name); - setQualifier(scope); - } + public QualifiedNameExpr(final NameExpr scope, final String name) { + super(name); + setQualifier(scope); + } - public QualifiedNameExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final NameExpr scope, final String name) { - super(beginLine, beginColumn, endLine, endColumn, name); - setQualifier(scope); - } + public QualifiedNameExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final NameExpr scope, final String name) { + super(beginLine, beginColumn, endLine, endColumn, name); + setQualifier(scope); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public NameExpr getQualifier() { - return qualifier; - } + public NameExpr getQualifier() { + return qualifier; + } - public void setQualifier(final NameExpr qualifier) { - this.qualifier = qualifier; - setAsParentNodeOf(this.qualifier); - } + public void setQualifier(final NameExpr qualifier) { + this.qualifier = qualifier; + setAsParentNodeOf(this.qualifier); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java index 1aeaa46c7e..bd8adb1166 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,39 +29,37 @@ */ public final class SingleMemberAnnotationExpr extends AnnotationExpr { - private Expression memberValue; + private Expression memberValue; - public SingleMemberAnnotationExpr() { - } + public SingleMemberAnnotationExpr() { + } - public SingleMemberAnnotationExpr(final NameExpr name, final Expression memberValue) { - setName(name); - setMemberValue(memberValue); - } + public SingleMemberAnnotationExpr(final NameExpr name, final Expression memberValue) { + setName(name); + setMemberValue(memberValue); + } - public SingleMemberAnnotationExpr(final int beginLine, final int beginColumn, final int endLine, - final int endColumn, final NameExpr name, final Expression memberValue) { - super(beginLine, beginColumn, endLine, endColumn); - setName(name); - setMemberValue(memberValue); - } + public SingleMemberAnnotationExpr(final int beginLine, final int beginColumn, final int endLine, + final int endColumn, final NameExpr name, final Expression memberValue) { + super(beginLine, beginColumn, endLine, endColumn); + setName(name); + setMemberValue(memberValue); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getMemberValue() { - return memberValue; - } + public Expression getMemberValue() { + return memberValue; + } - public void setMemberValue(final Expression memberValue) { - this.memberValue = memberValue; - setAsParentNodeOf(this.memberValue); - } + public void setMemberValue(final Expression memberValue) { + this.memberValue = memberValue; + setAsParentNodeOf(this.memberValue); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/StringLiteralExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/StringLiteralExpr.java index d406c8e8a3..6876fa23e2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/StringLiteralExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/StringLiteralExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,36 +29,34 @@ */ public class StringLiteralExpr extends LiteralExpr { - protected String value; + protected String value; - public StringLiteralExpr() { - } + public StringLiteralExpr() { + } - public StringLiteralExpr(final String value) { - this.value = value; - } + public StringLiteralExpr(final String value) { + this.value = value; + } - public StringLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String value) { - super(beginLine, beginColumn, endLine, endColumn); - this.value = value; - } + public StringLiteralExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String value) { + super(beginLine, beginColumn, endLine, endColumn); + this.value = value; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public final String getValue() { - return value; - } + public final String getValue() { + return value; + } - public final void setValue(final String value) { - this.value = value; - } + public final void setValue(final String value) { + this.value = value; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SuperExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SuperExpr.java index d2a5b58120..791d28bc90 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SuperExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/SuperExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,37 +29,35 @@ */ public final class SuperExpr extends Expression { - private Expression classExpr; + private Expression classExpr; - public SuperExpr() { - } + public SuperExpr() { + } - public SuperExpr(final Expression classExpr) { - setClassExpr(classExpr); - } + public SuperExpr(final Expression classExpr) { + setClassExpr(classExpr); + } - public SuperExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression classExpr) { - super(beginLine, beginColumn, endLine, endColumn); - setClassExpr(classExpr); - } + public SuperExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression classExpr) { + super(beginLine, beginColumn, endLine, endColumn); + setClassExpr(classExpr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getClassExpr() { - return classExpr; - } + public Expression getClassExpr() { + return classExpr; + } - public void setClassExpr(final Expression classExpr) { - this.classExpr = classExpr; - setAsParentNodeOf(this.classExpr); - } + public void setClassExpr(final Expression classExpr) { + this.classExpr = classExpr; + setAsParentNodeOf(this.classExpr); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ThisExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ThisExpr.java index 7751328a95..c269376c92 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ThisExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/ThisExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,37 +29,35 @@ */ public final class ThisExpr extends Expression { - private Expression classExpr; + private Expression classExpr; - public ThisExpr() { - } + public ThisExpr() { + } - public ThisExpr(final Expression classExpr) { - setClassExpr(classExpr); - } + public ThisExpr(final Expression classExpr) { + setClassExpr(classExpr); + } - public ThisExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression classExpr) { - super(beginLine, beginColumn, endLine, endColumn); - setClassExpr(classExpr); - } + public ThisExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression classExpr) { + super(beginLine, beginColumn, endLine, endColumn); + setClassExpr(classExpr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getClassExpr() { - return classExpr; - } + public Expression getClassExpr() { + return classExpr; + } - public void setClassExpr(final Expression classExpr) { - this.classExpr = classExpr; - setAsParentNodeOf(this.classExpr); - } + public void setClassExpr(final Expression classExpr) { + this.classExpr = classExpr; + setAsParentNodeOf(this.classExpr); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/TypeExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/TypeExpr.java index bf64493c40..636d2c4a08 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/TypeExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/TypeExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.type.Type; @@ -27,15 +27,14 @@ /** * This class is just instantiated as scopes for MethodReferenceExpr nodes to encapsulate Types. - * * @author Raquel Pau + * */ -public class TypeExpr extends Expression { +public class TypeExpr extends Expression{ private Type type; - public TypeExpr() { - } + public TypeExpr(){} public TypeExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type) { super(beginLine, beginColumn, endLine, endColumn); @@ -62,4 +61,5 @@ public void setType(Type type) { } + } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/UnaryExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/UnaryExpr.java index 9a00579cd6..19d9360189 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/UnaryExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/UnaryExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,60 +29,58 @@ */ public final class UnaryExpr extends Expression { - public static enum Operator { - positive, // + - negative, // - - preIncrement, // ++ - preDecrement, // -- - not, // ! - inverse, // ~ - posIncrement, // ++ - posDecrement, // -- - } + public static enum Operator { + positive, // + + negative, // - + preIncrement, // ++ + preDecrement, // -- + not, // ! + inverse, // ~ + posIncrement, // ++ + posDecrement, // -- + } - private Expression expr; + private Expression expr; - private Operator op; + private Operator op; - public UnaryExpr() { - } + public UnaryExpr() { + } - public UnaryExpr(final Expression expr, final Operator op) { - setExpr(expr); - setOperator(op); - } + public UnaryExpr(final Expression expr, final Operator op) { + setExpr(expr); + setOperator(op); + } - public UnaryExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression expr, final Operator op) { - super(beginLine, beginColumn, endLine, endColumn); - setExpr(expr); - setOperator(op); - } + public UnaryExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression expr, final Operator op) { + super(beginLine, beginColumn, endLine, endColumn); + setExpr(expr); + setOperator(op); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public Operator getOperator() { - return op; - } + public Operator getOperator() { + return op; + } - public void setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - } + public void setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + } - public void setOperator(final Operator op) { - this.op = op; - } + public void setOperator(final Operator op) { + this.op = op; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/VariableDeclarationExpr.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/VariableDeclarationExpr.java index 28283be425..2dcaa22993 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/VariableDeclarationExpr.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/expr/VariableDeclarationExpr.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.expr; import com.github.javaparser.ast.body.ModifierSet; @@ -34,86 +34,84 @@ */ public final class VariableDeclarationExpr extends Expression { - private int modifiers; - - private List annotations; - - private Type type; - - private List vars; - - public VariableDeclarationExpr() { - } - - public VariableDeclarationExpr(final Type type, final List vars) { - setType(type); - setVars(vars); - } - - public VariableDeclarationExpr(final int modifiers, final Type type, final List vars) { - setModifiers(modifiers); - setType(type); - setVars(vars); - } - - public VariableDeclarationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final int modifiers, final List annotations, final Type type, - final List vars) { - super(beginLine, beginColumn, endLine, endColumn); - setModifiers(modifiers); - setAnnotations(annotations); - setType(type); - setVars(vars); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getAnnotations() { - return annotations; - } - - /** - * Return the modifiers of this variable declaration. - * - * @return modifiers - * @see ModifierSet - */ - public int getModifiers() { - return modifiers; - } - - public Type getType() { - return type; - } - - public List getVars() { - return vars; - } - - public void setAnnotations(final List annotations) { - this.annotations = annotations; - setAsParentNodeOf(this.annotations); - } - - public void setModifiers(final int modifiers) { - this.modifiers = modifiers; - } - - public void setType(final Type type) { - this.type = type; - setAsParentNodeOf(this.type); - } - - public void setVars(final List vars) { - this.vars = vars; - setAsParentNodeOf(this.vars); - } + private int modifiers; + + private List annotations; + + private Type type; + + private List vars; + + public VariableDeclarationExpr() { + } + + public VariableDeclarationExpr(final Type type, final List vars) { + setType(type); + setVars(vars); + } + + public VariableDeclarationExpr(final int modifiers, final Type type, final List vars) { + setModifiers(modifiers); + setType(type); + setVars(vars); + } + + public VariableDeclarationExpr(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final int modifiers, final List annotations, final Type type, + final List vars) { + super(beginLine, beginColumn, endLine, endColumn); + setModifiers(modifiers); + setAnnotations(annotations); + setType(type); + setVars(vars); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public List getAnnotations() { + return annotations; + } + + /** + * Return the modifiers of this variable declaration. + * + * @see ModifierSet + * @return modifiers + */ + public int getModifiers() { + return modifiers; + } + + public Type getType() { + return type; + } + + public List getVars() { + return vars; + } + + public void setAnnotations(final List annotations) { + this.annotations = annotations; + setAsParentNodeOf(this.annotations); + } + + public void setModifiers(final int modifiers) { + this.modifiers = modifiers; + } + + public void setType(final Type type) { + this.type = type; + setAsParentNodeOf(this.type); + } + + public void setVars(final List vars) { + this.vars = vars; + setAsParentNodeOf(this.vars); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/AssertStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/AssertStmt.java index f478289d1f..60f61bca5e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/AssertStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/AssertStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,56 +30,54 @@ */ public final class AssertStmt extends Statement { - private Expression check; - - private Expression msg; - - public AssertStmt() { - } + private Expression check; - public AssertStmt(final Expression check) { - setCheck(check); - } + private Expression msg; - public AssertStmt(final Expression check, final Expression msg) { - setCheck(check); - setMessage(msg); - } + public AssertStmt() { + } - public AssertStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression check, final Expression msg) { - super(beginLine, beginColumn, endLine, endColumn); + public AssertStmt(final Expression check) { + setCheck(check); + } - setCheck(check); - setMessage(msg); + public AssertStmt(final Expression check, final Expression msg) { + setCheck(check); + setMessage(msg); + } - } + public AssertStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression check, final Expression msg) { + super(beginLine, beginColumn, endLine, endColumn); + + setCheck(check); + setMessage(msg); + + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getCheck() { - return check; - } + public Expression getCheck() { + return check; + } - public Expression getMessage() { - return msg; - } + public Expression getMessage() { + return msg; + } - public void setCheck(final Expression check) { - this.check = check; - setAsParentNodeOf(this.check); - } + public void setCheck(final Expression check) { + this.check = check; + setAsParentNodeOf(this.check); + } - public void setMessage(final Expression msg) { - this.msg = msg; - setAsParentNodeOf(this.msg); - } + public void setMessage(final Expression msg) { + this.msg = msg; + setAsParentNodeOf(this.msg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BlockStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BlockStmt.java index 24da01dd0b..d8b16738ee 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BlockStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BlockStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -31,37 +31,37 @@ */ public final class BlockStmt extends Statement { - private List stmts; + private List stmts; - public BlockStmt() { - } + public BlockStmt() { + } - public BlockStmt(final List stmts) { - setStmts(stmts); - } + public BlockStmt(final List stmts) { + setStmts(stmts); + } - public BlockStmt(final int beginLine, final int beginColumn, - final int endLine, final int endColumn, final List stmts) { - super(beginLine, beginColumn, endLine, endColumn); - setStmts(stmts); - } + public BlockStmt(final int beginLine, final int beginColumn, + final int endLine, final int endColumn, final List stmts) { + super(beginLine, beginColumn, endLine, endColumn); + setStmts(stmts); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public List getStmts() { - return stmts; - } + public List getStmts() { + return stmts; + } - public void setStmts(final List stmts) { - this.stmts = stmts; - setAsParentNodeOf(this.stmts); - } + public void setStmts(final List stmts) { + this.stmts = stmts; + setAsParentNodeOf(this.stmts); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BreakStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BreakStmt.java index 8aad9ec2ea..1a80f3e677 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BreakStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/BreakStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,35 +29,33 @@ */ public final class BreakStmt extends Statement { - private String id; + private String id; - public BreakStmt() { - } + public BreakStmt() { + } - public BreakStmt(final String id) { - this.id = id; - } + public BreakStmt(final String id) { + this.id = id; + } - public BreakStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, final String id) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - } + public BreakStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, final String id) { + super(beginLine, beginColumn, endLine, endColumn); + this.id = id; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getId() { - return id; - } + public String getId() { + return id; + } - public void setId(final String id) { - this.id = id; - } + public void setId(final String id) { + this.id = id; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/CatchClause.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/CatchClause.java index d74899e72c..3f43e79771 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/CatchClause.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/CatchClause.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.Node; @@ -47,44 +47,42 @@ public CatchClause(final MultiTypeParameter except, final BlockStmt catchBlock) setExcept(except); setCatchBlock(catchBlock); } - + public CatchClause(int exceptModifier, List exceptAnnotations, List exceptTypes, VariableDeclaratorId exceptId, BlockStmt catchBlock) { this(new MultiTypeParameter(exceptModifier, exceptAnnotations, exceptTypes, exceptId), catchBlock); } public CatchClause(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final int exceptModifier, final List exceptAnnotations, final List exceptTypes, - final VariableDeclaratorId exceptId, final BlockStmt catchBlock) { + final int exceptModifier, final List exceptAnnotations, final List exceptTypes, + final VariableDeclaratorId exceptId, final BlockStmt catchBlock) { super(beginLine, beginColumn, endLine, endColumn); setExcept(new MultiTypeParameter(beginLine, beginColumn, endLine, endColumn, exceptModifier, exceptAnnotations, exceptTypes, exceptId)); setCatchBlock(catchBlock); } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public BlockStmt getCatchBlock() { - return catchBlock; - } + public BlockStmt getCatchBlock() { + return catchBlock; + } - public MultiTypeParameter getExcept() { - return except; - } + public MultiTypeParameter getExcept() { + return except; + } - public void setCatchBlock(final BlockStmt catchBlock) { - this.catchBlock = catchBlock; - setAsParentNodeOf(this.catchBlock); - } + public void setCatchBlock(final BlockStmt catchBlock) { + this.catchBlock = catchBlock; + setAsParentNodeOf(this.catchBlock); + } - public void setExcept(final MultiTypeParameter except) { - this.except = except; - setAsParentNodeOf(this.except); - } + public void setExcept(final MultiTypeParameter except) { + this.except = except; + setAsParentNodeOf(this.except); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ContinueStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ContinueStmt.java index 2afdec0cf2..81760d0a00 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ContinueStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ContinueStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,36 +29,34 @@ */ public final class ContinueStmt extends Statement { - private String id; + private String id; - public ContinueStmt() { - } + public ContinueStmt() { + } - public ContinueStmt(final String id) { - this.id = id; - } + public ContinueStmt(final String id) { + this.id = id; + } - public ContinueStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String id) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - } + public ContinueStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String id) { + super(beginLine, beginColumn, endLine, endColumn); + this.id = id; + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getId() { - return id; - } + public String getId() { + return id; + } - public void setId(final String id) { - this.id = id; - } + public void setId(final String id) { + this.id = id; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/DoStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/DoStmt.java index 022b7bb19f..0a6a770407 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/DoStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/DoStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,50 +30,48 @@ */ public final class DoStmt extends Statement { - private Statement body; + private Statement body; - private Expression condition; + private Expression condition; - public DoStmt() { - } + public DoStmt() { + } - public DoStmt(final Statement body, final Expression condition) { - setBody(body); - setCondition(condition); - } + public DoStmt(final Statement body, final Expression condition) { + setBody(body); + setCondition(condition); + } - public DoStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Statement body, final Expression condition) { - super(beginLine, beginColumn, endLine, endColumn); - setBody(body); - setCondition(condition); - } + public DoStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Statement body, final Expression condition) { + super(beginLine, beginColumn, endLine, endColumn); + setBody(body); + setCondition(condition); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Statement getBody() { - return body; - } + public Statement getBody() { + return body; + } - public Expression getCondition() { - return condition; - } + public Expression getCondition() { + return condition; + } - public void setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - } + public void setBody(final Statement body) { + this.body = body; + setAsParentNodeOf(this.body); + } - public void setCondition(final Expression condition) { - this.condition = condition; - setAsParentNodeOf(this.condition); - } + public void setCondition(final Expression condition) { + this.condition = condition; + setAsParentNodeOf(this.condition); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/EmptyStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/EmptyStmt.java index f6f9091371..fb16c4d986 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/EmptyStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/EmptyStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,20 +29,18 @@ */ public final class EmptyStmt extends Statement { - public EmptyStmt() { - } + public EmptyStmt() { + } - public EmptyStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } + public EmptyStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java index 49d140a976..d0a9efe8c5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -33,77 +33,77 @@ */ public final class ExplicitConstructorInvocationStmt extends Statement { - private List typeArgs; - - private boolean isThis; - - private Expression expr; - - private List args; - - public ExplicitConstructorInvocationStmt() { - } - - public ExplicitConstructorInvocationStmt(final boolean isThis, - final Expression expr, final List args) { - setThis(isThis); - setExpr(expr); - setArgs(args); - } - - public ExplicitConstructorInvocationStmt(final int beginLine, - final int beginColumn, final int endLine, final int endColumn, - final List typeArgs, final boolean isThis, - final Expression expr, final List args) { - super(beginLine, beginColumn, endLine, endColumn); - setTypeArgs(typeArgs); - setThis(isThis); - setExpr(expr); - setArgs(args); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public Expression getExpr() { - return expr; - } - - public List getTypeArgs() { - return typeArgs; - } - - public boolean isThis() { - return isThis; - } - - public void setArgs(final List args) { - this.args = args; - setAsParentNodeOf(this.args); - } - - public void setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - } - - public void setThis(final boolean isThis) { - this.isThis = isThis; - } - - public void setTypeArgs(final List typeArgs) { - this.typeArgs = typeArgs; - setAsParentNodeOf(this.typeArgs); - } + private List typeArgs; + + private boolean isThis; + + private Expression expr; + + private List args; + + public ExplicitConstructorInvocationStmt() { + } + + public ExplicitConstructorInvocationStmt(final boolean isThis, + final Expression expr, final List args) { + setThis(isThis); + setExpr(expr); + setArgs(args); + } + + public ExplicitConstructorInvocationStmt(final int beginLine, + final int beginColumn, final int endLine, final int endColumn, + final List typeArgs, final boolean isThis, + final Expression expr, final List args) { + super(beginLine, beginColumn, endLine, endColumn); + setTypeArgs(typeArgs); + setThis(isThis); + setExpr(expr); + setArgs(args); + } + + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public List getArgs() { + return args; + } + + public Expression getExpr() { + return expr; + } + + public List getTypeArgs() { + return typeArgs; + } + + public boolean isThis() { + return isThis; + } + + public void setArgs(final List args) { + this.args = args; + setAsParentNodeOf(this.args); + } + + public void setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + } + + public void setThis(final boolean isThis) { + this.isThis = isThis; + } + + public void setTypeArgs(final List typeArgs) { + this.typeArgs = typeArgs; + setAsParentNodeOf(this.typeArgs); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExpressionStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExpressionStmt.java index 2b5eb9884d..3c441e2a34 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExpressionStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ExpressionStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,37 +30,35 @@ */ public final class ExpressionStmt extends Statement { - private Expression expr; + private Expression expr; - public ExpressionStmt() { - } + public ExpressionStmt() { + } - public ExpressionStmt(final Expression expr) { - setExpression(expr); - } + public ExpressionStmt(final Expression expr) { + setExpression(expr); + } - public ExpressionStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - setExpression(expr); - } + public ExpressionStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression expr) { + super(beginLine, beginColumn, endLine, endColumn); + setExpression(expr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpression() { - return expr; - } + public Expression getExpression() { + return expr; + } - public void setExpression(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - } + public void setExpression(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForStmt.java index 4bc873256e..8e349bf2c0 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -32,79 +32,79 @@ */ public final class ForStmt extends Statement { - private List init; - - private Expression compare; - - private List update; - - private Statement body; - - public ForStmt() { - } - - public ForStmt(final List init, final Expression compare, - final List update, final Statement body) { - setCompare(compare); - setInit(init); - setUpdate(update); - setBody(body); - } - - public ForStmt(final int beginLine, final int beginColumn, - final int endLine, final int endColumn, - final List init, final Expression compare, - final List update, final Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - setCompare(compare); - setInit(init); - setUpdate(update); - setBody(body); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getCompare() { - return compare; - } - - public List getInit() { - return init; - } - - public List getUpdate() { - return update; - } - - public void setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - } - - public void setCompare(final Expression compare) { - this.compare = compare; - setAsParentNodeOf(this.compare); - } - - public void setInit(final List init) { - this.init = init; - setAsParentNodeOf(this.init); - } - - public void setUpdate(final List update) { - this.update = update; - setAsParentNodeOf(this.update); - } + private List init; + + private Expression compare; + + private List update; + + private Statement body; + + public ForStmt() { + } + + public ForStmt(final List init, final Expression compare, + final List update, final Statement body) { + setCompare(compare); + setInit(init); + setUpdate(update); + setBody(body); + } + + public ForStmt(final int beginLine, final int beginColumn, + final int endLine, final int endColumn, + final List init, final Expression compare, + final List update, final Statement body) { + super(beginLine, beginColumn, endLine, endColumn); + setCompare(compare); + setInit(init); + setUpdate(update); + setBody(body); + } + + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public Statement getBody() { + return body; + } + + public Expression getCompare() { + return compare; + } + + public List getInit() { + return init; + } + + public List getUpdate() { + return update; + } + + public void setBody(final Statement body) { + this.body = body; + setAsParentNodeOf(this.body); + } + + public void setCompare(final Expression compare) { + this.compare = compare; + setAsParentNodeOf(this.compare); + } + + public void setInit(final List init) { + this.init = init; + setAsParentNodeOf(this.init); + } + + public void setUpdate(final List update) { + this.update = update; + setAsParentNodeOf(this.update); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForeachStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForeachStmt.java index 8b5e24b38a..245622fc5b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForeachStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ForeachStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -31,66 +31,66 @@ */ public final class ForeachStmt extends Statement { - private VariableDeclarationExpr var; - - private Expression iterable; - - private Statement body; - - public ForeachStmt() { - } - - public ForeachStmt(final VariableDeclarationExpr var, - final Expression iterable, final Statement body) { - setVariable(var); - setIterable(iterable); - setBody(body); - } - - public ForeachStmt(final int beginLine, final int beginColumn, - final int endLine, final int endColumn, - final VariableDeclarationExpr var, final Expression iterable, - final Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - setVariable(var); - setIterable(iterable); - setBody(body); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getIterable() { - return iterable; - } - - public VariableDeclarationExpr getVariable() { - return var; - } - - public void setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - } - - public void setIterable(final Expression iterable) { - this.iterable = iterable; - setAsParentNodeOf(this.iterable); - } - - public void setVariable(final VariableDeclarationExpr var) { - this.var = var; - setAsParentNodeOf(this.var); - } + private VariableDeclarationExpr var; + + private Expression iterable; + + private Statement body; + + public ForeachStmt() { + } + + public ForeachStmt(final VariableDeclarationExpr var, + final Expression iterable, final Statement body) { + setVariable(var); + setIterable(iterable); + setBody(body); + } + + public ForeachStmt(final int beginLine, final int beginColumn, + final int endLine, final int endColumn, + final VariableDeclarationExpr var, final Expression iterable, + final Statement body) { + super(beginLine, beginColumn, endLine, endColumn); + setVariable(var); + setIterable(iterable); + setBody(body); + } + + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public Statement getBody() { + return body; + } + + public Expression getIterable() { + return iterable; + } + + public VariableDeclarationExpr getVariable() { + return var; + } + + public void setBody(final Statement body) { + this.body = body; + setAsParentNodeOf(this.body); + } + + public void setIterable(final Expression iterable) { + this.iterable = iterable; + setAsParentNodeOf(this.iterable); + } + + public void setVariable(final VariableDeclarationExpr var) { + this.var = var; + setAsParentNodeOf(this.var); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/IfStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/IfStmt.java index 52ae78415d..ccddd903eb 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/IfStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/IfStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,63 +30,61 @@ */ public final class IfStmt extends Statement { - private Expression condition; - - private Statement thenStmt; - - private Statement elseStmt; - - public IfStmt() { - } - - public IfStmt(final Expression condition, final Statement thenStmt, final Statement elseStmt) { - setCondition(condition); - setThenStmt(thenStmt); - setElseStmt(elseStmt); - } - - public IfStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression condition, final Statement thenStmt, final Statement elseStmt) { - super(beginLine, beginColumn, endLine, endColumn); - setCondition(condition); - setThenStmt(thenStmt); - setElseStmt(elseStmt); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public Expression getCondition() { - return condition; - } - - public Statement getElseStmt() { - return elseStmt; - } - - public Statement getThenStmt() { - return thenStmt; - } - - public void setCondition(final Expression condition) { - this.condition = condition; - setAsParentNodeOf(this.condition); - } - - public void setElseStmt(final Statement elseStmt) { - this.elseStmt = elseStmt; - setAsParentNodeOf(this.elseStmt); - } - - public void setThenStmt(final Statement thenStmt) { - this.thenStmt = thenStmt; - setAsParentNodeOf(this.thenStmt); - } + private Expression condition; + + private Statement thenStmt; + + private Statement elseStmt; + + public IfStmt() { + } + + public IfStmt(final Expression condition, final Statement thenStmt, final Statement elseStmt) { + setCondition(condition); + setThenStmt(thenStmt); + setElseStmt(elseStmt); + } + + public IfStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression condition, final Statement thenStmt, final Statement elseStmt) { + super(beginLine, beginColumn, endLine, endColumn); + setCondition(condition); + setThenStmt(thenStmt); + setElseStmt(elseStmt); + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public Expression getCondition() { + return condition; + } + + public Statement getElseStmt() { + return elseStmt; + } + + public Statement getThenStmt() { + return thenStmt; + } + + public void setCondition(final Expression condition) { + this.condition = condition; + setAsParentNodeOf(this.condition); + } + + public void setElseStmt(final Statement elseStmt) { + this.elseStmt = elseStmt; + setAsParentNodeOf(this.elseStmt); + } + + public void setThenStmt(final Statement thenStmt) { + this.thenStmt = thenStmt; + setAsParentNodeOf(this.thenStmt); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/LabeledStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/LabeledStmt.java index 4d1ffc7e42..85d8e7b999 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/LabeledStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/LabeledStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,49 +29,47 @@ */ public final class LabeledStmt extends Statement { - private String label; + private String label; - private Statement stmt; + private Statement stmt; - public LabeledStmt() { - } + public LabeledStmt() { + } - public LabeledStmt(final String label, final Statement stmt) { - setLabel(label); - setStmt(stmt); - } + public LabeledStmt(final String label, final Statement stmt) { + setLabel(label); + setStmt(stmt); + } - public LabeledStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final String label, final Statement stmt) { - super(beginLine, beginColumn, endLine, endColumn); - setLabel(label); - setStmt(stmt); - } + public LabeledStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final String label, final Statement stmt) { + super(beginLine, beginColumn, endLine, endColumn); + setLabel(label); + setStmt(stmt); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public String getLabel() { - return label; - } + public String getLabel() { + return label; + } - public Statement getStmt() { - return stmt; - } + public Statement getStmt() { + return stmt; + } - public void setLabel(final String label) { - this.label = label; - } + public void setLabel(final String label) { + this.label = label; + } - public void setStmt(final Statement stmt) { - this.stmt = stmt; - setAsParentNodeOf(this.stmt); - } + public void setStmt(final Statement stmt) { + this.stmt = stmt; + setAsParentNodeOf(this.stmt); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ReturnStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ReturnStmt.java index f176f6b7cb..3ac6fa65e6 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ReturnStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ReturnStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,37 +30,35 @@ */ public final class ReturnStmt extends Statement { - private Expression expr; + private Expression expr; - public ReturnStmt() { - } + public ReturnStmt() { + } - public ReturnStmt(final Expression expr) { - setExpr(expr); - } + public ReturnStmt(final Expression expr) { + setExpr(expr); + } - public ReturnStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - setExpr(expr); - } + public ReturnStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression expr) { + super(beginLine, beginColumn, endLine, endColumn); + setExpr(expr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public void setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - } + public void setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/Statement.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/Statement.java index 98bc475fa8..30c462d054 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/Statement.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/Statement.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.Node; @@ -28,11 +28,11 @@ */ public abstract class Statement extends Node { - public Statement() { - } + public Statement() { + } - public Statement(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } + public Statement(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchEntryStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchEntryStmt.java index 3103c88c49..8f5a85ad57 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchEntryStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchEntryStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -32,51 +32,51 @@ */ public final class SwitchEntryStmt extends Statement { - private Expression label; + private Expression label; - private List stmts; + private List stmts; - public SwitchEntryStmt() { - } + public SwitchEntryStmt() { + } - public SwitchEntryStmt(final Expression label, final List stmts) { - setLabel(label); - setStmts(stmts); - } + public SwitchEntryStmt(final Expression label, final List stmts) { + setLabel(label); + setStmts(stmts); + } - public SwitchEntryStmt(final int beginLine, final int beginColumn, - final int endLine, final int endColumn, final Expression label, - final List stmts) { - super(beginLine, beginColumn, endLine, endColumn); - setLabel(label); - setStmts(stmts); - } + public SwitchEntryStmt(final int beginLine, final int beginColumn, + final int endLine, final int endColumn, final Expression label, + final List stmts) { + super(beginLine, beginColumn, endLine, endColumn); + setLabel(label); + setStmts(stmts); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getLabel() { - return label; - } + public Expression getLabel() { + return label; + } - public List getStmts() { - return stmts; - } + public List getStmts() { + return stmts; + } - public void setLabel(final Expression label) { - this.label = label; - setAsParentNodeOf(this.label); - } + public void setLabel(final Expression label) { + this.label = label; + setAsParentNodeOf(this.label); + } - public void setStmts(final List stmts) { - this.stmts = stmts; - setAsParentNodeOf(this.stmts); - } + public void setStmts(final List stmts) { + this.stmts = stmts; + setAsParentNodeOf(this.stmts); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchStmt.java index e443e108c2..49fe903da6 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SwitchStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -32,52 +32,52 @@ */ public final class SwitchStmt extends Statement { - private Expression selector; + private Expression selector; - private List entries; + private List entries; - public SwitchStmt() { - } + public SwitchStmt() { + } - public SwitchStmt(final Expression selector, - final List entries) { - setSelector(selector); - setEntries(entries); - } + public SwitchStmt(final Expression selector, + final List entries) { + setSelector(selector); + setEntries(entries); + } - public SwitchStmt(final int beginLine, final int beginColumn, - final int endLine, final int endColumn, final Expression selector, - final List entries) { - super(beginLine, beginColumn, endLine, endColumn); - setSelector(selector); - setEntries(entries); - } + public SwitchStmt(final int beginLine, final int beginColumn, + final int endLine, final int endColumn, final Expression selector, + final List entries) { + super(beginLine, beginColumn, endLine, endColumn); + setSelector(selector); + setEntries(entries); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public List getEntries() { - return entries; - } + public List getEntries() { + return entries; + } - public Expression getSelector() { - return selector; - } + public Expression getSelector() { + return selector; + } - public void setEntries(final List entries) { - this.entries = entries; - setAsParentNodeOf(this.entries); - } + public void setEntries(final List entries) { + this.entries = entries; + setAsParentNodeOf(this.entries); + } - public void setSelector(final Expression selector) { - this.selector = selector; - setAsParentNodeOf(this.selector); - } + public void setSelector(final Expression selector) { + this.selector = selector; + setAsParentNodeOf(this.selector); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SynchronizedStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SynchronizedStmt.java index 0de7bf428a..e91fc0b194 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SynchronizedStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/SynchronizedStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,51 +30,51 @@ */ public final class SynchronizedStmt extends Statement { - private Expression expr; + private Expression expr; - private BlockStmt block; + private BlockStmt block; - public SynchronizedStmt() { - } + public SynchronizedStmt() { + } - public SynchronizedStmt(final Expression expr, final BlockStmt block) { - setExpr(expr); - setBlock(block); - } + public SynchronizedStmt(final Expression expr, final BlockStmt block) { + setExpr(expr); + setBlock(block); + } - public SynchronizedStmt(final int beginLine, final int beginColumn, - final int endLine, final int endColumn, final Expression expr, - final BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn); - setExpr(expr); - setBlock(block); - } + public SynchronizedStmt(final int beginLine, final int beginColumn, + final int endLine, final int endColumn, final Expression expr, + final BlockStmt block) { + super(beginLine, beginColumn, endLine, endColumn); + setExpr(expr); + setBlock(block); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public BlockStmt getBlock() { - return block; - } + public BlockStmt getBlock() { + return block; + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public void setBlock(final BlockStmt block) { - this.block = block; - setAsParentNodeOf(this.block); - } + public void setBlock(final BlockStmt block) { + this.block = block; + setAsParentNodeOf(this.block); + } - public void setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - } + public void setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ThrowStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ThrowStmt.java index b97009d9e0..48283b16da 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ThrowStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/ThrowStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,37 +30,35 @@ */ public final class ThrowStmt extends Statement { - private Expression expr; + private Expression expr; - public ThrowStmt() { - } + public ThrowStmt() { + } - public ThrowStmt(final Expression expr) { - setExpr(expr); - } + public ThrowStmt(final Expression expr) { + setExpr(expr); + } - public ThrowStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - setExpr(expr); - } + public ThrowStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression expr) { + super(beginLine, beginColumn, endLine, endColumn); + setExpr(expr); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Expression getExpr() { - return expr; - } + public Expression getExpr() { + return expr; + } - public void setExpr(final Expression expr) { - this.expr = expr; - setAsParentNodeOf(this.expr); - } + public void setExpr(final Expression expr) { + this.expr = expr; + setAsParentNodeOf(this.expr); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TryStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TryStmt.java index f4fecf8696..44009c4c98 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TryStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TryStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -31,78 +31,78 @@ * @author Julio Vilmar Gesser */ public final class TryStmt extends Statement { - - private List resources; - - private BlockStmt tryBlock; - - private List catchs; - - private BlockStmt finallyBlock; - - public TryStmt() { - } - - public TryStmt(final BlockStmt tryBlock, final List catchs, - final BlockStmt finallyBlock) { - setTryBlock(tryBlock); - setCatchs(catchs); - setFinallyBlock(finallyBlock); - } - - public TryStmt(final int beginLine, final int beginColumn, - final int endLine, final int endColumn, List resources, - final BlockStmt tryBlock, final List catchs, final BlockStmt finallyBlock) { - super(beginLine, beginColumn, endLine, endColumn); - setResources(resources); - setTryBlock(tryBlock); - setCatchs(catchs); - setFinallyBlock(finallyBlock); - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public List getCatchs() { - return catchs; - } - - public BlockStmt getFinallyBlock() { - return finallyBlock; - } - - public BlockStmt getTryBlock() { - return tryBlock; - } - - public List getResources() { - return resources; - } - - public void setCatchs(final List catchs) { - this.catchs = catchs; - setAsParentNodeOf(this.catchs); - } - - public void setFinallyBlock(final BlockStmt finallyBlock) { - this.finallyBlock = finallyBlock; - setAsParentNodeOf(this.finallyBlock); - } - - public void setTryBlock(final BlockStmt tryBlock) { - this.tryBlock = tryBlock; - setAsParentNodeOf(this.tryBlock); - } - - public void setResources(List resources) { - this.resources = resources; - setAsParentNodeOf(this.resources); - } + + private List resources; + + private BlockStmt tryBlock; + + private List catchs; + + private BlockStmt finallyBlock; + + public TryStmt() { + } + + public TryStmt(final BlockStmt tryBlock, final List catchs, + final BlockStmt finallyBlock) { + setTryBlock(tryBlock); + setCatchs(catchs); + setFinallyBlock(finallyBlock); + } + + public TryStmt(final int beginLine, final int beginColumn, + final int endLine, final int endColumn, List resources, + final BlockStmt tryBlock, final List catchs, final BlockStmt finallyBlock) { + super(beginLine, beginColumn, endLine, endColumn); + setResources(resources); + setTryBlock(tryBlock); + setCatchs(catchs); + setFinallyBlock(finallyBlock); + } + + @Override + public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public List getCatchs() { + return catchs; + } + + public BlockStmt getFinallyBlock() { + return finallyBlock; + } + + public BlockStmt getTryBlock() { + return tryBlock; + } + + public List getResources() { + return resources; + } + + public void setCatchs(final List catchs) { + this.catchs = catchs; + setAsParentNodeOf(this.catchs); + } + + public void setFinallyBlock(final BlockStmt finallyBlock) { + this.finallyBlock = finallyBlock; + setAsParentNodeOf(this.finallyBlock); + } + + public void setTryBlock(final BlockStmt tryBlock) { + this.tryBlock = tryBlock; + setAsParentNodeOf(this.tryBlock); + } + + public void setResources(List resources) { + this.resources = resources; + setAsParentNodeOf(this.resources); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java index 8e30292a3b..79b507a1f8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/TypeDeclarationStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.body.TypeDeclaration; @@ -30,37 +30,35 @@ */ public final class TypeDeclarationStmt extends Statement { - private TypeDeclaration typeDecl; + private TypeDeclaration typeDecl; - public TypeDeclarationStmt() { - } + public TypeDeclarationStmt() { + } - public TypeDeclarationStmt(final TypeDeclaration typeDecl) { - setTypeDeclaration(typeDecl); - } + public TypeDeclarationStmt(final TypeDeclaration typeDecl) { + setTypeDeclaration(typeDecl); + } - public TypeDeclarationStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final TypeDeclaration typeDecl) { - super(beginLine, beginColumn, endLine, endColumn); - setTypeDeclaration(typeDecl); - } + public TypeDeclarationStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final TypeDeclaration typeDecl) { + super(beginLine, beginColumn, endLine, endColumn); + setTypeDeclaration(typeDecl); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public TypeDeclaration getTypeDeclaration() { - return typeDecl; - } + public TypeDeclaration getTypeDeclaration() { + return typeDecl; + } - public void setTypeDeclaration(final TypeDeclaration typeDecl) { - this.typeDecl = typeDecl; - setAsParentNodeOf(this.typeDecl); - } + public void setTypeDeclaration(final TypeDeclaration typeDecl) { + this.typeDecl = typeDecl; + setAsParentNodeOf(this.typeDecl); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/WhileStmt.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/WhileStmt.java index 47b093d061..51b2a1a232 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/WhileStmt.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/stmt/WhileStmt.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.stmt; import com.github.javaparser.ast.expr.Expression; @@ -30,50 +30,48 @@ */ public final class WhileStmt extends Statement { - private Expression condition; + private Expression condition; - private Statement body; + private Statement body; - public WhileStmt() { - } + public WhileStmt() { + } - public WhileStmt(final Expression condition, final Statement body) { - setCondition(condition); - setBody(body); - } + public WhileStmt(final Expression condition, final Statement body) { + setCondition(condition); + setBody(body); + } - public WhileStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Expression condition, final Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - setCondition(condition); - setBody(body); - } + public WhileStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Expression condition, final Statement body) { + super(beginLine, beginColumn, endLine, endColumn); + setCondition(condition); + setBody(body); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public Statement getBody() { - return body; - } + public Statement getBody() { + return body; + } - public Expression getCondition() { - return condition; - } + public Expression getCondition() { + return condition; + } - public void setBody(final Statement body) { - this.body = body; - setAsParentNodeOf(this.body); - } + public void setBody(final Statement body) { + this.body = body; + setAsParentNodeOf(this.body); + } - public void setCondition(final Expression condition) { - this.condition = condition; - setAsParentNodeOf(this.condition); - } + public void setCondition(final Expression condition) { + this.condition = condition; + setAsParentNodeOf(this.condition); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ClassOrInterfaceType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ClassOrInterfaceType.java index 9b3c6d625e..a7efbf4e36 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ClassOrInterfaceType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ClassOrInterfaceType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/PrimitiveType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/PrimitiveType.java index 1b599d3b93..561a89657c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/PrimitiveType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/PrimitiveType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import java.util.HashMap; @@ -31,70 +31,67 @@ */ public final class PrimitiveType extends Type { - public enum Primitive { - Boolean("Boolean"), - Char("Character"), - Byte("Byte"), - Short("Short"), - Int("Integer"), - Long("Long"), - Float("Float"), - Double("Double"); - - final String nameOfBoxedType; - - public ClassOrInterfaceType toBoxedType() { - return new ClassOrInterfaceType(nameOfBoxedType); - } - - private Primitive(String nameOfBoxedType) { - this.nameOfBoxedType = nameOfBoxedType; - } - } - - static final HashMap unboxMap = new HashMap(); - - static { - for (Primitive unboxedType : Primitive.values()) { - unboxMap.put(unboxedType.nameOfBoxedType, unboxedType); - } - } - - private Primitive type; - - public PrimitiveType() { - } - - public PrimitiveType(final Primitive type) { - this.type = type; - } - - public PrimitiveType(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Primitive type) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - } - - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public Primitive getType() { - return type; - } - - public ClassOrInterfaceType toBoxedType() { - return type.toBoxedType(); - } - - public void setType(final Primitive type) { - this.type = type; - } + public enum Primitive { + Boolean ("Boolean"), + Char ("Character"), + Byte ("Byte"), + Short ("Short"), + Int ("Integer"), + Long ("Long"), + Float ("Float"), + Double ("Double"); + + final String nameOfBoxedType; + + public ClassOrInterfaceType toBoxedType() { + return new ClassOrInterfaceType(nameOfBoxedType); + } + + private Primitive(String nameOfBoxedType) { + this.nameOfBoxedType = nameOfBoxedType; + } + } + + static final HashMap unboxMap = new HashMap(); + static { + for(Primitive unboxedType : Primitive.values()) { + unboxMap.put(unboxedType.nameOfBoxedType, unboxedType); + } + } + + private Primitive type; + + public PrimitiveType() { + } + + public PrimitiveType(final Primitive type) { + this.type = type; + } + + public PrimitiveType(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Primitive type) { + super(beginLine, beginColumn, endLine, endColumn); + this.type = type; + } + + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public Primitive getType() { + return type; + } + + public ClassOrInterfaceType toBoxedType() { + return type.toBoxedType(); + } + + public void setType(final Primitive type) { + this.type = type; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ReferenceType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ReferenceType.java index 9de2bb4786..55d303492e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ReferenceType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/ReferenceType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -32,30 +32,30 @@ */ public final class ReferenceType extends Type { - private Type type; + private Type type; - private int arrayCount; + private int arrayCount; private List> arraysAnnotations; public ReferenceType() { - } + } - public ReferenceType(final Type type) { - setType(type); - } + public ReferenceType(final Type type) { + setType(type); + } - public ReferenceType(final Type type, final int arrayCount) { - setType(type); - setArrayCount(arrayCount); - } + public ReferenceType(final Type type, final int arrayCount) { + setType(type); + setArrayCount(arrayCount); + } - public ReferenceType(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final Type type, final int arrayCount) { - super(beginLine, beginColumn, endLine, endColumn); - setType(type); - setArrayCount(arrayCount); - } + public ReferenceType(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final Type type, final int arrayCount) { + super(beginLine, beginColumn, endLine, endColumn); + setType(type); + setArrayCount(arrayCount); + } public ReferenceType(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount, @@ -67,60 +67,58 @@ public ReferenceType(int beginLine, int beginColumn, int endLine, this.arraysAnnotations = arraysAnnotations; } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public Type getType() { - return type; - } - - public void setArrayCount(final int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setType(final Type type) { - this.type = type; - setAsParentNodeOf(this.type); - } - - /** - *

    Arrays annotations are annotations on the arrays modifiers of the type. - * Consider this example:

    - * - *

    -     * {@code
    -     * int @Ann1 [] @Ann2 [] array;
    -     * }

    - * - *

    in this method will return a list with the annotation expressions

    @Ann1
    - * and
    @Ann2

    - * - *

    Note that the first list element of arraysAnnotations will refer to the first array modifier encountered. - * Considering the example the first element will be a list containing just @Ann1 while the second element will - * be a list containing just @Ann2. - *

    - * - *

    This property is guaranteed to hold:

    {@code getArraysAnnotations().size() == getArrayCount()}
    - * If a certain array modifier has no annotation the corresponding entry of arraysAnnotations will be null

    - */ + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } + + @Override public
    void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } + + public int getArrayCount() { + return arrayCount; + } + + public Type getType() { + return type; + } + + public void setArrayCount(final int arrayCount) { + this.arrayCount = arrayCount; + } + + public void setType(final Type type) { + this.type = type; + setAsParentNodeOf(this.type); + } + + /** + *

    Arrays annotations are annotations on the arrays modifiers of the type. + * Consider this example:

    + * + *

    +	 * {@code
    +	 * int @Ann1 [] @Ann2 [] array;
    +	 * }

    + * + *

    in this method will return a list with the annotation expressions

    @Ann1
    + * and
    @Ann2

    + * + *

    Note that the first list element of arraysAnnotations will refer to the first array modifier encountered. + * Considering the example the first element will be a list containing just @Ann1 while the second element will + * be a list containing just @Ann2. + *

    + * + *

    This property is guaranteed to hold:

    {@code getArraysAnnotations().size() == getArrayCount()}
    + * If a certain array modifier has no annotation the corresponding entry of arraysAnnotations will be null

    + */ public List> getArraysAnnotations() { return arraysAnnotations; } - /** - * For a description of the arrayAnnotations field refer to {@link #getArraysAnnotations()} - */ + /** + * For a description of the arrayAnnotations field refer to {@link #getArraysAnnotations()} + */ public void setArraysAnnotations(List> arraysAnnotations) { this.arraysAnnotations = arraysAnnotations; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/Type.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/Type.java index 298b95b533..22c91240fa 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/Type.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/Type.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.ast.Node; @@ -36,7 +36,7 @@ public abstract class Type extends Node { public Type() { } - public Type(List annotation) { + public Type(List annotation){ this.annotations = annotation; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/UnknownType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/UnknownType.java index e40dd56f21..af6d4d979e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/UnknownType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/UnknownType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.ast.visitor.GenericVisitor; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/VoidType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/VoidType.java index e2246babcd..5dacbe1e7e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/VoidType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/VoidType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,21 +29,19 @@ */ public final class VoidType extends Type { - public VoidType() { - } + public VoidType() { + } - public VoidType(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } + public VoidType(final int beginLine, final int beginColumn, final int endLine, final int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public
    void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/WildcardType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/WildcardType.java index 0d33a68586..8016ed70eb 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/WildcardType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/type/WildcardType.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.type; import com.github.javaparser.ast.visitor.GenericVisitor; @@ -29,55 +29,53 @@ */ public final class WildcardType extends Type { - private ReferenceType ext; + private ReferenceType ext; - private ReferenceType sup; + private ReferenceType sup; - public WildcardType() { - } + public WildcardType() { + } - public WildcardType(final ReferenceType ext) { - setExtends(ext); - } + public WildcardType(final ReferenceType ext) { + setExtends(ext); + } - public WildcardType(final ReferenceType ext, final ReferenceType sup) { - setExtends(ext); - setSuper(sup); - } + public WildcardType(final ReferenceType ext, final ReferenceType sup) { + setExtends(ext); + setSuper(sup); + } - public WildcardType(final int beginLine, final int beginColumn, final int endLine, final int endColumn, - final ReferenceType ext, final ReferenceType sup) { - super(beginLine, beginColumn, endLine, endColumn); - setExtends(ext); - setSuper(sup); - } + public WildcardType(final int beginLine, final int beginColumn, final int endLine, final int endColumn, + final ReferenceType ext, final ReferenceType sup) { + super(beginLine, beginColumn, endLine, endColumn); + setExtends(ext); + setSuper(sup); + } - @Override - public R accept(final GenericVisitor v, final A arg) { - return v.visit(this, arg); - } + @Override public R accept(final GenericVisitor v, final A arg) { + return v.visit(this, arg); + } - @Override - public void accept(final VoidVisitor v, final A arg) { - v.visit(this, arg); - } + @Override public void accept(final VoidVisitor v, final A arg) { + v.visit(this, arg); + } - public ReferenceType getExtends() { - return ext; - } + public ReferenceType getExtends() { + return ext; + } - public ReferenceType getSuper() { - return sup; - } + public ReferenceType getSuper() { + return sup; + } - public void setExtends(final ReferenceType ext) { - this.ext = ext; - setAsParentNodeOf(this.ext); - } + public void setExtends(final ReferenceType ext) { + this.ext = ext; + setAsParentNodeOf(this.ext); + } - public void setSuper(final ReferenceType sup) { - this.sup = sup; - setAsParentNodeOf(this.sup); - } + public void setSuper(final ReferenceType sup) { + this.sup = sup; + setAsParentNodeOf(this.sup); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/CloneVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/CloneVisitor.java index a81452213b..3d8d299aa0 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/CloneVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/CloneVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import java.util.ArrayList; @@ -57,47 +57,47 @@ public class CloneVisitor implements GenericVisitor { - @Override - public Node visit(CompilationUnit _n, Object _arg) { - PackageDeclaration package_ = cloneNodes(_n.getPackage(), _arg); - List imports = visit(_n.getImports(), _arg); - List types = visit(_n.getTypes(), _arg); - - return new CompilationUnit( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - package_, imports, types - ); - } - - @Override - public Node visit(PackageDeclaration _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - NameExpr name = cloneNodes(_n.getName(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - PackageDeclaration r = new PackageDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - annotations, name - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ImportDeclaration _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ImportDeclaration r = new ImportDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - name, _n.isStatic(), _n.isAsterisk() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(TypeParameter _n, Object _arg) { + @Override + public Node visit(CompilationUnit _n, Object _arg) { + PackageDeclaration package_ = cloneNodes(_n.getPackage(), _arg); + List imports = visit(_n.getImports(), _arg); + List types = visit(_n.getTypes(), _arg); + + return new CompilationUnit( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + package_, imports, types + ); + } + + @Override + public Node visit(PackageDeclaration _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + NameExpr name = cloneNodes(_n.getName(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + PackageDeclaration r = new PackageDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + annotations, name + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ImportDeclaration _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ImportDeclaration r = new ImportDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + name, _n.isStatic(), _n.isAsterisk() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(TypeParameter _n, Object _arg) { List typeBound = visit(_n.getTypeBound(), _arg); List annotations = visit(_n.getAnnotations(), _arg); @@ -107,1085 +107,1085 @@ public Node visit(TypeParameter _n, Object _arg) { Comment comment = cloneNodes(_n.getComment(), _arg); r.setComment(comment); - return r; - } - - @Override - public Node visit(LineComment _n, Object _arg) { - return new LineComment(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getContent()); - } - - @Override - public Node visit(BlockComment _n, Object _arg) { - return new BlockComment(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getContent()); - } - - @Override - public Node visit(ClassOrInterfaceDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - List typeParameters = visit(_n.getTypeParameters(), _arg); - List extendsList = visit(_n.getExtends(), _arg); - List implementsList = visit(_n.getImplements(), _arg); - List members = visit(_n.getMembers(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ClassOrInterfaceDeclaration r = new ClassOrInterfaceDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, _n.isInterface(), _n.getName(), typeParameters, extendsList, implementsList, members - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EnumDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - List implementsList = visit(_n.getImplements(), _arg); - List entries = visit(_n.getEntries(), _arg); - List members = visit(_n.getMembers(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EnumDeclaration r = new EnumDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, _n.getName(), implementsList, entries, members - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EmptyTypeDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EmptyTypeDeclaration r = new EmptyTypeDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EnumConstantDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - List args = visit(_n.getArgs(), _arg); - List classBody = visit(_n.getClassBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EnumConstantDeclaration r = new EnumConstantDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - annotations, _n.getName(), args, classBody - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AnnotationDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - List members = visit(_n.getMembers(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AnnotationDeclaration r = new AnnotationDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, _n.getName(), members - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AnnotationMemberDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - Expression defaultValue = cloneNodes(_n.getDefaultValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AnnotationMemberDeclaration r = new AnnotationMemberDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, type_, _n.getName(), defaultValue - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(FieldDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - List variables = visit(_n.getVariables(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - FieldDeclaration r = new FieldDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, type_, variables - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(VariableDeclarator _n, Object _arg) { - VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); - Expression init = cloneNodes(_n.getInit(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - VariableDeclarator r = new VariableDeclarator( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - id, init - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(VariableDeclaratorId _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - VariableDeclaratorId r = new VariableDeclaratorId( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getName(), _n.getArrayCount() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ConstructorDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - List typeParameters = visit(_n.getTypeParameters(), _arg); - List parameters = visit(_n.getParameters(), _arg); - List throws_ = visit(_n.getThrows(), _arg); - BlockStmt block = cloneNodes(_n.getBlock(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ConstructorDeclaration r = new ConstructorDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MethodDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - List annotations = visit(_n.getAnnotations(), _arg); - List typeParameters = visit(_n.getTypeParameters(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - List parameters = visit(_n.getParameters(), _arg); - List throws_ = visit(_n.getThrows(), _arg); - BlockStmt block = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MethodDeclaration r = new MethodDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, typeParameters, type_, _n.getName(), parameters, _n.getArrayCount(), throws_, block - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(Parameter _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - Parameter r = new Parameter( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, type_, _n.isVarArgs(), id - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MultiTypeParameter _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - List types = visit(_n.getTypes(), _arg); - VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MultiTypeParameter r = new MultiTypeParameter( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, types, id - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EmptyMemberDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EmptyMemberDeclaration r = new EmptyMemberDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(InitializerDeclaration _n, Object _arg) { - JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); - BlockStmt block = cloneNodes(_n.getBlock(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - InitializerDeclaration r = new InitializerDeclaration( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.isStatic(), block - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(JavadocComment _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - JavadocComment r = new JavadocComment( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getContent() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ClassOrInterfaceType _n, Object _arg) { - ClassOrInterfaceType scope = cloneNodes(_n.getScope(), _arg); - List typeArgs = visit(_n.getTypeArgs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ClassOrInterfaceType r = new ClassOrInterfaceType( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - scope, _n.getName(), typeArgs - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(PrimitiveType _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - PrimitiveType r = new PrimitiveType( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getType() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ReferenceType _n, Object _arg) { - List ann = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - List> arraysAnnotations = _n.getArraysAnnotations(); - List> _arraysAnnotations = null; - if (arraysAnnotations != null) { - _arraysAnnotations = new LinkedList>(); - for (List aux : arraysAnnotations) { - _arraysAnnotations.add(visit(aux, _arg)); - } - } + return r; + } + + @Override + public Node visit(LineComment _n, Object _arg) { + return new LineComment(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getContent()); + } + + @Override + public Node visit(BlockComment _n, Object _arg) { + return new BlockComment(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getContent()); + } + + @Override + public Node visit(ClassOrInterfaceDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + List typeParameters = visit(_n.getTypeParameters(), _arg); + List extendsList = visit(_n.getExtends(), _arg); + List implementsList = visit(_n.getImplements(), _arg); + List members = visit(_n.getMembers(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ClassOrInterfaceDeclaration r = new ClassOrInterfaceDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, _n.isInterface(), _n.getName(), typeParameters, extendsList, implementsList, members + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EnumDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + List implementsList = visit(_n.getImplements(), _arg); + List entries = visit(_n.getEntries(), _arg); + List members = visit(_n.getMembers(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EnumDeclaration r = new EnumDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, _n.getName(), implementsList, entries, members + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EmptyTypeDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EmptyTypeDeclaration r = new EmptyTypeDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EnumConstantDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + List args = visit(_n.getArgs(), _arg); + List classBody = visit(_n.getClassBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EnumConstantDeclaration r = new EnumConstantDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + annotations, _n.getName(), args, classBody + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AnnotationDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + List members = visit(_n.getMembers(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AnnotationDeclaration r = new AnnotationDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, _n.getName(), members + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AnnotationMemberDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + Expression defaultValue = cloneNodes(_n.getDefaultValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AnnotationMemberDeclaration r = new AnnotationMemberDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, type_, _n.getName(), defaultValue + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(FieldDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + List variables = visit(_n.getVariables(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + FieldDeclaration r = new FieldDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, type_, variables + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(VariableDeclarator _n, Object _arg) { + VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); + Expression init = cloneNodes(_n.getInit(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + VariableDeclarator r = new VariableDeclarator( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + id, init + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(VariableDeclaratorId _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + VariableDeclaratorId r = new VariableDeclaratorId( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getName(), _n.getArrayCount() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ConstructorDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + List typeParameters = visit(_n.getTypeParameters(), _arg); + List parameters = visit(_n.getParameters(), _arg); + List throws_ = visit(_n.getThrows(), _arg); + BlockStmt block = cloneNodes(_n.getBlock(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ConstructorDeclaration r = new ConstructorDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MethodDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + List annotations = visit(_n.getAnnotations(), _arg); + List typeParameters = visit(_n.getTypeParameters(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + List parameters = visit(_n.getParameters(), _arg); + List throws_ = visit(_n.getThrows(), _arg); + BlockStmt block = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MethodDeclaration r = new MethodDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, typeParameters, type_, _n.getName(), parameters, _n.getArrayCount(), throws_, block + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(Parameter _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + Parameter r = new Parameter( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, type_, _n.isVarArgs(), id + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MultiTypeParameter _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + List types = visit(_n.getTypes(), _arg); + VariableDeclaratorId id = cloneNodes(_n.getId(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MultiTypeParameter r = new MultiTypeParameter( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, types, id + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EmptyMemberDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EmptyMemberDeclaration r = new EmptyMemberDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(InitializerDeclaration _n, Object _arg) { + JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); + BlockStmt block = cloneNodes(_n.getBlock(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + InitializerDeclaration r = new InitializerDeclaration( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.isStatic(), block + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(JavadocComment _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + JavadocComment r = new JavadocComment( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getContent() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ClassOrInterfaceType _n, Object _arg) { + ClassOrInterfaceType scope = cloneNodes(_n.getScope(), _arg); + List typeArgs = visit(_n.getTypeArgs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ClassOrInterfaceType r = new ClassOrInterfaceType( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + scope, _n.getName(), typeArgs + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(PrimitiveType _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + PrimitiveType r = new PrimitiveType( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getType() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ReferenceType _n, Object _arg) { + List ann = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + List> arraysAnnotations = _n.getArraysAnnotations(); + List> _arraysAnnotations = null; + if(arraysAnnotations != null){ + _arraysAnnotations = new LinkedList>(); + for(List aux: arraysAnnotations){ + _arraysAnnotations.add(visit(aux, _arg)); + } + } ReferenceType r = new ReferenceType(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), type_, _n.getArrayCount(), ann, _arraysAnnotations); Comment comment = cloneNodes(_n.getComment(), _arg); r.setComment(comment); - return r; - } - - @Override - public Node visit(VoidType _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - VoidType r = new VoidType(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(WildcardType _n, Object _arg) { - ReferenceType ext = cloneNodes(_n.getExtends(), _arg); - ReferenceType sup = cloneNodes(_n.getSuper(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - WildcardType r = new WildcardType( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - ext, sup - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(UnknownType _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - UnknownType r = new UnknownType(); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ArrayAccessExpr _n, Object _arg) { - Expression name = cloneNodes(_n.getName(), _arg); - Expression index = cloneNodes(_n.getIndex(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ArrayAccessExpr r = new ArrayAccessExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - name, index - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ArrayCreationExpr _n, Object _arg) { - Type type_ = cloneNodes(_n.getType(), _arg); - List dimensions = visit(_n.getDimensions(), _arg); - ArrayCreationExpr r = new ArrayCreationExpr(_n.getBeginLine(), - _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), type_, - dimensions, _n.getArrayCount()); - if (_n.getInitializer() != null) {// ArrayCreationExpr has two mutually - // exclusive constructors - r.setInitializer(cloneNodes(_n.getInitializer(), _arg)); - } - List> arraysAnnotations = _n.getArraysAnnotations(); - List> _arraysAnnotations = null; - if (arraysAnnotations != null) { - _arraysAnnotations = new LinkedList>(); - for (List aux : arraysAnnotations) { - _arraysAnnotations.add(visit(aux, _arg)); - } - } - r.setArraysAnnotations(_arraysAnnotations); - Comment comment = cloneNodes(_n.getComment(), _arg); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ArrayInitializerExpr _n, Object _arg) { - List values = visit(_n.getValues(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ArrayInitializerExpr r = new ArrayInitializerExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - values - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AssignExpr _n, Object _arg) { - Expression target = cloneNodes(_n.getTarget(), _arg); - Expression value = cloneNodes(_n.getValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AssignExpr r = new AssignExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - target, value, _n.getOperator()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BinaryExpr _n, Object _arg) { - Expression left = cloneNodes(_n.getLeft(), _arg); - Expression right = cloneNodes(_n.getRight(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - BinaryExpr r = new BinaryExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - left, right, _n.getOperator() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(CastExpr _n, Object _arg) { - Type type_ = cloneNodes(_n.getType(), _arg); - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - CastExpr r = new CastExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - type_, expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ClassExpr _n, Object _arg) { - Type type_ = cloneNodes(_n.getType(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ClassExpr r = new ClassExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - type_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ConditionalExpr _n, Object _arg) { - Expression condition = cloneNodes(_n.getCondition(), _arg); - Expression thenExpr = cloneNodes(_n.getThenExpr(), _arg); - Expression elseExpr = cloneNodes(_n.getElseExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ConditionalExpr r = new ConditionalExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - condition, thenExpr, elseExpr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EnclosedExpr _n, Object _arg) { - Expression inner = cloneNodes(_n.getInner(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - EnclosedExpr r = new EnclosedExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - inner - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(FieldAccessExpr _n, Object _arg) { - Expression scope = cloneNodes(_n.getScope(), _arg); - List typeArgs = visit(_n.getTypeArgs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - FieldAccessExpr r = new FieldAccessExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - scope, typeArgs, _n.getField() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(InstanceOfExpr _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - InstanceOfExpr r = new InstanceOfExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - expr, type_ - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(StringLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - StringLiteralExpr r = new StringLiteralExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(IntegerLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - IntegerLiteralExpr r = new IntegerLiteralExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LongLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - LongLiteralExpr r = new LongLiteralExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(IntegerLiteralMinValueExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - IntegerLiteralMinValueExpr r = new IntegerLiteralMinValueExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LongLiteralMinValueExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - LongLiteralMinValueExpr r = new LongLiteralMinValueExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(CharLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - CharLiteralExpr r = new CharLiteralExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(DoubleLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - DoubleLiteralExpr r = new DoubleLiteralExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BooleanLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - BooleanLiteralExpr r = new BooleanLiteralExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getValue() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(NullLiteralExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - NullLiteralExpr r = new NullLiteralExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MethodCallExpr _n, Object _arg) { - Expression scope = cloneNodes(_n.getScope(), _arg); - List typeArgs = visit(_n.getTypeArgs(), _arg); - List args = visit(_n.getArgs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MethodCallExpr r = new MethodCallExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - scope, typeArgs, _n.getName(), args - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(NameExpr _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - NameExpr r = new NameExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getName() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ObjectCreationExpr _n, Object _arg) { - Expression scope = cloneNodes(_n.getScope(), _arg); - ClassOrInterfaceType type_ = cloneNodes(_n.getType(), _arg); - List typeArgs = visit(_n.getTypeArgs(), _arg); - List args = visit(_n.getArgs(), _arg); - List anonymousBody = visit(_n.getAnonymousClassBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ObjectCreationExpr r = new ObjectCreationExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - scope, type_, typeArgs, args, anonymousBody - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(QualifiedNameExpr _n, Object _arg) { - NameExpr scope = cloneNodes(_n.getQualifier(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - QualifiedNameExpr r = new QualifiedNameExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - scope, _n.getName() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ThisExpr _n, Object _arg) { - Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ThisExpr r = new ThisExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - classExpr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SuperExpr _n, Object _arg) { - Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SuperExpr r = new SuperExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - classExpr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(UnaryExpr _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - UnaryExpr r = new UnaryExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - expr, _n.getOperator() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(VariableDeclarationExpr _n, Object _arg) { - List annotations = visit(_n.getAnnotations(), _arg); - Type type_ = cloneNodes(_n.getType(), _arg); - List vars = visit(_n.getVars(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - VariableDeclarationExpr r = new VariableDeclarationExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getModifiers(), annotations, type_, vars - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MarkerAnnotationExpr _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MarkerAnnotationExpr r = new MarkerAnnotationExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - name - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SingleMemberAnnotationExpr _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - Expression memberValue = cloneNodes(_n.getMemberValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SingleMemberAnnotationExpr r = new SingleMemberAnnotationExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - name, memberValue - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(NormalAnnotationExpr _n, Object _arg) { - NameExpr name = cloneNodes(_n.getName(), _arg); - List pairs = visit(_n.getPairs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - NormalAnnotationExpr r = new NormalAnnotationExpr( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - name, pairs - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(MemberValuePair _n, Object _arg) { - Expression value = cloneNodes(_n.getValue(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - MemberValuePair r = new MemberValuePair( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getName(), value - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ExplicitConstructorInvocationStmt _n, Object _arg) { - List typeArgs = visit(_n.getTypeArgs(), _arg); - Expression expr = cloneNodes(_n.getExpr(), _arg); - List args = visit(_n.getArgs(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ExplicitConstructorInvocationStmt r = new ExplicitConstructorInvocationStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - typeArgs, _n.isThis(), expr, args - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(TypeDeclarationStmt _n, Object _arg) { - TypeDeclaration typeDecl = cloneNodes(_n.getTypeDeclaration(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - TypeDeclarationStmt r = new TypeDeclarationStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - typeDecl - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(AssertStmt _n, Object _arg) { - Expression check = cloneNodes(_n.getCheck(), _arg); - Expression message = cloneNodes(_n.getMessage(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - AssertStmt r = new AssertStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - check, message - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BlockStmt _n, Object _arg) { - List stmts = visit(_n.getStmts(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - BlockStmt r = new BlockStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - stmts - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LabeledStmt _n, Object _arg) { - Statement stmt = cloneNodes(_n.getStmt(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - LabeledStmt r = new LabeledStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getLabel(), stmt - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(EmptyStmt _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - EmptyStmt r = new EmptyStmt(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ExpressionStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpression(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ExpressionStmt r = new ExpressionStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SwitchStmt _n, Object _arg) { - Expression selector = cloneNodes(_n.getSelector(), _arg); - List entries = visit(_n.getEntries(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SwitchStmt r = new SwitchStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - selector, entries - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SwitchEntryStmt _n, Object _arg) { - Expression label = cloneNodes(_n.getLabel(), _arg); - List stmts = visit(_n.getStmts(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SwitchEntryStmt r = new SwitchEntryStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - label, stmts - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(BreakStmt _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - BreakStmt r = new BreakStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getId() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ReturnStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ReturnStmt r = new ReturnStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(IfStmt _n, Object _arg) { - Expression condition = cloneNodes(_n.getCondition(), _arg); - Statement thenStmt = cloneNodes(_n.getThenStmt(), _arg); - Statement elseStmt = cloneNodes(_n.getElseStmt(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - IfStmt r = new IfStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - condition, thenStmt, elseStmt - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(WhileStmt _n, Object _arg) { - Expression condition = cloneNodes(_n.getCondition(), _arg); - Statement body = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - WhileStmt r = new WhileStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - condition, body - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ContinueStmt _n, Object _arg) { - Comment comment = cloneNodes(_n.getComment(), _arg); - - ContinueStmt r = new ContinueStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - _n.getId() - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(DoStmt _n, Object _arg) { - Statement body = cloneNodes(_n.getBody(), _arg); - Expression condition = cloneNodes(_n.getCondition(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - DoStmt r = new DoStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - body, condition - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ForeachStmt _n, Object _arg) { - VariableDeclarationExpr var = cloneNodes(_n.getVariable(), _arg); - Expression iterable = cloneNodes(_n.getIterable(), _arg); - Statement body = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ForeachStmt r = new ForeachStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - var, iterable, body - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ForStmt _n, Object _arg) { - List init = visit(_n.getInit(), _arg); - Expression compare = cloneNodes(_n.getCompare(), _arg); - List update = visit(_n.getUpdate(), _arg); - Statement body = cloneNodes(_n.getBody(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ForStmt r = new ForStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - init, compare, update, body - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(ThrowStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - ThrowStmt r = new ThrowStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - expr - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(SynchronizedStmt _n, Object _arg) { - Expression expr = cloneNodes(_n.getExpr(), _arg); - BlockStmt block = cloneNodes(_n.getBlock(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - SynchronizedStmt r = new SynchronizedStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - expr, block - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(TryStmt _n, Object _arg) { - List resources = visit(_n.getResources(), _arg); - BlockStmt tryBlock = cloneNodes(_n.getTryBlock(), _arg); - List catchs = visit(_n.getCatchs(), _arg); - BlockStmt finallyBlock = cloneNodes(_n.getFinallyBlock(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - TryStmt r = new TryStmt( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - resources, tryBlock, catchs, finallyBlock - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(CatchClause _n, Object _arg) { - MultiTypeParameter except = cloneNodes(_n.getExcept(), _arg); - BlockStmt catchBlock = cloneNodes(_n.getCatchBlock(), _arg); - Comment comment = cloneNodes(_n.getComment(), _arg); - - CatchClause r = new CatchClause( - _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), - except.getModifiers(), except.getAnnotations(), except.getTypes(), except.getId(), catchBlock - ); - r.setComment(comment); - return r; - } - - @Override - public Node visit(LambdaExpr _n, Object _arg) { - - List lambdaParameters = visit(_n.getParameters(), _arg); - - Statement body = cloneNodes(_n.getBody(), _arg); - - LambdaExpr r = new LambdaExpr(_n.getBeginLine(), _n.getBeginColumn(), - _n.getEndLine(), _n.getEndColumn(), lambdaParameters, body, - _n.isParametersEnclosed()); - - return r; - } - - @Override - public Node visit(MethodReferenceExpr _n, Object arg) { - - List typeParams = visit(_n.getTypeParameters(), arg); - Expression scope = cloneNodes(_n.getScope(), arg); - - MethodReferenceExpr r = new MethodReferenceExpr(_n.getBeginLine(), - _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), scope, - typeParams, _n.getIdentifier()); - return r; - } - - @Override - public Node visit(TypeExpr n, Object arg) { - - Type t = cloneNodes(n.getType(), arg); - - TypeExpr r = new TypeExpr(n.getBeginLine(), n.getBeginColumn(), - n.getEndLine(), n.getEndColumn(), t); - - return r; - } + return r; + } + + @Override + public Node visit(VoidType _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + VoidType r = new VoidType(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(WildcardType _n, Object _arg) { + ReferenceType ext = cloneNodes(_n.getExtends(), _arg); + ReferenceType sup = cloneNodes(_n.getSuper(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + WildcardType r = new WildcardType( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + ext, sup + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(UnknownType _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + UnknownType r = new UnknownType(); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ArrayAccessExpr _n, Object _arg) { + Expression name = cloneNodes(_n.getName(), _arg); + Expression index = cloneNodes(_n.getIndex(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ArrayAccessExpr r = new ArrayAccessExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + name, index + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ArrayCreationExpr _n, Object _arg) { + Type type_ = cloneNodes(_n.getType(), _arg); + List dimensions = visit(_n.getDimensions(), _arg); + ArrayCreationExpr r = new ArrayCreationExpr(_n.getBeginLine(), + _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), type_, + dimensions, _n.getArrayCount()); + if (_n.getInitializer() != null) {// ArrayCreationExpr has two mutually + // exclusive constructors + r.setInitializer(cloneNodes(_n.getInitializer(), _arg)); + } + List> arraysAnnotations = _n.getArraysAnnotations(); + List> _arraysAnnotations = null; + if(arraysAnnotations != null){ + _arraysAnnotations = new LinkedList>(); + for(List aux: arraysAnnotations){ + _arraysAnnotations.add(visit(aux, _arg)); + } + } + r.setArraysAnnotations(_arraysAnnotations); + Comment comment = cloneNodes(_n.getComment(), _arg); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ArrayInitializerExpr _n, Object _arg) { + List values = visit(_n.getValues(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ArrayInitializerExpr r = new ArrayInitializerExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + values + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AssignExpr _n, Object _arg) { + Expression target = cloneNodes(_n.getTarget(), _arg); + Expression value = cloneNodes(_n.getValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AssignExpr r = new AssignExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + target, value, _n.getOperator()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BinaryExpr _n, Object _arg) { + Expression left = cloneNodes(_n.getLeft(), _arg); + Expression right = cloneNodes(_n.getRight(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + BinaryExpr r = new BinaryExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + left, right, _n.getOperator() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(CastExpr _n, Object _arg) { + Type type_ = cloneNodes(_n.getType(), _arg); + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + CastExpr r = new CastExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + type_, expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ClassExpr _n, Object _arg) { + Type type_ = cloneNodes(_n.getType(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ClassExpr r = new ClassExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + type_ + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ConditionalExpr _n, Object _arg) { + Expression condition = cloneNodes(_n.getCondition(), _arg); + Expression thenExpr = cloneNodes(_n.getThenExpr(), _arg); + Expression elseExpr = cloneNodes(_n.getElseExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ConditionalExpr r = new ConditionalExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + condition, thenExpr, elseExpr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EnclosedExpr _n, Object _arg) { + Expression inner = cloneNodes(_n.getInner(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + EnclosedExpr r = new EnclosedExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + inner + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(FieldAccessExpr _n, Object _arg) { + Expression scope = cloneNodes(_n.getScope(), _arg); + List typeArgs = visit(_n.getTypeArgs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + FieldAccessExpr r = new FieldAccessExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + scope, typeArgs, _n.getField() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(InstanceOfExpr _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + InstanceOfExpr r = new InstanceOfExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + expr, type_ + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(StringLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + StringLiteralExpr r = new StringLiteralExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(IntegerLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + IntegerLiteralExpr r = new IntegerLiteralExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LongLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + LongLiteralExpr r = new LongLiteralExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(IntegerLiteralMinValueExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + IntegerLiteralMinValueExpr r = new IntegerLiteralMinValueExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LongLiteralMinValueExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + LongLiteralMinValueExpr r = new LongLiteralMinValueExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(CharLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + CharLiteralExpr r = new CharLiteralExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(DoubleLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + DoubleLiteralExpr r = new DoubleLiteralExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BooleanLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + BooleanLiteralExpr r = new BooleanLiteralExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getValue() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(NullLiteralExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + NullLiteralExpr r = new NullLiteralExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MethodCallExpr _n, Object _arg) { + Expression scope = cloneNodes(_n.getScope(), _arg); + List typeArgs = visit(_n.getTypeArgs(), _arg); + List args = visit(_n.getArgs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MethodCallExpr r = new MethodCallExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + scope, typeArgs, _n.getName(), args + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(NameExpr _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + NameExpr r = new NameExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getName() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ObjectCreationExpr _n, Object _arg) { + Expression scope = cloneNodes(_n.getScope(), _arg); + ClassOrInterfaceType type_ = cloneNodes(_n.getType(), _arg); + List typeArgs = visit(_n.getTypeArgs(), _arg); + List args = visit(_n.getArgs(), _arg); + List anonymousBody = visit(_n.getAnonymousClassBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ObjectCreationExpr r = new ObjectCreationExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + scope, type_, typeArgs, args, anonymousBody + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(QualifiedNameExpr _n, Object _arg) { + NameExpr scope = cloneNodes(_n.getQualifier(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + QualifiedNameExpr r = new QualifiedNameExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + scope, _n.getName() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ThisExpr _n, Object _arg) { + Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ThisExpr r = new ThisExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + classExpr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SuperExpr _n, Object _arg) { + Expression classExpr = cloneNodes(_n.getClassExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SuperExpr r = new SuperExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + classExpr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(UnaryExpr _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + UnaryExpr r = new UnaryExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + expr, _n.getOperator() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(VariableDeclarationExpr _n, Object _arg) { + List annotations = visit(_n.getAnnotations(), _arg); + Type type_ = cloneNodes(_n.getType(), _arg); + List vars = visit(_n.getVars(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + VariableDeclarationExpr r = new VariableDeclarationExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getModifiers(), annotations, type_, vars + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MarkerAnnotationExpr _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MarkerAnnotationExpr r = new MarkerAnnotationExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + name + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SingleMemberAnnotationExpr _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + Expression memberValue = cloneNodes(_n.getMemberValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SingleMemberAnnotationExpr r = new SingleMemberAnnotationExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + name, memberValue + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(NormalAnnotationExpr _n, Object _arg) { + NameExpr name = cloneNodes(_n.getName(), _arg); + List pairs = visit(_n.getPairs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + NormalAnnotationExpr r = new NormalAnnotationExpr( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + name, pairs + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(MemberValuePair _n, Object _arg) { + Expression value = cloneNodes(_n.getValue(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + MemberValuePair r = new MemberValuePair( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getName(), value + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ExplicitConstructorInvocationStmt _n, Object _arg) { + List typeArgs = visit(_n.getTypeArgs(), _arg); + Expression expr = cloneNodes(_n.getExpr(), _arg); + List args = visit(_n.getArgs(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ExplicitConstructorInvocationStmt r = new ExplicitConstructorInvocationStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + typeArgs, _n.isThis(), expr, args + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(TypeDeclarationStmt _n, Object _arg) { + TypeDeclaration typeDecl = cloneNodes(_n.getTypeDeclaration(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + TypeDeclarationStmt r = new TypeDeclarationStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + typeDecl + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(AssertStmt _n, Object _arg) { + Expression check = cloneNodes(_n.getCheck(), _arg); + Expression message = cloneNodes(_n.getMessage(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + AssertStmt r = new AssertStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + check, message + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BlockStmt _n, Object _arg) { + List stmts = visit(_n.getStmts(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + BlockStmt r = new BlockStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + stmts + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LabeledStmt _n, Object _arg) { + Statement stmt = cloneNodes(_n.getStmt(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + LabeledStmt r = new LabeledStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getLabel(), stmt + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(EmptyStmt _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + EmptyStmt r = new EmptyStmt(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn()); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ExpressionStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpression(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ExpressionStmt r = new ExpressionStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SwitchStmt _n, Object _arg) { + Expression selector = cloneNodes(_n.getSelector(), _arg); + List entries = visit(_n.getEntries(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SwitchStmt r = new SwitchStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + selector, entries + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SwitchEntryStmt _n, Object _arg) { + Expression label = cloneNodes(_n.getLabel(), _arg); + List stmts = visit(_n.getStmts(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SwitchEntryStmt r = new SwitchEntryStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + label, stmts + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(BreakStmt _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + BreakStmt r = new BreakStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getId() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ReturnStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ReturnStmt r = new ReturnStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(IfStmt _n, Object _arg) { + Expression condition = cloneNodes(_n.getCondition(), _arg); + Statement thenStmt = cloneNodes(_n.getThenStmt(), _arg); + Statement elseStmt = cloneNodes(_n.getElseStmt(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + IfStmt r = new IfStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + condition, thenStmt, elseStmt + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(WhileStmt _n, Object _arg) { + Expression condition = cloneNodes(_n.getCondition(), _arg); + Statement body = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + WhileStmt r = new WhileStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + condition, body + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ContinueStmt _n, Object _arg) { + Comment comment = cloneNodes(_n.getComment(), _arg); + + ContinueStmt r = new ContinueStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + _n.getId() + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(DoStmt _n, Object _arg) { + Statement body = cloneNodes(_n.getBody(), _arg); + Expression condition = cloneNodes(_n.getCondition(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + DoStmt r = new DoStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + body, condition + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ForeachStmt _n, Object _arg) { + VariableDeclarationExpr var = cloneNodes(_n.getVariable(), _arg); + Expression iterable = cloneNodes(_n.getIterable(), _arg); + Statement body = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ForeachStmt r = new ForeachStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + var, iterable, body + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ForStmt _n, Object _arg) { + List init = visit(_n.getInit(), _arg); + Expression compare = cloneNodes(_n.getCompare(), _arg); + List update = visit(_n.getUpdate(), _arg); + Statement body = cloneNodes(_n.getBody(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ForStmt r = new ForStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + init, compare, update, body + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(ThrowStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + ThrowStmt r = new ThrowStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + expr + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(SynchronizedStmt _n, Object _arg) { + Expression expr = cloneNodes(_n.getExpr(), _arg); + BlockStmt block = cloneNodes(_n.getBlock(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + SynchronizedStmt r = new SynchronizedStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + expr, block + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(TryStmt _n, Object _arg) { + List resources = visit(_n.getResources(),_arg); + BlockStmt tryBlock = cloneNodes(_n.getTryBlock(), _arg); + List catchs = visit(_n.getCatchs(), _arg); + BlockStmt finallyBlock = cloneNodes(_n.getFinallyBlock(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + TryStmt r = new TryStmt( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + resources, tryBlock, catchs, finallyBlock + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(CatchClause _n, Object _arg) { + MultiTypeParameter except = cloneNodes(_n.getExcept(), _arg); + BlockStmt catchBlock = cloneNodes(_n.getCatchBlock(), _arg); + Comment comment = cloneNodes(_n.getComment(), _arg); + + CatchClause r = new CatchClause( + _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), + except.getModifiers(), except.getAnnotations(), except.getTypes(), except.getId(), catchBlock + ); + r.setComment(comment); + return r; + } + + @Override + public Node visit(LambdaExpr _n, Object _arg) { + + List lambdaParameters = visit(_n.getParameters(), _arg); + + Statement body = cloneNodes(_n.getBody(), _arg); + + LambdaExpr r = new LambdaExpr(_n.getBeginLine(), _n.getBeginColumn(), + _n.getEndLine(), _n.getEndColumn(), lambdaParameters, body, + _n.isParametersEnclosed()); + + return r; + } + + @Override + public Node visit(MethodReferenceExpr _n, Object arg) { + + List typeParams = visit(_n.getTypeParameters(), arg); + Expression scope = cloneNodes(_n.getScope(), arg); + + MethodReferenceExpr r = new MethodReferenceExpr(_n.getBeginLine(), + _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), scope, + typeParams, _n.getIdentifier()); + return r; + } + + @Override + public Node visit(TypeExpr n, Object arg) { + + Type t = cloneNodes(n.getType(), arg); + + TypeExpr r = new TypeExpr(n.getBeginLine(), n.getBeginColumn(), + n.getEndLine(), n.getEndColumn(), t); + + return r; + } public List visit(List _nodes, Object _arg) { if (_nodes == null) diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/DumpVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/DumpVisitor.java index 0b90e3789d..8b04afe0aa 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/DumpVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/DumpVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,11 +18,10 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import static com.github.javaparser.PositionUtils.sortByBeginPosition; - import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.ImportDeclaration; import com.github.javaparser.ast.Node; @@ -83,7 +82,7 @@ /** * Dumps the AST to formatted Java source code. - * + * * @author Julio Vilmar Gesser */ public final class DumpVisitor implements VoidVisitor { @@ -98,1565 +97,1483 @@ public DumpVisitor(boolean printComments) { this.printComments = printComments; } - private static class SourcePrinter { - - private int level = 0; - - private boolean indented = false; - - private final StringBuilder buf = new StringBuilder(); - - public void indent() { - level++; - } - - public void unindent() { - level--; - } - - private void makeIndent() { - for (int i = 0; i < level; i++) { - buf.append(" "); - } - } - - public void print(final String arg) { - if (!indented) { - makeIndent(); - indented = true; - } - buf.append(arg); - } - - public void printLn(final String arg) { - print(arg); - printLn(); - } - - public void printLn() { - buf.append(System.getProperty("line.separator")); - indented = false; - } - - public String getSource() { - return buf.toString(); - } - - @Override - public String toString() { - return getSource(); - } - } - - private final SourcePrinter printer = new SourcePrinter(); - - public String getSource() { - return printer.getSource(); - } - - private void printModifiers(final int modifiers) { - if (ModifierSet.isPrivate(modifiers)) { - printer.print("private "); - } - if (ModifierSet.isProtected(modifiers)) { - printer.print("protected "); - } - if (ModifierSet.isPublic(modifiers)) { - printer.print("public "); - } - if (ModifierSet.isAbstract(modifiers)) { - printer.print("abstract "); - } - if (ModifierSet.isStatic(modifiers)) { - printer.print("static "); - } - if (ModifierSet.isFinal(modifiers)) { - printer.print("final "); - } - if (ModifierSet.isNative(modifiers)) { - printer.print("native "); - } - if (ModifierSet.isStrictfp(modifiers)) { - printer.print("strictfp "); - } - if (ModifierSet.isSynchronized(modifiers)) { - printer.print("synchronized "); - } - if (ModifierSet.isTransient(modifiers)) { - printer.print("transient "); - } - if (ModifierSet.isVolatile(modifiers)) { - printer.print("volatile "); - } - } - - private void printMembers(final List members, final Object arg) { - for (final BodyDeclaration member : members) { - printer.printLn(); - member.accept(this, arg); - printer.printLn(); - } - } - - private void printMemberAnnotations(final List annotations, final Object arg) { - if (!isNullOrEmpty(annotations)) { - for (final AnnotationExpr a : annotations) { - a.accept(this, arg); - printer.printLn(); - } - } - } - - private void printAnnotations(final List annotations, final Object arg) { - if (!isNullOrEmpty(annotations)) { - for (final AnnotationExpr a : annotations) { - a.accept(this, arg); - printer.print(" "); - } - } - } - - private void printTypeArgs(final List args, final Object arg) { + private static class SourcePrinter { + + private int level = 0; + + private boolean indented = false; + + private final StringBuilder buf = new StringBuilder(); + + public void indent() { + level++; + } + + public void unindent() { + level--; + } + + private void makeIndent() { + for (int i = 0; i < level; i++) { + buf.append(" "); + } + } + + public void print(final String arg) { + if (!indented) { + makeIndent(); + indented = true; + } + buf.append(arg); + } + + public void printLn(final String arg) { + print(arg); + printLn(); + } + + public void printLn() { + buf.append(System.getProperty("line.separator")); + indented = false; + } + + public String getSource() { + return buf.toString(); + } + + @Override public String toString() { + return getSource(); + } + } + + private final SourcePrinter printer = new SourcePrinter(); + + public String getSource() { + return printer.getSource(); + } + + private void printModifiers(final int modifiers) { + if (ModifierSet.isPrivate(modifiers)) { + printer.print("private "); + } + if (ModifierSet.isProtected(modifiers)) { + printer.print("protected "); + } + if (ModifierSet.isPublic(modifiers)) { + printer.print("public "); + } + if (ModifierSet.isAbstract(modifiers)) { + printer.print("abstract "); + } + if (ModifierSet.isStatic(modifiers)) { + printer.print("static "); + } + if (ModifierSet.isFinal(modifiers)) { + printer.print("final "); + } + if (ModifierSet.isNative(modifiers)) { + printer.print("native "); + } + if (ModifierSet.isStrictfp(modifiers)) { + printer.print("strictfp "); + } + if (ModifierSet.isSynchronized(modifiers)) { + printer.print("synchronized "); + } + if (ModifierSet.isTransient(modifiers)) { + printer.print("transient "); + } + if (ModifierSet.isVolatile(modifiers)) { + printer.print("volatile "); + } + } + + private void printMembers(final List members, final Object arg) { + for (final BodyDeclaration member : members) { + printer.printLn(); + member.accept(this, arg); + printer.printLn(); + } + } + + private void printMemberAnnotations(final List annotations, final Object arg) { + if (!isNullOrEmpty(annotations)) { + for (final AnnotationExpr a : annotations) { + a.accept(this, arg); + printer.printLn(); + } + } + } + + private void printAnnotations(final List annotations, final Object arg) { + if (!isNullOrEmpty(annotations)) { + for (final AnnotationExpr a : annotations) { + a.accept(this, arg); + printer.print(" "); + } + } + } + + private void printTypeArgs(final List args, final Object arg) { if (!isNullOrEmpty(args)) { - printer.print("<"); - for (final Iterator i = args.iterator(); i.hasNext(); ) { - final Type t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - private void printTypeParameters(final List args, final Object arg) { + printer.print("<"); + for (final Iterator i = args.iterator(); i.hasNext();) { + final Type t = i.next(); + t.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(">"); + } + } + + private void printTypeParameters(final List args, final Object arg) { if (!isNullOrEmpty(args)) { - printer.print("<"); - for (final Iterator i = args.iterator(); i.hasNext(); ) { - final TypeParameter t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - private void printArguments(final List args, final Object arg) { - printer.print("("); + printer.print("<"); + for (final Iterator i = args.iterator(); i.hasNext();) { + final TypeParameter t = i.next(); + t.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(">"); + } + } + + private void printArguments(final List args, final Object arg) { + printer.print("("); if (!isNullOrEmpty(args)) { - for (final Iterator i = args.iterator(); i.hasNext(); ) { - final Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - private void printJavadoc(final JavadocComment javadoc, final Object arg) { - if (javadoc != null) { - javadoc.accept(this, arg); - } - } - - private void printJavaComment(final Comment javacomment, final Object arg) { - if (javacomment != null) { - javacomment.accept(this, arg); - } - } - - @Override - public void visit(final CompilationUnit n, final Object arg) { - printJavaComment(n.getComment(), arg); - - if (n.getPackage() != null) { - n.getPackage().accept(this, arg); - } - - if (n.getImports() != null) { - for (final ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - printer.printLn(); - } - - if (n.getTypes() != null) { - for (final Iterator i = n.getTypes().iterator(); i.hasNext(); ) { - i.next().accept(this, arg); - printer.printLn(); - if (i.hasNext()) { - printer.printLn(); - } - } - } + for (final Iterator i = args.iterator(); i.hasNext();) { + final Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + } + + private void printJavadoc(final JavadocComment javadoc, final Object arg) { + if (javadoc != null) { + javadoc.accept(this, arg); + } + } + + private void printJavaComment(final Comment javacomment, final Object arg) { + if (javacomment != null) { + javacomment.accept(this, arg); + } + } + + @Override public void visit(final CompilationUnit n, final Object arg) { + printJavaComment(n.getComment(), arg); + + if (n.getPackage() != null) { + n.getPackage().accept(this, arg); + } + + if (n.getImports() != null) { + for (final ImportDeclaration i : n.getImports()) { + i.accept(this, arg); + } + printer.printLn(); + } + + if (n.getTypes() != null) { + for (final Iterator i = n.getTypes().iterator(); i.hasNext();) { + i.next().accept(this, arg); + printer.printLn(); + if (i.hasNext()) { + printer.printLn(); + } + } + } printOrphanCommentsEnding(n); - } + } - @Override - public void visit(final PackageDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), arg); - printer.print("package "); - n.getName().accept(this, arg); - printer.printLn(";"); - printer.printLn(); + @Override public void visit(final PackageDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), arg); + printer.print("package "); + n.getName().accept(this, arg); + printer.printLn(";"); + printer.printLn(); printOrphanCommentsEnding(n); - } + } - @Override - public void visit(final NameExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getName()); + @Override public void visit(final NameExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getName()); printOrphanCommentsEnding(n); - } + } - @Override - public void visit(final QualifiedNameExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getQualifier().accept(this, arg); - printer.print("."); - printer.print(n.getName()); + @Override public void visit(final QualifiedNameExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getQualifier().accept(this, arg); + printer.print("."); + printer.print(n.getName()); printOrphanCommentsEnding(n); - } - - @Override - public void visit(final ImportDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("import "); - if (n.isStatic()) { - printer.print("static "); - } - n.getName().accept(this, arg); - if (n.isAsterisk()) { - printer.print(".*"); - } - printer.printLn(";"); + } + + @Override public void visit(final ImportDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("import "); + if (n.isStatic()) { + printer.print("static "); + } + n.getName().accept(this, arg); + if (n.isAsterisk()) { + printer.print(".*"); + } + printer.printLn(";"); printOrphanCommentsEnding(n); - } - - @Override - public void visit(final ClassOrInterfaceDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - if (n.isInterface()) { - printer.print("interface "); - } else { - printer.print("class "); - } - - printer.print(n.getName()); - - printTypeParameters(n.getTypeParameters(), arg); - - if (!isNullOrEmpty(n.getExtends())) { - printer.print(" extends "); - for (final Iterator i = n.getExtends().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - if (!isNullOrEmpty(n.getImplements())) { - printer.print(" implements "); - for (final Iterator i = n.getImplements().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (!isNullOrEmpty(n.getMembers())) { - printMembers(n.getMembers(), arg); - } + } + + @Override public void visit(final ClassOrInterfaceDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + if (n.isInterface()) { + printer.print("interface "); + } else { + printer.print("class "); + } + + printer.print(n.getName()); + + printTypeParameters(n.getTypeParameters(), arg); + + if (!isNullOrEmpty(n.getExtends())) { + printer.print(" extends "); + for (final Iterator i = n.getExtends().iterator(); i.hasNext();) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + if (!isNullOrEmpty(n.getImplements())) { + printer.print(" implements "); + for (final Iterator i = n.getImplements().iterator(); i.hasNext();) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + printer.printLn(" {"); + printer.indent(); + if (!isNullOrEmpty(n.getMembers())) { + printMembers(n.getMembers(), arg); + } printOrphanCommentsEnding(n); - printer.unindent(); - printer.print("}"); - } + printer.unindent(); + printer.print("}"); + } - @Override - public void visit(final EmptyTypeDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printer.print(";"); + @Override public void visit(final EmptyTypeDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printer.print(";"); printOrphanCommentsEnding(n); - } - - @Override - public void visit(final JavadocComment n, final Object arg) { - printer.print("/**"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - - @Override - public void visit(final ClassOrInterfaceType n, final Object arg) { - printJavaComment(n.getComment(), arg); - - if (n.getAnnotations() != null) { - for (AnnotationExpr ae : n.getAnnotations()) { - ae.accept(this, arg); - printer.print(" "); - } - } - - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - printer.print(n.getName()); - printTypeArgs(n.getTypeArgs(), arg); - } - - @Override - public void visit(final TypeParameter n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (AnnotationExpr ann : n.getAnnotations()) { - ann.accept(this, arg); - printer.print(" "); - } - } - printer.print(n.getName()); - if (n.getTypeBound() != null) { - printer.print(" extends "); - for (final Iterator i = n.getTypeBound().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(" & "); - } - } - } - } - - @Override - public void visit(final PrimitiveType n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (AnnotationExpr ae : n.getAnnotations()) { - ae.accept(this, arg); - printer.print(" "); - } - } - switch (n.getType()) { - case Boolean: - printer.print("boolean"); - break; - case Byte: - printer.print("byte"); - break; - case Char: - printer.print("char"); - break; - case Double: - printer.print("double"); - break; - case Float: - printer.print("float"); - break; - case Int: - printer.print("int"); - break; - case Long: - printer.print("long"); - break; - case Short: - printer.print("short"); - break; - } - } - - @Override - public void visit(final ReferenceType n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (AnnotationExpr ae : n.getAnnotations()) { - ae.accept(this, arg); - printer.print(" "); - } - } - n.getType().accept(this, arg); - List> arraysAnnotations = n.getArraysAnnotations(); - for (int i = 0; i < n.getArrayCount(); i++) { - if (arraysAnnotations != null && i < arraysAnnotations.size()) { - List annotations = arraysAnnotations.get(i); - if (annotations != null) { - for (AnnotationExpr ae : annotations) { - printer.print(" "); - ae.accept(this, arg); - - } - } - } - printer.print("[]"); - } - } - - @Override - public void visit(final WildcardType n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (AnnotationExpr ae : n.getAnnotations()) { - printer.print(" "); - ae.accept(this, arg); - } - } - printer.print("?"); - if (n.getExtends() != null) { - printer.print(" extends "); - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - printer.print(" super "); - n.getSuper().accept(this, arg); - } - } - - @Override - public void visit(final UnknownType n, final Object arg) { - // Nothing to dump - } + } + + @Override public void visit(final JavadocComment n, final Object arg) { + printer.print("/**"); + printer.print(n.getContent()); + printer.printLn("*/"); + } + + @Override public void visit(final ClassOrInterfaceType n, final Object arg) { + printJavaComment(n.getComment(), arg); + + if (n.getAnnotations() != null) { + for (AnnotationExpr ae : n.getAnnotations()) { + ae.accept(this, arg); + printer.print(" "); + } + } + + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + printer.print(n.getName()); + printTypeArgs(n.getTypeArgs(), arg); + } + + @Override public void visit(final TypeParameter n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (AnnotationExpr ann : n.getAnnotations()) { + ann.accept(this, arg); + printer.print(" "); + } + } + printer.print(n.getName()); + if (n.getTypeBound() != null) { + printer.print(" extends "); + for (final Iterator i = n.getTypeBound().iterator(); i.hasNext();) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(" & "); + } + } + } + } + + @Override public void visit(final PrimitiveType n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (AnnotationExpr ae : n.getAnnotations()) { + ae.accept(this, arg); + printer.print(" "); + } + } + switch (n.getType()) { + case Boolean: + printer.print("boolean"); + break; + case Byte: + printer.print("byte"); + break; + case Char: + printer.print("char"); + break; + case Double: + printer.print("double"); + break; + case Float: + printer.print("float"); + break; + case Int: + printer.print("int"); + break; + case Long: + printer.print("long"); + break; + case Short: + printer.print("short"); + break; + } + } + + @Override public void visit(final ReferenceType n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (AnnotationExpr ae : n.getAnnotations()) { + ae.accept(this, arg); + printer.print(" "); + } + } + n.getType().accept(this, arg); + List> arraysAnnotations = n.getArraysAnnotations(); + for (int i = 0; i < n.getArrayCount(); i++) { + if (arraysAnnotations != null && i < arraysAnnotations.size()) { + List annotations = arraysAnnotations.get(i); + if (annotations != null) { + for (AnnotationExpr ae : annotations) { + printer.print(" "); + ae.accept(this, arg); + + } + } + } + printer.print("[]"); + } + } + + @Override public void visit(final WildcardType n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (AnnotationExpr ae : n.getAnnotations()) { + printer.print(" "); + ae.accept(this, arg); + } + } + printer.print("?"); + if (n.getExtends() != null) { + printer.print(" extends "); + n.getExtends().accept(this, arg); + } + if (n.getSuper() != null) { + printer.print(" super "); + n.getSuper().accept(this, arg); + } + } + + @Override public void visit(final UnknownType n, final Object arg) { + // Nothing to dump + } + + @Override public void visit(final FieldDeclaration n, final Object arg) { + printOrphanCommentsBeforeThisChildNode(n); - @Override - public void visit(final FieldDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + n.getType().accept(this, arg); + + printer.print(" "); + for (final Iterator i = n.getVariables().iterator(); i.hasNext();) { + final VariableDeclarator var = i.next(); + var.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + + printer.print(";"); + } + + @Override public void visit(final VariableDeclarator n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getId().accept(this, arg); + if (n.getInit() != null) { + printer.print(" = "); + n.getInit().accept(this, arg); + } + } + + @Override public void visit(final VariableDeclaratorId n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getName()); + for (int i = 0; i < n.getArrayCount(); i++) { + printer.print("[]"); + } + } + + @Override public void visit(final ArrayInitializerExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("{"); + if (n.getValues() != null) { + printer.print(" "); + for (final Iterator i = n.getValues().iterator(); i.hasNext();) { + final Expression expr = i.next(); + expr.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(" "); + } + printer.print("}"); + } + + @Override public void visit(final VoidType n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("void"); + } + + @Override public void visit(final ArrayAccessExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getName().accept(this, arg); + printer.print("["); + n.getIndex().accept(this, arg); + printer.print("]"); + } + + @Override public void visit(final ArrayCreationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("new "); + n.getType().accept(this, arg); + List> arraysAnnotations = n.getArraysAnnotations(); + if (n.getDimensions() != null) { + int j = 0; + for (final Expression dim : n.getDimensions()) { + + if (arraysAnnotations != null && j < arraysAnnotations.size()) { + List annotations = arraysAnnotations.get(j); + if (annotations != null) { + for (AnnotationExpr ae : annotations) { + printer.print(" "); + ae.accept(this, arg); + } + } + } + printer.print("["); + dim.accept(this, arg); + printer.print("]"); + j++; + } + for (int i = 0; i < n.getArrayCount(); i++) { + if (arraysAnnotations != null && i < arraysAnnotations.size()) { + + List annotations = arraysAnnotations.get(i); + if (annotations != null) { + for (AnnotationExpr ae : annotations) { + printer.print(" "); + ae.accept(this, arg); + + } + } + } + printer.print("[]"); + } + + } else { + for (int i = 0; i < n.getArrayCount(); i++) { + if (arraysAnnotations != null && i < arraysAnnotations.size()) { + List annotations = arraysAnnotations.get(i); + if (annotations != null) { + for (AnnotationExpr ae : annotations) { + ae.accept(this, arg); + printer.print(" "); + } + } + } + printer.print("[]"); + } + printer.print(" "); + n.getInitializer().accept(this, arg); + } + } + + @Override public void visit(final AssignExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getTarget().accept(this, arg); + printer.print(" "); + switch (n.getOperator()) { + case assign: + printer.print("="); + break; + case and: + printer.print("&="); + break; + case or: + printer.print("|="); + break; + case xor: + printer.print("^="); + break; + case plus: + printer.print("+="); + break; + case minus: + printer.print("-="); + break; + case rem: + printer.print("%="); + break; + case slash: + printer.print("/="); + break; + case star: + printer.print("*="); + break; + case lShift: + printer.print("<<="); + break; + case rSignedShift: + printer.print(">>="); + break; + case rUnsignedShift: + printer.print(">>>="); + break; + } + printer.print(" "); + n.getValue().accept(this, arg); + } + + @Override public void visit(final BinaryExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getLeft().accept(this, arg); + printer.print(" "); + switch (n.getOperator()) { + case or: + printer.print("||"); + break; + case and: + printer.print("&&"); + break; + case binOr: + printer.print("|"); + break; + case binAnd: + printer.print("&"); + break; + case xor: + printer.print("^"); + break; + case equals: + printer.print("=="); + break; + case notEquals: + printer.print("!="); + break; + case less: + printer.print("<"); + break; + case greater: + printer.print(">"); + break; + case lessEquals: + printer.print("<="); + break; + case greaterEquals: + printer.print(">="); + break; + case lShift: + printer.print("<<"); + break; + case rSignedShift: + printer.print(">>"); + break; + case rUnsignedShift: + printer.print(">>>"); + break; + case plus: + printer.print("+"); + break; + case minus: + printer.print("-"); + break; + case times: + printer.print("*"); + break; + case divide: + printer.print("/"); + break; + case remainder: + printer.print("%"); + break; + } + printer.print(" "); + n.getRight().accept(this, arg); + } + + @Override public void visit(final CastExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("("); + n.getType().accept(this, arg); + printer.print(") "); + n.getExpr().accept(this, arg); + } + + @Override public void visit(final ClassExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getType().accept(this, arg); + printer.print(".class"); + } + + @Override public void visit(final ConditionalExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + printer.print(" ? "); + n.getThenExpr().accept(this, arg); + printer.print(" : "); + n.getElseExpr().accept(this, arg); + } + + @Override public void visit(final EnclosedExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("("); + if (n.getInner() != null) { + n.getInner().accept(this, arg); + } + printer.print(")"); + } + + @Override public void visit(final FieldAccessExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getScope().accept(this, arg); + printer.print("."); + printer.print(n.getField()); + } + + @Override public void visit(final InstanceOfExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + printer.print(" instanceof "); + n.getType().accept(this, arg); + } + + @Override public void visit(final CharLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("'"); + printer.print(n.getValue()); + printer.print("'"); + } + + @Override public void visit(final DoubleLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override public void visit(final IntegerLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override public void visit(final LongLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override public void visit(final IntegerLiteralMinValueExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override public void visit(final LongLiteralMinValueExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getValue()); + } + + @Override public void visit(final StringLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("\""); + printer.print(n.getValue()); + printer.print("\""); + } + + @Override public void visit(final BooleanLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(String.valueOf(n.getValue())); + } + + @Override public void visit(final NullLiteralExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("null"); + } + + @Override public void visit(final ThisExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + printer.print("."); + } + printer.print("this"); + } + + @Override public void visit(final SuperExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + printer.print("."); + } + printer.print("super"); + } + + @Override public void visit(final MethodCallExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + printTypeArgs(n.getTypeArgs(), arg); + printer.print(n.getName()); + printArguments(n.getArgs(), arg); + } + + @Override public void visit(final ObjectCreationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + + printer.print("new "); + + printTypeArgs(n.getTypeArgs(), arg); + if (!isNullOrEmpty(n.getTypeArgs())) { + printer.print(" "); + } + + n.getType().accept(this, arg); + + printArguments(n.getArgs(), arg); + + if (n.getAnonymousClassBody() != null) { + printer.printLn(" {"); + printer.indent(); + printMembers(n.getAnonymousClassBody(), arg); + printer.unindent(); + printer.print("}"); + } + } + + @Override public void visit(final UnaryExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + switch (n.getOperator()) { + case positive: + printer.print("+"); + break; + case negative: + printer.print("-"); + break; + case inverse: + printer.print("~"); + break; + case not: + printer.print("!"); + break; + case preIncrement: + printer.print("++"); + break; + case preDecrement: + printer.print("--"); + break; + default: + } + + n.getExpr().accept(this, arg); + + switch (n.getOperator()) { + case posIncrement: + printer.print("++"); + break; + case posDecrement: + printer.print("--"); + break; + default: + } + } + + @Override public void visit(final ConstructorDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printTypeParameters(n.getTypeParameters(), arg); + if (n.getTypeParameters() != null) { + printer.print(" "); + } + printer.print(n.getName()); + + printer.print("("); + if (n.getParameters() != null) { + for (final Iterator i = n.getParameters().iterator(); i.hasNext();) { + final Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + + if (!isNullOrEmpty(n.getThrows())) { + printer.print(" throws "); + for (final Iterator i = n.getThrows().iterator(); i.hasNext();) { + final NameExpr name = i.next(); + name.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(" "); + n.getBlock().accept(this, arg); + } + + @Override public void visit(final MethodDeclaration n, final Object arg) { printOrphanCommentsBeforeThisChildNode(n); - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + if (n.isDefault()) { + printer.print("default "); + } + printTypeParameters(n.getTypeParameters(), arg); + if (n.getTypeParameters() != null) { + printer.print(" "); + } + + n.getType().accept(this, arg); + printer.print(" "); + printer.print(n.getName()); + + printer.print("("); + if (n.getParameters() != null) { + for (final Iterator i = n.getParameters().iterator(); i.hasNext();) { + final Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + + for (int i = 0; i < n.getArrayCount(); i++) { + printer.print("[]"); + } + + if (!isNullOrEmpty(n.getThrows())) { + printer.print(" throws "); + for (final Iterator i = n.getThrows().iterator(); i.hasNext();) { + final NameExpr name = i.next(); + name.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (n.getBody() == null) { + printer.print(";"); + } else { + printer.print(" "); + n.getBody().accept(this, arg); + } + } + + @Override public void visit(final Parameter n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + if (n.getType() != null) { + n.getType().accept(this, arg); + } + if (n.isVarArgs()) { + printer.print("..."); + } + printer.print(" "); + n.getId().accept(this, arg); + } + + @Override public void visit(MultiTypeParameter n, Object arg) { + printAnnotations(n.getAnnotations(), arg); printModifiers(n.getModifiers()); - n.getType().accept(this, arg); - printer.print(" "); - for (final Iterator i = n.getVariables().iterator(); i.hasNext(); ) { - final VariableDeclarator var = i.next(); - var.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } + Iterator types = n.getTypes().iterator(); + types.next().accept(this, arg); + while (types.hasNext()) { + printer.print(" | "); + types.next().accept(this, arg); } - - printer.print(";"); - } - - @Override - public void visit(final VariableDeclarator n, final Object arg) { - printJavaComment(n.getComment(), arg); + + printer.print(" "); n.getId().accept(this, arg); - if (n.getInit() != null) { - printer.print(" = "); - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(final VariableDeclaratorId n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getName()); - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - } - - @Override - public void visit(final ArrayInitializerExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("{"); - if (n.getValues() != null) { - printer.print(" "); - for (final Iterator i = n.getValues().iterator(); i.hasNext(); ) { - final Expression expr = i.next(); - expr.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(" "); - } - printer.print("}"); - } - - @Override - public void visit(final VoidType n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("void"); } - @Override - public void visit(final ArrayAccessExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getName().accept(this, arg); - printer.print("["); - n.getIndex().accept(this, arg); - printer.print("]"); - } - - @Override - public void visit(final ArrayCreationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("new "); - n.getType().accept(this, arg); - List> arraysAnnotations = n.getArraysAnnotations(); - if (n.getDimensions() != null) { - int j = 0; - for (final Expression dim : n.getDimensions()) { - - if (arraysAnnotations != null && j < arraysAnnotations.size()) { - List annotations = arraysAnnotations.get(j); - if (annotations != null) { - for (AnnotationExpr ae : annotations) { - printer.print(" "); - ae.accept(this, arg); - } - } - } - printer.print("["); - dim.accept(this, arg); - printer.print("]"); - j++; - } - for (int i = 0; i < n.getArrayCount(); i++) { - if (arraysAnnotations != null && i < arraysAnnotations.size()) { - - List annotations = arraysAnnotations.get(i); - if (annotations != null) { - for (AnnotationExpr ae : annotations) { - printer.print(" "); - ae.accept(this, arg); - - } - } - } - printer.print("[]"); - } - - } else { - for (int i = 0; i < n.getArrayCount(); i++) { - if (arraysAnnotations != null && i < arraysAnnotations.size()) { - List annotations = arraysAnnotations.get(i); - if (annotations != null) { - for (AnnotationExpr ae : annotations) { - ae.accept(this, arg); - printer.print(" "); - } - } - } - printer.print("[]"); - } - printer.print(" "); - n.getInitializer().accept(this, arg); + @Override public void visit(final ExplicitConstructorInvocationStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.isThis()) { + printTypeArgs(n.getTypeArgs(), arg); + printer.print("this"); + } else { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + printer.print("."); + } + printTypeArgs(n.getTypeArgs(), arg); + printer.print("super"); + } + printArguments(n.getArgs(), arg); + printer.print(";"); + } + + @Override public void visit(final VariableDeclarationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + n.getType().accept(this, arg); + printer.print(" "); + + for (final Iterator i = n.getVars().iterator(); i.hasNext();) { + final VariableDeclarator v = i.next(); + v.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + @Override public void visit(final TypeDeclarationStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + n.getTypeDeclaration().accept(this, arg); + } + + @Override public void visit(final AssertStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("assert "); + n.getCheck().accept(this, arg); + if (n.getMessage() != null) { + printer.print(" : "); + n.getMessage().accept(this, arg); + } + printer.print(";"); + } + + @Override public void visit(final BlockStmt n, final Object arg) { + printOrphanCommentsBeforeThisChildNode(n); + printJavaComment(n.getComment(), arg); + printer.printLn("{"); + if (n.getStmts() != null) { + printer.indent(); + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + printer.printLn(); + } + printer.unindent(); + } + printOrphanCommentsEnding(n); + printer.print("}"); + + } + + @Override public void visit(final LabeledStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getLabel()); + printer.print(": "); + n.getStmt().accept(this, arg); + } + + @Override public void visit(final EmptyStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(";"); + } + + @Override public void visit(final ExpressionStmt n, final Object arg) { + printOrphanCommentsBeforeThisChildNode(n); + printJavaComment(n.getComment(), arg); + n.getExpression().accept(this, arg); + printer.print(";"); + } + + @Override public void visit(final SwitchStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("switch("); + n.getSelector().accept(this, arg); + printer.printLn(") {"); + if (n.getEntries() != null) { + printer.indent(); + for (final SwitchEntryStmt e : n.getEntries()) { + e.accept(this, arg); + } + printer.unindent(); + } + printer.print("}"); + + } + + @Override public void visit(final SwitchEntryStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + if (n.getLabel() != null) { + printer.print("case "); + n.getLabel().accept(this, arg); + printer.print(":"); + } else { + printer.print("default:"); + } + printer.printLn(); + printer.indent(); + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + printer.printLn(); + } + } + printer.unindent(); + } + + @Override public void visit(final BreakStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("break"); + if (n.getId() != null) { + printer.print(" "); + printer.print(n.getId()); + } + printer.print(";"); + } + + @Override public void visit(final ReturnStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("return"); + if (n.getExpr() != null) { + printer.print(" "); + n.getExpr().accept(this, arg); + } + printer.print(";"); + } + + @Override public void visit(final EnumDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printer.print("enum "); + printer.print(n.getName()); + + if (n.getImplements() != null) { + printer.print(" implements "); + for (final Iterator i = n.getImplements().iterator(); i.hasNext();) { + final ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + printer.printLn(" {"); + printer.indent(); + if (n.getEntries() != null) { + printer.printLn(); + for (final Iterator i = n.getEntries().iterator(); i.hasNext();) { + final EnumConstantDeclaration e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (n.getMembers() != null) { + printer.printLn(";"); + printMembers(n.getMembers(), arg); + } else { + if (n.getEntries() != null) { + printer.printLn(); + } + } + printer.unindent(); + printer.print("}"); + } + + @Override public void visit(final EnumConstantDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printer.print(n.getName()); + + if (n.getArgs() != null) { + printArguments(n.getArgs(), arg); + } + + if (n.getClassBody() != null) { + printer.printLn(" {"); + printer.indent(); + printMembers(n.getClassBody(), arg); + printer.unindent(); + printer.printLn("}"); + } + } + + @Override public void visit(final EmptyMemberDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printer.print(";"); + } + + @Override public void visit(final InitializerDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + if (n.isStatic()) { + printer.print("static "); + } + n.getBlock().accept(this, arg); + } + + @Override public void visit(final IfStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("if ("); + n.getCondition().accept(this, arg); + final boolean thenBlock = n.getThenStmt() instanceof BlockStmt; + if (thenBlock) // block statement should start on the same line + printer.print(") "); + else { + printer.printLn(")"); + printer.indent(); + } + n.getThenStmt().accept(this, arg); + if (!thenBlock) + printer.unindent(); + if (n.getElseStmt() != null) { + if (thenBlock) + printer.print(" "); + else + printer.printLn(); + final boolean elseIf = n.getElseStmt() instanceof IfStmt; + final boolean elseBlock = n.getElseStmt() instanceof BlockStmt; + if (elseIf || elseBlock) // put chained if and start of block statement on a same level + printer.print("else "); + else { + printer.printLn("else"); + printer.indent(); + } + n.getElseStmt().accept(this, arg); + if (!(elseIf || elseBlock)) + printer.unindent(); + } + } + + @Override public void visit(final WhileStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("while ("); + n.getCondition().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override public void visit(final ContinueStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("continue"); + if (n.getId() != null) { + printer.print(" "); + printer.print(n.getId()); + } + printer.print(";"); + } + + @Override public void visit(final DoStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("do "); + n.getBody().accept(this, arg); + printer.print(" while ("); + n.getCondition().accept(this, arg); + printer.print(");"); + } + + @Override public void visit(final ForeachStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("for ("); + n.getVariable().accept(this, arg); + printer.print(" : "); + n.getIterable().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override public void visit(final ForStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("for ("); + if (n.getInit() != null) { + for (final Iterator i = n.getInit().iterator(); i.hasNext();) { + final Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print("; "); + if (n.getCompare() != null) { + n.getCompare().accept(this, arg); + } + printer.print("; "); + if (n.getUpdate() != null) { + for (final Iterator i = n.getUpdate().iterator(); i.hasNext();) { + final Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override public void visit(final ThrowStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("throw "); + n.getExpr().accept(this, arg); + printer.print(";"); + } + + @Override public void visit(final SynchronizedStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("synchronized ("); + n.getExpr().accept(this, arg); + printer.print(") "); + n.getBlock().accept(this, arg); + } + + @Override public void visit(final TryStmt n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("try "); + if (!n.getResources().isEmpty()) { + printer.print("("); + Iterator resources = n.getResources().iterator(); + boolean first = true; + while (resources.hasNext()) { + visit(resources.next(), arg); + if (resources.hasNext()) { + printer.print(";"); + printer.printLn(); + if (first) { + printer.indent(); + } + } + first = false; + } + if (n.getResources().size() > 1) { + printer.unindent(); + } + printer.print(") "); + } + n.getTryBlock().accept(this, arg); + if (n.getCatchs() != null) { + for (final CatchClause c : n.getCatchs()) { + c.accept(this, arg); + } + } + if (n.getFinallyBlock() != null) { + printer.print(" finally "); + n.getFinallyBlock().accept(this, arg); + } + } + + @Override public void visit(final CatchClause n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(" catch ("); + n.getExcept().accept(this, arg); + printer.print(") "); + n.getCatchBlock().accept(this, arg); + + } + + @Override public void visit(final AnnotationDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printer.print("@interface "); + printer.print(n.getName()); + printer.printLn(" {"); + printer.indent(); + if (n.getMembers() != null) { + printMembers(n.getMembers(), arg); + } + printer.unindent(); + printer.print("}"); + } + + @Override public void visit(final AnnotationMemberDeclaration n, final Object arg) { + printJavaComment(n.getComment(), arg); + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + n.getType().accept(this, arg); + printer.print(" "); + printer.print(n.getName()); + printer.print("()"); + if (n.getDefaultValue() != null) { + printer.print(" default "); + n.getDefaultValue().accept(this, arg); + } + printer.print(";"); + } + + @Override public void visit(final MarkerAnnotationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("@"); + n.getName().accept(this, arg); + } + + @Override public void visit(final SingleMemberAnnotationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("@"); + n.getName().accept(this, arg); + printer.print("("); + n.getMemberValue().accept(this, arg); + printer.print(")"); + } + + @Override public void visit(final NormalAnnotationExpr n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print("@"); + n.getName().accept(this, arg); + printer.print("("); + if (n.getPairs() != null) { + for (final Iterator i = n.getPairs().iterator(); i.hasNext();) { + final MemberValuePair m = i.next(); + m.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + } + + @Override public void visit(final MemberValuePair n, final Object arg) { + printJavaComment(n.getComment(), arg); + printer.print(n.getName()); + printer.print(" = "); + n.getValue().accept(this, arg); + } + + @Override public void visit(final LineComment n, final Object arg) { + if (!this.printComments) { + return; } - } + printer.print("//"); + String tmp = n.getContent(); + tmp = tmp.replace('\r', ' '); + tmp = tmp.replace('\n', ' '); + printer.printLn(tmp); + } - @Override - public void visit(final AssignExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getTarget().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case assign: - printer.print("="); - break; - case and: - printer.print("&="); - break; - case or: - printer.print("|="); - break; - case xor: - printer.print("^="); - break; - case plus: - printer.print("+="); - break; - case minus: - printer.print("-="); - break; - case rem: - printer.print("%="); - break; - case slash: - printer.print("/="); - break; - case star: - printer.print("*="); - break; - case lShift: - printer.print("<<="); - break; - case rSignedShift: - printer.print(">>="); - break; - case rUnsignedShift: - printer.print(">>>="); - break; + @Override public void visit(final BlockComment n, final Object arg) { + if (!this.printComments) { + return; } - printer.print(" "); - n.getValue().accept(this, arg); - } + printer.print("/*"); + printer.print(n.getContent()); + printer.printLn("*/"); + } - @Override - public void visit(final BinaryExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getLeft().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case or: - printer.print("||"); - break; - case and: - printer.print("&&"); - break; - case binOr: - printer.print("|"); - break; - case binAnd: - printer.print("&"); - break; - case xor: - printer.print("^"); - break; - case equals: - printer.print("=="); - break; - case notEquals: - printer.print("!="); - break; - case less: - printer.print("<"); - break; - case greater: - printer.print(">"); - break; - case lessEquals: - printer.print("<="); - break; - case greaterEquals: - printer.print(">="); - break; - case lShift: - printer.print("<<"); - break; - case rSignedShift: - printer.print(">>"); - break; - case rUnsignedShift: - printer.print(">>>"); - break; - case plus: - printer.print("+"); - break; - case minus: - printer.print("-"); - break; - case times: - printer.print("*"); - break; - case divide: - printer.print("/"); - break; - case remainder: - printer.print("%"); - break; - } - printer.print(" "); - n.getRight().accept(this, arg); - } - - @Override - public void visit(final CastExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("("); - n.getType().accept(this, arg); - printer.print(") "); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final ClassExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getType().accept(this, arg); - printer.print(".class"); - } - - @Override - public void visit(final ConditionalExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - printer.print(" ? "); - n.getThenExpr().accept(this, arg); - printer.print(" : "); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(final EnclosedExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("("); - if (n.getInner() != null) { - n.getInner().accept(this, arg); - } - printer.print(")"); - } - - @Override - public void visit(final FieldAccessExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getScope().accept(this, arg); - printer.print("."); - printer.print(n.getField()); - } - - @Override - public void visit(final InstanceOfExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - printer.print(" instanceof "); - n.getType().accept(this, arg); - } - - @Override - public void visit(final CharLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("'"); - printer.print(n.getValue()); - printer.print("'"); - } - - @Override - public void visit(final DoubleLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final IntegerLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final LongLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final IntegerLiteralMinValueExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final LongLiteralMinValueExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getValue()); - } - - @Override - public void visit(final StringLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("\""); - printer.print(n.getValue()); - printer.print("\""); - } - - @Override - public void visit(final BooleanLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(String.valueOf(n.getValue())); - } - - @Override - public void visit(final NullLiteralExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("null"); - } - - @Override - public void visit(final ThisExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("this"); - } - - @Override - public void visit(final SuperExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("super"); - } - - @Override - public void visit(final MethodCallExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - printTypeArgs(n.getTypeArgs(), arg); - printer.print(n.getName()); - printArguments(n.getArgs(), arg); - } - - @Override - public void visit(final ObjectCreationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - - printer.print("new "); - - printTypeArgs(n.getTypeArgs(), arg); - if (!isNullOrEmpty(n.getTypeArgs())) { - printer.print(" "); - } - - n.getType().accept(this, arg); - - printArguments(n.getArgs(), arg); - - if (n.getAnonymousClassBody() != null) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getAnonymousClassBody(), arg); - printer.unindent(); - printer.print("}"); - } - } - - @Override - public void visit(final UnaryExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - switch (n.getOperator()) { - case positive: - printer.print("+"); - break; - case negative: - printer.print("-"); - break; - case inverse: - printer.print("~"); - break; - case not: - printer.print("!"); - break; - case preIncrement: - printer.print("++"); - break; - case preDecrement: - printer.print("--"); - break; - default: - } - - n.getExpr().accept(this, arg); - - switch (n.getOperator()) { - case posIncrement: - printer.print("++"); - break; - case posDecrement: - printer.print("--"); - break; - default: - } - } - - @Override - public void visit(final ConstructorDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printTypeParameters(n.getTypeParameters(), arg); - if (n.getTypeParameters() != null) { - printer.print(" "); - } - printer.print(n.getName()); - - printer.print("("); - if (n.getParameters() != null) { - for (final Iterator i = n.getParameters().iterator(); i.hasNext(); ) { - final Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - if (!isNullOrEmpty(n.getThrows())) { - printer.print(" throws "); - for (final Iterator i = n.getThrows().iterator(); i.hasNext(); ) { - final NameExpr name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(" "); - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final MethodDeclaration n, final Object arg) { - printOrphanCommentsBeforeThisChildNode(n); - - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - if (n.isDefault()) { - printer.print("default "); - } - printTypeParameters(n.getTypeParameters(), arg); - if (n.getTypeParameters() != null) { - printer.print(" "); - } - - n.getType().accept(this, arg); - printer.print(" "); - printer.print(n.getName()); - - printer.print("("); - if (n.getParameters() != null) { - for (final Iterator i = n.getParameters().iterator(); i.hasNext(); ) { - final Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - - if (!isNullOrEmpty(n.getThrows())) { - printer.print(" throws "); - for (final Iterator i = n.getThrows().iterator(); i.hasNext(); ) { - final NameExpr name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (n.getBody() == null) { - printer.print(";"); - } else { - printer.print(" "); - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(final Parameter n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - if (n.getType() != null) { - n.getType().accept(this, arg); - } - if (n.isVarArgs()) { - printer.print("..."); - } - printer.print(" "); - n.getId().accept(this, arg); - } - - @Override - public void visit(MultiTypeParameter n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - Iterator types = n.getTypes().iterator(); - types.next().accept(this, arg); - while (types.hasNext()) { - printer.print(" | "); - types.next().accept(this, arg); - } - - printer.print(" "); - n.getId().accept(this, arg); - } - - @Override - public void visit(final ExplicitConstructorInvocationStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.isThis()) { - printTypeArgs(n.getTypeArgs(), arg); - printer.print("this"); - } else { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - printer.print("."); - } - printTypeArgs(n.getTypeArgs(), arg); - printer.print("super"); - } - printArguments(n.getArgs(), arg); - printer.print(";"); - } - - @Override - public void visit(final VariableDeclarationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - printer.print(" "); - - for (final Iterator i = n.getVars().iterator(); i.hasNext(); ) { - final VariableDeclarator v = i.next(); - v.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - @Override - public void visit(final TypeDeclarationStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(final AssertStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("assert "); - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - printer.print(" : "); - n.getMessage().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(final BlockStmt n, final Object arg) { - printOrphanCommentsBeforeThisChildNode(n); - printJavaComment(n.getComment(), arg); - printer.printLn("{"); - if (n.getStmts() != null) { - printer.indent(); - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - printer.unindent(); - } - printOrphanCommentsEnding(n); - printer.print("}"); - - } - - @Override - public void visit(final LabeledStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getLabel()); - printer.print(": "); - n.getStmt().accept(this, arg); - } - - @Override - public void visit(final EmptyStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(";"); - } - - @Override - public void visit(final ExpressionStmt n, final Object arg) { - printOrphanCommentsBeforeThisChildNode(n); - printJavaComment(n.getComment(), arg); - n.getExpression().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(final SwitchStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("switch("); - n.getSelector().accept(this, arg); - printer.printLn(") {"); - if (n.getEntries() != null) { - printer.indent(); - for (final SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - printer.unindent(); - } - printer.print("}"); - - } - - @Override - public void visit(final SwitchEntryStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - if (n.getLabel() != null) { - printer.print("case "); - n.getLabel().accept(this, arg); - printer.print(":"); - } else { - printer.print("default:"); - } - printer.printLn(); - printer.indent(); - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - } - printer.unindent(); - } - - @Override - public void visit(final BreakStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("break"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(final ReturnStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("return"); - if (n.getExpr() != null) { - printer.print(" "); - n.getExpr().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(final EnumDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("enum "); - printer.print(n.getName()); - - if (n.getImplements() != null) { - printer.print(" implements "); - for (final Iterator i = n.getImplements().iterator(); i.hasNext(); ) { - final ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (n.getEntries() != null) { - printer.printLn(); - for (final Iterator i = n.getEntries().iterator(); i.hasNext(); ) { - final EnumConstantDeclaration e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (n.getMembers() != null) { - printer.printLn(";"); - printMembers(n.getMembers(), arg); - } else { - if (n.getEntries() != null) { - printer.printLn(); - } - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(final EnumConstantDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printer.print(n.getName()); - - if (n.getArgs() != null) { - printArguments(n.getArgs(), arg); - } - - if (n.getClassBody() != null) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getClassBody(), arg); - printer.unindent(); - printer.printLn("}"); - } - } - - @Override - public void visit(final EmptyMemberDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printer.print(";"); - } - - @Override - public void visit(final InitializerDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - if (n.isStatic()) { - printer.print("static "); - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final IfStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("if ("); - n.getCondition().accept(this, arg); - final boolean thenBlock = n.getThenStmt() instanceof BlockStmt; - if (thenBlock) // block statement should start on the same line - printer.print(") "); - else { - printer.printLn(")"); - printer.indent(); - } - n.getThenStmt().accept(this, arg); - if (!thenBlock) - printer.unindent(); - if (n.getElseStmt() != null) { - if (thenBlock) - printer.print(" "); - else - printer.printLn(); - final boolean elseIf = n.getElseStmt() instanceof IfStmt; - final boolean elseBlock = n.getElseStmt() instanceof BlockStmt; - if (elseIf || elseBlock) // put chained if and start of block statement on a same level - printer.print("else "); - else { - printer.printLn("else"); - printer.indent(); - } - n.getElseStmt().accept(this, arg); - if (!(elseIf || elseBlock)) - printer.unindent(); - } - } - - @Override - public void visit(final WhileStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("while ("); - n.getCondition().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ContinueStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("continue"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(final DoStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("do "); - n.getBody().accept(this, arg); - printer.print(" while ("); - n.getCondition().accept(this, arg); - printer.print(");"); - } - - @Override - public void visit(final ForeachStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("for ("); - n.getVariable().accept(this, arg); - printer.print(" : "); - n.getIterable().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ForStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("for ("); - if (n.getInit() != null) { - for (final Iterator i = n.getInit().iterator(); i.hasNext(); ) { - final Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print("; "); - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - printer.print("; "); - if (n.getUpdate() != null) { - for (final Iterator i = n.getUpdate().iterator(); i.hasNext(); ) { - final Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ThrowStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("throw "); - n.getExpr().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(final SynchronizedStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("synchronized ("); - n.getExpr().accept(this, arg); - printer.print(") "); - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final TryStmt n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("try "); - if (!n.getResources().isEmpty()) { - printer.print("("); - Iterator resources = n.getResources().iterator(); - boolean first = true; - while (resources.hasNext()) { - visit(resources.next(), arg); - if (resources.hasNext()) { - printer.print(";"); - printer.printLn(); - if (first) { - printer.indent(); - } - } - first = false; - } - if (n.getResources().size() > 1) { - printer.unindent(); - } - printer.print(") "); - } - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (final CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - printer.print(" finally "); - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(final CatchClause n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(" catch ("); - n.getExcept().accept(this, arg); - printer.print(") "); - n.getCatchBlock().accept(this, arg); - - } - - @Override - public void visit(final AnnotationDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("@interface "); - printer.print(n.getName()); - printer.printLn(" {"); - printer.indent(); - if (n.getMembers() != null) { - printMembers(n.getMembers(), arg); - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(final AnnotationMemberDeclaration n, final Object arg) { - printJavaComment(n.getComment(), arg); - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - printer.print(" "); - printer.print(n.getName()); - printer.print("()"); - if (n.getDefaultValue() != null) { - printer.print(" default "); - n.getDefaultValue().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(final MarkerAnnotationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("@"); - n.getName().accept(this, arg); - } - - @Override - public void visit(final SingleMemberAnnotationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - n.getMemberValue().accept(this, arg); - printer.print(")"); - } - - @Override - public void visit(final NormalAnnotationExpr n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - if (n.getPairs() != null) { - for (final Iterator i = n.getPairs().iterator(); i.hasNext(); ) { - final MemberValuePair m = i.next(); - m.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - @Override - public void visit(final MemberValuePair n, final Object arg) { - printJavaComment(n.getComment(), arg); - printer.print(n.getName()); - printer.print(" = "); - n.getValue().accept(this, arg); - } - - @Override - public void visit(final LineComment n, final Object arg) { - if (!this.printComments) { - return; - } - printer.print("//"); - String tmp = n.getContent(); - tmp = tmp.replace('\r', ' '); - tmp = tmp.replace('\n', ' '); - printer.printLn(tmp); - } - - @Override - public void visit(final BlockComment n, final Object arg) { - if (!this.printComments) { - return; - } - printer.print("/*"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - - @Override - public void visit(LambdaExpr n, Object arg) { + @Override + public void visit(LambdaExpr n, Object arg) { printJavaComment(n.getComment(), arg); List parameters = n.getParameters(); - boolean printPar = false; - printPar = n.isParametersEnclosed(); - - if (printPar) { - printer.print("("); - } - if (parameters != null) { - for (Iterator i = parameters.iterator(); i.hasNext(); ) { - Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (printPar) { - printer.print(")"); - } - - printer.print(" -> "); - Statement body = n.getBody(); - if (body instanceof ExpressionStmt) { - // Print the expression directly - ((ExpressionStmt) body).getExpression().accept(this, arg); - } else { - body.accept(this, arg); - } - } + boolean printPar = false; + printPar = n.isParametersEnclosed(); + + if (printPar) { + printer.print("("); + } + if (parameters != null) { + for (Iterator i = parameters.iterator(); i.hasNext();) { + Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (printPar) { + printer.print(")"); + } + + printer.print(" -> "); + Statement body = n.getBody(); + if (body instanceof ExpressionStmt) { + // Print the expression directly + ((ExpressionStmt) body).getExpression().accept(this, arg); + } else { + body.accept(this, arg); + } + } @Override @@ -1672,7 +1589,7 @@ public void visit(MethodReferenceExpr n, Object arg) { if (n.getTypeParameters() != null) { printer.print("<"); for (Iterator i = n.getTypeParameters().iterator(); i - .hasNext(); ) { + .hasNext();) { TypeParameter p = i.next(); p.accept(this, arg); if (i.hasNext()) { @@ -1695,47 +1612,46 @@ public void visit(TypeExpr n, Object arg) { } } - private void printOrphanCommentsBeforeThisChildNode(final Node node) { + private void printOrphanCommentsBeforeThisChildNode(final Node node){ if (node instanceof Comment) return; Node parent = node.getParentNode(); - if (parent == null) return; + if (parent==null) return; List everything = new LinkedList(); everything.addAll(parent.getChildrenNodes()); sortByBeginPosition(everything); int positionOfTheChild = -1; - for (int i = 0; i < everything.size(); i++) { - if (everything.get(i) == node) positionOfTheChild = i; + for (int i=0;i= 0 && positionOfPreviousChild == -1; i--) { + for (int i=positionOfTheChild-1;i>=0 && positionOfPreviousChild==-1;i--){ if (!(everything.get(i) instanceof Comment)) positionOfPreviousChild = i; } - for (int i = positionOfPreviousChild + 1; i < positionOfTheChild; i++) { + for (int i=positionOfPreviousChild+1;i everything = new LinkedList(); everything.addAll(node.getChildrenNodes()); sortByBeginPosition(everything); - if (everything.size() == 0) return; + if (everything.size()==0) return; int commentsAtEnd = 0; boolean findingComments = true; - while (findingComments && commentsAtEnd < everything.size()) { - Node last = everything.get(everything.size() - 1 - commentsAtEnd); + while (findingComments&&commentsAtEnd { - private static final EqualsVisitor SINGLETON = new EqualsVisitor(); + private static final EqualsVisitor SINGLETON = new EqualsVisitor(); - public static boolean equals(final Node n1, final Node n2) { - return SINGLETON.nodeEquals(n1, n2); - } + public static boolean equals(final Node n1, final Node n2) { + return SINGLETON.nodeEquals(n1, n2); + } - private EqualsVisitor() { - // hide constructor - } + private EqualsVisitor() { + // hide constructor + } /** * Check for equality that can be applied to each kind of node, @@ -95,1413 +95,1337 @@ private boolean commonNodeEquality(Node n1, Node n2) { if (!nodeEquals(n1.getComment(), n2.getComment())) { return false; } - if (!nodesEquals(n1.getOrphanComments(), n2.getOrphanComments())) { + if (!nodesEquals(n1.getOrphanComments(), n2.getOrphanComments())){ return false; } return true; } - private boolean nodesEquals(final List nodes1, final List nodes2) { - if (nodes1 == null) { - if (nodes2 == null) { - return true; - } + private boolean nodesEquals(final List nodes1, final List nodes2) { + if (nodes1 == null) { + if (nodes2 == null) { + return true; + } + return false; + } else if (nodes2 == null) { + return false; + } + if (nodes1.size() != nodes2.size()) { + return false; + } + for (int i = 0; i < nodes1.size(); i++) { + if (!nodeEquals(nodes1.get(i), nodes2.get(i))) { + return false; + } + } + return true; + } + + private boolean nodeEquals(final T n1, final T n2) { + if (n1 == n2) { + return true; + } + if (n1 == null) { + if (n2 == null) { + return true; + } + return false; + } else if (n2 == null) { + return false; + } + if (n1.getClass() != n2.getClass()) { + return false; + } + if (!commonNodeEquality(n1, n2)){ return false; - } else if (nodes2 == null) { - return false; - } - if (nodes1.size() != nodes2.size()) { - return false; - } - for (int i = 0; i < nodes1.size(); i++) { - if (!nodeEquals(nodes1.get(i), nodes2.get(i))) { - return false; - } } - return true; - } + return n1.accept(this, n2).booleanValue(); + } + + private boolean objEquals(final Object n1, final Object n2) { + if (n1 == n2) { + return true; + } + if (n1 == null) { + if (n2 == null) { + return true; + } + return false; + } else if (n2 == null) { + return false; + } + return n1.equals(n2); + } + + @Override public Boolean visit(final CompilationUnit n1, final Node arg) { + final CompilationUnit n2 = (CompilationUnit) arg; + + if (!nodeEquals(n1.getPackage(), n2.getPackage())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getImports(), n2.getImports())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getTypes(), n2.getTypes())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getComments(), n2.getComments())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final PackageDeclaration n1, final Node arg) { + final PackageDeclaration n2 = (PackageDeclaration) arg; + + if (!nodeEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final ImportDeclaration n1, final Node arg) { + final ImportDeclaration n2 = (ImportDeclaration) arg; + + if (!nodeEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final TypeParameter n1, final Node arg) { + final TypeParameter n2 = (TypeParameter) arg; + + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getTypeBound(), n2.getTypeBound())) { + return Boolean.FALSE; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final LineComment n1, final Node arg) { + final LineComment n2 = (LineComment) arg; + + if (!objEquals(n1.getContent(), n2.getContent())) { + return Boolean.FALSE; + } - private boolean nodeEquals(final T n1, final T n2) { - if (n1 == n2) { - return true; - } - if (n1 == null) { - if (n2 == null) { - return true; - } - return false; - } else if (n2 == null) { - return false; - } - if (n1.getClass() != n2.getClass()) { - return false; - } - if (!commonNodeEquality(n1, n2)) { - return false; - } - return n1.accept(this, n2).booleanValue(); - } + if (!objEquals(n1.getBeginLine(), n2.getBeginLine())) { + return Boolean.FALSE; + } - private boolean objEquals(final Object n1, final Object n2) { - if (n1 == n2) { - return true; - } - if (n1 == null) { - if (n2 == null) { - return true; - } - return false; - } else if (n2 == null) { - return false; - } - return n1.equals(n2); - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final CompilationUnit n1, final Node arg) { - final CompilationUnit n2 = (CompilationUnit) arg; + @Override public Boolean visit(final BlockComment n1, final Node arg) { + final BlockComment n2 = (BlockComment) arg; - if (!nodeEquals(n1.getPackage(), n2.getPackage())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getContent(), n2.getContent())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getImports(), n2.getImports())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getBeginLine(), n2.getBeginLine())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getTypes(), n2.getTypes())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getComments(), n2.getComments())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final ClassOrInterfaceDeclaration n1, final Node arg) { + final ClassOrInterfaceDeclaration n2 = (ClassOrInterfaceDeclaration) arg; - return Boolean.TRUE; - } + // javadoc are checked at CompilationUnit - @Override - public Boolean visit(final PackageDeclaration n1, final Node arg) { - final PackageDeclaration n2 = (PackageDeclaration) arg; + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (n1.isInterface() != n2.isInterface()) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final ImportDeclaration n1, final Node arg) { - final ImportDeclaration n2 = (ImportDeclaration) arg; + if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getExtends(), n2.getExtends())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodesEquals(n1.getImplements(), n2.getImplements())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final TypeParameter n1, final Node arg) { - final TypeParameter n2 = (TypeParameter) arg; + if (!nodesEquals(n1.getMembers(), n2.getMembers())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getTypeBound(), n2.getTypeBound())) { - return Boolean.FALSE; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + @Override public Boolean visit(final EnumDeclaration n1, final Node arg) { + final EnumDeclaration n2 = (EnumDeclaration) arg; - @Override - public Boolean visit(final LineComment n1, final Node arg) { - final LineComment n2 = (LineComment) arg; + // javadoc are checked at CompilationUnit - if (!objEquals(n1.getContent(), n2.getContent())) { - return Boolean.FALSE; - } + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } - if (!objEquals(n1.getBeginLine(), n2.getBeginLine())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final BlockComment n1, final Node arg) { - final BlockComment n2 = (BlockComment) arg; + if (!nodesEquals(n1.getImplements(), n2.getImplements())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getContent(), n2.getContent())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getEntries(), n2.getEntries())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getBeginLine(), n2.getBeginLine())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getMembers(), n2.getMembers())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final ClassOrInterfaceDeclaration n1, final Node arg) { - final ClassOrInterfaceDeclaration n2 = (ClassOrInterfaceDeclaration) arg; + @Override public Boolean visit(final EmptyTypeDeclaration n1, final Node arg) { + return Boolean.TRUE; + } - // javadoc are checked at CompilationUnit + @Override public Boolean visit(final EnumConstantDeclaration n1, final Node arg) { + final EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + // javadoc are checked at CompilationUnit - if (n1.isInterface() != n2.isInterface()) { - return Boolean.FALSE; - } + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getExtends(), n2.getExtends())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getImplements(), n2.getImplements())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final AnnotationDeclaration n1, final Node arg) { + final AnnotationDeclaration n2 = (AnnotationDeclaration) arg; - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return Boolean.FALSE; - } + // javadoc are checked at CompilationUnit - return Boolean.TRUE; - } + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final EnumDeclaration n1, final Node arg) { - final EnumDeclaration n2 = (EnumDeclaration) arg; + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - // javadoc are checked at CompilationUnit + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getMembers(), n2.getMembers())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final AnnotationMemberDeclaration n1, final Node arg) { + final AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg; - if (!nodesEquals(n1.getImplements(), n2.getImplements())) { - return Boolean.FALSE; - } + // javadoc are checked at CompilationUnit - if (!nodesEquals(n1.getEntries(), n2.getEntries())) { - return Boolean.FALSE; - } + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final EmptyTypeDeclaration n1, final Node arg) { - return Boolean.TRUE; - } + if (!nodeEquals(n1.getDefaultValue(), n2.getDefaultValue())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final EnumConstantDeclaration n1, final Node arg) { - final EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } - // javadoc are checked at CompilationUnit + return Boolean.TRUE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final FieldDeclaration n1, final Node arg) { + final FieldDeclaration n2 = (FieldDeclaration) arg; - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + // javadoc are checked at CompilationUnit - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final AnnotationDeclaration n1, final Node arg) { - final AnnotationDeclaration n2 = (AnnotationDeclaration) arg; + if (!nodesEquals(n1.getVariables(), n2.getVariables())) { + return Boolean.FALSE; + } - // javadoc are checked at CompilationUnit + return Boolean.TRUE; + } - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + @Override public Boolean visit(final VariableDeclarator n1, final Node arg) { + final VariableDeclarator n2 = (VariableDeclarator) arg; - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getId(), n2.getId())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getInit(), n2.getInit())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final VariableDeclaratorId n1, final Node arg) { + final VariableDeclaratorId n2 = (VariableDeclaratorId) arg; - @Override - public Boolean visit(final AnnotationMemberDeclaration n1, final Node arg) { - final AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg; + if (n1.getArrayCount() != n2.getArrayCount()) { + return Boolean.FALSE; + } - // javadoc are checked at CompilationUnit + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } + + @Override public Boolean visit(final ConstructorDeclaration n1, final Node arg) { + final ConstructorDeclaration n2 = (ConstructorDeclaration) arg; + + // javadoc are checked at CompilationUnit + + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } + + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getBlock(), n2.getBlock())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getParameters(), n2.getParameters())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getThrows(), n2.getThrows())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final MethodDeclaration n1, final Node arg) { + final MethodDeclaration n2 = (MethodDeclaration) arg; + + // javadoc are checked at CompilationUnit + + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } + + if (n1.getArrayCount() != n2.getArrayCount()) { + return Boolean.FALSE; + } + + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getParameters(), n2.getParameters())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getThrows(), n2.getThrows())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { + return Boolean.FALSE; + } + if(n1.isDefault() != n2.isDefault()){ + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final Parameter n1, final Node arg) { + final Parameter n2 = (Parameter) arg; + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } + return visit((BaseParameter) n1, arg); + } + + @Override public Boolean visit(MultiTypeParameter n1, Node arg) { + MultiTypeParameter n2 = (MultiTypeParameter) arg; + if (n1.getTypes().size() != n2.getTypes().size()) { + return Boolean.FALSE; + } + Iterator n1types = n1.getTypes().iterator(); + Iterator n2types = n2.getTypes().iterator(); + while (n1types.hasNext() && n2types.hasNext()) { + if (!nodeEquals(n1types.next(), n2types.next())) { + return Boolean.FALSE; + } + } + return visit((BaseParameter) n1, arg); + } + + protected Boolean visit(final BaseParameter n1, final Node arg) { + final BaseParameter n2 = (BaseParameter) arg; + + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getId(), n2.getId())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final EmptyMemberDeclaration n1, final Node arg) { + return Boolean.TRUE; + } + + @Override public Boolean visit(final InitializerDeclaration n1, final Node arg) { + final InitializerDeclaration n2 = (InitializerDeclaration) arg; + + if (!nodeEquals(n1.getBlock(), n2.getBlock())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final JavadocComment n1, final Node arg) { + final JavadocComment n2 = (JavadocComment) arg; + + if (!objEquals(n1.getContent(), n2.getContent())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final ClassOrInterfaceType n1, final Node arg) { + final ClassOrInterfaceType n2 = (ClassOrInterfaceType) arg; + + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { + return Boolean.FALSE; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final PrimitiveType n1, final Node arg) { + final PrimitiveType n2 = (PrimitiveType) arg; + + if (n1.getType() != n2.getType()) { + return Boolean.FALSE; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final ReferenceType n1, final Node arg) { + final ReferenceType n2 = (ReferenceType) arg; + + if (n1.getArrayCount() != n2.getArrayCount()) { + return Boolean.FALSE; + } + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + List> n1a = n1.getArraysAnnotations(); + List> n2a = n2.getArraysAnnotations(); + + if (n1a !=null && n2a!= null) { + if(n1a.size() != n2a.size()){ + return Boolean.FALSE; + } + else{ + int i = 0; + for(List aux: n1a){ + if(!nodesEquals(aux, n2a.get(i))){ + return Boolean.FALSE; + } + i++; + } + } + } + else if (n1a != n2a){ + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + public Boolean visit(VoidType n1, Node arg) { + VoidType n2 = (VoidType) arg; + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final WildcardType n1, final Node arg) { + final WildcardType n2 = (WildcardType) arg; + + if (!nodeEquals(n1.getExtends(), n2.getExtends())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getSuper(), n2.getSuper())) { + return Boolean.FALSE; + } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final UnknownType n1, final Node arg) { + final WildcardType n2 = (WildcardType) arg; + + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final ArrayAccessExpr n1, final Node arg) { + final ArrayAccessExpr n2 = (ArrayAccessExpr) arg; + + if (!nodeEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getIndex(), n2.getIndex())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final ArrayCreationExpr n1, final Node arg) { + final ArrayCreationExpr n2 = (ArrayCreationExpr) arg; + + if (n1.getArrayCount() != n2.getArrayCount()) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getInitializer(), n2.getInitializer())) { + return Boolean.FALSE; + } + + if (!nodesEquals(n1.getDimensions(), n2.getDimensions())) { + return Boolean.FALSE; + } + List> n1a = n1.getArraysAnnotations(); + List> n2a = n2.getArraysAnnotations(); + + if (n1a !=null && n2a!= null) { + if(n1a.size() != n2a.size()){ + return Boolean.FALSE; + } + else{ + int i = 0; + for(List aux: n1a){ + if(!nodesEquals(aux, n2a.get(i))){ + return Boolean.FALSE; + } + i++; + } + } + } + else if (n1a != n2a){ + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + @Override public Boolean visit(final ArrayInitializerExpr n1, final Node arg) { + final ArrayInitializerExpr n2 = (ArrayInitializerExpr) arg; + + if (!nodesEquals(n1.getValues(), n2.getValues())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final AssignExpr n1, final Node arg) { + final AssignExpr n2 = (AssignExpr) arg; + + if (n1.getOperator() != n2.getOperator()) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getTarget(), n2.getTarget())) { + return Boolean.FALSE; + } + + if (!nodeEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + @Override public Boolean visit(final BinaryExpr n1, final Node arg) { + final BinaryExpr n2 = (BinaryExpr) arg; - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (n1.getOperator() != n2.getOperator()) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getLeft(), n2.getLeft())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getDefaultValue(), n2.getDefaultValue())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getRight(), n2.getRight())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final CastExpr n1, final Node arg) { + final CastExpr n2 = (CastExpr) arg; - @Override - public Boolean visit(final FieldDeclaration n1, final Node arg) { - final FieldDeclaration n2 = (FieldDeclaration) arg; + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } - // javadoc are checked at CompilationUnit + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return Boolean.FALSE; + } - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final ClassExpr n1, final Node arg) { + final ClassExpr n2 = (ClassExpr) arg; - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getVariables(), n2.getVariables())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final ConditionalExpr n1, final Node arg) { + final ConditionalExpr n2 = (ConditionalExpr) arg; - @Override - public Boolean visit(final VariableDeclarator n1, final Node arg) { - final VariableDeclarator n2 = (VariableDeclarator) arg; + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getThenExpr(), n2.getThenExpr())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getInit(), n2.getInit())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getElseExpr(), n2.getElseExpr())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final VariableDeclaratorId n1, final Node arg) { - final VariableDeclaratorId n2 = (VariableDeclaratorId) arg; + @Override public Boolean visit(final EnclosedExpr n1, final Node arg) { + final EnclosedExpr n2 = (EnclosedExpr) arg; - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getInner(), n2.getInner())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final FieldAccessExpr n1, final Node arg) { + final FieldAccessExpr n2 = (FieldAccessExpr) arg; - @Override - public Boolean visit(final ConstructorDeclaration n1, final Node arg) { - final ConstructorDeclaration n2 = (ConstructorDeclaration) arg; + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return Boolean.FALSE; + } - // javadoc are checked at CompilationUnit + if (!objEquals(n1.getField(), n2.getField())) { + return Boolean.FALSE; + } - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final InstanceOfExpr n1, final Node arg) { + final InstanceOfExpr n2 = (InstanceOfExpr) arg; - if (!nodeEquals(n1.getBlock(), n2.getBlock())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getParameters(), n2.getParameters())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getThrows(), n2.getThrows())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final StringLiteralExpr n1, final Node arg) { + final StringLiteralExpr n2 = (StringLiteralExpr) arg; - return Boolean.TRUE; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final MethodDeclaration n1, final Node arg) { - final MethodDeclaration n2 = (MethodDeclaration) arg; + return Boolean.TRUE; + } - // javadoc are checked at CompilationUnit + @Override public Boolean visit(final IntegerLiteralExpr n1, final Node arg) { + final IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg; - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final LongLiteralExpr n1, final Node arg) { + final LongLiteralExpr n2 = (LongLiteralExpr) arg; - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final IntegerLiteralMinValueExpr n1, final Node arg) { + final IntegerLiteralMinValueExpr n2 = (IntegerLiteralMinValueExpr) arg; - if (!nodesEquals(n1.getParameters(), n2.getParameters())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getThrows(), n2.getThrows())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return Boolean.FALSE; - } - if (n1.isDefault() != n2.isDefault()) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + @Override public Boolean visit(final LongLiteralMinValueExpr n1, final Node arg) { + final LongLiteralMinValueExpr n2 = (LongLiteralMinValueExpr) arg; - @Override - public Boolean visit(final Parameter n1, final Node arg) { - final Parameter n2 = (Parameter) arg; - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - return visit((BaseParameter) n1, arg); - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(MultiTypeParameter n1, Node arg) { - MultiTypeParameter n2 = (MultiTypeParameter) arg; - if (n1.getTypes().size() != n2.getTypes().size()) { - return Boolean.FALSE; - } - Iterator n1types = n1.getTypes().iterator(); - Iterator n2types = n2.getTypes().iterator(); - while (n1types.hasNext() && n2types.hasNext()) { - if (!nodeEquals(n1types.next(), n2types.next())) { - return Boolean.FALSE; - } - } - return visit((BaseParameter) n1, arg); - } + return Boolean.TRUE; + } - protected Boolean visit(final BaseParameter n1, final Node arg) { - final BaseParameter n2 = (BaseParameter) arg; + @Override public Boolean visit(final CharLiteralExpr n1, final Node arg) { + final CharLiteralExpr n2 = (CharLiteralExpr) arg; - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final DoubleLiteralExpr n1, final Node arg) { + final DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg; - return Boolean.TRUE; - } + if (!objEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final EmptyMemberDeclaration n1, final Node arg) { - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final InitializerDeclaration n1, final Node arg) { - final InitializerDeclaration n2 = (InitializerDeclaration) arg; + @Override public Boolean visit(final BooleanLiteralExpr n1, final Node arg) { + final BooleanLiteralExpr n2 = (BooleanLiteralExpr) arg; - if (!nodeEquals(n1.getBlock(), n2.getBlock())) { - return Boolean.FALSE; - } + if (n1.getValue() != n2.getValue()) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final NullLiteralExpr n1, final Node arg) { + return Boolean.TRUE; + } - @Override - public Boolean visit(final JavadocComment n1, final Node arg) { - final JavadocComment n2 = (JavadocComment) arg; + @Override public Boolean visit(final MethodCallExpr n1, final Node arg) { + final MethodCallExpr n2 = (MethodCallExpr) arg; - if (!objEquals(n1.getContent(), n2.getContent())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final ClassOrInterfaceType n1, final Node arg) { - final ClassOrInterfaceType n2 = (ClassOrInterfaceType) arg; + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + @Override public Boolean visit(final NameExpr n1, final Node arg) { + final NameExpr n2 = (NameExpr) arg; - @Override - public Boolean visit(final PrimitiveType n1, final Node arg) { - final PrimitiveType n2 = (PrimitiveType) arg; + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - if (n1.getType() != n2.getType()) { - return Boolean.FALSE; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final ReferenceType n1, final Node arg) { - final ReferenceType n2 = (ReferenceType) arg; + @Override public Boolean visit(final ObjectCreationExpr n1, final Node arg) { + final ObjectCreationExpr n2 = (ObjectCreationExpr) arg; - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - List> n1a = n1.getArraysAnnotations(); - List> n2a = n2.getArraysAnnotations(); - - if (n1a != null && n2a != null) { - if (n1a.size() != n2a.size()) { - return Boolean.FALSE; - } else { - int i = 0; - for (List aux : n1a) { - if (!nodesEquals(aux, n2a.get(i))) { - return Boolean.FALSE; - } - i++; - } - } - } else if (n1a != n2a) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + if (!nodeEquals(n1.getScope(), n2.getScope())) { + return Boolean.FALSE; + } - public Boolean visit(VoidType n1, Node arg) { - VoidType n2 = (VoidType) arg; - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final WildcardType n1, final Node arg) { - final WildcardType n2 = (WildcardType) arg; + if (!nodesEquals(n1.getAnonymousClassBody(), n2.getAnonymousClassBody())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getExtends(), n2.getExtends())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getSuper(), n2.getSuper())) { - return Boolean.FALSE; - } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final UnknownType n1, final Node arg) { - final WildcardType n2 = (WildcardType) arg; + return Boolean.TRUE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + @Override public Boolean visit(final QualifiedNameExpr n1, final Node arg) { + final QualifiedNameExpr n2 = (QualifiedNameExpr) arg; - @Override - public Boolean visit(final ArrayAccessExpr n1, final Node arg) { - final ArrayAccessExpr n2 = (ArrayAccessExpr) arg; + if (!nodeEquals(n1.getQualifier(), n2.getQualifier())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getIndex(), n2.getIndex())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final ThisExpr n1, final Node arg) { + final ThisExpr n2 = (ThisExpr) arg; - @Override - public Boolean visit(final ArrayCreationExpr n1, final Node arg) { - final ArrayCreationExpr n2 = (ArrayCreationExpr) arg; + if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { + return Boolean.FALSE; + } - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final SuperExpr n1, final Node arg) { + final SuperExpr n2 = (SuperExpr) arg; - if (!nodeEquals(n1.getInitializer(), n2.getInitializer())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getDimensions(), n2.getDimensions())) { - return Boolean.FALSE; - } - List> n1a = n1.getArraysAnnotations(); - List> n2a = n2.getArraysAnnotations(); - - if (n1a != null && n2a != null) { - if (n1a.size() != n2a.size()) { - return Boolean.FALSE; - } else { - int i = 0; - for (List aux : n1a) { - if (!nodesEquals(aux, n2a.get(i))) { - return Boolean.FALSE; - } - i++; - } - } - } else if (n1a != n2a) { - return Boolean.FALSE; - } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final ArrayInitializerExpr n1, final Node arg) { - final ArrayInitializerExpr n2 = (ArrayInitializerExpr) arg; + @Override public Boolean visit(final UnaryExpr n1, final Node arg) { + final UnaryExpr n2 = (UnaryExpr) arg; - if (!nodesEquals(n1.getValues(), n2.getValues())) { - return Boolean.FALSE; - } + if (n1.getOperator() != n2.getOperator()) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final AssignExpr n1, final Node arg) { - final AssignExpr n2 = (AssignExpr) arg; + return Boolean.TRUE; + } - if (n1.getOperator() != n2.getOperator()) { - return Boolean.FALSE; - } + @Override public Boolean visit(final VariableDeclarationExpr n1, final Node arg) { + final VariableDeclarationExpr n2 = (VariableDeclarationExpr) arg; - if (!nodeEquals(n1.getTarget(), n2.getTarget())) { - return Boolean.FALSE; - } + if (n1.getModifiers() != n2.getModifiers()) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodeEquals(n1.getType(), n2.getType())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final BinaryExpr n1, final Node arg) { - final BinaryExpr n2 = (BinaryExpr) arg; + if (!nodesEquals(n1.getVars(), n2.getVars())) { + return Boolean.FALSE; + } - if (n1.getOperator() != n2.getOperator()) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodeEquals(n1.getLeft(), n2.getLeft())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final MarkerAnnotationExpr n1, final Node arg) { + final MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg; - if (!nodeEquals(n1.getRight(), n2.getRight())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final CastExpr n1, final Node arg) { - final CastExpr n2 = (CastExpr) arg; + @Override public Boolean visit(final SingleMemberAnnotationExpr n1, final Node arg) { + final SingleMemberAnnotationExpr n2 = (SingleMemberAnnotationExpr) arg; - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getMemberValue(), n2.getMemberValue())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final ClassExpr n1, final Node arg) { - final ClassExpr n2 = (ClassExpr) arg; + @Override public Boolean visit(final NormalAnnotationExpr n1, final Node arg) { + final NormalAnnotationExpr n2 = (NormalAnnotationExpr) arg; - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodesEquals(n1.getPairs(), n2.getPairs())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final ConditionalExpr n1, final Node arg) { - final ConditionalExpr n2 = (ConditionalExpr) arg; + return Boolean.TRUE; + } - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final MemberValuePair n1, final Node arg) { + final MemberValuePair n2 = (MemberValuePair) arg; - if (!nodeEquals(n1.getThenExpr(), n2.getThenExpr())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getName(), n2.getName())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getElseExpr(), n2.getElseExpr())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getValue(), n2.getValue())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final EnclosedExpr n1, final Node arg) { - final EnclosedExpr n2 = (EnclosedExpr) arg; + @Override public Boolean visit(final ExplicitConstructorInvocationStmt n1, final Node arg) { + final ExplicitConstructorInvocationStmt n2 = (ExplicitConstructorInvocationStmt) arg; - if (!nodeEquals(n1.getInner(), n2.getInner())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodesEquals(n1.getArgs(), n2.getArgs())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final FieldAccessExpr n1, final Node arg) { - final FieldAccessExpr n2 = (FieldAccessExpr) arg; + if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!objEquals(n1.getField(), n2.getField())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final TypeDeclarationStmt n1, final Node arg) { + final TypeDeclarationStmt n2 = (TypeDeclarationStmt) arg; - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getTypeDeclaration(), n2.getTypeDeclaration())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final InstanceOfExpr n1, final Node arg) { - final InstanceOfExpr n2 = (InstanceOfExpr) arg; + @Override public Boolean visit(final AssertStmt n1, final Node arg) { + final AssertStmt n2 = (AssertStmt) arg; - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getCheck(), n2.getCheck())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getMessage(), n2.getMessage())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final StringLiteralExpr n1, final Node arg) { - final StringLiteralExpr n2 = (StringLiteralExpr) arg; + @Override public Boolean visit(final BlockStmt n1, final Node arg) { + final BlockStmt n2 = (BlockStmt) arg; - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getStmts(), n2.getStmts())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final IntegerLiteralExpr n1, final Node arg) { - final IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg; + @Override public Boolean visit(final LabeledStmt n1, final Node arg) { + final LabeledStmt n2 = (LabeledStmt) arg; - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getStmt(), n2.getStmt())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final LongLiteralExpr n1, final Node arg) { - final LongLiteralExpr n2 = (LongLiteralExpr) arg; + @Override public Boolean visit(final EmptyStmt n1, final Node arg) { + return Boolean.TRUE; + } - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final ExpressionStmt n1, final Node arg) { + final ExpressionStmt n2 = (ExpressionStmt) arg; - return Boolean.TRUE; - } + if (!nodeEquals(n1.getExpression(), n2.getExpression())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final IntegerLiteralMinValueExpr n1, final Node arg) { - final IntegerLiteralMinValueExpr n2 = (IntegerLiteralMinValueExpr) arg; + return Boolean.TRUE; + } - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final SwitchStmt n1, final Node arg) { + final SwitchStmt n2 = (SwitchStmt) arg; - return Boolean.TRUE; - } + if (!nodeEquals(n1.getSelector(), n2.getSelector())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final LongLiteralMinValueExpr n1, final Node arg) { - final LongLiteralMinValueExpr n2 = (LongLiteralMinValueExpr) arg; + if (!nodesEquals(n1.getEntries(), n2.getEntries())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final SwitchEntryStmt n1, final Node arg) { + final SwitchEntryStmt n2 = (SwitchEntryStmt) arg; - @Override - public Boolean visit(final CharLiteralExpr n1, final Node arg) { - final CharLiteralExpr n2 = (CharLiteralExpr) arg; + if (!nodeEquals(n1.getLabel(), n2.getLabel())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getStmts(), n2.getStmts())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final DoubleLiteralExpr n1, final Node arg) { - final DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg; + @Override public Boolean visit(final BreakStmt n1, final Node arg) { + final BreakStmt n2 = (BreakStmt) arg; - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } + if (!objEquals(n1.getId(), n2.getId())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final BooleanLiteralExpr n1, final Node arg) { - final BooleanLiteralExpr n2 = (BooleanLiteralExpr) arg; + @Override public Boolean visit(final ReturnStmt n1, final Node arg) { + final ReturnStmt n2 = (ReturnStmt) arg; - if (n1.getValue() != n2.getValue()) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final NullLiteralExpr n1, final Node arg) { - return Boolean.TRUE; - } + @Override public Boolean visit(final IfStmt n1, final Node arg) { + final IfStmt n2 = (IfStmt) arg; - @Override - public Boolean visit(final MethodCallExpr n1, final Node arg) { - final MethodCallExpr n2 = (MethodCallExpr) arg; + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getThenStmt(), n2.getThenStmt())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getElseStmt(), n2.getElseStmt())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final WhileStmt n1, final Node arg) { + final WhileStmt n2 = (WhileStmt) arg; - return Boolean.TRUE; - } + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final NameExpr n1, final Node arg) { - final NameExpr n2 = (NameExpr) arg; + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final ContinueStmt n1, final Node arg) { + final ContinueStmt n2 = (ContinueStmt) arg; - @Override - public Boolean visit(final ObjectCreationExpr n1, final Node arg) { - final ObjectCreationExpr n2 = (ObjectCreationExpr) arg; + if (!objEquals(n1.getId(), n2.getId())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final DoStmt n1, final Node arg) { + final DoStmt n2 = (DoStmt) arg; - if (!nodesEquals(n1.getAnonymousClassBody(), n2.getAnonymousClassBody())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getCondition(), n2.getCondition())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final ForeachStmt n1, final Node arg) { + final ForeachStmt n2 = (ForeachStmt) arg; - @Override - public Boolean visit(final QualifiedNameExpr n1, final Node arg) { - final QualifiedNameExpr n2 = (QualifiedNameExpr) arg; + if (!nodeEquals(n1.getVariable(), n2.getVariable())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getQualifier(), n2.getQualifier())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getIterable(), n2.getIterable())) { + return Boolean.FALSE; + } - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final ThisExpr n1, final Node arg) { - final ThisExpr n2 = (ThisExpr) arg; + @Override public Boolean visit(final ForStmt n1, final Node arg) { + final ForStmt n2 = (ForStmt) arg; - if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { - return Boolean.FALSE; - } + if (!nodesEquals(n1.getInit(), n2.getInit())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + if (!nodeEquals(n1.getCompare(), n2.getCompare())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final SuperExpr n1, final Node arg) { - final SuperExpr n2 = (SuperExpr) arg; + if (!nodesEquals(n1.getUpdate(), n2.getUpdate())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getBody(), n2.getBody())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final UnaryExpr n1, final Node arg) { - final UnaryExpr n2 = (UnaryExpr) arg; + @Override public Boolean visit(final ThrowStmt n1, final Node arg) { + final ThrowStmt n2 = (ThrowStmt) arg; - if (n1.getOperator() != n2.getOperator()) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - return Boolean.TRUE; - } + @Override public Boolean visit(final SynchronizedStmt n1, final Node arg) { + final SynchronizedStmt n2 = (SynchronizedStmt) arg; - @Override - public Boolean visit(final VariableDeclarationExpr n1, final Node arg) { - final VariableDeclarationExpr n2 = (VariableDeclarationExpr) arg; + if (!nodeEquals(n1.getExpr(), n2.getExpr())) { + return Boolean.FALSE; + } - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getBlock(), n2.getBlock())) { + return Boolean.FALSE; + } - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } + return Boolean.TRUE; + } - if (!nodesEquals(n1.getVars(), n2.getVars())) { - return Boolean.FALSE; - } + @Override public Boolean visit(final TryStmt n1, final Node arg) { + final TryStmt n2 = (TryStmt) arg; - return Boolean.TRUE; - } + if (!nodeEquals(n1.getTryBlock(), n2.getTryBlock())) { + return Boolean.FALSE; + } - @Override - public Boolean visit(final MarkerAnnotationExpr n1, final Node arg) { - final MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg; + if (!nodesEquals(n1.getCatchs(), n2.getCatchs())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getFinallyBlock(), n2.getFinallyBlock())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } + return Boolean.TRUE; + } - @Override - public Boolean visit(final SingleMemberAnnotationExpr n1, final Node arg) { - final SingleMemberAnnotationExpr n2 = (SingleMemberAnnotationExpr) arg; + @Override public Boolean visit(final CatchClause n1, final Node arg) { + final CatchClause n2 = (CatchClause) arg; - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getExcept(), n2.getExcept())) { + return Boolean.FALSE; + } - if (!nodeEquals(n1.getMemberValue(), n2.getMemberValue())) { - return Boolean.FALSE; - } + if (!nodeEquals(n1.getCatchBlock(), n2.getCatchBlock())) { + return Boolean.FALSE; + } - return Boolean.TRUE; - } - - @Override - public Boolean visit(final NormalAnnotationExpr n1, final Node arg) { - final NormalAnnotationExpr n2 = (NormalAnnotationExpr) arg; - - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getPairs(), n2.getPairs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final MemberValuePair n1, final Node arg) { - final MemberValuePair n2 = (MemberValuePair) arg; - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final ExplicitConstructorInvocationStmt n1, final Node arg) { - final ExplicitConstructorInvocationStmt n2 = (ExplicitConstructorInvocationStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final TypeDeclarationStmt n1, final Node arg) { - final TypeDeclarationStmt n2 = (TypeDeclarationStmt) arg; - - if (!nodeEquals(n1.getTypeDeclaration(), n2.getTypeDeclaration())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final AssertStmt n1, final Node arg) { - final AssertStmt n2 = (AssertStmt) arg; - - if (!nodeEquals(n1.getCheck(), n2.getCheck())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getMessage(), n2.getMessage())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final BlockStmt n1, final Node arg) { - final BlockStmt n2 = (BlockStmt) arg; - - if (!nodesEquals(n1.getStmts(), n2.getStmts())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final LabeledStmt n1, final Node arg) { - final LabeledStmt n2 = (LabeledStmt) arg; - - if (!nodeEquals(n1.getStmt(), n2.getStmt())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final EmptyStmt n1, final Node arg) { - return Boolean.TRUE; - } - - @Override - public Boolean visit(final ExpressionStmt n1, final Node arg) { - final ExpressionStmt n2 = (ExpressionStmt) arg; - - if (!nodeEquals(n1.getExpression(), n2.getExpression())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final SwitchStmt n1, final Node arg) { - final SwitchStmt n2 = (SwitchStmt) arg; - - if (!nodeEquals(n1.getSelector(), n2.getSelector())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getEntries(), n2.getEntries())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final SwitchEntryStmt n1, final Node arg) { - final SwitchEntryStmt n2 = (SwitchEntryStmt) arg; - - if (!nodeEquals(n1.getLabel(), n2.getLabel())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getStmts(), n2.getStmts())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final BreakStmt n1, final Node arg) { - final BreakStmt n2 = (BreakStmt) arg; - - if (!objEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final ReturnStmt n1, final Node arg) { - final ReturnStmt n2 = (ReturnStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final IfStmt n1, final Node arg) { - final IfStmt n2 = (IfStmt) arg; - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getThenStmt(), n2.getThenStmt())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getElseStmt(), n2.getElseStmt())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final WhileStmt n1, final Node arg) { - final WhileStmt n2 = (WhileStmt) arg; - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final ContinueStmt n1, final Node arg) { - final ContinueStmt n2 = (ContinueStmt) arg; - - if (!objEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final DoStmt n1, final Node arg) { - final DoStmt n2 = (DoStmt) arg; - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final ForeachStmt n1, final Node arg) { - final ForeachStmt n2 = (ForeachStmt) arg; - - if (!nodeEquals(n1.getVariable(), n2.getVariable())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getIterable(), n2.getIterable())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final ForStmt n1, final Node arg) { - final ForStmt n2 = (ForStmt) arg; - - if (!nodesEquals(n1.getInit(), n2.getInit())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getCompare(), n2.getCompare())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getUpdate(), n2.getUpdate())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final ThrowStmt n1, final Node arg) { - final ThrowStmt n2 = (ThrowStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final SynchronizedStmt n1, final Node arg) { - final SynchronizedStmt n2 = (SynchronizedStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBlock(), n2.getBlock())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final TryStmt n1, final Node arg) { - final TryStmt n2 = (TryStmt) arg; - - if (!nodeEquals(n1.getTryBlock(), n2.getTryBlock())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getCatchs(), n2.getCatchs())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getFinallyBlock(), n2.getFinallyBlock())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(final CatchClause n1, final Node arg) { - final CatchClause n2 = (CatchClause) arg; - - if (!nodeEquals(n1.getExcept(), n2.getExcept())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getCatchBlock(), n2.getCatchBlock())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } + return Boolean.TRUE; + } @Override public Boolean visit(LambdaExpr n1, Node arg) { @@ -1509,7 +1433,7 @@ public Boolean visit(LambdaExpr n1, Node arg) { if (!nodesEquals(n1.getParameters(), n2.getParameters())) { return Boolean.FALSE; } - if (n1.isParametersEnclosed() != n2.isParametersEnclosed()) { + if(n1.isParametersEnclosed() != n2.isParametersEnclosed()){ return Boolean.FALSE; } if (!nodeEquals(n1.getBody(), n2.getBody())) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitor.java index 968d082e92..58fbf6db9f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.comments.BlockComment; @@ -69,182 +69,182 @@ /** * A visitor that has a return value. - * + * * @author Julio Vilmar Gesser */ public interface GenericVisitor { - //- Compilation Unit ---------------------------------- - - public R visit(CompilationUnit n, A arg); + //- Compilation Unit ---------------------------------- - public R visit(PackageDeclaration n, A arg); + public R visit(CompilationUnit n, A arg); - public R visit(ImportDeclaration n, A arg); + public R visit(PackageDeclaration n, A arg); - public R visit(TypeParameter n, A arg); + public R visit(ImportDeclaration n, A arg); - public R visit(LineComment n, A arg); + public R visit(TypeParameter n, A arg); - public R visit(BlockComment n, A arg); + public R visit(LineComment n, A arg); - //- Body ---------------------------------------------- + public R visit(BlockComment n, A arg); - public R visit(ClassOrInterfaceDeclaration n, A arg); + //- Body ---------------------------------------------- - public R visit(EnumDeclaration n, A arg); + public R visit(ClassOrInterfaceDeclaration n, A arg); - public R visit(EmptyTypeDeclaration n, A arg); + public R visit(EnumDeclaration n, A arg); - public R visit(EnumConstantDeclaration n, A arg); + public R visit(EmptyTypeDeclaration n, A arg); - public R visit(AnnotationDeclaration n, A arg); + public R visit(EnumConstantDeclaration n, A arg); - public R visit(AnnotationMemberDeclaration n, A arg); + public R visit(AnnotationDeclaration n, A arg); - public R visit(FieldDeclaration n, A arg); + public R visit(AnnotationMemberDeclaration n, A arg); - public R visit(VariableDeclarator n, A arg); + public R visit(FieldDeclaration n, A arg); - public R visit(VariableDeclaratorId n, A arg); + public R visit(VariableDeclarator n, A arg); - public R visit(ConstructorDeclaration n, A arg); + public R visit(VariableDeclaratorId n, A arg); - public R visit(MethodDeclaration n, A arg); + public R visit(ConstructorDeclaration n, A arg); - public R visit(Parameter n, A arg); + public R visit(MethodDeclaration n, A arg); - public R visit(MultiTypeParameter n, A arg); + public R visit(Parameter n, A arg); + + public R visit(MultiTypeParameter n, A arg); - public R visit(EmptyMemberDeclaration n, A arg); + public R visit(EmptyMemberDeclaration n, A arg); - public R visit(InitializerDeclaration n, A arg); + public R visit(InitializerDeclaration n, A arg); - public R visit(JavadocComment n, A arg); + public R visit(JavadocComment n, A arg); - //- Type ---------------------------------------------- + //- Type ---------------------------------------------- - public R visit(ClassOrInterfaceType n, A arg); + public R visit(ClassOrInterfaceType n, A arg); - public R visit(PrimitiveType n, A arg); + public R visit(PrimitiveType n, A arg); - public R visit(ReferenceType n, A arg); + public R visit(ReferenceType n, A arg); - public R visit(VoidType n, A arg); + public R visit(VoidType n, A arg); - public R visit(WildcardType n, A arg); + public R visit(WildcardType n, A arg); - public R visit(UnknownType n, A arg); + public R visit(UnknownType n, A arg); - //- Expression ---------------------------------------- + //- Expression ---------------------------------------- - public R visit(ArrayAccessExpr n, A arg); + public R visit(ArrayAccessExpr n, A arg); - public R visit(ArrayCreationExpr n, A arg); + public R visit(ArrayCreationExpr n, A arg); - public R visit(ArrayInitializerExpr n, A arg); + public R visit(ArrayInitializerExpr n, A arg); - public R visit(AssignExpr n, A arg); + public R visit(AssignExpr n, A arg); - public R visit(BinaryExpr n, A arg); + public R visit(BinaryExpr n, A arg); - public R visit(CastExpr n, A arg); + public R visit(CastExpr n, A arg); - public R visit(ClassExpr n, A arg); + public R visit(ClassExpr n, A arg); - public R visit(ConditionalExpr n, A arg); + public R visit(ConditionalExpr n, A arg); - public R visit(EnclosedExpr n, A arg); + public R visit(EnclosedExpr n, A arg); - public R visit(FieldAccessExpr n, A arg); + public R visit(FieldAccessExpr n, A arg); - public R visit(InstanceOfExpr n, A arg); + public R visit(InstanceOfExpr n, A arg); - public R visit(StringLiteralExpr n, A arg); + public R visit(StringLiteralExpr n, A arg); - public R visit(IntegerLiteralExpr n, A arg); + public R visit(IntegerLiteralExpr n, A arg); - public R visit(LongLiteralExpr n, A arg); + public R visit(LongLiteralExpr n, A arg); - public R visit(IntegerLiteralMinValueExpr n, A arg); + public R visit(IntegerLiteralMinValueExpr n, A arg); - public R visit(LongLiteralMinValueExpr n, A arg); + public R visit(LongLiteralMinValueExpr n, A arg); - public R visit(CharLiteralExpr n, A arg); + public R visit(CharLiteralExpr n, A arg); - public R visit(DoubleLiteralExpr n, A arg); + public R visit(DoubleLiteralExpr n, A arg); - public R visit(BooleanLiteralExpr n, A arg); + public R visit(BooleanLiteralExpr n, A arg); - public R visit(NullLiteralExpr n, A arg); + public R visit(NullLiteralExpr n, A arg); - public R visit(MethodCallExpr n, A arg); + public R visit(MethodCallExpr n, A arg); - public R visit(NameExpr n, A arg); + public R visit(NameExpr n, A arg); - public R visit(ObjectCreationExpr n, A arg); + public R visit(ObjectCreationExpr n, A arg); - public R visit(QualifiedNameExpr n, A arg); + public R visit(QualifiedNameExpr n, A arg); - public R visit(ThisExpr n, A arg); + public R visit(ThisExpr n, A arg); - public R visit(SuperExpr n, A arg); + public R visit(SuperExpr n, A arg); - public R visit(UnaryExpr n, A arg); + public R visit(UnaryExpr n, A arg); - public R visit(VariableDeclarationExpr n, A arg); + public R visit(VariableDeclarationExpr n, A arg); - public R visit(MarkerAnnotationExpr n, A arg); + public R visit(MarkerAnnotationExpr n, A arg); - public R visit(SingleMemberAnnotationExpr n, A arg); + public R visit(SingleMemberAnnotationExpr n, A arg); - public R visit(NormalAnnotationExpr n, A arg); + public R visit(NormalAnnotationExpr n, A arg); - public R visit(MemberValuePair n, A arg); + public R visit(MemberValuePair n, A arg); - //- Statements ---------------------------------------- + //- Statements ---------------------------------------- - public R visit(ExplicitConstructorInvocationStmt n, A arg); + public R visit(ExplicitConstructorInvocationStmt n, A arg); - public R visit(TypeDeclarationStmt n, A arg); + public R visit(TypeDeclarationStmt n, A arg); - public R visit(AssertStmt n, A arg); + public R visit(AssertStmt n, A arg); - public R visit(BlockStmt n, A arg); + public R visit(BlockStmt n, A arg); - public R visit(LabeledStmt n, A arg); + public R visit(LabeledStmt n, A arg); - public R visit(EmptyStmt n, A arg); + public R visit(EmptyStmt n, A arg); - public R visit(ExpressionStmt n, A arg); + public R visit(ExpressionStmt n, A arg); - public R visit(SwitchStmt n, A arg); + public R visit(SwitchStmt n, A arg); - public R visit(SwitchEntryStmt n, A arg); + public R visit(SwitchEntryStmt n, A arg); - public R visit(BreakStmt n, A arg); + public R visit(BreakStmt n, A arg); - public R visit(ReturnStmt n, A arg); + public R visit(ReturnStmt n, A arg); - public R visit(IfStmt n, A arg); + public R visit(IfStmt n, A arg); - public R visit(WhileStmt n, A arg); + public R visit(WhileStmt n, A arg); - public R visit(ContinueStmt n, A arg); + public R visit(ContinueStmt n, A arg); - public R visit(DoStmt n, A arg); + public R visit(DoStmt n, A arg); - public R visit(ForeachStmt n, A arg); + public R visit(ForeachStmt n, A arg); - public R visit(ForStmt n, A arg); + public R visit(ForStmt n, A arg); - public R visit(ThrowStmt n, A arg); + public R visit(ThrowStmt n, A arg); - public R visit(SynchronizedStmt n, A arg); + public R visit(SynchronizedStmt n, A arg); - public R visit(TryStmt n, A arg); + public R visit(TryStmt n, A arg); - public R visit(CatchClause n, A arg); + public R visit(CatchClause n, A arg); public R visit(LambdaExpr n, A arg); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java index d7700c9592..eac9cab405 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.comments.BlockComment; @@ -75,1515 +75,1515 @@ */ public abstract class GenericVisitorAdapter implements GenericVisitor { - @Override - public R visit(final AnnotationDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final AnnotationMemberDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getDefaultValue() != null) { - { - R result = n.getDefaultValue().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ArrayAccessExpr n, final A arg) { - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getIndex().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ArrayCreationExpr n, final A arg) { - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getDimensions() != null) { - for (final Expression dim : n.getDimensions()) { - { - R result = dim.accept(this, arg); - if (result != null) { - return result; - } - } - } - } else { - { - R result = n.getInitializer().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ArrayInitializerExpr n, final A arg) { - if (n.getValues() != null) { - for (final Expression expr : n.getValues()) { - { - R result = expr.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final AssertStmt n, final A arg) { - { - R result = n.getCheck().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getMessage() != null) { - { - R result = n.getMessage().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final AssignExpr n, final A arg) { - { - R result = n.getTarget().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getValue().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final BinaryExpr n, final A arg) { - { - R result = n.getLeft().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getRight().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final BlockStmt n, final A arg) { - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - { - R result = s.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - - } - - @Override - public R visit(final BooleanLiteralExpr n, final A arg) { - return null; - } - - @Override - public R visit(final BreakStmt n, final A arg) { - return null; - } - - @Override - public R visit(final CastExpr n, final A arg) { - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final CatchClause n, final A arg) { - { - R result = n.getExcept().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getCatchBlock().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - - } - - @Override - public R visit(final CharLiteralExpr n, final A arg) { - return null; - } - - @Override - public R visit(final ClassExpr n, final A arg) { - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ClassOrInterfaceDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getExtends() != null) { - for (final ClassOrInterfaceType c : n.getExtends()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - - if (n.getImplements() != null) { - for (final ClassOrInterfaceType c : n.getImplements()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final ClassOrInterfaceType n, final A arg) { - if (n.getScope() != null) { - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final CompilationUnit n, final A arg) { - if (n.getPackage() != null) { - { - R result = n.getPackage().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getImports() != null) { - for (final ImportDeclaration i : n.getImports()) { - { - R result = i.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypes() != null) { - for (final TypeDeclaration typeDeclaration : n.getTypes()) { - { - R result = typeDeclaration.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final ConditionalExpr n, final A arg) { - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getThenExpr().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getElseExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ConstructorDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - { - R result = p.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getThrows() != null) { - for (final NameExpr name : n.getThrows()) { - { - R result = name.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getBlock().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ContinueStmt n, final A arg) { - return null; - } - - @Override - public R visit(final DoStmt n, final A arg) { - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final DoubleLiteralExpr n, final A arg) { - return null; - } - - @Override - public R visit(final EmptyMemberDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final EmptyStmt n, final A arg) { - return null; - } - - @Override - public R visit(final EmptyTypeDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final EnclosedExpr n, final A arg) { - { - R result = n.getInner().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final EnumConstantDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getClassBody() != null) { - for (final BodyDeclaration member : n.getClassBody()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final EnumDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getImplements() != null) { - for (final ClassOrInterfaceType c : n.getImplements()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getEntries() != null) { - for (final EnumConstantDeclaration e : n.getEntries()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { - if (!n.isThis()) { - if (n.getExpr() != null) { - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final ExpressionStmt n, final A arg) { - { - R result = n.getExpression().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final FieldAccessExpr n, final A arg) { - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final FieldDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - for (final VariableDeclarator var : n.getVariables()) { - { - R result = var.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ForeachStmt n, final A arg) { - { - R result = n.getVariable().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getIterable().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ForStmt n, final A arg) { - if (n.getInit() != null) { - for (final Expression e : n.getInit()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getCompare() != null) { - { - R result = n.getCompare().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getUpdate() != null) { - for (final Expression e : n.getUpdate()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final IfStmt n, final A arg) { - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getThenStmt().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getElseStmt() != null) { - { - R result = n.getElseStmt().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ImportDeclaration n, final A arg) { - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final InitializerDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - { - R result = n.getBlock().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final InstanceOfExpr n, final A arg) { - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final IntegerLiteralExpr n, final A arg) { - return null; - } - - @Override - public R visit(final IntegerLiteralMinValueExpr n, final A arg) { - return null; - } - - @Override - public R visit(final JavadocComment n, final A arg) { - return null; - } - - @Override - public R visit(final LabeledStmt n, final A arg) { - { - R result = n.getStmt().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final LongLiteralExpr n, final A arg) { - return null; - } - - @Override - public R visit(final LongLiteralMinValueExpr n, final A arg) { - return null; - } - - @Override - public R visit(final MarkerAnnotationExpr n, final A arg) { - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final MemberValuePair n, final A arg) { - { - R result = n.getValue().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final MethodCallExpr n, final A arg) { - if (n.getScope() != null) { - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final MethodDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - { - R result = n.getJavaDoc().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - { - R result = p.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getThrows() != null) { - for (final NameExpr name : n.getThrows()) { - { - R result = name.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getBody() != null) { - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final NameExpr n, final A arg) { - return null; - } - - @Override - public R visit(final NormalAnnotationExpr n, final A arg) { - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getPairs() != null) { - for (final MemberValuePair m : n.getPairs()) { - { - R result = m.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final NullLiteralExpr n, final A arg) { - return null; - } - - @Override - public R visit(final ObjectCreationExpr n, final A arg) { - if (n.getScope() != null) { - { - R result = n.getScope().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - { - R result = t.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getAnonymousClassBody() != null) { - for (final BodyDeclaration member : n.getAnonymousClassBody()) { - { - R result = member.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final PackageDeclaration n, final A arg) { - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final Parameter n, final A arg) { - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getId().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final MultiTypeParameter n, final A arg) { - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - for (final Type type : n.getTypes()) { - R result = type.accept(this, arg); - if (result != null) { - return result; - } - } - } - { - R result = n.getId().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final PrimitiveType n, final A arg) { - return null; - } - - @Override - public R visit(final QualifiedNameExpr n, final A arg) { - { - R result = n.getQualifier().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ReferenceType n, final A arg) { - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ReturnStmt n, final A arg) { - if (n.getExpr() != null) { - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final SingleMemberAnnotationExpr n, final A arg) { - { - R result = n.getName().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getMemberValue().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final StringLiteralExpr n, final A arg) { - return null; - } - - @Override - public R visit(final SuperExpr n, final A arg) { - if (n.getClassExpr() != null) { - { - R result = n.getClassExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final SwitchEntryStmt n, final A arg) { - if (n.getLabel() != null) { - { - R result = n.getLabel().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - { - R result = s.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final SwitchStmt n, final A arg) { - { - R result = n.getSelector().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getEntries() != null) { - for (final SwitchEntryStmt e : n.getEntries()) { - { - R result = e.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - - } - - @Override - public R visit(final SynchronizedStmt n, final A arg) { - { - if (n.getExpr() != null) { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - { - R result = n.getBlock().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final ThisExpr n, final A arg) { - if (n.getClassExpr() != null) { - { - R result = n.getClassExpr().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final ThrowStmt n, final A arg) { - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final TryStmt n, final A arg) { - if (n.getResources() != null) { - for (final VariableDeclarationExpr v : n.getResources()) { - { - R result = v.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getTryBlock().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getCatchs() != null) { - for (final CatchClause c : n.getCatchs()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - if (n.getFinallyBlock() != null) { - { - R result = n.getFinallyBlock().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final TypeDeclarationStmt n, final A arg) { - { - R result = n.getTypeDeclaration().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final TypeParameter n, final A arg) { - if (n.getTypeBound() != null) { - for (final ClassOrInterfaceType c : n.getTypeBound()) { - { - R result = c.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - return null; - } - - @Override - public R visit(final UnaryExpr n, final A arg) { - { - R result = n.getExpr().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final UnknownType n, final A arg) { - return null; - } - - @Override - public R visit(final VariableDeclarationExpr n, final A arg) { - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - { - R result = a.accept(this, arg); - if (result != null) { - return result; - } - } - } - } - { - R result = n.getType().accept(this, arg); - if (result != null) { - return result; - } - } - for (final VariableDeclarator v : n.getVars()) { - { - R result = v.accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final VariableDeclarator n, final A arg) { - { - R result = n.getId().accept(this, arg); - if (result != null) { - return result; - } - } - if (n.getInit() != null) { - { - R result = n.getInit().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } - - @Override - public R visit(final VariableDeclaratorId n, final A arg) { - return null; - } - - @Override - public R visit(final VoidType n, final A arg) { - return null; - } - - @Override - public R visit(final WhileStmt n, final A arg) { - { - R result = n.getCondition().accept(this, arg); - if (result != null) { - return result; - } - } - { - R result = n.getBody().accept(this, arg); - if (result != null) { - return result; - } - } - return null; - } - - @Override - public R visit(final WildcardType n, final A arg) { - if (n.getExtends() != null) { - { - R result = n.getExtends().accept(this, arg); - if (result != null) { - return result; - } - } - } - if (n.getSuper() != null) { - { - R result = n.getSuper().accept(this, arg); - if (result != null) { - return result; - } - } - } - return null; - } + @Override + public R visit(final AnnotationDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final AnnotationMemberDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getDefaultValue() != null) { + { + R result = n.getDefaultValue().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ArrayAccessExpr n, final A arg) { + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getIndex().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ArrayCreationExpr n, final A arg) { + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getDimensions() != null) { + for (final Expression dim : n.getDimensions()) { + { + R result = dim.accept(this, arg); + if (result != null) { + return result; + } + } + } + } else { + { + R result = n.getInitializer().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ArrayInitializerExpr n, final A arg) { + if (n.getValues() != null) { + for (final Expression expr : n.getValues()) { + { + R result = expr.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final AssertStmt n, final A arg) { + { + R result = n.getCheck().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getMessage() != null) { + { + R result = n.getMessage().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final AssignExpr n, final A arg) { + { + R result = n.getTarget().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getValue().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final BinaryExpr n, final A arg) { + { + R result = n.getLeft().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getRight().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final BlockStmt n, final A arg) { + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + { + R result = s.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + + } + + @Override + public R visit(final BooleanLiteralExpr n, final A arg) { + return null; + } + + @Override + public R visit(final BreakStmt n, final A arg) { + return null; + } + + @Override + public R visit(final CastExpr n, final A arg) { + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final CatchClause n, final A arg) { + { + R result = n.getExcept().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getCatchBlock().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + + } + + @Override + public R visit(final CharLiteralExpr n, final A arg) { + return null; + } + + @Override + public R visit(final ClassExpr n, final A arg) { + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ClassOrInterfaceDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getExtends() != null) { + for (final ClassOrInterfaceType c : n.getExtends()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + + if (n.getImplements() != null) { + for (final ClassOrInterfaceType c : n.getImplements()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ClassOrInterfaceType n, final A arg) { + if (n.getScope() != null) { + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final CompilationUnit n, final A arg) { + if (n.getPackage() != null) { + { + R result = n.getPackage().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getImports() != null) { + for (final ImportDeclaration i : n.getImports()) { + { + R result = i.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypes() != null) { + for (final TypeDeclaration typeDeclaration : n.getTypes()) { + { + R result = typeDeclaration.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ConditionalExpr n, final A arg) { + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getThenExpr().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getElseExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ConstructorDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + { + R result = p.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getThrows() != null) { + for (final NameExpr name : n.getThrows()) { + { + R result = name.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getBlock().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ContinueStmt n, final A arg) { + return null; + } + + @Override + public R visit(final DoStmt n, final A arg) { + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final DoubleLiteralExpr n, final A arg) { + return null; + } + + @Override + public R visit(final EmptyMemberDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final EmptyStmt n, final A arg) { + return null; + } + + @Override + public R visit(final EmptyTypeDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final EnclosedExpr n, final A arg) { + { + R result = n.getInner().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final EnumConstantDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getClassBody() != null) { + for (final BodyDeclaration member : n.getClassBody()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final EnumDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getImplements() != null) { + for (final ClassOrInterfaceType c : n.getImplements()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getEntries() != null) { + for (final EnumConstantDeclaration e : n.getEntries()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { + if (!n.isThis()) { + if (n.getExpr() != null) { + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final ExpressionStmt n, final A arg) { + { + R result = n.getExpression().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final FieldAccessExpr n, final A arg) { + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final FieldDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + for (final VariableDeclarator var : n.getVariables()) { + { + R result = var.accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ForeachStmt n, final A arg) { + { + R result = n.getVariable().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getIterable().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ForStmt n, final A arg) { + if (n.getInit() != null) { + for (final Expression e : n.getInit()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getCompare() != null) { + { + R result = n.getCompare().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getUpdate() != null) { + for (final Expression e : n.getUpdate()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final IfStmt n, final A arg) { + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getThenStmt().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getElseStmt() != null) { + { + R result = n.getElseStmt().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ImportDeclaration n, final A arg) { + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final InitializerDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + { + R result = n.getBlock().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final InstanceOfExpr n, final A arg) { + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final IntegerLiteralExpr n, final A arg) { + return null; + } + + @Override + public R visit(final IntegerLiteralMinValueExpr n, final A arg) { + return null; + } + + @Override + public R visit(final JavadocComment n, final A arg) { + return null; + } + + @Override + public R visit(final LabeledStmt n, final A arg) { + { + R result = n.getStmt().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final LongLiteralExpr n, final A arg) { + return null; + } + + @Override + public R visit(final LongLiteralMinValueExpr n, final A arg) { + return null; + } + + @Override + public R visit(final MarkerAnnotationExpr n, final A arg) { + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final MemberValuePair n, final A arg) { + { + R result = n.getValue().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final MethodCallExpr n, final A arg) { + if (n.getScope() != null) { + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final MethodDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + { + R result = n.getJavaDoc().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + { + R result = p.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getThrows() != null) { + for (final NameExpr name : n.getThrows()) { + { + R result = name.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getBody() != null) { + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final NameExpr n, final A arg) { + return null; + } + + @Override + public R visit(final NormalAnnotationExpr n, final A arg) { + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getPairs() != null) { + for (final MemberValuePair m : n.getPairs()) { + { + R result = m.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final NullLiteralExpr n, final A arg) { + return null; + } + + @Override + public R visit(final ObjectCreationExpr n, final A arg) { + if (n.getScope() != null) { + { + R result = n.getScope().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + { + R result = t.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getAnonymousClassBody() != null) { + for (final BodyDeclaration member : n.getAnonymousClassBody()) { + { + R result = member.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final PackageDeclaration n, final A arg) { + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final Parameter n, final A arg) { + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getId().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final MultiTypeParameter n, final A arg) { + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + for (final Type type : n.getTypes()) { + R result = type.accept(this, arg); + if (result != null) { + return result; + } + } + } + { + R result = n.getId().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final PrimitiveType n, final A arg) { + return null; + } + + @Override + public R visit(final QualifiedNameExpr n, final A arg) { + { + R result = n.getQualifier().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ReferenceType n, final A arg) { + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ReturnStmt n, final A arg) { + if (n.getExpr() != null) { + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final SingleMemberAnnotationExpr n, final A arg) { + { + R result = n.getName().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getMemberValue().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final StringLiteralExpr n, final A arg) { + return null; + } + + @Override + public R visit(final SuperExpr n, final A arg) { + if (n.getClassExpr() != null) { + { + R result = n.getClassExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final SwitchEntryStmt n, final A arg) { + if (n.getLabel() != null) { + { + R result = n.getLabel().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + { + R result = s.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final SwitchStmt n, final A arg) { + { + R result = n.getSelector().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getEntries() != null) { + for (final SwitchEntryStmt e : n.getEntries()) { + { + R result = e.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + + } + + @Override + public R visit(final SynchronizedStmt n, final A arg) { + { + if (n.getExpr() != null) { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + { + R result = n.getBlock().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final ThisExpr n, final A arg) { + if (n.getClassExpr() != null) { + { + R result = n.getClassExpr().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final ThrowStmt n, final A arg) { + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final TryStmt n, final A arg) { + if (n.getResources() != null) { + for (final VariableDeclarationExpr v : n.getResources()) { + { + R result = v.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getTryBlock().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getCatchs() != null) { + for (final CatchClause c : n.getCatchs()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + if (n.getFinallyBlock() != null) { + { + R result = n.getFinallyBlock().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final TypeDeclarationStmt n, final A arg) { + { + R result = n.getTypeDeclaration().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final TypeParameter n, final A arg) { + if (n.getTypeBound() != null) { + for (final ClassOrInterfaceType c : n.getTypeBound()) { + { + R result = c.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + return null; + } + + @Override + public R visit(final UnaryExpr n, final A arg) { + { + R result = n.getExpr().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final UnknownType n, final A arg) { + return null; + } + + @Override + public R visit(final VariableDeclarationExpr n, final A arg) { + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + { + R result = a.accept(this, arg); + if (result != null) { + return result; + } + } + } + } + { + R result = n.getType().accept(this, arg); + if (result != null) { + return result; + } + } + for (final VariableDeclarator v : n.getVars()) { + { + R result = v.accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final VariableDeclarator n, final A arg) { + { + R result = n.getId().accept(this, arg); + if (result != null) { + return result; + } + } + if (n.getInit() != null) { + { + R result = n.getInit().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public R visit(final VariableDeclaratorId n, final A arg) { + return null; + } + + @Override + public R visit(final VoidType n, final A arg) { + return null; + } + + @Override + public R visit(final WhileStmt n, final A arg) { + { + R result = n.getCondition().accept(this, arg); + if (result != null) { + return result; + } + } + { + R result = n.getBody().accept(this, arg); + if (result != null) { + return result; + } + } + return null; + } + + @Override + public R visit(final WildcardType n, final A arg) { + if (n.getExtends() != null) { + { + R result = n.getExtends().accept(this, arg); + if (result != null) { + return result; + } + } + } + if (n.getSuper() != null) { + { + R result = n.getSuper().accept(this, arg); + if (result != null) { + return result; + } + } + } + return null; + } @Override public R visit(LambdaExpr n, A arg) { @@ -1591,23 +1591,23 @@ public R visit(LambdaExpr n, A arg) { } @Override - public R visit(MethodReferenceExpr n, A arg) { + public R visit(MethodReferenceExpr n, A arg){ return null; } @Override - public R visit(TypeExpr n, A arg) { + public R visit(TypeExpr n, A arg){ return null; } - @Override - public R visit(final BlockComment n, final A arg) { - return null; - } + @Override + public R visit(final BlockComment n, final A arg) { + return null; + } - @Override - public R visit(final LineComment n, final A arg) { - return null; - } + @Override + public R visit(final LineComment n, final A arg) { + return null; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java index 056838917c..3d23cea5ad 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.comments.BlockComment; @@ -115,943 +115,859 @@ * This visitor adapter can be used to save time when some specific nodes needs * to be changed. To do that just extend this class and override the methods * from the nodes who needs to be changed, returning the changed node. - * + * * @author Julio Vilmar Gesser */ public abstract class ModifierVisitorAdapter implements GenericVisitor { - private void removeNulls(final List list) { - for (int i = list.size() - 1; i >= 0; i--) { - if (list.get(i) == null) { - list.remove(i); - } - } - } - - @Override - public Node visit(final AnnotationDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { - members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(final AnnotationMemberDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - if (n.getDefaultValue() != null) { - n.setDefaultValue((Expression) n.getDefaultValue().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ArrayAccessExpr n, final A arg) { - n.setName((Expression) n.getName().accept(this, arg)); - n.setIndex((Expression) n.getIndex().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ArrayCreationExpr n, final A arg) { - n.setType((Type) n.getType().accept(this, arg)); - if (n.getDimensions() != null) { - final List dimensions = n.getDimensions(); - if (dimensions != null) { - for (int i = 0; i < dimensions.size(); i++) { - dimensions.set(i, (Expression) dimensions.get(i).accept(this, arg)); - } - removeNulls(dimensions); - } - } else { - n.setInitializer((ArrayInitializerExpr) n.getInitializer().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ArrayInitializerExpr n, final A arg) { - if (n.getValues() != null) { - final List values = n.getValues(); - if (values != null) { - for (int i = 0; i < values.size(); i++) { - values.set(i, (Expression) values.get(i).accept(this, arg)); - } - removeNulls(values); - } - } - return n; - } - - @Override - public Node visit(final AssertStmt n, final A arg) { - n.setCheck((Expression) n.getCheck().accept(this, arg)); - if (n.getMessage() != null) { - n.setMessage((Expression) n.getMessage().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final AssignExpr n, final A arg) { - n.setTarget((Expression) n.getTarget().accept(this, arg)); - n.setValue((Expression) n.getValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(final BinaryExpr n, final A arg) { - n.setLeft((Expression) n.getLeft().accept(this, arg)); - n.setRight((Expression) n.getRight().accept(this, arg)); - return n; - } - - @Override - public Node visit(final BlockStmt n, final A arg) { - final List stmts = n.getStmts(); - if (stmts != null) { - for (int i = 0; i < stmts.size(); i++) { - stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); - } - removeNulls(stmts); - } - return n; - } - - @Override - public Node visit(final BooleanLiteralExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final BreakStmt n, final A arg) { - return n; - } - - @Override - public Node visit(final CastExpr n, final A arg) { - n.setType((Type) n.getType().accept(this, arg)); - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(final CatchClause n, final A arg) { - n.setExcept((MultiTypeParameter) n.getExcept().accept(this, arg)); - n.setCatchBlock((BlockStmt) n.getCatchBlock().accept(this, arg)); - return n; - - } - - @Override - public Node visit(final CharLiteralExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final ClassExpr n, final A arg) { - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ClassOrInterfaceDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - final List extendz = n.getExtends(); - if (extendz != null) { - for (int i = 0; i < extendz.size(); i++) { - extendz.set(i, (ClassOrInterfaceType) extendz.get(i).accept(this, arg)); - } - removeNulls(extendz); - } - final List implementz = n.getImplements(); - if (implementz != null) { - for (int i = 0; i < implementz.size(); i++) { - implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); - } - removeNulls(implementz); - } - final List members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { - members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(final ClassOrInterfaceType n, final A arg) { - if (n.getScope() != null) { - n.setScope((ClassOrInterfaceType) n.getScope().accept(this, arg)); - } - final List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - return n; - } - - @Override - public Node visit(final CompilationUnit n, final A arg) { - if (n.getPackage() != null) { - n.setPackage((PackageDeclaration) n.getPackage().accept(this, arg)); - } - final List imports = n.getImports(); - if (imports != null) { - for (int i = 0; i < imports.size(); i++) { - imports.set(i, (ImportDeclaration) imports.get(i).accept(this, arg)); - } - removeNulls(imports); - } - final List types = n.getTypes(); - if (types != null) { - for (int i = 0; i < types.size(); i++) { - types.set(i, (TypeDeclaration) types.get(i).accept(this, arg)); - } - removeNulls(types); - } - return n; - } - - @Override - public Node visit(final ConditionalExpr n, final A arg) { - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setThenExpr((Expression) n.getThenExpr().accept(this, arg)); - n.setElseExpr((Expression) n.getElseExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ConstructorDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - final List parameters = n.getParameters(); - if (parameters != null) { - for (int i = 0; i < parameters.size(); i++) { - parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); - } - removeNulls(parameters); - } - final List throwz = n.getThrows(); - if (throwz != null) { - for (int i = 0; i < throwz.size(); i++) { - throwz.set(i, (NameExpr) throwz.get(i).accept(this, arg)); - } - removeNulls(throwz); - } - n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ContinueStmt n, final A arg) { - return n; - } - - @Override - public Node visit(final DoStmt n, final A arg) { - n.setBody((Statement) n.getBody().accept(this, arg)); - n.setCondition((Expression) n.getCondition().accept(this, arg)); - return n; - } - - @Override - public Node visit(final DoubleLiteralExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final EmptyMemberDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final EmptyStmt n, final A arg) { - return n; - } - - @Override - public Node visit(final EmptyTypeDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final EnclosedExpr n, final A arg) { - n.setInner((Expression) n.getInner().accept(this, arg)); - return n; - } - - @Override - public Node visit(final EnumConstantDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - final List classBody = n.getClassBody(); - if (classBody != null) { - for (int i = 0; i < classBody.size(); i++) { - classBody.set(i, (BodyDeclaration) classBody.get(i).accept(this, arg)); - } - removeNulls(classBody); - } - return n; - } - - @Override - public Node visit(final EnumDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List implementz = n.getImplements(); - if (implementz != null) { - for (int i = 0; i < implementz.size(); i++) { - implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); - } - removeNulls(implementz); - } - final List entries = n.getEntries(); - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - entries.set(i, (EnumConstantDeclaration) entries.get(i).accept(this, arg)); - } - removeNulls(entries); - } - final List members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { - members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(final ExplicitConstructorInvocationStmt n, final A arg) { - if (!n.isThis()) { - if (n.getExpr() != null) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - } - } - final List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - return n; - } - - @Override - public Node visit(final ExpressionStmt n, final A arg) { - n.setExpression((Expression) n.getExpression().accept(this, arg)); - return n; - } - - @Override - public Node visit(final FieldAccessExpr n, final A arg) { - n.setScope((Expression) n.getScope().accept(this, arg)); - return n; - } - - @Override - public Node visit(final FieldDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - final List variables = n.getVariables(); - for (int i = 0; i < variables.size(); i++) { - variables.set(i, (VariableDeclarator) variables.get(i).accept(this, arg)); - } - removeNulls(variables); - return n; - } - - @Override - public Node visit(final ForeachStmt n, final A arg) { - n.setVariable((VariableDeclarationExpr) n.getVariable().accept(this, arg)); - n.setIterable((Expression) n.getIterable().accept(this, arg)); - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ForStmt n, final A arg) { - final List init = n.getInit(); - if (init != null) { - for (int i = 0; i < init.size(); i++) { - init.set(i, (Expression) init.get(i).accept(this, arg)); - } - removeNulls(init); - } - if (n.getCompare() != null) { - n.setCompare((Expression) n.getCompare().accept(this, arg)); - } - final List update = n.getUpdate(); - if (update != null) { - for (int i = 0; i < update.size(); i++) { - update.set(i, (Expression) update.get(i).accept(this, arg)); - } - removeNulls(update); - } - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final IfStmt n, final A arg) { - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setThenStmt((Statement) n.getThenStmt().accept(this, arg)); - if (n.getElseStmt() != null) { - n.setElseStmt((Statement) n.getElseStmt().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ImportDeclaration n, final A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(final InitializerDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); - return n; - } - - @Override - public Node visit(final InstanceOfExpr n, final A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(final IntegerLiteralExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final IntegerLiteralMinValueExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final JavadocComment n, final A arg) { - return n; - } - - @Override - public Node visit(final LabeledStmt n, final A arg) { - n.setStmt((Statement) n.getStmt().accept(this, arg)); - return n; - } - - @Override - public Node visit(final LongLiteralExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final LongLiteralMinValueExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final MarkerAnnotationExpr n, final A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(final MemberValuePair n, final A arg) { - n.setValue((Expression) n.getValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(final MethodCallExpr n, final A arg) { - if (n.getScope() != null) { - n.setScope((Expression) n.getScope().accept(this, arg)); - } - final List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - return n; - } - - @Override - public Node visit(final MethodDeclaration n, final A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - final List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - n.setType((Type) n.getType().accept(this, arg)); - final List parameters = n.getParameters(); - if (parameters != null) { - for (int i = 0; i < parameters.size(); i++) { - parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); - } - removeNulls(parameters); - } - final List throwz = n.getThrows(); - if (throwz != null) { - for (int i = 0; i < throwz.size(); i++) { - throwz.set(i, (NameExpr) throwz.get(i).accept(this, arg)); - } - removeNulls(throwz); - } - if (n.getBody() != null) { - n.setBody((BlockStmt) n.getBody().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final NameExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final NormalAnnotationExpr n, final A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - final List pairs = n.getPairs(); - if (pairs != null) { - for (int i = 0; i < pairs.size(); i++) { - pairs.set(i, (MemberValuePair) pairs.get(i).accept(this, arg)); - } - removeNulls(pairs); - } - return n; - } - - @Override - public Node visit(final NullLiteralExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final ObjectCreationExpr n, final A arg) { - if (n.getScope() != null) { - n.setScope((Expression) n.getScope().accept(this, arg)); - } - final List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - n.setType((ClassOrInterfaceType) n.getType().accept(this, arg)); - final List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - final List anonymousClassBody = n.getAnonymousClassBody(); - if (anonymousClassBody != null) { - for (int i = 0; i < anonymousClassBody.size(); i++) { - anonymousClassBody.set(i, (BodyDeclaration) anonymousClassBody.get(i).accept(this, arg)); - } - removeNulls(anonymousClassBody); - } - return n; - } - - @Override - public Node visit(final PackageDeclaration n, final A arg) { - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(final Parameter n, final A arg) { - visit((BaseParameter) n, arg); - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(MultiTypeParameter n, A arg) { - visit((BaseParameter) n, arg); - List types = new LinkedList(); - for (Type type : n.getTypes()) { - types.add((Type) type.accept(this, arg)); - } + private void removeNulls(final List list) { + for (int i = list.size() - 1; i >= 0; i--) { + if (list.get(i) == null) { + list.remove(i); + } + } + } + + @Override public Node visit(final AnnotationDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List members = n.getMembers(); + if (members != null) { + for (int i = 0; i < members.size(); i++) { + members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); + } + removeNulls(members); + } + return n; + } + + @Override public Node visit(final AnnotationMemberDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + n.setType((Type) n.getType().accept(this, arg)); + if (n.getDefaultValue() != null) { + n.setDefaultValue((Expression) n.getDefaultValue().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ArrayAccessExpr n, final A arg) { + n.setName((Expression) n.getName().accept(this, arg)); + n.setIndex((Expression) n.getIndex().accept(this, arg)); + return n; + } + + @Override public Node visit(final ArrayCreationExpr n, final A arg) { + n.setType((Type) n.getType().accept(this, arg)); + if (n.getDimensions() != null) { + final List dimensions = n.getDimensions(); + if (dimensions != null) { + for (int i = 0; i < dimensions.size(); i++) { + dimensions.set(i, (Expression) dimensions.get(i).accept(this, arg)); + } + removeNulls(dimensions); + } + } else { + n.setInitializer((ArrayInitializerExpr) n.getInitializer().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ArrayInitializerExpr n, final A arg) { + if (n.getValues() != null) { + final List values = n.getValues(); + if (values != null) { + for (int i = 0; i < values.size(); i++) { + values.set(i, (Expression) values.get(i).accept(this, arg)); + } + removeNulls(values); + } + } + return n; + } + + @Override public Node visit(final AssertStmt n, final A arg) { + n.setCheck((Expression) n.getCheck().accept(this, arg)); + if (n.getMessage() != null) { + n.setMessage((Expression) n.getMessage().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final AssignExpr n, final A arg) { + n.setTarget((Expression) n.getTarget().accept(this, arg)); + n.setValue((Expression) n.getValue().accept(this, arg)); + return n; + } + + @Override public Node visit(final BinaryExpr n, final A arg) { + n.setLeft((Expression) n.getLeft().accept(this, arg)); + n.setRight((Expression) n.getRight().accept(this, arg)); + return n; + } + + @Override public Node visit(final BlockStmt n, final A arg) { + final List stmts = n.getStmts(); + if (stmts != null) { + for (int i = 0; i < stmts.size(); i++) { + stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); + } + removeNulls(stmts); + } + return n; + } + + @Override public Node visit(final BooleanLiteralExpr n, final A arg) { + return n; + } + + @Override public Node visit(final BreakStmt n, final A arg) { + return n; + } + + @Override public Node visit(final CastExpr n, final A arg) { + n.setType((Type) n.getType().accept(this, arg)); + n.setExpr((Expression) n.getExpr().accept(this, arg)); + return n; + } + + @Override public Node visit(final CatchClause n, final A arg) { + n.setExcept((MultiTypeParameter) n.getExcept().accept(this, arg)); + n.setCatchBlock((BlockStmt) n.getCatchBlock().accept(this, arg)); + return n; + + } + + @Override public Node visit(final CharLiteralExpr n, final A arg) { + return n; + } + + @Override public Node visit(final ClassExpr n, final A arg) { + n.setType((Type) n.getType().accept(this, arg)); + return n; + } + + @Override public Node visit(final ClassOrInterfaceDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List typeParameters = n.getTypeParameters(); + if (typeParameters != null) { + for (int i = 0; i < typeParameters.size(); i++) { + typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); + } + removeNulls(typeParameters); + } + final List extendz = n.getExtends(); + if (extendz != null) { + for (int i = 0; i < extendz.size(); i++) { + extendz.set(i, (ClassOrInterfaceType) extendz.get(i).accept(this, arg)); + } + removeNulls(extendz); + } + final List implementz = n.getImplements(); + if (implementz != null) { + for (int i = 0; i < implementz.size(); i++) { + implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); + } + removeNulls(implementz); + } + final List members = n.getMembers(); + if (members != null) { + for (int i = 0; i < members.size(); i++) { + members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); + } + removeNulls(members); + } + return n; + } + + @Override public Node visit(final ClassOrInterfaceType n, final A arg) { + if (n.getScope() != null) { + n.setScope((ClassOrInterfaceType) n.getScope().accept(this, arg)); + } + final List typeArgs = n.getTypeArgs(); + if (typeArgs != null) { + for (int i = 0; i < typeArgs.size(); i++) { + typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); + } + removeNulls(typeArgs); + } + return n; + } + + @Override public Node visit(final CompilationUnit n, final A arg) { + if (n.getPackage() != null) { + n.setPackage((PackageDeclaration) n.getPackage().accept(this, arg)); + } + final List imports = n.getImports(); + if (imports != null) { + for (int i = 0; i < imports.size(); i++) { + imports.set(i, (ImportDeclaration) imports.get(i).accept(this, arg)); + } + removeNulls(imports); + } + final List types = n.getTypes(); + if (types != null) { + for (int i = 0; i < types.size(); i++) { + types.set(i, (TypeDeclaration) types.get(i).accept(this, arg)); + } + removeNulls(types); + } + return n; + } + + @Override public Node visit(final ConditionalExpr n, final A arg) { + n.setCondition((Expression) n.getCondition().accept(this, arg)); + n.setThenExpr((Expression) n.getThenExpr().accept(this, arg)); + n.setElseExpr((Expression) n.getElseExpr().accept(this, arg)); + return n; + } + + @Override public Node visit(final ConstructorDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List typeParameters = n.getTypeParameters(); + if (typeParameters != null) { + for (int i = 0; i < typeParameters.size(); i++) { + typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); + } + removeNulls(typeParameters); + } + final List parameters = n.getParameters(); + if (parameters != null) { + for (int i = 0; i < parameters.size(); i++) { + parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); + } + removeNulls(parameters); + } + final List throwz = n.getThrows(); + if (throwz != null) { + for (int i = 0; i < throwz.size(); i++) { + throwz.set(i, (NameExpr) throwz.get(i).accept(this, arg)); + } + removeNulls(throwz); + } + n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); + return n; + } + + @Override public Node visit(final ContinueStmt n, final A arg) { + return n; + } + + @Override public Node visit(final DoStmt n, final A arg) { + n.setBody((Statement) n.getBody().accept(this, arg)); + n.setCondition((Expression) n.getCondition().accept(this, arg)); + return n; + } + + @Override public Node visit(final DoubleLiteralExpr n, final A arg) { + return n; + } + + @Override public Node visit(final EmptyMemberDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final EmptyStmt n, final A arg) { + return n; + } + + @Override public Node visit(final EmptyTypeDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final EnclosedExpr n, final A arg) { + n.setInner((Expression) n.getInner().accept(this, arg)); + return n; + } + + @Override public Node visit(final EnumConstantDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } + final List classBody = n.getClassBody(); + if (classBody != null) { + for (int i = 0; i < classBody.size(); i++) { + classBody.set(i, (BodyDeclaration) classBody.get(i).accept(this, arg)); + } + removeNulls(classBody); + } + return n; + } + + @Override public Node visit(final EnumDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List implementz = n.getImplements(); + if (implementz != null) { + for (int i = 0; i < implementz.size(); i++) { + implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); + } + removeNulls(implementz); + } + final List entries = n.getEntries(); + if (entries != null) { + for (int i = 0; i < entries.size(); i++) { + entries.set(i, (EnumConstantDeclaration) entries.get(i).accept(this, arg)); + } + removeNulls(entries); + } + final List members = n.getMembers(); + if (members != null) { + for (int i = 0; i < members.size(); i++) { + members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); + } + removeNulls(members); + } + return n; + } + + @Override public Node visit(final ExplicitConstructorInvocationStmt n, final A arg) { + if (!n.isThis()) { + if (n.getExpr() != null) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + } + } + final List typeArgs = n.getTypeArgs(); + if (typeArgs != null) { + for (int i = 0; i < typeArgs.size(); i++) { + typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); + } + removeNulls(typeArgs); + } + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } + return n; + } + + @Override public Node visit(final ExpressionStmt n, final A arg) { + n.setExpression((Expression) n.getExpression().accept(this, arg)); + return n; + } + + @Override public Node visit(final FieldAccessExpr n, final A arg) { + n.setScope((Expression) n.getScope().accept(this, arg)); + return n; + } + + @Override public Node visit(final FieldDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + n.setType((Type) n.getType().accept(this, arg)); + final List variables = n.getVariables(); + for (int i = 0; i < variables.size(); i++) { + variables.set(i, (VariableDeclarator) variables.get(i).accept(this, arg)); + } + removeNulls(variables); + return n; + } + + @Override public Node visit(final ForeachStmt n, final A arg) { + n.setVariable((VariableDeclarationExpr) n.getVariable().accept(this, arg)); + n.setIterable((Expression) n.getIterable().accept(this, arg)); + n.setBody((Statement) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final ForStmt n, final A arg) { + final List init = n.getInit(); + if (init != null) { + for (int i = 0; i < init.size(); i++) { + init.set(i, (Expression) init.get(i).accept(this, arg)); + } + removeNulls(init); + } + if (n.getCompare() != null) { + n.setCompare((Expression) n.getCompare().accept(this, arg)); + } + final List update = n.getUpdate(); + if (update != null) { + for (int i = 0; i < update.size(); i++) { + update.set(i, (Expression) update.get(i).accept(this, arg)); + } + removeNulls(update); + } + n.setBody((Statement) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final IfStmt n, final A arg) { + n.setCondition((Expression) n.getCondition().accept(this, arg)); + n.setThenStmt((Statement) n.getThenStmt().accept(this, arg)); + if (n.getElseStmt() != null) { + n.setElseStmt((Statement) n.getElseStmt().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ImportDeclaration n, final A arg) { + n.setName((NameExpr) n.getName().accept(this, arg)); + return n; + } + + @Override public Node visit(final InitializerDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); + return n; + } + + @Override public Node visit(final InstanceOfExpr n, final A arg) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + n.setType((Type) n.getType().accept(this, arg)); + return n; + } + + @Override public Node visit(final IntegerLiteralExpr n, final A arg) { + return n; + } + + @Override public Node visit(final IntegerLiteralMinValueExpr n, final A arg) { + return n; + } + + @Override public Node visit(final JavadocComment n, final A arg) { + return n; + } + + @Override public Node visit(final LabeledStmt n, final A arg) { + n.setStmt((Statement) n.getStmt().accept(this, arg)); + return n; + } + + @Override public Node visit(final LongLiteralExpr n, final A arg) { + return n; + } + + @Override public Node visit(final LongLiteralMinValueExpr n, final A arg) { + return n; + } + + @Override public Node visit(final MarkerAnnotationExpr n, final A arg) { + n.setName((NameExpr) n.getName().accept(this, arg)); + return n; + } + + @Override public Node visit(final MemberValuePair n, final A arg) { + n.setValue((Expression) n.getValue().accept(this, arg)); + return n; + } + + @Override public Node visit(final MethodCallExpr n, final A arg) { + if (n.getScope() != null) { + n.setScope((Expression) n.getScope().accept(this, arg)); + } + final List typeArgs = n.getTypeArgs(); + if (typeArgs != null) { + for (int i = 0; i < typeArgs.size(); i++) { + typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); + } + removeNulls(typeArgs); + } + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } + return n; + } + + @Override public Node visit(final MethodDeclaration n, final A arg) { + if (n.getJavaDoc() != null) { + n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); + } + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + final List typeParameters = n.getTypeParameters(); + if (typeParameters != null) { + for (int i = 0; i < typeParameters.size(); i++) { + typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); + } + removeNulls(typeParameters); + } + n.setType((Type) n.getType().accept(this, arg)); + final List parameters = n.getParameters(); + if (parameters != null) { + for (int i = 0; i < parameters.size(); i++) { + parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); + } + removeNulls(parameters); + } + final List throwz = n.getThrows(); + if (throwz != null) { + for (int i = 0; i < throwz.size(); i++) { + throwz.set(i, (NameExpr) throwz.get(i).accept(this, arg)); + } + removeNulls(throwz); + } + if (n.getBody() != null) { + n.setBody((BlockStmt) n.getBody().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final NameExpr n, final A arg) { + return n; + } + + @Override public Node visit(final NormalAnnotationExpr n, final A arg) { + n.setName((NameExpr) n.getName().accept(this, arg)); + final List pairs = n.getPairs(); + if (pairs != null) { + for (int i = 0; i < pairs.size(); i++) { + pairs.set(i, (MemberValuePair) pairs.get(i).accept(this, arg)); + } + removeNulls(pairs); + } + return n; + } + + @Override public Node visit(final NullLiteralExpr n, final A arg) { + return n; + } + + @Override public Node visit(final ObjectCreationExpr n, final A arg) { + if (n.getScope() != null) { + n.setScope((Expression) n.getScope().accept(this, arg)); + } + final List typeArgs = n.getTypeArgs(); + if (typeArgs != null) { + for (int i = 0; i < typeArgs.size(); i++) { + typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); + } + removeNulls(typeArgs); + } + n.setType((ClassOrInterfaceType) n.getType().accept(this, arg)); + final List args = n.getArgs(); + if (args != null) { + for (int i = 0; i < args.size(); i++) { + args.set(i, (Expression) args.get(i).accept(this, arg)); + } + removeNulls(args); + } + final List anonymousClassBody = n.getAnonymousClassBody(); + if (anonymousClassBody != null) { + for (int i = 0; i < anonymousClassBody.size(); i++) { + anonymousClassBody.set(i, (BodyDeclaration) anonymousClassBody.get(i).accept(this, arg)); + } + removeNulls(anonymousClassBody); + } + return n; + } + + @Override public Node visit(final PackageDeclaration n, final A arg) { + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + n.setName((NameExpr) n.getName().accept(this, arg)); + return n; + } + + @Override public Node visit(final Parameter n, final A arg) { + visit((BaseParameter) n, arg); + n.setType((Type) n.getType().accept(this, arg)); + return n; + } + + @Override public Node visit(MultiTypeParameter n, A arg) { + visit((BaseParameter) n, arg); + List types = new LinkedList(); + for (Type type : n.getTypes()) { + types.add((Type) type.accept(this, arg)); + } n.setTypes(types); return n; } - protected Node visit(final BaseParameter n, final A arg) { - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - - n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); - return n; - } - - @Override - public Node visit(final PrimitiveType n, final A arg) { - return n; - } - - @Override - public Node visit(final QualifiedNameExpr n, final A arg) { - n.setQualifier((NameExpr) n.getQualifier().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ReferenceType n, final A arg) { - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ReturnStmt n, final A arg) { - if (n.getExpr() != null) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final SingleMemberAnnotationExpr n, final A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - n.setMemberValue((Expression) n.getMemberValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(final StringLiteralExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final SuperExpr n, final A arg) { - if (n.getClassExpr() != null) { - n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final SwitchEntryStmt n, final A arg) { - if (n.getLabel() != null) { - n.setLabel((Expression) n.getLabel().accept(this, arg)); - } - final List stmts = n.getStmts(); - if (stmts != null) { - for (int i = 0; i < stmts.size(); i++) { - stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); - } - removeNulls(stmts); - } - return n; - } - - @Override - public Node visit(final SwitchStmt n, final A arg) { - n.setSelector((Expression) n.getSelector().accept(this, arg)); - final List entries = n.getEntries(); - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - entries.set(i, (SwitchEntryStmt) entries.get(i).accept(this, arg)); - } - removeNulls(entries); - } - return n; - - } - - @Override - public Node visit(final SynchronizedStmt n, final A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); - return n; - } - - @Override - public Node visit(final ThisExpr n, final A arg) { - if (n.getClassExpr() != null) { - n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final ThrowStmt n, final A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(final TryStmt n, final A arg) { - n.setTryBlock((BlockStmt) n.getTryBlock().accept(this, arg)); - final List catchs = n.getCatchs(); - if (catchs != null) { - for (int i = 0; i < catchs.size(); i++) { - catchs.set(i, (CatchClause) catchs.get(i).accept(this, arg)); - } - removeNulls(catchs); - } - if (n.getFinallyBlock() != null) { - n.setFinallyBlock((BlockStmt) n.getFinallyBlock().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final TypeDeclarationStmt n, final A arg) { - n.setTypeDeclaration((TypeDeclaration) n.getTypeDeclaration().accept(this, arg)); - return n; - } - - @Override - public Node visit(final TypeParameter n, final A arg) { - final List typeBound = n.getTypeBound(); - if (typeBound != null) { - for (int i = 0; i < typeBound.size(); i++) { - typeBound.set(i, (ClassOrInterfaceType) typeBound.get(i).accept(this, arg)); - } - removeNulls(typeBound); - } - return n; - } - - @Override - public Node visit(final UnaryExpr n, final A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(final UnknownType n, final A arg) { - return n; - } - - @Override - public Node visit(final VariableDeclarationExpr n, final A arg) { - final List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - final List vars = n.getVars(); - for (int i = 0; i < vars.size(); i++) { - vars.set(i, (VariableDeclarator) vars.get(i).accept(this, arg)); - } - removeNulls(vars); - return n; - } - - @Override - public Node visit(final VariableDeclarator n, final A arg) { - n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); - if (n.getInit() != null) { - n.setInit((Expression) n.getInit().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final VariableDeclaratorId n, final A arg) { - return n; - } - - @Override - public Node visit(final VoidType n, final A arg) { - return n; - } - - @Override - public Node visit(final WhileStmt n, final A arg) { - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(final WildcardType n, final A arg) { - if (n.getExtends() != null) { - n.setExtends((ReferenceType) n.getExtends().accept(this, arg)); - } - if (n.getSuper() != null) { - n.setSuper((ReferenceType) n.getSuper().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(final LambdaExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final MethodReferenceExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final TypeExpr n, final A arg) { - return n; - } - - @Override - public Node visit(final BlockComment n, final A arg) { - return n; - } - - @Override - public Node visit(final LineComment n, final A arg) { - return n; - } + protected Node visit(final BaseParameter n, final A arg) { + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + + n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); + return n; + } + + @Override public Node visit(final PrimitiveType n, final A arg) { + return n; + } + + @Override public Node visit(final QualifiedNameExpr n, final A arg) { + n.setQualifier((NameExpr) n.getQualifier().accept(this, arg)); + return n; + } + + @Override public Node visit(final ReferenceType n, final A arg) { + n.setType((Type) n.getType().accept(this, arg)); + return n; + } + + @Override public Node visit(final ReturnStmt n, final A arg) { + if (n.getExpr() != null) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final SingleMemberAnnotationExpr n, final A arg) { + n.setName((NameExpr) n.getName().accept(this, arg)); + n.setMemberValue((Expression) n.getMemberValue().accept(this, arg)); + return n; + } + + @Override public Node visit(final StringLiteralExpr n, final A arg) { + return n; + } + + @Override public Node visit(final SuperExpr n, final A arg) { + if (n.getClassExpr() != null) { + n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final SwitchEntryStmt n, final A arg) { + if (n.getLabel() != null) { + n.setLabel((Expression) n.getLabel().accept(this, arg)); + } + final List stmts = n.getStmts(); + if (stmts != null) { + for (int i = 0; i < stmts.size(); i++) { + stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); + } + removeNulls(stmts); + } + return n; + } + + @Override public Node visit(final SwitchStmt n, final A arg) { + n.setSelector((Expression) n.getSelector().accept(this, arg)); + final List entries = n.getEntries(); + if (entries != null) { + for (int i = 0; i < entries.size(); i++) { + entries.set(i, (SwitchEntryStmt) entries.get(i).accept(this, arg)); + } + removeNulls(entries); + } + return n; + + } + + @Override public Node visit(final SynchronizedStmt n, final A arg) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); + return n; + } + + @Override public Node visit(final ThisExpr n, final A arg) { + if (n.getClassExpr() != null) { + n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final ThrowStmt n, final A arg) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + return n; + } + + @Override public Node visit(final TryStmt n, final A arg) { + n.setTryBlock((BlockStmt) n.getTryBlock().accept(this, arg)); + final List catchs = n.getCatchs(); + if (catchs != null) { + for (int i = 0; i < catchs.size(); i++) { + catchs.set(i, (CatchClause) catchs.get(i).accept(this, arg)); + } + removeNulls(catchs); + } + if (n.getFinallyBlock() != null) { + n.setFinallyBlock((BlockStmt) n.getFinallyBlock().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final TypeDeclarationStmt n, final A arg) { + n.setTypeDeclaration((TypeDeclaration) n.getTypeDeclaration().accept(this, arg)); + return n; + } + + @Override public Node visit(final TypeParameter n, final A arg) { + final List typeBound = n.getTypeBound(); + if (typeBound != null) { + for (int i = 0; i < typeBound.size(); i++) { + typeBound.set(i, (ClassOrInterfaceType) typeBound.get(i).accept(this, arg)); + } + removeNulls(typeBound); + } + return n; + } + + @Override public Node visit(final UnaryExpr n, final A arg) { + n.setExpr((Expression) n.getExpr().accept(this, arg)); + return n; + } + + @Override public Node visit(final UnknownType n, final A arg) { + return n; + } + + @Override public Node visit(final VariableDeclarationExpr n, final A arg) { + final List annotations = n.getAnnotations(); + if (annotations != null) { + for (int i = 0; i < annotations.size(); i++) { + annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); + } + removeNulls(annotations); + } + n.setType((Type) n.getType().accept(this, arg)); + final List vars = n.getVars(); + for (int i = 0; i < vars.size(); i++) { + vars.set(i, (VariableDeclarator) vars.get(i).accept(this, arg)); + } + removeNulls(vars); + return n; + } + + @Override public Node visit(final VariableDeclarator n, final A arg) { + n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); + if (n.getInit() != null) { + n.setInit((Expression) n.getInit().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final VariableDeclaratorId n, final A arg) { + return n; + } + + @Override public Node visit(final VoidType n, final A arg) { + return n; + } + + @Override public Node visit(final WhileStmt n, final A arg) { + n.setCondition((Expression) n.getCondition().accept(this, arg)); + n.setBody((Statement) n.getBody().accept(this, arg)); + return n; + } + + @Override public Node visit(final WildcardType n, final A arg) { + if (n.getExtends() != null) { + n.setExtends((ReferenceType) n.getExtends().accept(this, arg)); + } + if (n.getSuper() != null) { + n.setSuper((ReferenceType) n.getSuper().accept(this, arg)); + } + return n; + } + + @Override public Node visit(final LambdaExpr n, final A arg) { + return n; + } + + @Override public Node visit(final MethodReferenceExpr n, final A arg){ + return n; + } + + @Override public Node visit(final TypeExpr n, final A arg){ + return n; + } + + @Override public Node visit(final BlockComment n, final A arg) { + return n; + } + + @Override public Node visit(final LineComment n, final A arg) { + return n; + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitor.java index 6e6352b9ee..b85bd55a77 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitor.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.comments.BlockComment; @@ -69,182 +69,182 @@ /** * A visitor that does not return anything. - * + * * @author Julio Vilmar Gesser */ public interface VoidVisitor { - //- Compilation Unit ---------------------------------- - - void visit(CompilationUnit n, A arg); + //- Compilation Unit ---------------------------------- - void visit(PackageDeclaration n, A arg); + void visit(CompilationUnit n, A arg); - void visit(ImportDeclaration n, A arg); + void visit(PackageDeclaration n, A arg); - void visit(TypeParameter n, A arg); + void visit(ImportDeclaration n, A arg); - void visit(LineComment n, A arg); + void visit(TypeParameter n, A arg); - void visit(BlockComment n, A arg); + void visit(LineComment n, A arg); - //- Body ---------------------------------------------- + void visit(BlockComment n, A arg); - void visit(ClassOrInterfaceDeclaration n, A arg); + //- Body ---------------------------------------------- - void visit(EnumDeclaration n, A arg); + void visit(ClassOrInterfaceDeclaration n, A arg); - void visit(EmptyTypeDeclaration n, A arg); + void visit(EnumDeclaration n, A arg); - void visit(EnumConstantDeclaration n, A arg); + void visit(EmptyTypeDeclaration n, A arg); - void visit(AnnotationDeclaration n, A arg); + void visit(EnumConstantDeclaration n, A arg); - void visit(AnnotationMemberDeclaration n, A arg); + void visit(AnnotationDeclaration n, A arg); - void visit(FieldDeclaration n, A arg); + void visit(AnnotationMemberDeclaration n, A arg); - void visit(VariableDeclarator n, A arg); + void visit(FieldDeclaration n, A arg); - void visit(VariableDeclaratorId n, A arg); + void visit(VariableDeclarator n, A arg); - void visit(ConstructorDeclaration n, A arg); + void visit(VariableDeclaratorId n, A arg); - void visit(MethodDeclaration n, A arg); + void visit(ConstructorDeclaration n, A arg); - void visit(Parameter n, A arg); + void visit(MethodDeclaration n, A arg); - void visit(MultiTypeParameter n, A arg); + void visit(Parameter n, A arg); + + void visit(MultiTypeParameter n, A arg); - void visit(EmptyMemberDeclaration n, A arg); + void visit(EmptyMemberDeclaration n, A arg); - void visit(InitializerDeclaration n, A arg); + void visit(InitializerDeclaration n, A arg); - void visit(JavadocComment n, A arg); + void visit(JavadocComment n, A arg); - //- Type ---------------------------------------------- + //- Type ---------------------------------------------- - void visit(ClassOrInterfaceType n, A arg); + void visit(ClassOrInterfaceType n, A arg); - void visit(PrimitiveType n, A arg); + void visit(PrimitiveType n, A arg); - void visit(ReferenceType n, A arg); + void visit(ReferenceType n, A arg); - void visit(VoidType n, A arg); + void visit(VoidType n, A arg); - void visit(WildcardType n, A arg); + void visit(WildcardType n, A arg); - void visit(UnknownType n, A arg); + void visit(UnknownType n, A arg); - //- Expression ---------------------------------------- + //- Expression ---------------------------------------- - void visit(ArrayAccessExpr n, A arg); + void visit(ArrayAccessExpr n, A arg); - void visit(ArrayCreationExpr n, A arg); + void visit(ArrayCreationExpr n, A arg); - void visit(ArrayInitializerExpr n, A arg); + void visit(ArrayInitializerExpr n, A arg); - void visit(AssignExpr n, A arg); + void visit(AssignExpr n, A arg); - void visit(BinaryExpr n, A arg); + void visit(BinaryExpr n, A arg); - void visit(CastExpr n, A arg); + void visit(CastExpr n, A arg); - void visit(ClassExpr n, A arg); + void visit(ClassExpr n, A arg); - void visit(ConditionalExpr n, A arg); + void visit(ConditionalExpr n, A arg); - void visit(EnclosedExpr n, A arg); + void visit(EnclosedExpr n, A arg); - void visit(FieldAccessExpr n, A arg); + void visit(FieldAccessExpr n, A arg); - void visit(InstanceOfExpr n, A arg); + void visit(InstanceOfExpr n, A arg); - void visit(StringLiteralExpr n, A arg); + void visit(StringLiteralExpr n, A arg); - void visit(IntegerLiteralExpr n, A arg); + void visit(IntegerLiteralExpr n, A arg); - void visit(LongLiteralExpr n, A arg); + void visit(LongLiteralExpr n, A arg); - void visit(IntegerLiteralMinValueExpr n, A arg); + void visit(IntegerLiteralMinValueExpr n, A arg); - void visit(LongLiteralMinValueExpr n, A arg); + void visit(LongLiteralMinValueExpr n, A arg); - void visit(CharLiteralExpr n, A arg); + void visit(CharLiteralExpr n, A arg); - void visit(DoubleLiteralExpr n, A arg); + void visit(DoubleLiteralExpr n, A arg); - void visit(BooleanLiteralExpr n, A arg); + void visit(BooleanLiteralExpr n, A arg); - void visit(NullLiteralExpr n, A arg); + void visit(NullLiteralExpr n, A arg); - void visit(MethodCallExpr n, A arg); + void visit(MethodCallExpr n, A arg); - void visit(NameExpr n, A arg); + void visit(NameExpr n, A arg); - void visit(ObjectCreationExpr n, A arg); + void visit(ObjectCreationExpr n, A arg); - void visit(QualifiedNameExpr n, A arg); + void visit(QualifiedNameExpr n, A arg); - void visit(ThisExpr n, A arg); + void visit(ThisExpr n, A arg); - void visit(SuperExpr n, A arg); + void visit(SuperExpr n, A arg); - void visit(UnaryExpr n, A arg); + void visit(UnaryExpr n, A arg); - void visit(VariableDeclarationExpr n, A arg); + void visit(VariableDeclarationExpr n, A arg); - void visit(MarkerAnnotationExpr n, A arg); + void visit(MarkerAnnotationExpr n, A arg); - void visit(SingleMemberAnnotationExpr n, A arg); + void visit(SingleMemberAnnotationExpr n, A arg); - void visit(NormalAnnotationExpr n, A arg); + void visit(NormalAnnotationExpr n, A arg); - void visit(MemberValuePair n, A arg); + void visit(MemberValuePair n, A arg); - //- Statements ---------------------------------------- + //- Statements ---------------------------------------- - void visit(ExplicitConstructorInvocationStmt n, A arg); + void visit(ExplicitConstructorInvocationStmt n, A arg); - void visit(TypeDeclarationStmt n, A arg); + void visit(TypeDeclarationStmt n, A arg); - void visit(AssertStmt n, A arg); + void visit(AssertStmt n, A arg); - void visit(BlockStmt n, A arg); + void visit(BlockStmt n, A arg); - void visit(LabeledStmt n, A arg); + void visit(LabeledStmt n, A arg); - void visit(EmptyStmt n, A arg); + void visit(EmptyStmt n, A arg); - void visit(ExpressionStmt n, A arg); + void visit(ExpressionStmt n, A arg); - void visit(SwitchStmt n, A arg); + void visit(SwitchStmt n, A arg); - void visit(SwitchEntryStmt n, A arg); + void visit(SwitchEntryStmt n, A arg); - void visit(BreakStmt n, A arg); + void visit(BreakStmt n, A arg); - void visit(ReturnStmt n, A arg); + void visit(ReturnStmt n, A arg); - void visit(IfStmt n, A arg); + void visit(IfStmt n, A arg); - void visit(WhileStmt n, A arg); + void visit(WhileStmt n, A arg); - void visit(ContinueStmt n, A arg); + void visit(ContinueStmt n, A arg); - void visit(DoStmt n, A arg); + void visit(DoStmt n, A arg); - void visit(ForeachStmt n, A arg); + void visit(ForeachStmt n, A arg); - void visit(ForStmt n, A arg); + void visit(ForStmt n, A arg); - void visit(ThrowStmt n, A arg); + void visit(ThrowStmt n, A arg); - void visit(SynchronizedStmt n, A arg); + void visit(SynchronizedStmt n, A arg); - void visit(TryStmt n, A arg); + void visit(TryStmt n, A arg); - void visit(CatchClause n, A arg); + void visit(CatchClause n, A arg); void visit(LambdaExpr n, A arg); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java index b4fca84c34..ddad12fb7c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast.visitor; import com.github.javaparser.ast.comments.BlockComment; @@ -78,815 +78,734 @@ */ public abstract class VoidVisitorAdapter implements VoidVisitor { - @Override - public void visit(final AnnotationDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final AnnotationMemberDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getDefaultValue() != null) { - n.getDefaultValue().accept(this, arg); - } - } - - @Override - public void visit(final ArrayAccessExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - n.getIndex().accept(this, arg); - } - - @Override - public void visit(final ArrayCreationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getType().accept(this, arg); - if (!isNullOrEmpty(n.getDimensions())) { - for (final Expression dim : n.getDimensions()) { - dim.accept(this, arg); - } - } else { - n.getInitializer().accept(this, arg); - } - } - - @Override - public void visit(final ArrayInitializerExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getValues() != null) { - for (final Expression expr : n.getValues()) { - expr.accept(this, arg); - } - } - } - - @Override - public void visit(final AssertStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - n.getMessage().accept(this, arg); - } - } - - @Override - public void visit(final AssignExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getTarget().accept(this, arg); - n.getValue().accept(this, arg); - } - - @Override - public void visit(final BinaryExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getLeft().accept(this, arg); - n.getRight().accept(this, arg); - } - - @Override - public void visit(final BlockComment n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final BlockStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(final BooleanLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final BreakStmt n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final CastExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getType().accept(this, arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final CatchClause n, final A arg) { - visitComment(n.getComment(), arg); - n.getExcept().accept(this, arg); - n.getCatchBlock().accept(this, arg); - } - - @Override - public void visit(final CharLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final ClassExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getType().accept(this, arg); - } - - @Override - public void visit(final ClassOrInterfaceDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getExtends() != null) { - for (final ClassOrInterfaceType c : n.getExtends()) { - c.accept(this, arg); - } - } - - if (n.getImplements() != null) { - for (final ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final ClassOrInterfaceType n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - } - - @Override - public void visit(final CompilationUnit n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getPackage() != null) { - n.getPackage().accept(this, arg); - } - if (n.getImports() != null) { - for (final ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - } - if (n.getTypes() != null) { - for (final TypeDeclaration typeDeclaration : n.getTypes()) { - typeDeclaration.accept(this, arg); - } - } - } - - @Override - public void visit(final ConditionalExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - n.getThenExpr().accept(this, arg); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(final ConstructorDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (final NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final ContinueStmt n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final DoStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getBody().accept(this, arg); - n.getCondition().accept(this, arg); - } - - @Override - public void visit(final DoubleLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final EmptyMemberDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - } - - @Override - public void visit(final EmptyStmt n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final EmptyTypeDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - } - - @Override - public void visit(final EnclosedExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getInner().accept(this, arg); - } - - @Override - public void visit(final EnumConstantDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getClassBody() != null) { - for (final BodyDeclaration member : n.getClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final EnumDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getImplements() != null) { - for (final ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getEntries() != null) { - for (final EnumConstantDeclaration e : n.getEntries()) { - e.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (final BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (!n.isThis()) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(final ExpressionStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpression().accept(this, arg); - } - - @Override - public void visit(final FieldAccessExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getScope().accept(this, arg); - } - - @Override - public void visit(final FieldDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (final VariableDeclarator var : n.getVariables()) { - var.accept(this, arg); - } - } - - @Override - public void visit(final ForeachStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getVariable().accept(this, arg); - n.getIterable().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final ForStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getInit() != null) { - for (final Expression e : n.getInit()) { - e.accept(this, arg); - } - } - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - if (n.getUpdate() != null) { - for (final Expression e : n.getUpdate()) { - e.accept(this, arg); - } - } - n.getBody().accept(this, arg); - } - - @Override - public void visit(final IfStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - n.getElseStmt().accept(this, arg); - } - } - - @Override - public void visit(final ImportDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - } - - @Override - public void visit(final InitializerDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final InstanceOfExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - n.getType().accept(this, arg); - } - - @Override - public void visit(final IntegerLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final IntegerLiteralMinValueExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final JavadocComment n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final LabeledStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getStmt().accept(this, arg); - } - - @Override - public void visit(final LineComment n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final LongLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final LongLiteralMinValueExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final MarkerAnnotationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - } - - @Override - public void visit(final MemberValuePair n, final A arg) { - visitComment(n.getComment(), arg); - n.getValue().accept(this, arg); - } - - @Override - public void visit(final MethodCallExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(final MethodDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (final TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getParameters() != null) { - for (final Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (final NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - if (n.getBody() != null) { - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(final NameExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final NormalAnnotationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - if (n.getPairs() != null) { - for (final MemberValuePair m : n.getPairs()) { - m.accept(this, arg); - } - } - } - - @Override - public void visit(final NullLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final ObjectCreationExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (final Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getArgs() != null) { - for (final Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getAnonymousClassBody() != null) { - for (final BodyDeclaration member : n.getAnonymousClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(final PackageDeclaration n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getName().accept(this, arg); - } - - @Override - public void visit(final Parameter n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - n.getId().accept(this, arg); - } - - @Override - public void visit(final MultiTypeParameter n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - for (final Type type : n.getTypes()) { - type.accept(this, arg); - } - n.getId().accept(this, arg); - } - - @Override - public void visit(final PrimitiveType n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final QualifiedNameExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getQualifier().accept(this, arg); - } - - @Override - public void visit(final ReferenceType n, final A arg) { - visitComment(n.getComment(), arg); - n.getType().accept(this, arg); - } - - @Override - public void visit(final ReturnStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - - @Override - public void visit(final SingleMemberAnnotationExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getName().accept(this, arg); - n.getMemberValue().accept(this, arg); - } - - @Override - public void visit(final StringLiteralExpr n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final SuperExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(final SwitchEntryStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getLabel() != null) { - n.getLabel().accept(this, arg); - } - if (n.getStmts() != null) { - for (final Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(final SwitchStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getSelector().accept(this, arg); - if (n.getEntries() != null) { - for (final SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(final SynchronizedStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - n.getBlock().accept(this, arg); - } - - @Override - public void visit(final ThisExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(final ThrowStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final TryStmt n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getResources() != null) { - for (final VariableDeclarationExpr v : n.getResources()) { - v.accept(this, arg); - } - } - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (final CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(final TypeDeclarationStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(final TypeParameter n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getTypeBound() != null) { - for (final ClassOrInterfaceType c : n.getTypeBound()) { - c.accept(this, arg); - } - } - } - - @Override - public void visit(final UnaryExpr n, final A arg) { - visitComment(n.getComment(), arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(final UnknownType n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final VariableDeclarationExpr n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getAnnotations() != null) { - for (final AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (final VariableDeclarator v : n.getVars()) { - v.accept(this, arg); - } - } - - @Override - public void visit(final VariableDeclarator n, final A arg) { - visitComment(n.getComment(), arg); - n.getId().accept(this, arg); - if (n.getInit() != null) { - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(final VariableDeclaratorId n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final VoidType n, final A arg) { - visitComment(n.getComment(), arg); - } - - @Override - public void visit(final WhileStmt n, final A arg) { - visitComment(n.getComment(), arg); - n.getCondition().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(final WildcardType n, final A arg) { - visitComment(n.getComment(), arg); - if (n.getExtends() != null) { - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - n.getSuper().accept(this, arg); - } - } + @Override public void visit(final AnnotationDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final AnnotationMemberDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getDefaultValue() != null) { + n.getDefaultValue().accept(this, arg); + } + } + + @Override public void visit(final ArrayAccessExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + n.getIndex().accept(this, arg); + } + + @Override public void visit(final ArrayCreationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getType().accept(this, arg); + if (!isNullOrEmpty(n.getDimensions())) { + for (final Expression dim : n.getDimensions()) { + dim.accept(this, arg); + } + } else { + n.getInitializer().accept(this, arg); + } + } + + @Override public void visit(final ArrayInitializerExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getValues() != null) { + for (final Expression expr : n.getValues()) { + expr.accept(this, arg); + } + } + } + + @Override public void visit(final AssertStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getCheck().accept(this, arg); + if (n.getMessage() != null) { + n.getMessage().accept(this, arg); + } + } + + @Override public void visit(final AssignExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getTarget().accept(this, arg); + n.getValue().accept(this, arg); + } + + @Override public void visit(final BinaryExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getLeft().accept(this, arg); + n.getRight().accept(this, arg); + } + + @Override public void visit(final BlockComment n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final BlockStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + } + + @Override public void visit(final BooleanLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final BreakStmt n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final CastExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getType().accept(this, arg); + n.getExpr().accept(this, arg); + } + + @Override public void visit(final CatchClause n, final A arg) { + visitComment(n.getComment(), arg); + n.getExcept().accept(this, arg); + n.getCatchBlock().accept(this, arg); + } + + @Override public void visit(final CharLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final ClassExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getType().accept(this, arg); + } + + @Override public void visit(final ClassOrInterfaceDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + if (n.getExtends() != null) { + for (final ClassOrInterfaceType c : n.getExtends()) { + c.accept(this, arg); + } + } + + if (n.getImplements() != null) { + for (final ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final ClassOrInterfaceType n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + } + + @Override public void visit(final CompilationUnit n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getPackage() != null) { + n.getPackage().accept(this, arg); + } + if (n.getImports() != null) { + for (final ImportDeclaration i : n.getImports()) { + i.accept(this, arg); + } + } + if (n.getTypes() != null) { + for (final TypeDeclaration typeDeclaration : n.getTypes()) { + typeDeclaration.accept(this, arg); + } + } + } + + @Override public void visit(final ConditionalExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + n.getThenExpr().accept(this, arg); + n.getElseExpr().accept(this, arg); + } + + @Override public void visit(final ConstructorDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (final NameExpr name : n.getThrows()) { + name.accept(this, arg); + } + } + n.getBlock().accept(this, arg); + } + + @Override public void visit(final ContinueStmt n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final DoStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getBody().accept(this, arg); + n.getCondition().accept(this, arg); + } + + @Override public void visit(final DoubleLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final EmptyMemberDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + } + + @Override public void visit(final EmptyStmt n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final EmptyTypeDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + } + + @Override public void visit(final EnclosedExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getInner().accept(this, arg); + } + + @Override public void visit(final EnumConstantDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getClassBody() != null) { + for (final BodyDeclaration member : n.getClassBody()) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final EnumDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getImplements() != null) { + for (final ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } + } + if (n.getEntries() != null) { + for (final EnumConstantDeclaration e : n.getEntries()) { + e.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (final BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (!n.isThis()) { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + } + + @Override public void visit(final ExpressionStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpression().accept(this, arg); + } + + @Override public void visit(final FieldAccessExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getScope().accept(this, arg); + } + + @Override public void visit(final FieldDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + for (final VariableDeclarator var : n.getVariables()) { + var.accept(this, arg); + } + } + + @Override public void visit(final ForeachStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getVariable().accept(this, arg); + n.getIterable().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override public void visit(final ForStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getInit() != null) { + for (final Expression e : n.getInit()) { + e.accept(this, arg); + } + } + if (n.getCompare() != null) { + n.getCompare().accept(this, arg); + } + if (n.getUpdate() != null) { + for (final Expression e : n.getUpdate()) { + e.accept(this, arg); + } + } + n.getBody().accept(this, arg); + } + + @Override public void visit(final IfStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + n.getThenStmt().accept(this, arg); + if (n.getElseStmt() != null) { + n.getElseStmt().accept(this, arg); + } + } + + @Override public void visit(final ImportDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + } + + @Override public void visit(final InitializerDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + n.getBlock().accept(this, arg); + } + + @Override public void visit(final InstanceOfExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + n.getType().accept(this, arg); + } + + @Override public void visit(final IntegerLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final IntegerLiteralMinValueExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final JavadocComment n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final LabeledStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getStmt().accept(this, arg); + } + + @Override public void visit(final LineComment n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final LongLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final LongLiteralMinValueExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final MarkerAnnotationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + } + + @Override public void visit(final MemberValuePair n, final A arg) { + visitComment(n.getComment(), arg); + n.getValue().accept(this, arg); + } + + @Override public void visit(final MethodCallExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + } + + @Override public void visit(final MethodDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (final TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getParameters() != null) { + for (final Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (final NameExpr name : n.getThrows()) { + name.accept(this, arg); + } + } + if (n.getBody() != null) { + n.getBody().accept(this, arg); + } + } + + @Override public void visit(final NameExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final NormalAnnotationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + if (n.getPairs() != null) { + for (final MemberValuePair m : n.getPairs()) { + m.accept(this, arg); + } + } + } + + @Override public void visit(final NullLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final ObjectCreationExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (final Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getArgs() != null) { + for (final Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getAnonymousClassBody() != null) { + for (final BodyDeclaration member : n.getAnonymousClassBody()) { + member.accept(this, arg); + } + } + } + + @Override public void visit(final PackageDeclaration n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getName().accept(this, arg); + } + + @Override public void visit(final Parameter n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + n.getId().accept(this, arg); + } + + @Override public void visit(final MultiTypeParameter n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + for (final Type type : n.getTypes()) { + type.accept(this, arg); + } + n.getId().accept(this, arg); + } + + @Override public void visit(final PrimitiveType n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final QualifiedNameExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getQualifier().accept(this, arg); + } + + @Override public void visit(final ReferenceType n, final A arg) { + visitComment(n.getComment(), arg); + n.getType().accept(this, arg); + } + + @Override public void visit(final ReturnStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + } + + @Override public void visit(final SingleMemberAnnotationExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getName().accept(this, arg); + n.getMemberValue().accept(this, arg); + } + + @Override public void visit(final StringLiteralExpr n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final SuperExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + } + + @Override public void visit(final SwitchEntryStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getLabel() != null) { + n.getLabel().accept(this, arg); + } + if (n.getStmts() != null) { + for (final Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + } + + @Override public void visit(final SwitchStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getSelector().accept(this, arg); + if (n.getEntries() != null) { + for (final SwitchEntryStmt e : n.getEntries()) { + e.accept(this, arg); + } + } + } + + @Override public void visit(final SynchronizedStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + n.getBlock().accept(this, arg); + } + + @Override public void visit(final ThisExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + } + + @Override public void visit(final ThrowStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + } + + @Override public void visit(final TryStmt n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getResources() != null) { + for (final VariableDeclarationExpr v : n.getResources()) { + v.accept(this, arg); + } + } + n.getTryBlock().accept(this, arg); + if (n.getCatchs() != null) { + for (final CatchClause c : n.getCatchs()) { + c.accept(this, arg); + } + } + if (n.getFinallyBlock() != null) { + n.getFinallyBlock().accept(this, arg); + } + } + + @Override public void visit(final TypeDeclarationStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getTypeDeclaration().accept(this, arg); + } + + @Override public void visit(final TypeParameter n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getTypeBound() != null) { + for (final ClassOrInterfaceType c : n.getTypeBound()) { + c.accept(this, arg); + } + } + } + + @Override public void visit(final UnaryExpr n, final A arg) { + visitComment(n.getComment(), arg); + n.getExpr().accept(this, arg); + } + + @Override public void visit(final UnknownType n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final VariableDeclarationExpr n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getAnnotations() != null) { + for (final AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + for (final VariableDeclarator v : n.getVars()) { + v.accept(this, arg); + } + } + + @Override public void visit(final VariableDeclarator n, final A arg) { + visitComment(n.getComment(), arg); + n.getId().accept(this, arg); + if (n.getInit() != null) { + n.getInit().accept(this, arg); + } + } + + @Override public void visit(final VariableDeclaratorId n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final VoidType n, final A arg) { + visitComment(n.getComment(), arg); + } + + @Override public void visit(final WhileStmt n, final A arg) { + visitComment(n.getComment(), arg); + n.getCondition().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override public void visit(final WildcardType n, final A arg) { + visitComment(n.getComment(), arg); + if (n.getExtends() != null) { + n.getExtends().accept(this, arg); + } + if (n.getSuper() != null) { + n.getSuper().accept(this, arg); + } + } @Override public void visit(LambdaExpr n, final A arg) { @@ -920,8 +839,8 @@ public void visit(TypeExpr n, final A arg) { } private void visitComment(final Comment n, final A arg) { - if (n != null) { - n.accept(this, arg); - } - } + if (n != null) { + n.accept(this, arg); + } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java index 545a086d1a..e98eb10b94 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java @@ -183,21 +183,21 @@ public SymbolReference solve(ExplicitConstructorInvocati return res; } - public SymbolReference solve(ThisExpr node) { + public SymbolReference solve(ThisExpr node){ // If 'this' is prefixed by a class eg. MyClass.this - if (node.getClassExpr().isPresent()) { + if (node.getClassExpr().isPresent()){ // Get the class name String className = node.getClassExpr().get().toString(); // Attempt to resolve using a typeSolver SymbolReference clazz = typeSolver.tryToSolveType(className); - if (clazz.isSolved()) { + if (clazz.isSolved()){ return SymbolReference.solved(clazz.getCorrespondingDeclaration()); } // Attempt to resolve locally in Compilation unit Optional cu = node.getAncestorOfType(CompilationUnit.class); - if (cu.isPresent()) { + if (cu.isPresent()){ Optional classByName = cu.get().getClassByName(className); - if (classByName.isPresent()) { + if (classByName.isPresent()){ return SymbolReference.solved(getTypeDeclaration(classByName.get())); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java index 2b3ad3edfa..132c7527d4 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java @@ -76,7 +76,7 @@ public static Context getContext(Node node, TypeSolver typeSolver) { } else if (node instanceof CatchClause) { return new CatchClauseContext((CatchClause) node, typeSolver); } else if (node instanceof ObjectCreationExpr && - ((ObjectCreationExpr) node).getAnonymousClassBody().isPresent()) { + ((ObjectCreationExpr) node).getAnonymousClassBody().isPresent()) { return new AnonymousClassDeclarationContext((ObjectCreationExpr) node, typeSolver); } else { if (node instanceof NameExpr) { @@ -86,7 +86,7 @@ public static Context getContext(Node node, TypeSolver typeSolver) { } } final Node parentNode = getParentNode(node); - if (parentNode instanceof ObjectCreationExpr && node == ((ObjectCreationExpr) parentNode).getType()) { + if(parentNode instanceof ObjectCreationExpr && node == ((ObjectCreationExpr) parentNode).getType()) { return getContext(getParentNode(parentNode), typeSolver); } return getContext(parentNode, typeSolver); @@ -114,7 +114,7 @@ public static SymbolDeclarator getSymbolDeclarator(Node node, TypeSolver typeSol return new NoSymbolDeclarator(node, typeSolver); } } - + public static ReferenceTypeDeclaration toTypeDeclaration(Node node, TypeSolver typeSolver) { if (node instanceof ClassOrInterfaceDeclaration) { if (((ClassOrInterfaceDeclaration) node).isInterface()) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java index ec1d4b4aa7..2048e6cea3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java @@ -186,14 +186,14 @@ public Type visit(FieldAccessExpr node, Boolean solveLambdas) { return solveDotExpressionType( typeAccessedStatically.getCorrespondingDeclaration().asReferenceType(), node); } - } else if (node.getScope() instanceof ThisExpr) { + } else if (node.getScope()instanceof ThisExpr){ // If we are accessing through a 'this' expression, first resolve the type // corresponding to 'this' SymbolReference solve = facade.solve((ThisExpr) node.getScope()); // If found get it's declaration and get the field in there - if (solve.isSolved()) { + if (solve.isSolved()){ TypeDeclaration correspondingDeclaration = solve.getCorrespondingDeclaration(); - if (correspondingDeclaration instanceof ReferenceTypeDeclaration) { + if (correspondingDeclaration instanceof ReferenceTypeDeclaration){ return solveDotExpressionType(correspondingDeclaration.asReferenceType(), node); } } @@ -297,19 +297,19 @@ public Type visit(ObjectCreationExpr node, Boolean solveLambdas) { @Override public Type visit(ThisExpr node, Boolean solveLambdas) { // If 'this' is prefixed by a class eg. MyClass.this - if (node.getClassExpr().isPresent()) { + if (node.getClassExpr().isPresent()){ // Get the class name String className = node.getClassExpr().get().toString(); // Attempt to resolve using a typeSolver SymbolReference clazz = typeSolver.tryToSolveType(className); - if (clazz.isSolved()) { - return new ReferenceTypeImpl(clazz.getCorrespondingDeclaration(), typeSolver); + if (clazz.isSolved()){ + return new ReferenceTypeImpl(clazz.getCorrespondingDeclaration(),typeSolver); } // Attempt to resolve locally in Compilation unit Optional cu = node.getAncestorOfType(CompilationUnit.class); - if (cu.isPresent()) { + if (cu.isPresent()){ Optional classByName = cu.get().getClassByName(className); - if (classByName.isPresent()) { + if (classByName.isPresent()){ return new ReferenceTypeImpl(facade.getTypeDeclaration(classByName.get()), typeSolver); } } @@ -379,7 +379,7 @@ public Type visit(LambdaExpr node, Boolean solveLambdas) { NameExpr nameExpr = (NameExpr) scope; try { SymbolReference type = JavaParserFactory.getContext(nameExpr, typeSolver).solveType(nameExpr.getName().getId(), typeSolver); - if (type.isSolved()) { + if (type.isSolved()){ staticCall = true; } } catch (Exception e) { @@ -419,7 +419,7 @@ public Type visit(LambdaExpr node, Boolean solveLambdas) { Type actualType; if (lambdaExpr.getBody() instanceof ExpressionStmt) { - actualType = facade.getType(((ExpressionStmt) lambdaExpr.getBody()).getExpression()); + actualType = facade.getType(((ExpressionStmt)lambdaExpr.getBody()).getExpression()); } else if (lambdaExpr.getBody() instanceof BlockStmt) { BlockStmt blockStmt = (BlockStmt) lambdaExpr.getBody(); NodeList statements = blockStmt.getStatements(); @@ -427,20 +427,20 @@ public Type visit(LambdaExpr node, Boolean solveLambdas) { // Get all the return statements in the lambda block List returnStmts = blockStmt.getNodesByType(ReturnStmt.class); - if (returnStmts.size() > 0) { + if (returnStmts.size() > 0){ actualType = returnStmts.stream() - .map(returnStmt -> { - Optional expression = returnStmt.getExpression(); - if (expression.isPresent()) { - return facade.getType(expression.get()); - } else { - return VoidType.INSTANCE; - } - }) - .filter(x -> x != null && !x.isVoid() && !x.isNull()) - .findFirst() - .orElse(VoidType.INSTANCE); + .map(returnStmt -> { + Optional expression = returnStmt.getExpression(); + if (expression.isPresent()){ + return facade.getType(expression.get()); + } else{ + return VoidType.INSTANCE; + } + }) + .filter(x -> x != null && !x.isVoid() && !x.isNull()) + .findFirst() + .orElse(VoidType.INSTANCE); } else { return VoidType.INSTANCE; @@ -460,7 +460,7 @@ public Type visit(LambdaExpr node, Boolean solveLambdas) { // if the functional method returns void anyway // we don't need to bother inferring types - if (!(formalType instanceof VoidType)) { + if (!(formalType instanceof VoidType)){ lambdaCtx.addPair(result, functionalTypeWithReturn); result = lambdaCtx.resolve(lambdaCtx.addSingle(result)); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/UnsolvedSymbolException.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/UnsolvedSymbolException.java index 760f2ed5f7..21dcf7c9e3 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/UnsolvedSymbolException.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/UnsolvedSymbolException.java @@ -21,6 +21,7 @@ /** * @author Federico Tomassetti + * * @deprecated Use {@link com.github.javaparser.symbolsolver.model.resolution.UnsolvedSymbolException} instead */ // Use the one in model instead diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java index 63fdce80eb..7a93633f4d 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java @@ -77,7 +77,7 @@ public final SymbolReference solveType(String name, TypeSolver } } } - + // Local types List localTypes = wrappedNode.getChildNodesByType( com.github.javaparser.ast.body.TypeDeclaration.class); @@ -89,7 +89,7 @@ public final SymbolReference solveType(String name, TypeSolver name.substring(localType.getName().getId().length() + 1), typeSolver); } } - + return getParent().solveType(name, typeSolver); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java index 6843b3501e..3eef0c9b11 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java @@ -7,7 +7,7 @@ import com.github.javaparser.symbolsolver.javaparsermodel.JavaParserFacade; import com.github.javaparser.symbolsolver.javaparsermodel.JavaParserFactory; import com.github.javaparser.symbolsolver.javaparsermodel.declarations - .JavaParserAnonymousClassDeclaration; + .JavaParserAnonymousClassDeclaration; import com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserTypeParameter; import com.github.javaparser.symbolsolver.model.declarations.MethodDeclaration; import com.github.javaparser.symbolsolver.model.declarations.TypeDeclaration; @@ -29,158 +29,158 @@ */ public class AnonymousClassDeclarationContext extends AbstractJavaParserContext { - private final JavaParserAnonymousClassDeclaration myDeclaration = - new JavaParserAnonymousClassDeclaration(wrappedNode, typeSolver); - - public AnonymousClassDeclarationContext(ObjectCreationExpr node, TypeSolver typeSolver) { - super(node, typeSolver); - Preconditions.checkArgument(node.getAnonymousClassBody().isPresent(), - "An anonymous class must have a body"); - } - - @Override - public SymbolReference solveMethod(String name, - List argumentsTypes, - boolean staticOnly, - TypeSolver typeSolver) { - List candidateMethods = - myDeclaration - .getDeclaredMethods() - .stream() - .filter(m -> m.getName().equals(name) && (!staticOnly || m.isStatic())) - .collect(Collectors.toList()); - - if (!Object.class.getCanonicalName().equals(myDeclaration.getQualifiedName())) { - for (ReferenceType ancestor : myDeclaration.getAncestors()) { - SymbolReference res = - MethodResolutionLogic.solveMethodInType(ancestor.getTypeDeclaration(), - name, - argumentsTypes, - staticOnly, - typeSolver); - // consider methods from superclasses and only default methods from interfaces : - // not true, we should keep abstract as a valid candidate - // abstract are removed in MethodResolutionLogic.isApplicable is necessary - if (res.isSolved()) { - candidateMethods.add(res.getCorrespondingDeclaration()); - } - } - } - - // We want to avoid infinite recursion when a class is using its own method - // see issue #75 - if (candidateMethods.isEmpty()) { - SymbolReference parentSolution = - getParent().solveMethod(name, argumentsTypes, staticOnly, typeSolver); - if (parentSolution.isSolved()) { - candidateMethods.add(parentSolution.getCorrespondingDeclaration()); - } + private final JavaParserAnonymousClassDeclaration myDeclaration = + new JavaParserAnonymousClassDeclaration(wrappedNode, typeSolver); + + public AnonymousClassDeclarationContext(ObjectCreationExpr node, TypeSolver typeSolver) { + super(node, typeSolver); + Preconditions.checkArgument(node.getAnonymousClassBody().isPresent(), + "An anonymous class must have a body"); + } + + @Override + public SymbolReference solveMethod(String name, + List argumentsTypes, + boolean staticOnly, + TypeSolver typeSolver) { + List candidateMethods = + myDeclaration + .getDeclaredMethods() + .stream() + .filter(m -> m.getName().equals(name) && (!staticOnly || m.isStatic())) + .collect(Collectors.toList()); + + if (!Object.class.getCanonicalName().equals(myDeclaration.getQualifiedName())) { + for (ReferenceType ancestor : myDeclaration.getAncestors()) { + SymbolReference res = + MethodResolutionLogic.solveMethodInType(ancestor.getTypeDeclaration(), + name, + argumentsTypes, + staticOnly, + typeSolver); + // consider methods from superclasses and only default methods from interfaces : + // not true, we should keep abstract as a valid candidate + // abstract are removed in MethodResolutionLogic.isApplicable is necessary + if (res.isSolved()) { + candidateMethods.add(res.getCorrespondingDeclaration()); } + } + } - // if is interface and candidate method list is empty, we should check the Object Methods - if (candidateMethods.isEmpty() && myDeclaration.getSuperTypeDeclaration().isInterface()) { - SymbolReference res = - MethodResolutionLogic.solveMethodInType(new ReflectionClassDeclaration(Object.class, - typeSolver), - name, - argumentsTypes, - false, - typeSolver); - if (res.isSolved()) { - candidateMethods.add(res.getCorrespondingDeclaration()); - } - } + // We want to avoid infinite recursion when a class is using its own method + // see issue #75 + if (candidateMethods.isEmpty()) { + SymbolReference parentSolution = + getParent().solveMethod(name, argumentsTypes, staticOnly, typeSolver); + if (parentSolution.isSolved()) { + candidateMethods.add(parentSolution.getCorrespondingDeclaration()); + } + } - return MethodResolutionLogic.findMostApplicable(candidateMethods, - name, - argumentsTypes, - typeSolver); + // if is interface and candidate method list is empty, we should check the Object Methods + if (candidateMethods.isEmpty() && myDeclaration.getSuperTypeDeclaration().isInterface()) { + SymbolReference res = + MethodResolutionLogic.solveMethodInType(new ReflectionClassDeclaration(Object.class, + typeSolver), + name, + argumentsTypes, + false, + typeSolver); + if (res.isSolved()) { + candidateMethods.add(res.getCorrespondingDeclaration()); + } } - @Override - public SymbolReference solveType(String name, TypeSolver typeSolver) { - List typeDeclarations = - myDeclaration - .findMembersOfKind(com.github.javaparser.ast.body.TypeDeclaration.class); - - Optional> exactMatch = - typeDeclarations - .stream() - .filter(internalType -> internalType.getName().getId().equals(name)) - .findFirst() - .map(internalType -> - SymbolReference.solved( - JavaParserFacade.get(typeSolver).getTypeDeclaration(internalType))); - - if (exactMatch.isPresent()) { - return exactMatch.get(); - } + return MethodResolutionLogic.findMostApplicable(candidateMethods, + name, + argumentsTypes, + typeSolver); + } + + @Override + public SymbolReference solveType(String name, TypeSolver typeSolver) { + List typeDeclarations = + myDeclaration + .findMembersOfKind(com.github.javaparser.ast.body.TypeDeclaration.class); + + Optional> exactMatch = + typeDeclarations + .stream() + .filter(internalType -> internalType.getName().getId().equals(name)) + .findFirst() + .map(internalType -> + SymbolReference.solved( + JavaParserFacade.get(typeSolver).getTypeDeclaration(internalType))); + + if(exactMatch.isPresent()){ + return exactMatch.get(); + } - Optional> recursiveMatch = - typeDeclarations - .stream() - .filter(internalType -> name.startsWith(String.format("%s.", internalType.getName()))) - .findFirst() - .map(internalType -> - JavaParserFactory - .getContext(internalType, typeSolver) - .solveType(name.substring(internalType.getName().getId().length() + 1), - typeSolver)); - - if (recursiveMatch.isPresent()) { - return recursiveMatch.get(); - } + Optional> recursiveMatch = + typeDeclarations + .stream() + .filter(internalType -> name.startsWith(String.format("%s.", internalType.getName()))) + .findFirst() + .map(internalType -> + JavaParserFactory + .getContext(internalType, typeSolver) + .solveType(name.substring(internalType.getName().getId().length() + 1), + typeSolver)); + + if (recursiveMatch.isPresent()) { + return recursiveMatch.get(); + } - Optional> typeArgumentsMatch = - wrappedNode - .getTypeArguments() - .map(nodes -> - ((NodeWithTypeArguments) nodes).getTypeArguments() - .orElse(new NodeList<>())) - .orElse(new NodeList<>()) - .stream() - .filter(type -> type.toString().equals(name)) - .findFirst() - .map(matchingType -> - SymbolReference.solved( - new JavaParserTypeParameter(new TypeParameter(matchingType.toString()), - typeSolver))); - - if (typeArgumentsMatch.isPresent()) { - return typeArgumentsMatch.get(); - } + Optional> typeArgumentsMatch = + wrappedNode + .getTypeArguments() + .map(nodes -> + ((NodeWithTypeArguments) nodes).getTypeArguments() + .orElse(new NodeList<>())) + .orElse(new NodeList<>()) + .stream() + .filter(type -> type.toString().equals(name)) + .findFirst() + .map(matchingType -> + SymbolReference.solved( + new JavaParserTypeParameter(new TypeParameter(matchingType.toString()), + typeSolver))); + + if (typeArgumentsMatch.isPresent()) { + return typeArgumentsMatch.get(); + } - // Look into extended classes and implemented interfaces - for (ReferenceType ancestor : myDeclaration.getAncestors()) { - // look at names of extended classes and implemented interfaces (this may not be important because they are checked in CompilationUnitContext) - if (ancestor.getTypeDeclaration().getName().equals(name)) { - return SymbolReference.solved(ancestor.getTypeDeclaration()); - } - // look into internal types of extended classes and implemented interfaces - try { - for (TypeDeclaration internalTypeDeclaration : ancestor.getTypeDeclaration().internalTypes()) { - if (internalTypeDeclaration.getName().equals(name)) { - return SymbolReference.solved(internalTypeDeclaration); - } - } - } catch (UnsupportedOperationException e) { - // just continue using the next ancestor - } + // Look into extended classes and implemented interfaces + for (ReferenceType ancestor : myDeclaration.getAncestors()) { + // look at names of extended classes and implemented interfaces (this may not be important because they are checked in CompilationUnitContext) + if (ancestor.getTypeDeclaration().getName().equals(name)) { + return SymbolReference.solved(ancestor.getTypeDeclaration()); + } + // look into internal types of extended classes and implemented interfaces + try { + for (TypeDeclaration internalTypeDeclaration : ancestor.getTypeDeclaration().internalTypes()) { + if (internalTypeDeclaration.getName().equals(name)) { + return SymbolReference.solved(internalTypeDeclaration); + } } - - return getParent().solveType(name, typeSolver); + } catch (UnsupportedOperationException e) { + // just continue using the next ancestor + } } + + return getParent().solveType(name, typeSolver); + } - @Override - public SymbolReference solveSymbol(String name, - TypeSolver typeSolver) { - Preconditions.checkArgument(typeSolver != null); - - if (myDeclaration.hasVisibleField(name)) { - return SymbolReference.solved(myDeclaration.getVisibleField(name)); - } + @Override + public SymbolReference solveSymbol(String name, + TypeSolver typeSolver) { + Preconditions.checkArgument(typeSolver != null); - return getParent().solveSymbol(name, typeSolver); + if (myDeclaration.hasVisibleField(name)) { + return SymbolReference.solved(myDeclaration.getVisibleField(name)); } + return getParent().solveSymbol(name, typeSolver); + } + } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java index a6922018ea..d7c92b93d6 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java @@ -80,15 +80,15 @@ public SymbolReference solveSymbol(String name, Type // Look among statically imported values if (wrappedNode.getImports() != null) { for (ImportDeclaration importDecl : wrappedNode.getImports()) { - if (importDecl.isStatic()) { - if (importDecl.isAsterisk()) { + if(importDecl.isStatic()){ + if(importDecl.isAsterisk()) { String qName = importDecl.getNameAsString(); com.github.javaparser.symbolsolver.model.declarations.TypeDeclaration importedType = typeSolver.solveType(qName); SymbolReference ref = new SymbolSolver(typeSolver).solveSymbolInType(importedType, name); if (ref.isSolved()) { return ref; } - } else { + } else{ String whole = importDecl.getNameAsString(); // split in field/method name and type name @@ -226,8 +226,8 @@ private String packageName(String qName) { @Override public SymbolReference solveMethod(String name, List argumentsTypes, boolean staticOnly, TypeSolver typeSolver) { for (ImportDeclaration importDecl : wrappedNode.getImports()) { - if (importDecl.isStatic()) { - if (importDecl.isAsterisk()) { + if(importDecl.isStatic()){ + if(importDecl.isAsterisk()){ String importString = importDecl.getNameAsString(); if (this.wrappedNode.getPackageDeclaration().isPresent() @@ -244,7 +244,7 @@ public SymbolReference solveMethod(String name, List ar if (method.isSolved()) { return method; } - } else { + } else{ String qName = importDecl.getNameAsString(); if (qName.equals(name) || qName.endsWith("." + name)) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java index 8845648e4c..65e4b5ab7e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java @@ -69,14 +69,14 @@ public SymbolReference solveType(String name, TypeSolver typeSo // Look into extended classes and implemented interfaces for (ReferenceType ancestor : this.typeDeclaration.getAncestors()) { - try { - for (TypeDeclaration internalTypeDeclaration : ancestor.getTypeDeclaration().internalTypes()) { - if (internalTypeDeclaration.getName().equals(name)) { - return SymbolReference.solved(internalTypeDeclaration); - } - } - } catch (UnsupportedOperationException e) { - // just continue using the next ancestor + try { + for (TypeDeclaration internalTypeDeclaration : ancestor.getTypeDeclaration().internalTypes()) { + if (internalTypeDeclaration.getName().equals(name)) { + return SymbolReference.solved(internalTypeDeclaration); + } + } + } catch (UnsupportedOperationException e) { + // just continue using the next ancestor } } @@ -86,12 +86,12 @@ public SymbolReference solveType(String name, TypeSolver typeSo public SymbolReference solveMethod(String name, List argumentsTypes, boolean staticOnly, TypeSolver typeSolver) { List candidateMethods = typeDeclaration.getDeclaredMethods().stream() .filter(m -> m.getName().equals(name)) - .filter(m -> !staticOnly || (staticOnly && m.isStatic())) + .filter(m -> !staticOnly || (staticOnly && m.isStatic())) .collect(Collectors.toList()); // We want to avoid infinite recursion in case of Object having Object as ancestor if (!Object.class.getCanonicalName().equals(typeDeclaration.getQualifiedName())) { for (ReferenceType ancestor : typeDeclaration.getAncestors()) { - // Avoid recursion on self + // Avoid recursion on self if (typeDeclaration != ancestor.getTypeDeclaration()) { SymbolReference res = MethodResolutionLogic .solveMethodInType(ancestor.getTypeDeclaration(), name, argumentsTypes, staticOnly, typeSolver); @@ -101,7 +101,7 @@ public SymbolReference solveMethod(String name, List ar if (res.isSolved()) { candidateMethods.add(res.getCorrespondingDeclaration()); } - } + } } } // We want to avoid infinite recursion when a class is using its own method diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java index e7fd29ea9a..02c69ee5de 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java @@ -68,7 +68,7 @@ public Optional solveSymbolAsValue(String name, TypeSolver typeSolver) { // Get the functional method in order for us to resolve it's type arguments properly Optional functionalMethodOpt = FunctionalInterfaceLogic.getFunctionalMethod(lambdaType); - if (functionalMethodOpt.isPresent()) { + if (functionalMethodOpt.isPresent()){ MethodUsage functionalMethod = functionalMethodOpt.get(); InferenceContext inferenceContext = new InferenceContext(MyObjectProvider.INSTANCE); @@ -79,28 +79,26 @@ public Optional solveSymbolAsValue(String name, TypeSolver typeSolver) { // Find the position of this lambda argument boolean found = false; int lambdaParamIndex; - for (lambdaParamIndex = 0; lambdaParamIndex < wrappedNode.getParameters().size(); lambdaParamIndex++) { - if (wrappedNode.getParameter(lambdaParamIndex).getName().getIdentifier().equals(name)) { + for (lambdaParamIndex = 0; lambdaParamIndex < wrappedNode.getParameters().size(); lambdaParamIndex++){ + if (wrappedNode.getParameter(lambdaParamIndex).getName().getIdentifier().equals(name)){ found = true; break; } } - if (!found) { - return Optional.empty(); - } + if (!found) { return Optional.empty(); } // Now resolve the argument type using the inference context Type argType = inferenceContext.resolve(inferenceContext.addSingle(functionalMethod.getParamType(lambdaParamIndex))); LambdaConstraintType conType; - if (argType.isWildcard()) { + if (argType.isWildcard()){ conType = LambdaConstraintType.bound(argType.asWildcard().getBoundedType()); } else { conType = LambdaConstraintType.bound(argType); } Value value = new Value(conType, name); return Optional.of(value); - } else { + } else{ return Optional.empty(); } } else if (getParentNode(wrappedNode) instanceof VariableDeclarator) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java index a387cd7bac..094f29ba4c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java @@ -61,11 +61,11 @@ public MethodCallExprContext(MethodCallExpr wrappedNode, TypeSolver typeSolver) @Override public Optional solveGenericType(String name, TypeSolver typeSolver) { - if (wrappedNode.getScope().isPresent()) { + if(wrappedNode.getScope().isPresent()){ Type typeOfScope = JavaParserFacade.get(typeSolver).getType(wrappedNode.getScope().get()); Optional res = typeOfScope.asReferenceType().getGenericParameterByName(name); return res; - } else { + } else{ return Optional.empty(); } } @@ -190,7 +190,7 @@ public SymbolReference solveMethod(String name, List ar } } return SymbolReference.unsolved(MethodDeclaration.class); - } else if (typeOfScope.isConstraint()) { + } else if (typeOfScope.isConstraint()){ return MethodResolutionLogic.solveMethodInType(typeOfScope.asConstraintType().getBound().asReferenceType().getTypeDeclaration(), name, argumentsTypes, typeSolver); } else { return MethodResolutionLogic.solveMethodInType(typeOfScope.asReferenceType().getTypeDeclaration(), name, argumentsTypes, false, typeSolver); @@ -237,12 +237,12 @@ private Optional solveMethodAsUsage(ReferenceType refType, String n ParameterDeclaration parameter = methodUsage.getDeclaration().getParam(i); Type parameterType = parameter.getType(); if (parameter.isVariadic()) { - parameterType = parameterType.asArrayType().getComponentType(); + parameterType = parameterType.asArrayType().getComponentType(); } inferTypes(argumentsTypes.get(i), parameterType, derivedValues); } - for (Map.Entry entry : derivedValues.entrySet()) { + for (Map.Entry entry : derivedValues.entrySet()){ methodUsage = methodUsage.replaceTypeParameter(entry.getKey(), entry.getValue()); } @@ -265,14 +265,14 @@ private void inferTypes(Type source, Type target, Map Type actualType = - actualParamTypes.get(actualParamTypes.size() - 1).isArray() ? - actualParamTypes.get(actualParamTypes.size() - 1).asArrayType().getComponentType() : - actualParamTypes.get(actualParamTypes.size() - 1); + actualParamTypes.get(actualParamTypes.size() - 1).isArray() ? + actualParamTypes.get(actualParamTypes.size() - 1).asArrayType().getComponentType() : + actualParamTypes.get(actualParamTypes.size() - 1); if (!expectedType.isAssignableBy(actualType)) { for (TypeParameterDeclaration tp : methodUsage.getDeclaration().getTypeParameters()) { expectedType = MethodResolutionLogic.replaceTypeParam(expectedType, tp, typeSolver); @@ -358,11 +358,11 @@ private MethodUsage resolveMethodTypeParameters(MethodUsage methodUsage, List solveMethodAsUsage(Type type, String name, List List findMembersOfKind(final Class memberClass) { - return wrappedNode - .getAnonymousClassBody() - .get() - .stream() - .filter(node -> memberClass.isAssignableFrom(node.getClass())) - .map(node -> (T) node) - .collect(Collectors.toList()); - } - - @Override - protected ReferenceType object() { - return new ReferenceTypeImpl(typeSolver.solveType(Object.class.getCanonicalName()), typeSolver); - } - - @Override - public ReferenceType getSuperClass() { - return new ReferenceTypeImpl(superTypeDeclaration.asReferenceType(), typeSolver); - } - - @Override - public List getInterfaces() { - return - superTypeDeclaration - .asReferenceType().getAncestors() - .stream() - .filter(type -> type.getTypeDeclaration().isInterface()) - .collect(Collectors.toList()); - } - - @Override - public List getConstructors() { - return - findMembersOfKind(com.github.javaparser.ast.body.ConstructorDeclaration.class) - .stream() - .map(ctor -> new JavaParserConstructorDeclaration(this, ctor, typeSolver)) - .collect(Collectors.toList()); - } - - @Override - public AccessLevel accessLevel() { - return AccessLevel.PRIVATE; - } - - @Override - public List getAncestors() { - return - ImmutableList. - builder() - .add(getSuperClass()) - .addAll(superTypeDeclaration.asReferenceType().getAncestors()) - .build(); - } - - @Override - public List getAllFields() { - - List myFields = - findMembersOfKind(com.github.javaparser.ast.body.FieldDeclaration.class) - .stream() - .flatMap(field -> - field.getVariables().stream() - .map(variable -> new JavaParserFieldDeclaration(variable, - typeSolver))) - .collect(Collectors.toList()); - - List superClassFields = - getSuperClass().getTypeDeclaration().getAllFields(); - - List interfaceFields = - getInterfaces().stream() - .flatMap(inteface -> inteface.getTypeDeclaration().getAllFields().stream()) - .collect(Collectors.toList()); - - return - ImmutableList - .builder() - .addAll(myFields) - .addAll(superClassFields) - .addAll(interfaceFields) - .build(); - } - - @Override - public Set getDeclaredMethods() { - return - findMembersOfKind(com.github.javaparser.ast.body.MethodDeclaration.class) - .stream() - .map(method -> new JavaParserMethodDeclaration(method, typeSolver)) - .collect(Collectors.toSet()); - } - - @Override - public boolean isAssignableBy(Type type) { - return false; - } - - @Override - public boolean isAssignableBy(ReferenceTypeDeclaration other) { - return false; - } - - @Override - public boolean hasDirectlyAnnotation(String qualifiedName) { - return false; - } - - @Override - public String getPackageName() { - return Helper.getPackageName(wrappedNode); - } - - @Override - public String getClassName() { - return Helper.getClassName("", wrappedNode); - } - - @Override - public String getQualifiedName() { - String containerName = Helper.containerName(getParentNode(wrappedNode)); - if (containerName.isEmpty()) { - return getName(); - } else { - return containerName + "." + getName(); - } - } - - @Override - public Set internalTypes() { - return - findMembersOfKind(com.github.javaparser.ast.body.TypeDeclaration.class) - .stream() - .map(typeMember -> JavaParserFacade.get(typeSolver).getTypeDeclaration(typeMember)) - .collect(Collectors.toSet()); - } - - @Override - public String getName() { - return name; - } - - @Override - public List getTypeParameters() { - return Lists.newArrayList(); - } - - @Override - public Optional containerType() { - throw new UnsupportedOperationException("containerType is not supported for " + this.getClass().getCanonicalName()); - } + private final TypeSolver typeSolver; + private final ObjectCreationExpr wrappedNode; + private final TypeDeclaration superTypeDeclaration; + private final String name = "Anonymous-" + UUID.randomUUID(); + + public JavaParserAnonymousClassDeclaration(ObjectCreationExpr wrappedNode, + TypeSolver typeSolver) { + this.typeSolver = typeSolver; + this.wrappedNode = wrappedNode; + superTypeDeclaration = + JavaParserFactory.getContext(wrappedNode.getParentNode().get(), typeSolver) + .solveType(wrappedNode.getType().getName().getId(), typeSolver) + .getCorrespondingDeclaration(); + } + + public TypeDeclaration getSuperTypeDeclaration() { + return superTypeDeclaration; + } + + public List findMembersOfKind(final Class memberClass) { + return wrappedNode + .getAnonymousClassBody() + .get() + .stream() + .filter(node -> memberClass.isAssignableFrom(node.getClass())) + .map(node -> (T) node) + .collect(Collectors.toList()); + } + + @Override + protected ReferenceType object() { + return new ReferenceTypeImpl(typeSolver.solveType(Object.class.getCanonicalName()), typeSolver); + } + + @Override + public ReferenceType getSuperClass() { + return new ReferenceTypeImpl(superTypeDeclaration.asReferenceType(), typeSolver); + } + + @Override + public List getInterfaces() { + return + superTypeDeclaration + .asReferenceType().getAncestors() + .stream() + .filter(type -> type.getTypeDeclaration().isInterface()) + .collect(Collectors.toList()); + } + + @Override + public List getConstructors() { + return + findMembersOfKind(com.github.javaparser.ast.body.ConstructorDeclaration.class) + .stream() + .map(ctor -> new JavaParserConstructorDeclaration(this, ctor, typeSolver)) + .collect(Collectors.toList()); + } + + @Override + public AccessLevel accessLevel() { + return AccessLevel.PRIVATE; + } + + @Override + public List getAncestors() { + return + ImmutableList. + builder() + .add(getSuperClass()) + .addAll(superTypeDeclaration.asReferenceType().getAncestors()) + .build(); + } + + @Override + public List getAllFields() { + + List myFields = + findMembersOfKind(com.github.javaparser.ast.body.FieldDeclaration.class) + .stream() + .flatMap(field -> + field.getVariables().stream() + .map(variable -> new JavaParserFieldDeclaration(variable, + typeSolver))) + .collect(Collectors.toList()); + + List superClassFields = + getSuperClass().getTypeDeclaration().getAllFields(); + + List interfaceFields = + getInterfaces().stream() + .flatMap(inteface -> inteface.getTypeDeclaration().getAllFields().stream()) + .collect(Collectors.toList()); + + return + ImmutableList + .builder() + .addAll(myFields) + .addAll(superClassFields) + .addAll(interfaceFields) + .build(); + } + + @Override + public Set getDeclaredMethods() { + return + findMembersOfKind(com.github.javaparser.ast.body.MethodDeclaration.class) + .stream() + .map(method -> new JavaParserMethodDeclaration(method, typeSolver)) + .collect(Collectors.toSet()); + } + + @Override + public boolean isAssignableBy(Type type) { + return false; + } + + @Override + public boolean isAssignableBy(ReferenceTypeDeclaration other) { + return false; + } + + @Override + public boolean hasDirectlyAnnotation(String qualifiedName) { + return false; + } + + @Override + public String getPackageName() { + return Helper.getPackageName(wrappedNode); + } + + @Override + public String getClassName() { + return Helper.getClassName("", wrappedNode); + } + + @Override + public String getQualifiedName() { + String containerName = Helper.containerName(getParentNode(wrappedNode)); + if (containerName.isEmpty()) { + return getName(); + } else { + return containerName + "." + getName(); + } + } + + @Override + public Set internalTypes() { + return + findMembersOfKind(com.github.javaparser.ast.body.TypeDeclaration.class) + .stream() + .map(typeMember -> JavaParserFacade.get(typeSolver).getTypeDeclaration(typeMember)) + .collect(Collectors.toSet()); + } + + @Override + public String getName() { + return name; + } + + @Override + public List getTypeParameters() { + return Lists.newArrayList(); + } + + @Override + public Optional containerType() { + throw new UnsupportedOperationException("containerType is not supported for " + this.getClass().getCanonicalName()); + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java index 7c199f4271..b7acdfd7c0 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java @@ -114,7 +114,7 @@ public List getAllFields() { } ClassDeclaration superclass = (ClassDeclaration) this.getSuperClass().getTypeDeclaration(); - if (superclass != this) + if (superclass!=this) fields.addAll(superclass.getAllFields()); getInterfaces().forEach(interf -> interf.getTypeDeclaration().getAllFields().forEach(f -> { @@ -338,7 +338,7 @@ public Set internalTypes() { Set res = new HashSet<>(); for (BodyDeclaration member : this.wrappedNode.getMembers()) { if (member instanceof com.github.javaparser.ast.body.TypeDeclaration) { - res.add(JavaParserFacade.get(typeSolver).getTypeDeclaration((com.github.javaparser.ast.body.TypeDeclaration) member)); + res.add(JavaParserFacade.get(typeSolver).getTypeDeclaration((com.github.javaparser.ast.body.TypeDeclaration)member)); } } return res; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java index 8144b255ca..1c34e4c114 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java @@ -69,7 +69,7 @@ public String getName() { public com.github.javaparser.ast.body.ConstructorDeclaration getWrappedNode() { return wrappedNode; } - + @Override public AccessLevel accessLevel() { return Helper.toAccessLevel(wrappedNode.getModifiers()); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java index d90bc4e185..fb858f9a46 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java @@ -327,7 +327,7 @@ public Set internalTypes() { Set res = new HashSet<>(); for (BodyDeclaration member : this.wrappedNode.getMembers()) { if (member instanceof com.github.javaparser.ast.body.TypeDeclaration) { - res.add(JavaParserFacade.get(typeSolver).getTypeDeclaration((com.github.javaparser.ast.body.TypeDeclaration) member)); + res.add(JavaParserFacade.get(typeSolver).getTypeDeclaration((com.github.javaparser.ast.body.TypeDeclaration)member)); } } return res; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java index 5f8585e5c7..7c50127bb1 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java @@ -279,7 +279,7 @@ public Set internalTypes() { Set res = new HashSet<>(); for (BodyDeclaration member : this.wrappedNode.getMembers()) { if (member instanceof com.github.javaparser.ast.body.TypeDeclaration) { - res.add(JavaParserFacade.get(typeSolver).getTypeDeclaration((com.github.javaparser.ast.body.TypeDeclaration) member)); + res.add(JavaParserFacade.get(typeSolver).getTypeDeclaration((com.github.javaparser.ast.body.TypeDeclaration)member)); } } return res; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java index 0634b6f9f3..97d1ab67c2 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java @@ -113,7 +113,7 @@ public SymbolReference solveType(String name, TypeSolver typeSo public Optional containerType() { Optional parent = wrappedNode.getParentNode(); - return parent.isPresent() ? + return parent.isPresent() ? Optional.of(JavaParserFactory.toTypeDeclaration(parent.get(), typeSolver)) : Optional.empty(); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java index 1e0c5a956e..07559699f5 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java @@ -119,7 +119,7 @@ public TypeParametrizable getContainer() { if (parentNode instanceof com.github.javaparser.ast.body.ClassOrInterfaceDeclaration) { com.github.javaparser.ast.body.ClassOrInterfaceDeclaration jpTypeDeclaration = (com.github.javaparser.ast.body.ClassOrInterfaceDeclaration) parentNode; return JavaParserFacade.get(typeSolver).getTypeDeclaration(jpTypeDeclaration); - } else if (parentNode instanceof com.github.javaparser.ast.body.ConstructorDeclaration) { + } else if (parentNode instanceof com.github.javaparser.ast.body.ConstructorDeclaration){ com.github.javaparser.ast.body.ConstructorDeclaration jpConstructorDeclaration = (com.github.javaparser.ast.body.ConstructorDeclaration) parentNode; Optional jpTypeDeclaration = jpConstructorDeclaration.getAncestorOfType(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration.class); if (jpTypeDeclaration.isPresent()) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java index d3b81f290a..9fb72da547 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java @@ -175,7 +175,7 @@ public SymbolReference solveMethod(String name, List ar Predicate staticOnlyCheck = m -> !staticOnly || (staticOnly && Modifier.isStatic(m.getModifiers())); for (CtMethod method : ctClass.getDeclaredMethods()) { boolean isSynthetic = method.getMethodInfo().getAttribute(SyntheticAttribute.tag) != null; - boolean isNotBridge = (method.getMethodInfo().getAccessFlags() & AccessFlag.BRIDGE) == 0; + boolean isNotBridge = (method.getMethodInfo().getAccessFlags() & AccessFlag.BRIDGE) == 0; if (method.getName().equals(name) && !isSynthetic && isNotBridge && staticOnlyCheck.test(method)) { candidates.add(new JavassistMethodDeclaration(method, typeSolver)); } @@ -248,7 +248,7 @@ public boolean isTypeParameter() { @Override public List getAllFields() { - return javassistTypeDeclarationAdapter.getDeclaredFields(); + return javassistTypeDeclarationAdapter.getDeclaredFields(); } @Override @@ -339,7 +339,7 @@ public AccessLevel accessLevel() { @Override public List getConstructors() { - return javassistTypeDeclarationAdapter.getConstructors(); + return javassistTypeDeclarationAdapter.getConstructors(); } @Override diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java index b4027581f7..fc16528bc7 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java @@ -28,57 +28,57 @@ */ public class JavassistFactory { - public static Type typeUsageFor(CtClass ctClazz, TypeSolver typeSolver) { - try { - if (ctClazz.isArray()) { - return new ArrayType(typeUsageFor(ctClazz.getComponentType(), typeSolver)); - } else if (ctClazz.isPrimitive()) { - if (ctClazz.getName().equals("void")) { - return VoidType.INSTANCE; - } else { - return PrimitiveType.byName(ctClazz.getName()); - } - } else { - if (ctClazz.isInterface()) { - return new ReferenceTypeImpl(new JavassistInterfaceDeclaration(ctClazz, typeSolver), - typeSolver); - } else if (ctClazz.isEnum()) { - return new ReferenceTypeImpl(new JavassistEnumDeclaration(ctClazz, typeSolver), - typeSolver); - } else { - return new ReferenceTypeImpl(new JavassistClassDeclaration(ctClazz, typeSolver), - typeSolver); - } - } - } catch (NotFoundException e) { - throw new RuntimeException(e); + public static Type typeUsageFor(CtClass ctClazz, TypeSolver typeSolver) { + try { + if (ctClazz.isArray()) { + return new ArrayType(typeUsageFor(ctClazz.getComponentType(), typeSolver)); + } else if (ctClazz.isPrimitive()) { + if (ctClazz.getName().equals("void")) { + return VoidType.INSTANCE; + } else { + return PrimitiveType.byName(ctClazz.getName()); } - } - - public static ReferenceTypeDeclaration toTypeDeclaration(CtClass ctClazz, TypeSolver typeSolver) { + } else { if (ctClazz.isInterface()) { - return new JavassistInterfaceDeclaration(ctClazz, typeSolver); + return new ReferenceTypeImpl(new JavassistInterfaceDeclaration(ctClazz, typeSolver), + typeSolver); } else if (ctClazz.isEnum()) { - return new JavassistEnumDeclaration(ctClazz, typeSolver); - } else if (ctClazz.isAnnotation()) { - throw new UnsupportedOperationException("CtClass of annotation not yet supported"); - } else if (ctClazz.isArray()) { - throw new IllegalArgumentException("This method should not be called passing an array"); + return new ReferenceTypeImpl(new JavassistEnumDeclaration(ctClazz, typeSolver), + typeSolver); } else { - return new JavassistClassDeclaration(ctClazz, typeSolver); + return new ReferenceTypeImpl(new JavassistClassDeclaration(ctClazz, typeSolver), + typeSolver); } + } + } catch (NotFoundException e) { + throw new RuntimeException(e); } + } - static AccessLevel modifiersToAccessLevel(final int modifiers) { - if (Modifier.isPublic(modifiers)) { - return AccessLevel.PUBLIC; - } else if (Modifier.isProtected(modifiers)) { - return AccessLevel.PROTECTED; - } else if (Modifier.isPrivate(modifiers)) { - return AccessLevel.PRIVATE; - } else { - return AccessLevel.PACKAGE_PROTECTED; - } + public static ReferenceTypeDeclaration toTypeDeclaration(CtClass ctClazz, TypeSolver typeSolver) { + if (ctClazz.isInterface()) { + return new JavassistInterfaceDeclaration(ctClazz, typeSolver); + } else if (ctClazz.isEnum()) { + return new JavassistEnumDeclaration(ctClazz, typeSolver); + } else if (ctClazz.isAnnotation()) { + throw new UnsupportedOperationException("CtClass of annotation not yet supported"); + } else if (ctClazz.isArray()) { + throw new IllegalArgumentException("This method should not be called passing an array"); + } else { + return new JavassistClassDeclaration(ctClazz, typeSolver); + } + } + + static AccessLevel modifiersToAccessLevel(final int modifiers) { + if (Modifier.isPublic(modifiers)) { + return AccessLevel.PUBLIC; + } else if (Modifier.isProtected(modifiers)) { + return AccessLevel.PROTECTED; + } else if (Modifier.isPrivate(modifiers)) { + return AccessLevel.PRIVATE; + } else { + return AccessLevel.PACKAGE_PROTECTED; } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java index a63139881c..9570c33d2d 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java @@ -107,7 +107,7 @@ public SymbolReference solveMethod(String name, List ar Predicate staticOnlyCheck = m -> !staticOnly || (staticOnly && Modifier.isStatic(m.getModifiers())); for (CtMethod method : ctClass.getDeclaredMethods()) { boolean isSynthetic = method.getMethodInfo().getAttribute(SyntheticAttribute.tag) != null; - boolean isNotBridge = (method.getMethodInfo().getAccessFlags() & AccessFlag.BRIDGE) == 0; + boolean isNotBridge = (method.getMethodInfo().getAccessFlags() & AccessFlag.BRIDGE) == 0; if (method.getName().equals(name) && !isSynthetic && isNotBridge && staticOnlyCheck.test(method)) { candidates.add(new JavassistMethodDeclaration(method, typeSolver)); } @@ -146,7 +146,7 @@ public boolean isAssignableBy(Type type) { @Override public List getAllFields() { - return javassistTypeDeclarationAdapter.getDeclaredFields(); + return javassistTypeDeclarationAdapter.getDeclaredFields(); } @Override diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java index 3ae8db3a72..7ea5df0694 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java @@ -29,65 +29,65 @@ */ public class JavassistTypeDeclarationAdapter { - private CtClass ctClass; - private TypeSolver typeSolver; + private CtClass ctClass; + private TypeSolver typeSolver; - public JavassistTypeDeclarationAdapter(CtClass ctClass, TypeSolver typeSolver) { - this.ctClass = ctClass; - this.typeSolver = typeSolver; - } + public JavassistTypeDeclarationAdapter(CtClass ctClass, TypeSolver typeSolver) { + this.ctClass = ctClass; + this.typeSolver = typeSolver; + } - public Set getDeclaredMethods() { - return Arrays.stream(ctClass.getDeclaredMethods()) - .map(m -> new JavassistMethodDeclaration(m, typeSolver)).collect(Collectors.toSet()); - } + public Set getDeclaredMethods() { + return Arrays.stream(ctClass.getDeclaredMethods()) + .map(m -> new JavassistMethodDeclaration(m, typeSolver)).collect(Collectors.toSet()); + } - public List getConstructors() { - return Arrays.stream(ctClass.getConstructors()) - .map(m -> new JavassistConstructorDeclaration(m, typeSolver)).collect(Collectors.toList()); - } + public List getConstructors() { + return Arrays.stream(ctClass.getConstructors()) + .map(m -> new JavassistConstructorDeclaration(m, typeSolver)).collect(Collectors.toList()); + } - public List getDeclaredFields() { - List fieldDecls = new ArrayList<>(); - collectDeclaredFields(ctClass, fieldDecls); - return fieldDecls; - } + public List getDeclaredFields() { + List fieldDecls = new ArrayList<>(); + collectDeclaredFields(ctClass, fieldDecls); + return fieldDecls; + } - private void collectDeclaredFields(CtClass ctClass, List fieldDecls) { - if (ctClass != null) { - Arrays.stream(ctClass.getDeclaredFields()) - .forEach(f -> fieldDecls.add(new JavassistFieldDeclaration(f, typeSolver))); - try { - collectDeclaredFields(ctClass.getSuperclass(), fieldDecls); - } catch (NotFoundException e) { - // We'll stop here - } - } + private void collectDeclaredFields(CtClass ctClass, List fieldDecls) { + if (ctClass != null) { + Arrays.stream(ctClass.getDeclaredFields()) + .forEach(f -> fieldDecls.add(new JavassistFieldDeclaration(f, typeSolver))); + try { + collectDeclaredFields(ctClass.getSuperclass(), fieldDecls); + } catch (NotFoundException e) { + // We'll stop here + } } + } - public List getTypeParameters() { - if (null == ctClass.getGenericSignature()) { - return Collections.emptyList(); - } else { - try { - SignatureAttribute.ClassSignature classSignature = - SignatureAttribute.toClassSignature(ctClass.getGenericSignature()); - return Arrays.stream(classSignature.getParameters()) - .map((tp) -> new JavassistTypeParameter(tp, JavassistFactory.toTypeDeclaration(ctClass, typeSolver), typeSolver)) - .collect(Collectors.toList()); - } catch (BadBytecode badBytecode) { - throw new RuntimeException(badBytecode); - } - } + public List getTypeParameters() { + if (null == ctClass.getGenericSignature()) { + return Collections.emptyList(); + } else { + try { + SignatureAttribute.ClassSignature classSignature = + SignatureAttribute.toClassSignature(ctClass.getGenericSignature()); + return Arrays.stream(classSignature.getParameters()) + .map((tp) -> new JavassistTypeParameter(tp, JavassistFactory.toTypeDeclaration(ctClass, typeSolver), typeSolver)) + .collect(Collectors.toList()); + } catch (BadBytecode badBytecode) { + throw new RuntimeException(badBytecode); + } } + } - public Optional containerType() { - try { - return ctClass.getDeclaringClass() == null ? - Optional.empty() : - Optional.of(JavassistFactory.toTypeDeclaration(ctClass.getDeclaringClass(), typeSolver)); - } catch (NotFoundException e) { - throw new RuntimeException(e); - } + public Optional containerType() { + try { + return ctClass.getDeclaringClass() == null ? + Optional.empty() : + Optional.of(JavassistFactory.toTypeDeclaration(ctClass.getDeclaringClass(), typeSolver)); + } catch (NotFoundException e) { + throw new RuntimeException(e); } + } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java index bad2a43493..3ab7ba0efa 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java @@ -130,7 +130,7 @@ static Type signatureTypeToType(SignatureAttribute.Type signatureType, TypeSolve internalNameToCanonicalName(typeName)); return new ReferenceTypeImpl(typeDeclaration, typeParameters, typeSolver); } else if (signatureType instanceof SignatureAttribute.TypeVariable) { - SignatureAttribute.TypeVariable typeVariableSignature = (SignatureAttribute.TypeVariable) signatureType; + SignatureAttribute.TypeVariable typeVariableSignature = (SignatureAttribute.TypeVariable)signatureType; Optional typeParameterDeclarationOpt = typeParametrizable.findTypeParameter(typeVariableSignature.getName()); if (!typeParameterDeclarationOpt.isPresent()) { throw new UnsolvedSymbolException("Unable to solve TypeVariable " + typeVariableSignature); @@ -150,8 +150,8 @@ private static Type objectTypeArgumentToType(SignatureAttribute.ObjectType typeA String typeName = typeArgument.jvmTypeName(); Optional type = getGenericParameterByName(typeName, typeParametrizable); return type.orElseGet(() -> new ReferenceTypeImpl( - typeSolver.solveType(internalNameToCanonicalName(typeName)), - typeSolver)); + typeSolver.solveType(internalNameToCanonicalName(typeName)), + typeSolver)); } private static Optional getGenericParameterByName(String typeName, TypeParametrizable typeParametrizable) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeImpl.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeImpl.java index 5dc4ca2300..8e474fe29f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeImpl.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeImpl.java @@ -118,7 +118,7 @@ public boolean isAssignableBy(Type other) { } } return false; - } else if (other.isConstraint()) { + } else if (other.isConstraint()){ return isAssignableBy(other.asConstraintType().getBound()); } else if (other.isWildcard()) { if (this.getQualifiedName().equals(Object.class.getCanonicalName())) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java index 9c21330a32..7ed5bccb7c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java @@ -180,7 +180,7 @@ public List getConstructors() { .map(m -> new ReflectionConstructorDeclaration(m, typeSolver)) .collect(Collectors.toList()); } - + public Optional containerType() { Class declaringClass = clazz.getDeclaringClass(); return declaringClass == null ? diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java index cebb7c9e6f..c8d920e52f 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java @@ -135,7 +135,7 @@ public SymbolReference solveMethod(String name, List ar List methods = new ArrayList<>(); Predicate staticFilter = m -> !staticOnly || (staticOnly && Modifier.isStatic(m.getModifiers())); for (Method method : Arrays.stream(clazz.getDeclaredMethods()).filter((m) -> m.getName().equals(name)).filter(staticFilter) - .sorted(new MethodComparator()).collect(Collectors.toList())) { + .sorted(new MethodComparator()).collect(Collectors.toList())) { if (method.isBridge() || method.isSynthetic()) continue; MethodDeclaration methodDeclaration = new ReflectionMethodDeclaration(method, typeSolver); methods.add(methodDeclaration); @@ -323,7 +323,7 @@ public List getConstructors() { public Optional containerType() { return reflectionClassAdapter.containerType(); } - + @Override public Set internalTypes() { return Arrays.stream(this.clazz.getDeclaredClasses()) diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java index 448cc828a4..0a150e9519 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java @@ -33,159 +33,159 @@ */ public class ReflectionEnumDeclaration extends AbstractTypeDeclaration implements EnumDeclaration { - /// - /// Fields - /// - - private Class clazz; - private TypeSolver typeSolver; - private ReflectionClassAdapter reflectionClassAdapter; - - /// - /// Constructors - /// - - public ReflectionEnumDeclaration(Class clazz, TypeSolver typeSolver) { - if (clazz == null) { - throw new IllegalArgumentException("Class should not be null"); - } - if (clazz.isInterface()) { - throw new IllegalArgumentException("Class should not be an interface"); - } - if (clazz.isPrimitive()) { - throw new IllegalArgumentException("Class should not represent a primitive class"); - } - if (clazz.isArray()) { - throw new IllegalArgumentException("Class should not be an array"); + /// + /// Fields + /// + + private Class clazz; + private TypeSolver typeSolver; + private ReflectionClassAdapter reflectionClassAdapter; + + /// + /// Constructors + /// + + public ReflectionEnumDeclaration(Class clazz, TypeSolver typeSolver) { + if (clazz == null) { + throw new IllegalArgumentException("Class should not be null"); + } + if (clazz.isInterface()) { + throw new IllegalArgumentException("Class should not be an interface"); + } + if (clazz.isPrimitive()) { + throw new IllegalArgumentException("Class should not represent a primitive class"); + } + if (clazz.isArray()) { + throw new IllegalArgumentException("Class should not be an array"); + } + if (!clazz.isEnum()) { + throw new IllegalArgumentException("Class should be an enum"); + } + this.clazz = clazz; + this.typeSolver = typeSolver; + this.reflectionClassAdapter = new ReflectionClassAdapter(clazz, typeSolver, this); + } + + /// + /// Public methods + /// + + @Override + public AccessLevel accessLevel() { + return ReflectionFactory.modifiersToAccessLevel(this.clazz.getModifiers()); + } + + @Override + public Optional containerType() { + return reflectionClassAdapter.containerType(); + } + + @Override + public String getPackageName() { + if (clazz.getPackage() != null) { + return clazz.getPackage().getName(); + } + return null; + } + + @Override + public String getClassName() { + String canonicalName = clazz.getCanonicalName(); + if (canonicalName != null && getPackageName() != null) { + return canonicalName.substring(getPackageName().length() + 1, canonicalName.length()); + } + return null; + } + + @Override + public String getQualifiedName() { + return clazz.getCanonicalName(); + } + + @Override + public List getAncestors() { + return reflectionClassAdapter.getAncestors(); + } + + @Override + public FieldDeclaration getField(String name) { + return reflectionClassAdapter.getField(name); + } + + @Override + public boolean hasField(String name) { + return reflectionClassAdapter.hasField(name); + } + + @Override + public List getAllFields() { + return reflectionClassAdapter.getAllFields(); + } + + @Override + public Set getDeclaredMethods() { + return reflectionClassAdapter.getDeclaredMethods(); + } + + @Override + public boolean isAssignableBy(Type type) { + return reflectionClassAdapter.isAssignableBy(type); + } + + @Override + public boolean isAssignableBy(ReferenceTypeDeclaration other) { + return isAssignableBy(new ReferenceTypeImpl(other, typeSolver)); + } + + @Override + public boolean hasDirectlyAnnotation(String qualifiedName) { + return reflectionClassAdapter.hasDirectlyAnnotation(qualifiedName); + } + + @Override + public String getName() { + return clazz.getSimpleName(); + } + + @Override + public List getTypeParameters() { + return reflectionClassAdapter.getTypeParameters(); + } + + public SymbolReference solveMethod(String name, List parameterTypes, boolean staticOnly) { + return ReflectionMethodResolutionLogic.solveMethod(name, parameterTypes, staticOnly, + typeSolver,this, clazz); + } + + public Optional solveMethodAsUsage(String name, List parameterTypes, TypeSolver typeSolver, Context invokationContext, List typeParameterValues) { + Optional res = ReflectionMethodResolutionLogic.solveMethodAsUsage(name, parameterTypes, typeSolver, invokationContext, + typeParameterValues, this, clazz); + if (res.isPresent()) { + // We have to replace method type typeParametersValues here + InferenceContext inferenceContext = new InferenceContext(MyObjectProvider.INSTANCE); + MethodUsage methodUsage = res.get(); + int i = 0; + List parameters = new LinkedList<>(); + for (Type actualType : parameterTypes) { + Type formalType = methodUsage.getParamType(i); + // We need to replace the class type typeParametersValues (while we derive the method ones) + + parameters.add(inferenceContext.addPair(formalType, actualType)); + i++; } - if (!clazz.isEnum()) { - throw new IllegalArgumentException("Class should be an enum"); - } - this.clazz = clazz; - this.typeSolver = typeSolver; - this.reflectionClassAdapter = new ReflectionClassAdapter(clazz, typeSolver, this); - } - - /// - /// Public methods - /// - - @Override - public AccessLevel accessLevel() { - return ReflectionFactory.modifiersToAccessLevel(this.clazz.getModifiers()); - } - - @Override - public Optional containerType() { - return reflectionClassAdapter.containerType(); - } - - @Override - public String getPackageName() { - if (clazz.getPackage() != null) { - return clazz.getPackage().getName(); - } - return null; - } - - @Override - public String getClassName() { - String canonicalName = clazz.getCanonicalName(); - if (canonicalName != null && getPackageName() != null) { - return canonicalName.substring(getPackageName().length() + 1, canonicalName.length()); - } - return null; - } - - @Override - public String getQualifiedName() { - return clazz.getCanonicalName(); - } - - @Override - public List getAncestors() { - return reflectionClassAdapter.getAncestors(); - } - - @Override - public FieldDeclaration getField(String name) { - return reflectionClassAdapter.getField(name); - } - - @Override - public boolean hasField(String name) { - return reflectionClassAdapter.hasField(name); - } - - @Override - public List getAllFields() { - return reflectionClassAdapter.getAllFields(); - } - - @Override - public Set getDeclaredMethods() { - return reflectionClassAdapter.getDeclaredMethods(); - } - - @Override - public boolean isAssignableBy(Type type) { - return reflectionClassAdapter.isAssignableBy(type); - } - - @Override - public boolean isAssignableBy(ReferenceTypeDeclaration other) { - return isAssignableBy(new ReferenceTypeImpl(other, typeSolver)); - } - - @Override - public boolean hasDirectlyAnnotation(String qualifiedName) { - return reflectionClassAdapter.hasDirectlyAnnotation(qualifiedName); - } - - @Override - public String getName() { - return clazz.getSimpleName(); - } - - @Override - public List getTypeParameters() { - return reflectionClassAdapter.getTypeParameters(); - } - - public SymbolReference solveMethod(String name, List parameterTypes, boolean staticOnly) { - return ReflectionMethodResolutionLogic.solveMethod(name, parameterTypes, staticOnly, - typeSolver, this, clazz); - } - - public Optional solveMethodAsUsage(String name, List parameterTypes, TypeSolver typeSolver, Context invokationContext, List typeParameterValues) { - Optional res = ReflectionMethodResolutionLogic.solveMethodAsUsage(name, parameterTypes, typeSolver, invokationContext, - typeParameterValues, this, clazz); - if (res.isPresent()) { - // We have to replace method type typeParametersValues here - InferenceContext inferenceContext = new InferenceContext(MyObjectProvider.INSTANCE); - MethodUsage methodUsage = res.get(); - int i = 0; - List parameters = new LinkedList<>(); - for (Type actualType : parameterTypes) { - Type formalType = methodUsage.getParamType(i); - // We need to replace the class type typeParametersValues (while we derive the method ones) - - parameters.add(inferenceContext.addPair(formalType, actualType)); - i++; + try { + Type returnType = inferenceContext.addSingle(methodUsage.returnType()); + for (int j=0;j solveMethod(String name, List parameterTypes, boolean staticOnly) { return ReflectionMethodResolutionLogic.solveMethod(name, parameterTypes, staticOnly, - typeSolver, this, clazz); + typeSolver,this, clazz); } @Override @@ -149,7 +149,7 @@ public Optional solveMethodAsUsage(String name, List paramete } try { Type returnType = inferenceContext.addSingle(methodUsage.returnType()); - for (int j = 0; j < parameters.size(); j++) { + for (int j=0;j getInterfacesExtended() { } return res; } - + @Override public Optional containerType() { return reflectionClassAdapter.containerType(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java index e8911882b6..3838bfdb52 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java @@ -44,12 +44,11 @@ class ReflectionMethodResolutionLogic { static SymbolReference solveMethod(String name, List parameterTypes, boolean staticOnly, TypeSolver typeSolver, ReferenceTypeDeclaration scopeType, - Class clazz) { + Class clazz){ List methods = new ArrayList<>(); Predicate staticOnlyCheck = m -> !staticOnly || (staticOnly && Modifier.isStatic(m.getModifiers())); for (Method method : clazz.getMethods()) { - if (method.isBridge() || method.isSynthetic() || !method.getName().equals(name) || !staticOnlyCheck.test(method)) - continue; + if (method.isBridge() || method.isSynthetic() || !method.getName().equals(name)|| !staticOnlyCheck.test(method)) continue; MethodDeclaration methodDeclaration = new ReflectionMethodDeclaration(method, typeSolver); methods.add(methodDeclaration); } @@ -61,7 +60,7 @@ static SymbolReference solveMethod(String name, List pa } } - if (scopeType.getAncestors().isEmpty()) { + if (scopeType.getAncestors().isEmpty()){ ReferenceTypeImpl objectClass = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver); SymbolReference ref = MethodResolutionLogic.solveMethodInType(objectClass.getTypeDeclaration(), name, parameterTypes, staticOnly, typeSolver); if (ref.isSolved()) { @@ -94,16 +93,16 @@ static Optional solveMethodAsUsage(String name, List argument } - for (ReferenceType ancestor : scopeType.getAncestors()) { + for(ReferenceType ancestor : scopeType.getAncestors()){ SymbolReference ref = MethodResolutionLogic.solveMethodInType(ancestor.getTypeDeclaration(), name, argumentsTypes, typeSolver); - if (ref.isSolved()) { + if (ref.isSolved()){ MethodDeclaration correspondingDeclaration = ref.getCorrespondingDeclaration(); MethodUsage methodUsage = replaceParams(typeParameterValues, ancestor.getTypeDeclaration(), correspondingDeclaration); methods.add(methodUsage); } } - if (scopeType.getAncestors().isEmpty()) { + if (scopeType.getAncestors().isEmpty()){ ReferenceTypeImpl objectClass = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver); SymbolReference ref = MethodResolutionLogic.solveMethodInType(objectClass.getTypeDeclaration(), name, argumentsTypes, typeSolver); if (ref.isSolved()) { @@ -129,7 +128,7 @@ private static MethodUsage replaceParams(List typeParameterValues, Referen int i = 0; // Only replace if we have enough values provided - if (typeParameterValues.size() == typeParametrizable.getTypeParameters().size()) { + if (typeParameterValues.size() == typeParametrizable.getTypeParameters().size()){ for (TypeParameterDeclaration tp : typeParametrizable.getTypeParameters()) { methodUsage = methodUsage.replaceTypeParameter(tp, typeParameterValues.get(i)); i++; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java index 5e9ddc4ec6..d553b6eded 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java @@ -102,7 +102,7 @@ public String getContainerId() { return ((MethodLikeDeclaration) container).getQualifiedSignature(); } } - + @Override public TypeParametrizable getContainer() { return this.container; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/MethodResolutionLogic.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/MethodResolutionLogic.java index 931873957e..f78dfa7c0e 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/MethodResolutionLogic.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/MethodResolutionLogic.java @@ -90,7 +90,7 @@ private static boolean isApplicable(MethodDeclaration method, String name, List< } // else it is already assignable, nothing to do } else { if (pos > argumentsTypes.size()) { - return false; + return false; } argumentsTypes = groupVariadicParamValues(argumentsTypes, pos, method.getLastParam().getType()); } @@ -183,7 +183,7 @@ private static boolean isAssignableMatchTypeParametersMatchingQName(ReferenceTyp // In the case of nested parameterizations eg. List <-> List // we should peel off one layer and ensure R <-> Integer - if (expectedParam.isReferenceType() && actualParam.isReferenceType()) { + if (expectedParam.isReferenceType() && actualParam.isReferenceType()){ ReferenceType r1 = expectedParam.asReferenceType(); ReferenceType r2 = actualParam.asReferenceType(); @@ -278,7 +278,7 @@ public static boolean isApplicable(MethodUsage method, String name, List a List typeParameters = method.getDeclaration().getTypeParameters(); typeParameters.addAll(method.declaringType().getTypeParameters()); - if (expectedType.describe().equals(actualType.describe())) { + if (expectedType.describe().equals(actualType.describe())){ return true; } @@ -292,7 +292,7 @@ public static boolean isApplicable(MethodUsage method, String name, List a inferTypes(argumentsTypes.get(j), parameterType, derivedValues); } - for (Map.Entry entry : derivedValues.entrySet()) { + for (Map.Entry entry : derivedValues.entrySet()){ TypeParameterDeclaration tp = entry.getKey(); expectedTypeWithInference = expectedTypeWithInference.replaceTypeVariables(tp, entry.getValue()); } @@ -385,26 +385,26 @@ public static SymbolReference findMostApplicable(List 1) { - List nullParamIndexes = new ArrayList<>(); - for (int i = 0; i < argumentsTypes.size(); i++) { - if (argumentsTypes.get(i).isNull()) { - nullParamIndexes.add(i); + List nullParamIndexes = new ArrayList<>(); + for (int i = 0; i < argumentsTypes.size(); i++) { + if (argumentsTypes.get(i).isNull()) { + nullParamIndexes.add(i); + } + } + if (!nullParamIndexes.isEmpty()) { + // remove method with array param if a non array exists and arg is null + Set removeCandidates = new HashSet<>(); + for (Integer nullParamIndex: nullParamIndexes) { + for (MethodDeclaration methDecl: applicableMethods) { + if (methDecl.getParam(nullParamIndex.intValue()).getType().isArray()) { + removeCandidates.add(methDecl); } + } } - if (!nullParamIndexes.isEmpty()) { - // remove method with array param if a non array exists and arg is null - Set removeCandidates = new HashSet<>(); - for (Integer nullParamIndex : nullParamIndexes) { - for (MethodDeclaration methDecl : applicableMethods) { - if (methDecl.getParam(nullParamIndex.intValue()).getType().isArray()) { - removeCandidates.add(methDecl); - } - } - } - if (!removeCandidates.isEmpty() && removeCandidates.size() < applicableMethods.size()) { - applicableMethods.removeAll(removeCandidates); - } + if (!removeCandidates.isEmpty() && removeCandidates.size() < applicableMethods.size()) { + applicableMethods.removeAll(removeCandidates); } + } } if (applicableMethods.size() == 1) { return SymbolReference.solved(applicableMethods.get(0)); @@ -428,26 +428,26 @@ public static SymbolReference findMostApplicable(List argumentsTypes) { - for (int i = 0; i < method.getNumberOfParams(); i++) { - if (!method.getParam(i).getType().equals(argumentsTypes.get(i))) { - return false; - } + for (int i = 0; i < method.getNumberOfParams(); i++) { + if (!method.getParam(i).getType().equals(argumentsTypes.get(i))) { + return false; } - return true; + } + return true; } private static boolean isMoreSpecific(MethodDeclaration methodA, MethodDeclaration methodB, List argumentTypes, TypeSolver typeSolver) { @@ -571,15 +571,15 @@ public static SymbolReference solveMethodInType(TypeDeclarati return solveMethodInType(typeDeclaration, name, argumentsTypes, false, typeSolver); } - /** - * Replace TypeDeclaration.solveMethod - * - * @param typeDeclaration - * @param name - * @param argumentsTypes - * @param staticOnly - * @return - */ + /** + * Replace TypeDeclaration.solveMethod + * + * @param typeDeclaration + * @param name + * @param argumentsTypes + * @param staticOnly + * @return + */ public static SymbolReference solveMethodInType(TypeDeclaration typeDeclaration, String name, List argumentsTypes, boolean staticOnly, TypeSolver typeSolver) { @@ -602,18 +602,18 @@ public static SymbolReference solveMethodInType(TypeDeclarati return ((ReflectionClassDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); } if (typeDeclaration instanceof ReflectionInterfaceDeclaration) { - return ((ReflectionInterfaceDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); + return ((ReflectionInterfaceDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); } - if (typeDeclaration instanceof ReflectionEnumDeclaration) { + if (typeDeclaration instanceof ReflectionEnumDeclaration) { return ((ReflectionEnumDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); } if (typeDeclaration instanceof JavassistInterfaceDeclaration) { return ((JavassistInterfaceDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); } if (typeDeclaration instanceof JavassistClassDeclaration) { - return ((JavassistClassDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); + return ((JavassistClassDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); } - if (typeDeclaration instanceof JavassistEnumDeclaration) { + if (typeDeclaration instanceof JavassistEnumDeclaration) { return ((JavassistEnumDeclaration) typeDeclaration).solveMethod(name, argumentsTypes, staticOnly); } throw new UnsupportedOperationException(typeDeclaration.getClass().getCanonicalName()); @@ -652,8 +652,8 @@ private static void inferTypes(Type source, Type target, Map parsedFiles = new HashMap(); private Map> parsedDirectories = new HashMap<>(); - private Map foundTypes = new HashMap<>(); + private Map foundTypes=new HashMap<>(); public JavaParserTypeSolver(File srcDir) { this.srcDir = srcDir; @@ -100,7 +100,7 @@ public SymbolReference tryToSolveType(String name) { // TODO support enums // TODO support interfaces if (foundTypes.containsKey(name)) - return SymbolReference.solved(foundTypes.get(name)); + return SymbolReference.solved(foundTypes.get(name)); SymbolReference result = tryToSolveTypeUncached(name); if (result.isSolved()) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceContext.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceContext.java index 5f2873d024..c1ccc62cc6 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceContext.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceContext.java @@ -51,6 +51,7 @@ private InferenceVariableType inferenceVariableTypeForTp(TypeParameterDeclaratio } /** + * * @return the actual with the inference variable inserted */ public Type addPair(Type target, Type actual) { @@ -77,7 +78,7 @@ private void registerCorrespondance(Type formalType, Type actualType) { ancestors = formalTypeAsReference.getAllAncestors(); final String actualParamTypeQname = actualTypeAsReference.getQualifiedName(); List correspondingActualType = ancestors.stream().filter(a -> a.getQualifiedName().equals(actualParamTypeQname)).collect(Collectors.toList()); - if (correspondingActualType.isEmpty()) { + if (correspondingActualType.isEmpty()){ throw new ConfilictingGenericTypesException(formalType, actualType); } correspondingFormalType = correspondingActualType; @@ -130,20 +131,20 @@ private void registerCorrespondance(Type formalType, Type actualType) { } } - if (actualType.isReferenceType()) { - if (formalType.asWildcard().isBounded()) { + if (actualType.isReferenceType()){ + if (formalType.asWildcard().isBounded()){ registerCorrespondance(formalType.asWildcard().getBoundedType(), actualType); } } - } else if (actualType instanceof InferenceVariableType) { - if (formalType instanceof ReferenceType) { + } else if (actualType instanceof InferenceVariableType){ + if (formalType instanceof ReferenceType){ ((InferenceVariableType) actualType).registerEquivalentType(formalType); - } else if (formalType instanceof InferenceVariableType) { + } else if (formalType instanceof InferenceVariableType){ ((InferenceVariableType) actualType).registerEquivalentType(formalType); } - } else if (actualType.isConstraint()) { + } else if (actualType.isConstraint()){ LambdaConstraintType constraintType = actualType.asConstraintType(); - if (constraintType.getBound() instanceof InferenceVariableType) { + if (constraintType.getBound() instanceof InferenceVariableType){ ((InferenceVariableType) constraintType.getBound()).registerEquivalentType(formalType); } } else if (actualType.isPrimitive()) { @@ -174,7 +175,7 @@ private Type placeInferenceVariables(Type type) { return new ArrayType(placeInferenceVariables(type.asArrayType().getComponentType())); } else if (type.isNull() || type.isPrimitive() || type.isVoid()) { return type; - } else if (type.isConstraint()) { + } else if (type.isConstraint()){ return LambdaConstraintType.bound(placeInferenceVariables(type.asConstraintType().getBound())); } else if (type instanceof InferenceVariableType) { return type; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceVariableType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceVariableType.java index 37aafbca37..632c2e2421 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceVariableType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceVariableType.java @@ -103,7 +103,7 @@ private Set concreteEquivalentTypesAlsoIndirectly(Set result = new HashSet<>(); result.addAll(inferenceVariableType.equivalentTypes.stream().filter(t -> !t.isTypeVariable() && !(t instanceof InferenceVariableType)).collect(Collectors.toSet())); inferenceVariableType.equivalentTypes.stream().filter(t -> t instanceof InferenceVariableType).forEach(t -> { - InferenceVariableType ivt = (InferenceVariableType) t; + InferenceVariableType ivt = (InferenceVariableType)t; if (!considered.contains(ivt)) { result.addAll(concreteEquivalentTypesAlsoIndirectly(considered, ivt)); } @@ -124,8 +124,8 @@ public Type equivalentType() { return concreteEquivalent.iterator().next(); } Set notTypeVariables = equivalentTypes.stream() - .filter(t -> !t.isTypeVariable() && !hasInferenceVariables(t)) - .collect(Collectors.toSet()); + .filter(t -> !t.isTypeVariable() && !hasInferenceVariables(t)) + .collect(Collectors.toSet()); if (notTypeVariables.size() == 1) { return notTypeVariables.iterator().next(); } else if (notTypeVariables.size() == 0 && !superTypes.isEmpty()) { @@ -139,22 +139,22 @@ public Type equivalentType() { } } - private boolean hasInferenceVariables(Type type) { - if (type instanceof InferenceVariableType) { + private boolean hasInferenceVariables(Type type){ + if (type instanceof InferenceVariableType){ return true; } - if (type.isReferenceType()) { + if (type.isReferenceType()){ ReferenceType refType = type.asReferenceType(); - for (Type t : refType.typeParametersValues()) { - if (hasInferenceVariables(t)) { + for (Type t : refType.typeParametersValues()){ + if (hasInferenceVariables(t)){ return true; } } return false; } - if (type.isWildcard()) { + if (type.isWildcard()){ Wildcard wildcardType = type.asWildcard(); return hasInferenceVariables(wildcardType.getBoundedType()); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ObjectProvider.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ObjectProvider.java index 152acd9c6e..e5c970b3f8 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ObjectProvider.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ObjectProvider.java @@ -23,6 +23,5 @@ */ public interface ObjectProvider { ReferenceType object(); - ReferenceType byName(String qname); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ReferenceTypeDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ReferenceTypeDeclaration.java index 9875c0e21d..76ae477878 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ReferenceTypeDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ReferenceTypeDeclaration.java @@ -39,12 +39,12 @@ default ReferenceTypeDeclaration asReferenceType() { * The list of all the ancestors of the current declaration, direct and indirect. * This list does not contains duplicates with the exacting same type parameters. */ - default List getAllAncestors() { + default List getAllAncestors() { List ancestors = new ArrayList<>(); // We want to avoid infinite recursion in case of Object having Object as ancestor - if (!(Object.class.getCanonicalName().equals(getQualifiedName()))) { + if (!(Object.class.getCanonicalName().equals(getQualifiedName()))) { for (ReferenceType ancestor : getAncestors()) { - ancestors.add(ancestor); + ancestors.add(ancestor); for (ReferenceType inheritedAncestor : ancestor.getAllAncestors()) { if (!ancestors.contains(inheritedAncestor)) { ancestors.add(inheritedAncestor); @@ -107,7 +107,7 @@ default boolean hasVisibleField(String name) { /** * Return a list of all fields, either declared in this declaration or inherited. - *

    + * * Note that they could refer to inherited type variables. */ List getAllFields(); diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParameterDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParameterDeclaration.java index ff2eec2470..6cd39d0e8d 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParameterDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParameterDeclaration.java @@ -69,7 +69,7 @@ public String getContainerQualifiedName() { public String getContainerId() { return classQName; } - + @Override public TypeParametrizable getContainer() { return null; @@ -152,7 +152,7 @@ default String getQualifiedName() { * The ID of the container. See TypeContainer.getId */ String getContainerId(); - + /** * The TypeParametrizable of the container. Can be either a ReferenceTypeDeclaration or a MethodLikeDeclaration */ diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ArrayType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ArrayType.java index edd5cad2b0..421bec5a58 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ArrayType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ArrayType.java @@ -86,7 +86,7 @@ public Type getComponentType() { public boolean isAssignableBy(Type other) { if (other.isArray()) { if (baseType.isPrimitive() && other.asArrayType().getComponentType().isPrimitive()) { - return baseType.equals(other.asArrayType().getComponentType()); + return baseType.equals(other.asArrayType().getComponentType()); } return baseType.isAssignableBy(other.asArrayType().getComponentType()); } else if (other.isNull()) { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/LambdaConstraintType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/LambdaConstraintType.java index 2853cc8743..43e1547ebe 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/LambdaConstraintType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/LambdaConstraintType.java @@ -1,6 +1,6 @@ package com.github.javaparser.symbolsolver.model.typesystem; -public class LambdaConstraintType implements Type { +public class LambdaConstraintType implements Type { Type bound; public LambdaConstraintType(Type bound) { @@ -26,7 +26,7 @@ public LambdaConstraintType asConstraintType() { return this; } - public static LambdaConstraintType bound(Type bound) { + public static LambdaConstraintType bound(Type bound){ return new LambdaConstraintType(bound); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveType.java index 7f5edb2159..c96a99fb4a 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveType.java @@ -113,7 +113,7 @@ public boolean isAssignableBy(Type other) { } } return false; - } else if (other.isConstraint()) { + } else if (other.isConstraint()){ return this.isAssignableBy(other.asConstraintType().getBound()); } else { return false; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ReferenceType.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ReferenceType.java index d1cb207e5f..05ff3f4a00 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ReferenceType.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ReferenceType.java @@ -190,7 +190,7 @@ public Type replaceTypeVariables(TypeParameterDeclaration tpToReplace, Type repl } List values = result.typeParametersValues(); - if (values.contains(tpToReplace)) { + if(values.contains(tpToReplace)){ int index = values.indexOf(tpToReplace); values.set(index, replaced); return create(result.getTypeDeclaration(), values, typeSolver); @@ -288,9 +288,9 @@ public List typeParametersValues() { public List> getTypeParametersMap() { List> typeParametersMap = new ArrayList<>(); if (!isRawType()) { - for (int i = 0; i < typeDeclaration.getTypeParameters().size(); i++) { - typeParametersMap.add(new Tuple2<>(typeDeclaration.getTypeParameters().get(0), typeParametersValues().get(i))); - } + for (int i = 0; i < typeDeclaration.getTypeParameters().size(); i++) { + typeParametersMap.add(new Tuple2<>(typeDeclaration.getTypeParameters().get(0), typeParametersValues().get(i))); + } } return typeParametersMap; } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Type.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Type.java index 710c85dfd3..38f490b991 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Type.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Type.java @@ -76,9 +76,7 @@ default boolean isReference() { /** * Is this a lambda constraint type? */ - default boolean isConstraint() { - return false; - } + default boolean isConstraint() { return false; } /** * Can this be seen as a ReferenceTypeUsage? diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeVariable.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeVariable.java index 19d413b98e..c18eff6d08 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeVariable.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeVariable.java @@ -74,7 +74,7 @@ public boolean isPrimitive() { @Override public Type replaceTypeVariables(TypeParameterDeclaration tpToBeReplaced, Type replaced, Map inferredTypes) { - if (tpToBeReplaced.getName().equals(this.typeParameter.getName())) { + if(tpToBeReplaced.getName().equals(this.typeParameter.getName())){ inferredTypes.put(this.asTypeParameter(), replaced); return replaced; } else { diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametersMap.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametersMap.java index 9fe399aeed..b73dbc1671 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametersMap.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javasymbolsolver_0_6_0/src/java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametersMap.java @@ -112,11 +112,11 @@ public Optional getValueBySignature(String signature) { } } - public List getNames() { + public List getNames(){ return new ArrayList<>(nameToValue.keySet()); } - public List getTypes() { + public List getTypes(){ return new ArrayList<>(nameToValue.values()); } diff --git a/jmlparser-jml-tests/build.gradle.kts b/jmlparser-jml-tests/build.gradle.kts new file mode 100644 index 0000000000..18b9f49212 --- /dev/null +++ b/jmlparser-jml-tests/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id("buildlogic.java-conventions") +} + +dependencies { + testImplementation(project(":jmlparser-core")) + testImplementation(project(":jmlparser-symbol-solver-core")) + testImplementation(project(":jmlparser-core-testing")) + testImplementation(project(":jmlparser-core-testing-bdd")) + testImplementation(project(":jmlparser-symbol-solver-testing")) + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testing.runtime) +} + +description = "io.github.jmltoolkit:jmlparser-jml-tests" diff --git a/jmlparser-jml-tests/pom.xml b/jmlparser-jml-tests/pom.xml index 92008ffdcd..e8cb4e63ec 100644 --- a/jmlparser-jml-tests/pom.xml +++ b/jmlparser-jml-tests/pom.xml @@ -2,7 +2,7 @@ jmlparser-parent io.github.jmltoolkit - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 4.0.0 diff --git a/jmlparser-jml-tests/src/test/java/com/github/jml/FragmentTest.java b/jmlparser-jml-tests/src/test/java/com/github/jml/FragmentTest.java index 783984cc0d..5a9a3a92ed 100644 --- a/jmlparser-jml-tests/src/test/java/com/github/jml/FragmentTest.java +++ b/jmlparser-jml-tests/src/test/java/com/github/jml/FragmentTest.java @@ -8,10 +8,8 @@ import java.io.FileNotFoundException; import java.util.Arrays; import java.util.stream.Stream; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.TestFactory; + +import org.junit.jupiter.api.*; /** * @author Alexander Weigl @@ -53,6 +51,11 @@ private void testClassLevel(File f) throws FileNotFoundException { Assertions.assertTrue(r.isSuccessful()); } + @Test + void test() throws FileNotFoundException { + testClassLevel(new File("/home/weigl/work/javaparser/jmlparser-jml-tests/src/test/resources/fragments/decl_1153518565.txt")); + } + private boolean ignorableMessages(String message) { return message.contains("model_program") || message.contains("recommends") diff --git a/pom.xml b/pom.xml index 814bfaa4ce..0af1dd01b4 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ io.github.jmltoolkit jmlparser-parent pom - 3.28.0-J8.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 https://github.com/wadoon/jmlparser 2021 @@ -180,9 +180,9 @@ - scm:git:git://github.com/wadoon/jmlparser.git - scm:git:git@github.com:wadoon/jmlparser.git - https://github.com/wadoon/jmlparser.git + scm:git:git://github.com/jmltoolkit/jmlparser.git + scm:git:git@github.com:jmltoolkit/jmlparser.git + https://github.com/jmltoolkit/jmlparser HEAD @@ -202,6 +202,11 @@ gitlab-maven https://git.key-project.org/api/v4/projects/35/packages/maven + + + ${project.build.directory}-site + file://${project.build.outputDirectory}/s + @@ -210,13 +215,30 @@ org.apache.maven.plugins maven-compiler-plugin - ${java.version} false - + + org.apache.maven.plugins + maven-enforcer-plugin + 3.6.2 + + + enforce-maven + + enforce + + + + + 3.6.3 + + + + + + @@ -233,7 +255,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.15.0 + 3.15.0 org.apache.maven.plugins @@ -253,7 +275,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.7.0 true ossrh @@ -294,41 +316,11 @@ - - + org.apache.maven.plugins maven-resources-plugin - 3.4.0 + 3.5.0 org.apache.maven.plugins @@ -387,31 +379,51 @@ false + + + org.apache.maven.plugins + maven-scm-publish-plugin + 3.1.0 + + + scm:git:git@github.com:jmltoolkit/jmltoolkit.github.io.git + + gh-pages + + + org.apache.maven.plugins maven-site-plugin 3.21.0 + biz.aQute.bnd bnd-maven-plugin - 7.2.1 + 7.2.1 + + + org.apache.maven.plugins + maven-surefire-report-plugin + 3.5.5 + + true + + true + + + org.apache.maven.plugins - maven-surefire-report-plugin - 3.5.5 - - true - - true - - - - org.apache.maven.plugins maven-surefire-plugin 3.5.5 + + true + + org.codehaus.mojo exec-maven-plugin @@ -425,7 +437,7 @@ org.codehaus.mojo templating-maven-plugin - 3.1.0 + 3.1.0 org.apache.maven.plugins @@ -435,7 +447,7 @@ org.codehaus.mojo versions-maven-plugin - 2.21.0 + 2.21.0 false @@ -462,7 +474,7 @@ com.diffplug.spotless spotless-maven-plugin - 3.2.1 + 3.3.0 @@ -486,11 +498,46 @@ org.apache.maven.plugins maven-surefire-report-plugin - 3.5.5 true + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + + + non-aggregate + + + ${project.build.sourceDirectory}/../generated + + + javadoc + + + + false + aggregate + + + ${project.build.sourceDirectory}/../generated + + + aggregate + + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + @@ -513,15 +560,15 @@ 33.5.0-jre - com.google.truth - truth - 1.4.5 - test - - + com.google.truth + truth + 1.4.5 + test + + org.checkerframework checker-qual - 3.53.1 + 3.53.1 org.hamcrest @@ -529,6 +576,12 @@ 3.0 test + + com.google.truth + truth + 1.4.5 + test + org.junit junit-bom diff --git a/readme.md b/readme.md index 1cf87315e6..f51f0e28ad 100644 --- a/readme.md +++ b/readme.md @@ -34,14 +34,14 @@ Just add the following to your maven configuration or tailor to your own depende org.key-project.proofjava javaparser-symbol-solver-core - 3.28.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 ``` **Gradle**: ``` -implementation 'com.github.javaparser:javaparser-symbol-solver-core:3.28.0-K10.1-SNAPSHOT' +implementation 'com.github.javaparser:javaparser-symbol-solver-core:3.28.0-J8.0-K13.4' ``` Since Version 3.5.10, the JavaParser project includes the JavaSymbolSolver. @@ -56,14 +56,14 @@ Using the dependency above will add both JavaParser and JavaSymbolSolver to your org.key-project.proofjava javaparser-core - 3.28.0-K10.1-SNAPSHOT + 3.28.0-J8.0-K13.4 ``` **Gradle**: ``` -implementation 'com.github.javaparser:javaparser-core:3.28.0-K10.1-SNAPSHOT' +implementation 'com.github.javaparser:javaparser-core:3.28.0-J8.0-K13.4' ``` ## How To Compile Sources @@ -90,7 +90,7 @@ The `run_metamodel_generator.sh` script will rebuild the metamodel, which is used by the code generators which are run by `run_core_generators.sh` Make sure that `javaparser-core` at least compiles before you run these. -**Note**: for Eclipse IDE follow the steps described in the wiki: https://github.com/javaparser/javaparser/wiki/Eclipse-Project-Setup-Guide +**Note**: for Eclipse IDE follow the steps described in the [wiki](https://github.com/javaparser/javaparser/wiki/Eclipse-Project-Setup-Guide). ## Structural Changes @@ -103,26 +103,15 @@ Make sure that `javaparser-core` at least compiles before you run these. For method this is already covered by the grammar. * New Statements - * KeyMetaConstructStatement - * StatementSV - * KeyMethodCallStatement - * KeyMethodBodyStatement - * KeyTransactionStatement - * KeyMergePointStatement - * KeyLoopScope - * KeyCatchAllStatement - * KeyExecStatement - * KeyMethodCallStatement -* Expression - * UnaryExpression - * KeyGeneralEscapeExpression - * KeyCreateObjectSV - * KeyLengthReferenceSV - * Cast expression allows schema type variables and meta constructs. - * PrimaryExpression - * PassiveExpression - * KeyStaticEvaluate - * IsStaticMC + * [`KeyMetaConstruct`](javaparser-core/src/main/java/com/github/javaparser/ast/key/sv/KeyMetaConstruct.java) + * [`KeyMethodCallStatement`](javaparser-core/src/main/java/com/github/javaparser/ast/key/KeyMethodCallStatement.java) + * [`KeyMethodBodyStatement`]() + * [`KeyTransactionStatement`]() + * [`KeyMergePointStatement`]() + * [`KeyLoopScopeBlock`]() + * [`KeyCatchAllStatement`]() + * [`KeyExecStatement`]() + * [`KeyMethodCallStatement`]() * Primitive types * `\bigint` * `\real` diff --git a/run_core_generators.sh b/run_core_generators.sh deleted file mode 100755 index 2e6b066618..0000000000 --- a/run_core_generators.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Runs all the code generators. -# If the node structure was changed, run_metamodel_generator.sh first! - -# Remember current directory -pushd javaparser-core-generators - -# Generate code -../mvnw --errors --show-version -B clean package -P run-generators -DskipTests - -# Go back to previous directory -popd - -# Fresh code has been generated in core, so rebuild the whole thing again. -./mvnw --errors --show-version -B clean compile -DskipTests -if [ "$?" -ne 0 ]; then - exit 1 -fi - -# Format code to make diff more understandable -./mvnw spotless:apply diff --git a/run_core_metamodel_generator.sh b/run_core_metamodel_generator.sh deleted file mode 100755 index c053209f7c..0000000000 --- a/run_core_metamodel_generator.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# Rebuilds the metamodel based on the nodes in javaparser-core - -# We introspect the nodes in javaparser-core, so we need an update build of it. -./mvnw --errors --show-version -B clean install -DskipTests -if [ "$?" -ne 0 ]; then - exit 1 -fi - -# Remember current directory -pushd javaparser-core-metamodel-generator - -# Generate code -../mvnw --errors --show-version -B clean package -P run-generators -DskipTests - -# Go back to previous directory -popd - -# Fresh code has been generated in core, so rebuild the whole thing again. -./mvnw --errors --show-version -B clean install -DskipTests -if [ "$?" -ne 0 ]; then - exit 1 -fi diff --git a/run_release_perform.sh b/run_release_perform.sh deleted file mode 100755 index 2b5c3955df..0000000000 --- a/run_release_perform.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -## Exit script if any non-zero exit code (nb: some redundancy with checks below - may remove if exit code checks are thorough) -set -e -## Disallow references to non-existent environment variables -set -u -## Exit on invalid/bad pipes -set -o pipefail - -#TODO --- Replace all mentions of Bintray - -echo "[JavaParser]" -echo "[JavaParser]" -echo "[JavaParser]: See also: http://github.com/javaparser/javaparser/wiki/Release-Process" -echo "[JavaParser]" -echo "[JavaParser]: ##" -echo "[JavaParser]: ##" -echo "[JavaParser]: ## TODO --- Replace all mentions of Bintray" -echo "[JavaParser]: ##" -echo "[JavaParser]: ##" -echo "[JavaParser]" -echo "[JavaParser]: Before running this script, ensure that your settings.xml file (~/.m/setings.xml) has been updated with your Bintray credentials." -echo "[JavaParser]: - A template settings.xml file can be found within the dev-files directory." -echo "[JavaParser]: - You must also be added to the JavaParser organisation on Bintray for releases to be successful." -echo "[JavaParser]:" -echo "[JavaParser]: Note that the git repo uses the SSH URL to pull/push -- this, therefore, requires you to have setup SSH access to your GitHub account." -echo "[JavaParser]:" -echo "[JavaParser]: Once the release is complete and has been uploaded to Bintray, there is still an oppotunity for it to be deleted via the Bintray website." -echo "[JavaParser]: - To push it to Maven Central (therefore be available to users), it must be synchronised via the Bintray web UI." -echo "[JavaParser]: - When successful, Bintray will report 'Last Sync Status: Successfully synced and closed repo.'" -echo "[JavaParser]:" -echo "[JavaParser]: - Note that you MUST have sonatype credentials that can be entered into the Bintray web UI to trigger the sync" -echo "[JavaParser]: (the same credentials used to login to http://oss.sonatype.org/ )." -echo "[JavaParser]:" -echo "[JavaParser]: - Note that you MUST have your sonatype account linked to the JavaParser coordinates, to trigger the sync FROM Bintray TO Sonatype/Maven Central." -echo "[JavaParser]: This can be done by having an existing committer open a ticket at https://issues.sonatype.org/ ." -echo "[JavaParser]" -echo "[JavaParser]" - -set -x - -./mvnw --errors --show-version \ - -Darguments="-DskipTests" release:perform - -if [ "$?" -ne 0 ]; then - echo "Error when performing release:perform" - exit 10; -fi - -set +x diff --git a/run_release_prepare.sh b/run_release_prepare.sh deleted file mode 100755 index e2d9d3b4a0..0000000000 --- a/run_release_prepare.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - - -echo "[JavaParser]" -echo "[JavaParser]" -echo "[JavaParser]: See also: http://github.com/javaparser/javaparser/wiki/Release-Process" -echo "[JavaParser]:" -echo "[JavaParser]: This script pulls the latest code from your default tracking branch (set automatically when using git clone)." -echo "[JavaParser]: This script then performs the maven release:prepare." -echo "[JavaParser]: - Note that release:prepare requires user input to define the new and next version." -echo "[JavaParser]:" -echo "[JavaParser]: Once the release has been prepared, several commits will have been created locally but not pushed (configured within pom.xml)." -echo "[JavaParser]: These locally created commits (AND THE NEW TAG!) must then be manually pushed." -echo "[JavaParser]:" -echo "[JavaParser]: - The release prepare can undone either via release:revert -- but note that this will create new revert commits." -echo "[JavaParser]:" -echo "[JavaParser]: - Alternatively, it can be undone by manually deleting the tag and resetting the current branch's head." -echo "[JavaParser]: (e.g. git reset --hard HEAD^3 to go back three commits, or git reset --hard )." -echo "[JavaParser]: You may also need to manually delete pom backup files." -echo "[JavaParser]:" -echo "[JavaParser]: - As a last resort, you can delete your local copy and clone the repo again." -echo "[JavaParser]" -echo "[JavaParser]" - -set -x - -git pull - -./mvnw --errors --show-version clean -if [ "$?" -ne 0 ]; then - echo "Error when performing clean" - exit 1 -fi - -./mvnw --errors --show-version --batch-mode \ - -Darguments="-DskipTests" release:prepare - -if [ "$?" -ne 0 ]; then - echo "Error when performing release:prepare" - exit 1 -fi - -set +x - -echo "[JavaParser]" -echo "[JavaParser]" -echo "[JavaParser]: Assuming the release:prepare is successful, you MUST now push the changes." -echo "[JavaParser]: - Specifically, release:perform requires the newly created tag to have been pushed." -echo "[JavaParser]" -echo "[JavaParser]: This can be achieved using: \`git push --follow-tags\`." -echo "[JavaParser]: Follow tags will push any tags associated with the current head commit." -echo "[JavaParser]: Alternatively, you can push the tag itself using \`git push \`." -echo "[JavaParser]" -echo "[JavaParser]" diff --git a/run_release_prepare_non-interactive.sh b/run_release_prepare_non-interactive.sh deleted file mode 100755 index b7e758e8e3..0000000000 --- a/run_release_prepare_non-interactive.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env bash - -## Exit script if any non-zero exit code (nb: some redundancy with checks below - may remove if exit code checks are thorough) -set -e -## Disallow references to non-existent environment variables -set -u -## Exit on invalid/bad pipes -set -o pipefail - - -echo "[JavaParser]" -echo "[JavaParser]" -echo "[JavaParser]: See also: http://github.com/javaparser/javaparser/wiki/Release-Process" -echo "[JavaParser]:" -echo "[JavaParser]: This script pulls the latest code from your default tracking branch (set automatically when using git clone)." -echo "[JavaParser]: This script then performs the maven release:prepare." -echo "[JavaParser]: - Note that release:prepare requires user input to define the new and next version." -echo "[JavaParser]:" -echo "[JavaParser]: Once the release has been prepared, several commits will have been created locally but not pushed (configured within pom.xml)." -echo "[JavaParser]: These locally created commits (AND THE NEW TAG!) must then be manually pushed." -echo "[JavaParser]:" -echo "[JavaParser]: - The release prepare can undone either via release:revert -- but note that this will create new revert commits." -echo "[JavaParser]:" -echo "[JavaParser]: - Alternatively, it can be undone by manually deleting the tag and resetting the current branch's head." -echo "[JavaParser]: (e.g. git reset --hard HEAD^3 to go back three commits, or git reset --hard )." -echo "[JavaParser]: You may also need to manually delete pom backup files." -echo "[JavaParser]:" -echo "[JavaParser]: - As a last resort, you can delete your local copy and clone the repo again." -echo "[JavaParser]" -echo "[JavaParser]" - - -## TODO: Consider the ability to pass toggles for running tests (or not) -## TODO: Consider the ability to pass toggles for doing a dry-run (or not) -if [ "$#" -ne 2 ]; then - echo "Usage: $0 " >&2 - echo "Example: $0 3.24.0 3.24.1-SNAPSHOT" >&2 - exit 1 -fi - -## Pass arguments into readable variable names -release_version=$1 -next_development_snapshot_version=$2 - -## Use a standard version for the git tag of each release: -git_tag="javaparser-parent-${release_version}" - - -echo "[JavaParser]" -echo "[JavaParser] ================================================================" -echo "[JavaParser]: PREPARING RELEASE" -echo "[JavaParser]: Release Version: ${release_version}" -echo "[JavaParser]: Release Git Tag: ${git_tag}" -echo "[JavaParser]: Next Snapshot Version: ${next_development_snapshot_version} " -echo "[JavaParser] ================================================================" -echo "[JavaParser]" - - - -set -x - - -## Start the release from a clean start -./mvnw --errors --show-version clean - -if [ "$?" -ne 0 ]; then - echo "Error when performing clean" - exit 102 -fi - - -## Do a non-interactive release, using values passed as script arguments -## Note: The flag `-Darguments` is used to pass arguments to submodules -./mvnw --errors --show-version --batch-mode \ - -Darguments="-DskipTests" release:prepare \ - -Dtag="${git_tag}" \ - -DreleaseVersion="${release_version}" \ - -DdevelopmentVersion="${next_development_snapshot_version}" - -if [ "$?" -ne 0 ]; then - echo "Error when performing release:prepare" - exit 103 -fi - - -set +x - -echo "[JavaParser]" -echo "[JavaParser]" -echo "[JavaParser]: Assuming the release:prepare is successful, you MUST now push the changes." -echo "[JavaParser]: - Specifically, release:perform requires the newly created tag to have been pushed." -echo "[JavaParser]" -echo "[JavaParser]: This can be achieved using: \`git push --follow-tags\`." -echo "[JavaParser]: Follow tags will push any tags associated with the current head commit." -echo "[JavaParser]: Alternatively, you can push the tag itself using \`git push \`." -echo "[JavaParser]" -echo "[JavaParser]" diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000000..4819be9752 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,42 @@ +pluginManagement { + // Include 'plugins build' to define convention plugins. + includeBuild("build-logic") + repositories { + gradlePluginPortal() + mavenCentral() + } +} + +rootProject.name = "jmlparser-parent" +include(":jmlparser-jml-tests") +include(":javaparser-key-testing") +include(":jmlparser-core-serialization") +include(":jmlparser-core-testing") +include(":jmlparser-core-testing-bdd") +include(":jmlparser-core-metamodel-generator") +include(":jmlparser-core-generators") +include(":jmlparser-core") +include(":jmlparser-symbol-solver-core") +include(":jmlparser-symbol-solver-testing") +project(":jmlparser-core-serialization").projectDir = file("javaparser-core-serialization") +project(":jmlparser-core-testing").projectDir = file("javaparser-core-testing") +project(":jmlparser-core-testing-bdd").projectDir = file("javaparser-core-testing-bdd") +project(":jmlparser-core-metamodel-generator").projectDir = file("javaparser-core-metamodel-generator") +project(":jmlparser-core-generators").projectDir = file("javaparser-core-generators") +project(":jmlparser-core").projectDir = file("javaparser-core") +project(":jmlparser-symbol-solver-core").projectDir = file("javaparser-symbol-solver-core") +project(":jmlparser-symbol-solver-testing").projectDir = file("javaparser-symbol-solver-testing") + + +include(":tools:stat") +include(":tools:lint") +include(":tools:smt") +include(":tools:prettyprinting") +include(":tools:utils") +include(":tools:wd") +include(":tools:redux") +include(":tools:xpath") +include(":tools:cli") +include(":tools:lsp") +include(":tools:web") +include(":tools:jml2java") diff --git a/tools/.gitattributes b/tools/.gitattributes new file mode 100644 index 0000000000..097f9f98d9 --- /dev/null +++ b/tools/.gitattributes @@ -0,0 +1,9 @@ +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf + diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 0000000000..1ddeda8004 --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,44 @@ +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store +# Ignore Gradle build output directory +build diff --git a/tools/LICENSE b/tools/LICENSE new file mode 100644 index 0000000000..f288702d2f --- /dev/null +++ b/tools/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000000..b6faf6c350 --- /dev/null +++ b/tools/README.md @@ -0,0 +1,2 @@ +# jml-tools +Tools for the processing of JML based on the jml-parser diff --git a/tools/cli/build.gradle.kts b/tools/cli/build.gradle.kts new file mode 100644 index 0000000000..3cf40c94d8 --- /dev/null +++ b/tools/cli/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("standard-kotlin") +} + +dependencies { + implementation(libs.clickt) + implementation(project(":jmlparser-core")) + implementation(project(":tools:wd")) + implementation(project(":tools:xpath")) + implementation(project(":tools:prettyprinting")) + implementation(project(":tools:lint")) + implementation(project(":tools:stat")) + implementation(project(":tools:jml2java")) +} diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/J2JCommand.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/J2JCommand.kt new file mode 100644 index 0000000000..eb3a39f7b1 --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/J2JCommand.kt @@ -0,0 +1,30 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context +import com.github.ajalt.clikt.parameters.arguments.argument +import com.github.ajalt.clikt.parameters.arguments.multiple +import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.option +import com.github.ajalt.clikt.parameters.types.file +import java.io.File + +/** + * @author Alexander Weigl + * @version 1 (09.04.23) + */ +class J2JCommand : + CliktCommand("jml2java") { + override fun help(context: Context): String = + "Submit usage for a given customer and subscription, accepts one usage item" + + private val outputFolder by option("-o", "--output", help = "Output folder of the Java Files") + .file() + .default(File("out")) + + private val jjbmcMode by option("jjbmc", "JBMC mode") + private val files by argument("FILES").file().multiple() + override fun run() { + TODO("Not yet implemented") + } +} diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/LintCommand.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/LintCommand.kt new file mode 100644 index 0000000000..2ed9945ff9 --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/LintCommand.kt @@ -0,0 +1,19 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context + +/** + * @author Alexander Weigl + * @version 1 (09.04.23) + */ +class LintCommand : + CliktCommand(name = "lint") { + override fun help(context: Context): String = + "Submit usage for a given customer and subscription, accepts one usage item" + + + override fun run() { + TODO("Not yet implemented") + } +} diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/Main.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/Main.kt new file mode 100644 index 0000000000..9bcfea2e83 --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/Main.kt @@ -0,0 +1,135 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.main +import com.github.ajalt.clikt.core.subcommands +import com.github.ajalt.clikt.parameters.arguments.argument +import com.github.ajalt.clikt.parameters.arguments.multiple +import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.flag +import com.github.ajalt.clikt.parameters.options.multiple +import com.github.ajalt.clikt.parameters.options.option +import com.github.ajalt.clikt.parameters.types.file +import com.github.ajalt.clikt.parameters.types.int +import com.github.javaparser.JavaParser +import com.github.javaparser.ParseResult +import com.github.javaparser.ParserConfiguration +import com.github.javaparser.Problem +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.Node +import io.github.jmltoolkit.lint.JmlLintingConfig +import io.github.jmltoolkit.lint.JmlLintingFacade +import io.github.jmltoolkit.lint.LintProblem +import java.io.File +import java.io.FileNotFoundException +import kotlin.jvm.optionals.getOrNull + +fun main(args: Array) { + var cmd = Main().subcommands( + J2JCommand(), LintCommand(), PrettyPrintCommand(), XPathCommand(), + StatCommand(), WdCommand(), + ) + cmd.main(args) +} + +/** + * @author Alexander Weigl + * @version 1 (12/31/21) + */ +class Main : CliktCommand() { + + override fun run() { + TODO("Not yet implemented") + } +} + +abstract class FileBasedCommand(name: String) : CliktCommand(name) { + val activeJmlKeys by option("--jml-key").multiple() + val verbose by option("--verbose", "-v", help = "Level of verbosity").int().default(1) + val disableJml by option("--disable-jml").flag() + val files by argument("").file().multiple() + + fun lint(nodes: Collection) { + val lconfig: JmlLintingConfig = createLinterConfiguration() + val problems = JmlLintingFacade(lconfig).lint(nodes) + for (problem in problems) { + report(problem) + } + } + + private fun createLinterConfiguration(): JmlLintingConfig { + return JmlLintingConfig() + } + + fun parse(files: List, config: ParserConfiguration): Collection { + val expanded: MutableList = ArrayList(files.size * 10) + for (f in files) { + if (f.isDirectory) { + expandDirectory(expanded, f) + } else { + expanded.add(f) + } + } + + return expanded.asSequence().map { parse(it, config) }.map { reportOnError(it) }.filterNotNull().toList() + } + + private fun reportOnError(it: ParseResult?): CompilationUnit? { + if (it == null) return null + + val result = it.result.getOrNull() + if (result != null) return result + + for (problem in it.problems) { + report(problem) + } + + return null + } + + + private fun expandDirectory(target: MutableCollection, dir: File) { + val files = dir.listFiles() + if (files != null) { + for (file in files) { + if (file.isDirectory) { + expandDirectory(target, file) + } else { + if (file.name.endsWith(".java")) { + target.add(file) + } + } + } + } + } + + + internal fun parse(file: File, configuration: ParserConfiguration): ParseResult? { + val p = JavaParser(configuration) + try { + return p.parse(file) + } catch (e: FileNotFoundException) { + report(Problem("File not found", null, e)) + return null + } + } + + internal fun createParserConfiguration( + activeJmlKeys: List = listOf(), + disableJml: Boolean = false + ): ParserConfiguration { + val config = ParserConfiguration() + config.jmlKeys.add(activeJmlKeys) + config.setProcessJml(disableJml) + return config + } + + + private fun report(problem: Problem) { + System.out.println(problem.toString()) + } + + private fun report(problem: LintProblem) { + println(problem.toString()) + } +} \ No newline at end of file diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/PrettyPrintCommand.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/PrettyPrintCommand.kt new file mode 100644 index 0000000000..b088e6aaed --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/PrettyPrintCommand.kt @@ -0,0 +1,18 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context +import com.github.ajalt.clikt.parameters.arguments.argument +import com.github.ajalt.clikt.parameters.arguments.multiple +import com.github.ajalt.clikt.parameters.types.file + +/** + * @author Alexander Weigl + * @version 1 (09.04.23) + */ +class PrettyPrintCommand : CliktCommand(name = "format") { + override fun help(context: Context): String = "Format the JML comments inside Java files." + + private val files by argument("FILES").file().multiple() + override fun run() {} +} diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/StatCommand.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/StatCommand.kt new file mode 100644 index 0000000000..5fa9fceadb --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/StatCommand.kt @@ -0,0 +1,18 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context + +/** + * @author Alexander Weigl + * @version 1 (09.04.23) + */ +class StatCommand : CliktCommand(name = "stat") { + override fun help(context: Context): String { + return "Print statistics on JML specification" + } + + override fun run() { + TODO("Not yet implemented") + } +} diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/StatMain.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/StatMain.kt new file mode 100644 index 0000000000..ac506822de --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/StatMain.kt @@ -0,0 +1,68 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.Context +import com.github.javaparser.ParserConfiguration +import io.github.jmltoolkit.stat.ExpressionCosts +import io.github.jmltoolkit.stat.StatVisitor +import java.io.StringWriter +import javax.xml.parsers.DocumentBuilderFactory +import javax.xml.transform.OutputKeys +import javax.xml.transform.TransformerFactory +import javax.xml.transform.dom.DOMSource +import javax.xml.transform.stream.StreamResult + +/** + * @author Alexander Weigl + * @version 1 (24.05.22) + */ +class StatMain : FileBasedCommand("stat") { + override fun help(context: Context): String = "Statistics for JML specification" + + override fun run() { + val config = ParserConfiguration() + config.setProcessJml(true) + config.setKeepJmlDocs(true) + for (activeJmlKey in activeJmlKeys) { + val activeJmlKeys = activeJmlKey.split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + config.jmlKeys.add(listOf(*activeJmlKeys)) + } + + if (activeJmlKeys.isEmpty()) { + //config.getJmlKeys().add(new ArrayList<>()); + config.jmlKeys.add(listOf("key")) + //config.getJmlKeys().add(Collections.singletonList("openjml")); + } + + + val builderFactory = DocumentBuilderFactory.newInstance() + val builder = builderFactory.newDocumentBuilder() + val xmlDocument = builder.newDocument() + val xmlRoot = xmlDocument.createElement("statistics-model") + + val nodes = parse(files, config) + val costs = ExpressionCosts() + for (key in config.jmlKeys) { + val statVisitor = StatVisitor(xmlDocument, key, costs) + val e = xmlDocument.createElement("settings") + e.setAttribute("keys", "" + key) + xmlRoot.appendChild(e) + for (node in nodes) { + node.accept(statVisitor, e) + } + } + + //Gson gson = new GsonBuilder().setPrettyPrinting().create(); + //System.out.println(gson.toJson(statVisitor.getNewlines())); + val transformer = TransformerFactory.newInstance().newTransformer() + transformer.setOutputProperty(OutputKeys.INDENT, "yes") + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2") + val result = StreamResult(StringWriter()) + val source = DOMSource(xmlRoot) + transformer.transform(source, result) + val xmlString = result.writer.toString() + println(xmlString) + } + + //val files by argument("FILES") + //val activeJmlKeys: List by option("-k").multiple() +} diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/WdCommand.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/WdCommand.kt new file mode 100644 index 0000000000..1aeca1e91c --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/WdCommand.kt @@ -0,0 +1,31 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.Context +import com.github.javaparser.ParserConfiguration +import io.github.jmltoolkit.wd.WDVisitor +import java.util.* + +/** + * @author Alexander Weigl + * @version 1 (09.04.23) + */ +class WdCommand : FileBasedCommand(name = "wd") { + override fun help(context: Context): String { + return "Well-definedness check for JML files." + } + + override fun run() { + val config = ParserConfiguration() + config.setProcessJml(true) + config.setKeepJmlDocs(true) + for (activeJmlKey in activeJmlKeys) { + val activeJmlKeys = activeJmlKey.split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + config.jmlKeys.add(Arrays.asList(*activeJmlKeys)) + } + + if (activeJmlKeys.isEmpty()) { + config.jmlKeys.add(listOf("key")) + } + val wd = WDVisitor() + } +} diff --git a/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/XPathCommand.kt b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/XPathCommand.kt new file mode 100644 index 0000000000..7cadf36444 --- /dev/null +++ b/tools/cli/src/main/kotlin/io/github/jmltoolkit/cli/XPathCommand.kt @@ -0,0 +1,19 @@ +package io.github.jmltoolkit.cli + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context + +/** + * @author Alexander Weigl + * @version 1 (09.04.23) + */ + +class XPathCommand : CliktCommand(name = "xpath") { + override fun help(context: Context): String { + return "Evaluate XPath queries on a set of Java/JML files." + } + + override fun run() { + TODO("Not yet implemented") + } +} diff --git a/tools/examples/ihm/VerifiedIdentityHashMap.java b/tools/examples/ihm/VerifiedIdentityHashMap.java new file mode 100644 index 0000000000..6a51dd614e --- /dev/null +++ b/tools/examples/ihm/VerifiedIdentityHashMap.java @@ -0,0 +1,2181 @@ +/* + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package ihm; + +//import sun.misc.SharedSecrets; + +/** + * This class implements the Map interface with a hash table, using + * reference-equality in place of object-equality when comparing keys (and + * values). In other words, in an VerifiedIdentityHashMap, two keys + * k1 and k2 are considered equal if and only if + * (k1==k2). (In normal Map implementations (like + * HashMap) two keys k1 and k2 are considered equal + * if and only if (k1==null ? k2==null : k1.equals(k2)).) + * + *

    This class is not a general-purpose Map + * implementation! While this class implements the Map interface, it + * intentionally violates Map's general contract, which mandates the + * use of the equals method when comparing objects. This class is + * designed for use only in the rare cases wherein reference-equality + * semantics are required. + * + *

    A typical use of this class is topology-preserving object graph + * transformations, such as serialization or deep-copying. To perform such + * a transformation, a program must maintain a "node table" that keeps track + * of all the object references that have already been processed. The node + * table must not equate distinct objects even if they happen to be equal. + * Another typical use of this class is to maintain proxy objects. For + * example, a debugging facility might wish to maintain a proxy object for + * each object in the program being debugged. + * + *

    This class provides all of the optional map operations, and permits + * null values and the null key. This class makes no + * guarantees as to the order of the map; in particular, it does not guarantee + * that the order will remain constant over time. + * + *

    This class provides constant-time performance for the basic + * operations (get and put), assuming the system + * identity hash function ({@link System#identityHashCode(Object)}) + * disperses elements properly among the buckets. + * + *

    This class has one tuning parameter (which affects performance but not + * semantics): expected maximum size. This parameter is the maximum + * number of key-value mappings that the map is expected to hold. Internally, + * this parameter is used to determine the number of buckets initially + * comprising the hash table. The precise relationship between the expected + * maximum size and the number of buckets is unspecified. + * + *

    If the size of the map (the number of key-value mappings) sufficiently + * exceeds the expected maximum size, the number of buckets is increased. + * Increasing the number of buckets ("rehashing") may be fairly expensive, so + * it pays to create identity hash maps with a sufficiently large expected + * maximum size. On the other hand, iteration over collection views requires + * time proportional to the number of buckets in the hash table, so it + * pays not to set the expected maximum size too high if you are especially + * concerned with iteration performance or memory usage. + * + *

    Note that this implementation is not synchronized. + * If multiple threads access an identity hash map concurrently, and at + * least one of the threads modifies the map structurally, it must + * be synchronized externally. (A structural modification is any operation + * that adds or deletes one or more mappings; merely changing the value + * associated with a key that an instance already contains is not a + * structural modification.) This is typically accomplished by + * synchronizing on some object that naturally encapsulates the map. + *

    + * If no such object exists, the map should be "wrapped" using the + * {@link Collections#synchronizedMap Collections.synchronizedMap} + * method. This is best done at creation time, to prevent accidental + * unsynchronized access to the map:

    + *   Map m = Collections.synchronizedMap(new VerifiedIdentityHashMap(...));
    + * + *

    The iterators returned by the iterator method of the + * collections returned by all of this class's "collection view + * methods" are fail-fast: if the map is structurally modified + * at any time after the iterator is created, in any way except + * through the iterator's own remove method, the iterator + * will throw a {@link ConcurrentModificationException}. Thus, in the + * face of concurrent modification, the iterator fails quickly and + * cleanly, rather than risking arbitrary, non-deterministic behavior + * at an undetermined time in the future. + * + *

    Note that the fail-fast behavior of an iterator cannot be guaranteed + * as it is, generally speaking, impossible to make any hard guarantees in the + * presence of unsynchronized concurrent modification. Fail-fast iterators + * throw ConcurrentModificationException on a best-effort basis. + * Therefore, it would be wrong to write a program that depended on this + * exception for its correctness: fail-fast iterators should be used only + * to detect bugs. + * + *

    Implementation note: This is a simple linear-probe hash table, + * as described for example in texts by Sedgewick and Knuth. The array + * alternates holding keys and values. (This has better locality for large + * tables than does using separate arrays.) For many JRE implementations + * and operation mixes, this class will yield better performance than + * {@link HashMap} (which uses chaining rather than linear-probing). + * + *

    This class is a member of the + * + * Java Collections Framework. + * + * @author Doug Lea and Josh Bloch + * @see System#identityHashCode(Object) + * @see Object#hashCode() + * @see Collection + * @see Map + * @see HashMap + * @see TreeMap + * @since 1.4 + */ + +public class VerifiedIdentityHashMap + extends AbstractMap + implements Map, java.io.Serializable, Cloneable { + + /*+KEY@ // JML specifically for KeY + @ public invariant + @ table != null && + @ MINIMUM_CAPACITY * (\bigint)2 <= table.length && + @ MAXIMUM_CAPACITY * (\bigint)2 >= table.length; + @ + @ // For all key-value pairs: if key == null, then value == null + @ public invariant + @ (\forall \bigint i; + @ 0 <= i && i < table.length / (\bigint)2; + @ (table[i * 2] == null ==> table[i * 2 + 1] == null)); + @ + @ // Non-empty keys are unique + @ public invariant + @ (\forall \bigint i; 0 <= i && i < table.length / (\bigint)2; + @ (\forall \bigint j; + @ i <= j && j < table.length / (\bigint)2; + @ (table[2 * i] != null && table[2 * i] == table[2 * j]) ==> i == j)); + @ + @ // Size equals the number of non-empty keys in the table + @ public invariant + @ size == (\num_of \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[2 * i] != null); + @ + @ // Table length is a power of two + @ public invariant + @ (\exists \bigint i; + @ 0 <= i < table.length; + @ \dl_pow(2,i) == table.length); + @ + @ // Table length is always an even number + @ public invariant + @ table.length % (\bigint)2 == 0; + @ + @ // Table must have at least one empty key-element to prevent + @ // infinite loops when a key is not present. + @ public invariant + @ (\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[2 * i] == null); + @ + @ // There are no gaps between a key's hashed index and its actual + @ // index (if the key is at a higher index than the hash code) + @ public invariant + @ (\forall \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[2 * i] != null && 2 * i > \dl_genHash(table[2 * i], table.length) ==> + @ (\forall \bigint j; + @ \dl_genHash(table[2 * i], table.length) / (\bigint)2 <= j < i; + @ table[2 * j] != null)); + @ + @ // There are no gaps between a key's hashed index and its actual + @ // index (if the key is at a lower index than the hash code) + @ public invariant + @ (\forall \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[2 * i] != null && 2 * i < \dl_genHash(table[2 * i], table.length) ==> + @ (\forall \bigint j; + @ \dl_genHash(table[2 * i], table.length) <= 2 * j < table.length || 0 <= 2 * j < 2 * i; + @ table[2 * j] != null)); + @ + @ // All keys and values are of type Object + @ public invariant + @ \typeof(table) == \type(Object[]); + @ + @ // Field modCount is of type integer (limits: + @ // Integer.MIN_VALUE and Integer.MAX_VALUE) + @ public invariant + @ \dl_inInt(modCount); + @ + @*/ + /*+OPENJML@ // JML for non-KeY tools, i.e. JJBMC + @ public invariant + @ table != null; // && + @ //MINIMUM_CAPACITY * 2 <= table.length && // is no longer valid as we set min and max to 4 + @ //MAXIMUM_CAPACITY * 2 >= table.length; + @ + @ // For all key-value pairs: if key == null, then value == null + @ public invariant + @ (\forall int i; + @ 0 <= i && i < table.length / 2; + @ (table[i * 2] == null ==> table[i * 2 + 1] == null)); + @ + @ // Non-empty keys are unique + @ public invariant + @ (\forall int i; 0 <= i && i < table.length / 2; + @ (\forall int j; + @ i <= j && j < table.length / 2; + @ (table[2*i] != null && table[2*i] == table[2*j]) ==> i == j)); + @ +// @ // Size equals the number of non-empty keys in the table +// @ public invariant +// @ size == (\num_of int i; +// @ 0 <= i < table.length / 2; +// @ table[2 * i] != null); +// @ + @ // Table length is a power of two + @ public invariant + @ (table.length & (table.length - 1)) == 0; + @ + @ // Table length is always an even number + @ public invariant + @ table.length % 2 == 0; + @ + @ // Table must have at least one empty key-element to prevent + @ // infinite loops when a key is not present. + @ public invariant + @ (\exists int i; + @ 0 <= i < table.length / 2; + @ table[2*i] == null); + @ + @ // There are no gaps between a key's hashed index and its actual + @ // index (if the key is at a higher index than the hash code) + @ public invariant + @ (\forall int i; + @ 0 <= i < table.length / 2; + @ table[2*i] != null && 2*i > hash(table[2*i], table.length) ==> + @ (\forall int j; + @ hash(table[2*i], table.length) / 2 <= j < i; + @ table[2*j] != null)); + @ +// @ // There are no gaps between a key's hashed index and its actual +// @ // index (if the key is at a lower index than the hash code) +// @ public invariant +// @ (\forall int i; +// @ 0 <= i < table.length / 2; +// @ table[2*i] != null && 2*i < hash(table[2*i], table.length) ==> +// @ (\forall int j; +// @ hash(table[2*i], table.length) <= 2*j < table.length || 0 <= 2*j < hash(table[2*i], table.length); +// @ table[2*j] != null)); +// @ +// @ // All keys and values are of type Object +// @ public invariant +// @ \typeof(table) == \type(Object[]); +// @ +// @ // Field modCount is of type integer (limits: +// @ // Integer.MIN_VALUE and Integer.MAX_VALUE) +// @ public invariant +// @ \dl_inInt(modCount); + @*/ + + /** + * The initial capacity used by the no-args constructor. + * MUST be a power of two. The value 32 corresponds to the + * (specified) expected maximum size of 21, given a load factor + * of 2/3. + */ + private /*@ spec_public @*/ static final int DEFAULT_CAPACITY = 32; // Original code. Disable for JJBMC + // private /*@ spec_public @*/ static final int DEFAULT_CAPACITY = 4; // Enable for JJBMC + + /** + * The minimum capacity, used if a lower value is implicitly specified + * by either of the constructors with arguments. The value 4 corresponds + * to an expected maximum size of 2, given a load factor of 2/3. + * MUST be a power of two. + */ + private /*@ spec_public @*/ static final int MINIMUM_CAPACITY = 4; + + /** + * The maximum capacity, used if a higher value is implicitly specified + * by either of the constructors with arguments. + * MUST be a power of two <= 1<<29. + *

    + * In fact, the map can hold no more than MAXIMUM_CAPACITY-1 items + * because it has to have at least one slot with the key == null + * in order to avoid infinite loops in get(), put(), remove() + */ + private /*@ spec_public @*/ static final int MAXIMUM_CAPACITY = 1 << 29; // Original code. Disable for JJBMC + // private /*@ spec_public @*/ static final int MAXIMUM_CAPACITY = 4; // Enable for JJBMC + + /** + * The table, resized as necessary. Length MUST always be a power of two. + */ + private /*@ spec_public nullable @*/ transient Object[] table; + + /** + * The number of key-value mappings contained in this identity hash map. + * + * @serial + */ + private /*@ spec_public @*/ int size; + + /** + * The number of modifications, to support fast-fail iterators + */ + private /*@ spec_public @*/ transient int modCount; + + /** + * Value representing null keys inside tables. + */ + private /*@ spec_public @*/ static final Object NULL_KEY = new Object(); + + /** + * Use NULL_KEY for key if it is null. + */ + /*@ private normal_behavior + @ ensures key == null ==> \result == NULL_KEY; + @ ensures key != null ==> \result == key; + @*/ + private /*@ spec_public @*/ static /*@ strictly_pure @*/ Object maskNull(/*@ nullable @*/ Object key) { + return (key == null ? NULL_KEY : key); + } + + /** + * Returns internal representation of null key back to caller as null. + */ + /*@ private normal_behavior + @ ensures key == NULL_KEY ==> \result == null; + @ ensures key != NULL_KEY ==> \result == key; + @*/ + private /*@ spec_public @*/ static /*@ strictly_pure nullable @*/ Object unmaskNull(Object key) { + return (key == NULL_KEY ? null : key); + } + + /** + * Constructs a new, empty identity hash map with a default expected + * maximum size (21). + */ + /*+KEY@ + @ private normal_behavior + @ ensures + @ table != null && + @ table.length == (\bigint)2 * DEFAULT_CAPACITY && + @ keySet == null && + @ values == null && + @ entrySet == null && + @ modCount == 0 && + @ size == 0 && + @ (\forall \bigint i; 0 <= i && i < table.length; table[i] == null); + @*/ + /*+OPENJML@ + @ private normal_behavior + @ ensures + @ table != null && + @ table.length == 2 * DEFAULT_CAPACITY && + @ keySet == null && + @ values == null && + @ entrySet == null && + @ modCount == 0 && + @ size == 0 && + @ (\forall int i; 0 <= i && i < table.length; table[i] == null); + @*/ + public VerifiedIdentityHashMap() { + init(DEFAULT_CAPACITY); + } + + /** + * Constructs a new, empty map with the specified expected maximum size. + * Putting more than the expected number of key-value mappings into + * the map may cause the internal data structure to grow, which may be + * somewhat time-consuming. + * + * @param expectedMaxSize the expected maximum size of the map + * @throws IllegalArgumentException if expectedMaxSize is negative + */ + public VerifiedIdentityHashMap(int expectedMaxSize) { + if (expectedMaxSize < 0) + throw new IllegalArgumentException("expectedMaxSize is negative: " + + expectedMaxSize); + init(capacity(expectedMaxSize)); + } + + /** + * Returns the appropriate capacity for the given expected maximum size. + * Returns the smallest power of two between MINIMUM_CAPACITY and + * MAXIMUM_CAPACITY, inclusive, that is greater than (3 * + * expectedMaxSize)/2, if such a number exists. Otherwise returns + * MAXIMUM_CAPACITY. + */ + /*+KEY@ + @ private normal_behavior + @ requires + @ expectedMaxSize > MAXIMUM_CAPACITY / (\bigint)3; + @ ensures + @ \result == MAXIMUM_CAPACITY; + @ + @ private normal_behavior + @ requires + @ expectedMaxSize <= MAXIMUM_CAPACITY / (\bigint)3 && + @ expectedMaxSize <= (\bigint)2 * MINIMUM_CAPACITY / 3; + @ ensures + @ \result == MINIMUM_CAPACITY; + @ + @ private normal_behavior + @ requires + @ expectedMaxSize <= MAXIMUM_CAPACITY / (\bigint)3 && + @ expectedMaxSize > (\bigint)2 * MINIMUM_CAPACITY / 3; + @ ensures + @ \result <= ((\bigint)3 * expectedMaxSize) && + @ (\bigint)2 * \result > ((\bigint)3 * expectedMaxSize); + @ ensures + @ (\exists \bigint i; + @ 0 <= i < \result; + @ \dl_pow(2,i) == \result); // result is a power of two + @*/ + /*+OPENJML@ + @ private normal_behavior + @ requires + @ expectedMaxSize > MAXIMUM_CAPACITY / 3; + @ ensures + @ \result == MAXIMUM_CAPACITY; + @ + @ private normal_behavior + @ requires + @ expectedMaxSize <= MAXIMUM_CAPACITY / 3 && + @ expectedMaxSize <= 2 * MINIMUM_CAPACITY / 3; + @ ensures + @ \result == MINIMUM_CAPACITY; + @ + @ private normal_behavior + @ requires + @ expectedMaxSize <= MAXIMUM_CAPACITY / 3 && + @ expectedMaxSize > 2 * MINIMUM_CAPACITY / 3; + @ ensures + @ \result <= (3 * expectedMaxSize) && + @ 2 * \result > (3 * expectedMaxSize); + @ ensures + @ (\result & (\result - 1)) == 0; // result is a power of two + @*/ + private static /*@ strictly_pure @*/ int capacity(int expectedMaxSize) { + // assert expectedMaxSize >= 0; + return + (expectedMaxSize > MAXIMUM_CAPACITY / 3) ? MAXIMUM_CAPACITY : + (expectedMaxSize <= 2 * MINIMUM_CAPACITY / 3) ? MINIMUM_CAPACITY : + Integer.highestOneBit(expectedMaxSize + (expectedMaxSize << 1)); + } + + /** + * Initializes object to be an empty map with the specified initial + * capacity, which is assumed to be a power of two between + * MINIMUM_CAPACITY and MAXIMUM_CAPACITY inclusive. + */ + /*+KEY@ + @ private normal_behavior + @ requires + @ (\exists \bigint i; 0 <= i < initCapacity; \dl_pow(2,i) == initCapacity) && + @ initCapacity >= MINIMUM_CAPACITY && + @ initCapacity <= MAXIMUM_CAPACITY && + @ \dl_inInt(modCount); + @ assignable + @ table; + @ ensures + @ table != null && + @ \typeof(table) == \type(Object[]) && + @ (\forall \bigint i; 0 <= i < table.length; table[i] == null) && + @ table.length == (\bigint)2 * initCapacity; + @*/ + /*+OPENJML@ + @ private normal_behavior + @ requires + @ (initCapacity & (initCapacity - 1)) == 0 && + @ initCapacity >= MINIMUM_CAPACITY && + @ initCapacity <= MAXIMUM_CAPACITY; + @ assignable + @ table; + @ ensures + @ table != null && + @ (\forall int i; 0 <= i < table.length; table[i] == null) && + @ table.length == 2 * initCapacity; + @*/ + private /*@ helper @*/ void init(int initCapacity) { + // assert (initCapacity & -initCapacity) == initCapacity; // power of 2 + // assert initCapacity >= MINIMUM_CAPACITY; + // assert initCapacity <= MAXIMUM_CAPACITY; + + table = new Object[2 * initCapacity]; + } + + /** + * Constructs a new identity hash map containing the keys-value mappings + * in the specified map. + * + * @param m the map whose mappings are to be placed into this map + * @throws NullPointerException if the specified map is null + */ + public VerifiedIdentityHashMap(Map m) { + // Allow for a bit of growth + this((int) ((1 + m.size()) * 1.1)); + putAll(m); + } + + /** + * Returns the number of key-value mappings in this identity hash map. + * + * @return the number of key-value mappings in this map + */ + /*@ also + @ public normal_behavior + @ ensures + @ \result == size; + @*/ + public /*@ strictly_pure @*/ int size() { + return size; + } + + /** + * Returns true if this identity hash map contains no key-value + * mappings. + * + * @return true if this identity hash map contains no key-value + * mappings + */ + /*@ also + @ public normal_behavior + @ ensures + @ \result <==> size == 0; + @*/ + public /*@ strictly_pure @*/ boolean isEmpty() { + return size == 0; + } + + /** + * Returns index for Object x. + */ + /*+KEY@ + @ private normal_behavior + @ ensures + @ (x == null ==> \result == 0) && + @ \result == \dl_genHash(x, length) && + @ \result % 2 == 0 && + @ \result < length && + @ \result >= 0; + @*/ + private /*@ spec_public @*/ static /*@ strictly_pure @*/ int hash(Object x, int length) { + int h = System.identityHashCode(x); + // Multiply by -127, and left-shift to use least bit as part of hash + return ((h << 1) - (h << 8)) & (length - 1); + } + + /** + * Circularly traverses table of size len. + */ + /*@ private normal_behavior + @ ensures + @ (i + 2 < len ==> \result == i + 2) && + @ (i + 2 >= len ==> \result == 0); + @*/ + private static /*@ strictly_pure @*/ int nextKeyIndex(int i, int len) { + return (i + 2 < len ? i + 2 : 0); + } + + /** + * Returns the value to which the specified key is mapped, + * or {@code null} if this map contains no mapping for the key. + * + *

    More formally, if this map contains a mapping from a key + * {@code k} to a value {@code v} such that {@code (key == k)}, + * then this method returns {@code v}; otherwise it returns + * {@code null}. (There can be at most one such mapping.) + * + *

    A return value of {@code null} does not necessarily + * indicate that the map contains no mapping for the key; it's also + * possible that the map explicitly maps the key to {@code null}. + * The {@link #containsKey containsKey} operation may be used to + * distinguish these two cases. + * + * @see #put(Object, Object) + */ + /*+KEY@ + @ // Key exists + @ also + @ public normal_behavior + @ requires + @ (\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i * 2] == maskNull(key)); + @ ensures + @ (\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i * 2] == maskNull(key) && \result == table[i * 2 + 1]); + @ + @ // Key does not exist + @ also + @ public normal_behavior + @ requires + @ !(\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i * 2] == maskNull(key)); + @ ensures + @ \result == null; + @*/ + /*+OPENJML@ + @ // Key exists + @ also + @ public normal_behavior + @ requires + @ (\exists int i; + @ 0 <= i < table.length / 2; + @ table[i * 2] == maskNull(key)); + @ ensures + @ (\exists int i; + @ 0 <= i < table.length / 2; + @ table[i * 2] == maskNull(key) && \result == table[i * 2 + 1]); + @ + @ // Key does not exist + @ also + @ public normal_behavior + @ requires + @ !(\exists int i; + @ 0 <= i < table.length / 2; + @ table[i * 2] == maskNull(key)); + @ ensures + @ \result == null; + @*/ + public /*@ pure nullable @*/ java.lang.Object get(/*@ nullable @*/ Object key) { + Object k = maskNull(key); + Object[] tab = table; + int len = tab.length; + int i = hash(k, len); + + //+KEY@ ghost \bigint hash = i; + + /*+KEY@ + @ // Index i is always an even value within the array bounds + @ maintaining + @ i >= 0 && i < len && i % (\bigint)2 == 0; + @ + @ // Suppose i > hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the interval [hash..i-2]. + @ maintaining + @ (i > hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); + @ + @ // Suppose i < hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. + @ maintaining + @ (i < hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && + @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); + @ + @ decreasing hash > i ? hash - i : hash + len - i; + @ + @ assignable \strictly_nothing; + @*/ + while (true) { + Object item = tab[i]; + if (item == k) + return (java.lang.Object) tab[i + 1]; + if (item == null) + return null; + i = nextKeyIndex(i, len); + } + } + + /** + * Tests whether the specified object reference is a key in this identity + * hash map. + * + * @param key possible key + * @return true if the specified object reference is a key + * in this map + * @see #containsValue(Object) + */ + /*+KEY@ + @ also + @ public normal_behavior + @ ensures + @ \result <==> (\exists \bigint j; + @ 0 <= j < (table.length / (\bigint)2); + @ table[j * 2] == maskNull(key)); + @*/ + /*+OPENJML@ + @ also + @ public normal_behavior + @ ensures + @ \result <==> (\exists int j; + @ 0 <= j < (table.length / 2); + @ table[j * 2] == maskNull(key)); + @*/ + public /*@ strictly_pure @*/ boolean containsKey(/*@ nullable @*/ Object key) { + Object k = maskNull(key); + Object[] tab = table; + int len = tab.length; + int i = hash(k, len); + + //+KEY@ ghost \bigint hash = i; + + /*+KEY@ + @ // Index i is always an even value within the array bounds + @ maintaining + @ i >= 0 && i < len && i % (\bigint)2 == 0; + @ + @ // Suppose i > hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the interval [hash..i-2]. + @ maintaining + @ (i > hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); + @ + @ // Suppose i < hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. + @ maintaining + @ (i < hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && + @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); + @ + @ decreasing hash > i ? hash - i : hash + len - i; + @ + @ assignable \strictly_nothing; + @*/ + while (true) { + Object item = tab[i]; + if (item == k) + return true; + if (item == null) + return false; + i = nextKeyIndex(i, len); + } + } + + /** + * Tests whether the specified object reference is a value in this identity + * hash map. + * + * @param value value whose presence in this map is to be tested + * @return true if this map maps one or more keys to the + * specified object reference + * @see #containsKey(Object) + */ + /*+KEY@ + @ also + @ public normal_behavior + @ ensures + @ \result <==> (\exists \bigint j; + @ 0 <= j < table.length / (\bigint)2; + @ table[j * (\bigint)2] != null && table[j * (\bigint)2 + 1] == value); + @*/ + /*+OPEN_JML@ + @ also + @ public normal_behavior + @ ensures + @ \result <==> (\exists int j; + @ 0 <= j < table.length / 2; + @ table[j * 2] != null && table[j * 2 + 1] == value); + @*/ + public /*@ strictly_pure @*/ boolean containsValue(/*@ nullable @*/ Object value) { + Object[] tab = table; + + /*+KEY@ + @ // Index i is always an odd value within the array bounds + @ maintaining + @ i >= 1 && i <= tab.length+1 && i % (\bigint)2 == 1; + @ + @ // There cannot be an odd index n < i containing the value we are looking for (unless + @ // the associated key is null, in which case the value is ignored). + @ maintaining + @ (\forall \bigint n; 1 <= n < i && n % 2 == 1; tab[n - 1] != null ==> tab[n] != value); + @ + @ decreasing tab.length + 1 - i; + @ + @ assignable \strictly_nothing; + @*/ + for (int i = 1; i < tab.length; i += 2) + if (tab[i] == value && tab[i - 1] != null) + return true; + + return false; + } + + /** + * Tests if the specified key-value mapping is in the map. + * + * @param key possible key + * @param value possible value + * @return true if and only if the specified key-value + * mapping is in the map + */ + /*+KEY@ + @ private normal_behavior + @ ensures + @ \result <==> (\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); + @*/ + /*+OPENJML@ + @ private normal_behavior + @ ensures + @ \result <==> (\exists int i; + @ 0 <= i < table.length / 2; + @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); + @*/ + private /*@ spec_public @*/ /*@ strictly_pure @*/ boolean containsMapping(Object key, Object value) { + Object k = maskNull(key); + Object[] tab = table; + int len = tab.length; + int i = hash(k, len); + + //+KEY@ ghost \bigint hash = i; + + /*+KEY@ + @ // Index i is always an even value within the array bounds + @ maintaining + @ i >= 0 && i < len && i % (\bigint)2 == 0; + @ + @ // Suppose i > hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the interval [hash..i-2]. + @ maintaining + @ (i > hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); + @ + @ // Suppose i < hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. + @ maintaining + @ (i < hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && + @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); + @ + @ decreasing hash > i ? hash - i : hash + len - i; + @ + @ assignable \strictly_nothing; + @*/ + while (true) { + Object item = tab[i]; + if (item == k) + return tab[i + 1] == value; + if (item == null) + return false; + i = nextKeyIndex(i, len); + } + } + + /** + * Associates the specified value with the specified key in this identity + * hash map. If the map previously contained a mapping for the key, the + * old value is replaced. + * + * @param key the key with which the specified value is to be associated + * @param value the value to be associated with the specified key + * @return the previous value associated with key, or + * null if there was no mapping for key. + * (A null return can also indicate that the map + * previously associated null with key.) + * @see Object#equals(Object) + * @see #get(Object) + * @see #containsKey(Object) + */ + /*+KEY@ + @ also + @ private exceptional_behavior + @ requires + @ size == MAXIMUM_CAPACITY - 1; + @ requires + @ // The key is not present in the table + @ !(\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i * 2] == maskNull(key)); + @ assignable + @ \nothing; + @ signals_only + @ IllegalStateException; + @ signals + @ (IllegalStateException e) true; + @ also + @ public normal_behavior + @ requires + @ // The key is already present in the table + @ (\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i*2] == maskNull(key)); + @ assignable + @ table[*]; + @ ensures + @ // The new value is associated with key and + @ // the old value associated with key is returned + @ (\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i*2] == maskNull(key) && + @ \result == \old(table[i * 2 + 1]) && + @ table[i * 2 + 1] == value); + @ ensures + @ // After execution, all keys are unchanged and all old values are unchanged + @ // except the old value that was associated with key + @ (\forall \bigint i; + @ 0 <= i < \old(table.length) / (\bigint)2; + @ (\old(table[i * 2]) == table[i * 2]) && + @ (\old(table[i * 2]) != maskNull(key) ==> + @ \old(table[i * 2 + 1]) == table[i * 2 + 1])); + @ also + @ public normal_behavior + @ requires + @ size < MAXIMUM_CAPACITY - 1; + @ requires + @ // The key is not present in the table + @ !(\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i * 2] == maskNull(key)); + @ assignable + @ size, table[*], modCount, table; + @ ensures + @ // size must be increased by 1, modCount must change, and null must be returned + @ size == \old(size) + 1 && modCount != \old(modCount) && \result == null; + @ ensures + @ // After execution, all old keys are still present and all old values are still present + @ (\forall \bigint i; + @ 0 <= i < \old(table.length) / (\bigint)2; + @ (\exists \bigint j; + @ 0 <= j < table.length / (\bigint)2; + @ (\old(table[i * 2]) == table[j * 2]) && + @ \old(table[i * 2 + 1]) == table[j * 2 + 1])); + @ ensures + @ // After execution, the table contains the new key associated with the new value + @ (\exists \bigint i; + @ 0 <= i < table.length / (\bigint)2; + @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); + @*/ + /*+OPENJML@ + @ also + @ public normal_behavior + @ requires + @ // The key is already present in the table + @ (\exists int i; + @ 0 <= i < table.length / 2; + @ table[i*2] == maskNull(key)); + @ assignable + @ table[*]; + @ ensures + @ // The new value is associated with key and + @ // the old value associated with key is returned + @ (\exists int i; + @ 0 <= i < table.length / 2; + @ table[i*2] == maskNull(key) && + @ \result == \old(table[i * 2 + 1]) && + @ table[i * 2 + 1] == value); + @ ensures + @ // After execution, all keys are unchanged and all old values are unchanged + @ // except the old value that was associated with key + @ (\forall int i; + @ 0 <= i < \old(table.length) / 2; + @ (\old(table[i * 2]) == table[i * 2]) && + @ (\old(table[i * 2]) != maskNull(key) ==> + @ \old(table[i * 2 + 1]) == table[i * 2 + 1])); + @ also + @ public normal_behavior + @ requires + @ size < MAXIMUM_CAPACITY - 1; + @ requires + @ // The key is not present in the table + @ !(\exists int i; + @ 0 <= i < table.length / 2; + @ table[i * 2] == maskNull(key)); + @ assignable + @ size, table[*], modCount, table; + @ ensures + @ // size must be increased by 1, modCount must change, and null must be returned + @ size == \old(size) + 1 && modCount != \old(modCount) && \result == null; + @ ensures + @ // After execution, all old keys are still present and all old values are still present + @ (\forall int i; + @ 0 <= i < \old(table.length) / 2; + @ (\exists int j; + @ 0 <= j < table.length / 2; + @ (\old(table[i * 2]) == table[j * 2]) && + @ \old(table[i * 2 + 1]) == table[j * 2 + 1])); + @ ensures + @ // After execution, the table contains the new key associated with the new value + @ (\exists int i; + @ 0 <= i < table.length / 2; + @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); + @*/ + public /*@ nullable @*/ java.lang.Object put(/*@ nullable @*/ java.lang.Object key, /*@ nullable @*/ java.lang.Object value) { + final Object k = maskNull(key); + + retryAfterResize: + for (; ; ) { + final Object[] tab = table; + final int len = tab.length; + int i = hash(k, len); + + //+KEY@ ghost \bigint hash = i; + + /*+KEY@ + @ // Index i is always an even value within the array bounds + @ maintaining + @ tab == table && len == tab.length && + @ i >= 0 && i < (len - (\bigint)1) && i % (\bigint)2 == 0; + @ + @ // Suppose i > hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the interval [hash..i-2]. + @ maintaining + @ (i > hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); + @ + @ // Suppose i < hash. This can only be the case when no key k and no null is present + @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. + @ maintaining + @ (i < hash) ==> + @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && + @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); + @ + @ decreasing hash > i ? hash - i : len + hash - i; + @ + @ // if the loop iteration completes, the heap is unchanged + @ // in case key is present, table is updated but the loop iteration terminates without + @ // completing because the method returns, so the assignable clause need not hold + @ assignable \strictly_nothing; + @*/ + for (Object item; (item = tab[i]) != null; + i = nextKeyIndex(i, len)) { + if (item == k) { + java.lang.Object oldValue = (java.lang.Object) tab[i + 1]; + tab[i + 1] = value; + return oldValue; + } + } + + final int s = size + 1; + // Use optimized form of 3 * s. + // Next capacity is len, 2 * current capacity. + if (s + (s << 1) > len && resize(len)) + continue retryAfterResize; + + modCount++; + tab[i] = k; + tab[i + 1] = value; + size = s; + return null; + } + } + + /** + * Resizes the table if necessary to hold given capacity. + * + * @param newCapacity the new capacity, must be a power of two. + * @return whether a resize did in fact take place + */ + /*+KEY@ + @ // Throws an exception when table.length == 2 * MAXIMUM_CAPACITY && + @ // size == MAXIMUM_CAPACITY - 1. + @ private exceptional_behavior + @ requires + @ table.length == (\bigint)2 * MAXIMUM_CAPACITY && + @ size == MAXIMUM_CAPACITY - 1; + @ assignable + @ \nothing; + @ signals_only + @ IllegalStateException; + @ signals + @ (IllegalStateException e) true; + @ + @ // Nothing changes if table.length == 2 * MAXIMUM_CAPACITY && + @ // size < MAXIMUM_CAPACITY - 1. + @ private normal_behavior + @ requires + @ table.length == (\bigint)2 * MAXIMUM_CAPACITY && + @ size < MAXIMUM_CAPACITY - 1; + @ assignable + @ \strictly_nothing; + @ ensures + @ \result == false; + @ + @ // Nothing changes when table.length < 2 * MAXIMUM_CAPACITY && + @ // table.length >= 2 * newCapacity. + @ private normal_behavior + @ requires + @ table.length < (\bigint)2 * MAXIMUM_CAPACITY && + @ table.length >= (\bigint)2 * newCapacity && + @ newCapacity >= MINIMUM_CAPACITY && + @ newCapacity <= (\bigint)2 * MAXIMUM_CAPACITY; + @ + @ assignable + @ \strictly_nothing; + @ + @ ensures + @ // Map is unchanged, so return false + @ \result == false; + @ + @ + @ // If we actually resize (table.length < 2 * MAXIMUM_CAPACITY && table.length < 2 * newCapacity) + @ // then rehash the table with the new length to re-establish the class invariant. + @ private normal_behavior + @ requires + @ table.length < (\bigint)2 * newCapacity && + @ newCapacity <= MAXIMUM_CAPACITY && + @ newCapacity >= MINIMUM_CAPACITY && + @ (\exists \bigint i; + @ 0 <= i < newCapacity; + @ \dl_pow(2,i) == newCapacity); + @ + @ assignable + @ table, table[*]; + @ + @ ensures + @ table.length == (newCapacity * (\bigint)2); + @ + @ ensures + @ // After execution, all old entries are still present + @ (\forall \bigint i; + @ 0 <= i < \old(table.length) && i % 2 == 0; + @ (\exists \bigint j; + @ 0 <= j < table.length && j % 2 == 0; + @ \old(table[i]) == table[j] && \old(table[i + 1]) == table[j + 1])); + @ + @ ensures + @ // Map is changed, so return true + @ \result == true; + @ + @ ensures + @ \fresh(table); + @ + @ ensures + @ // All entries in the new table were also present in \old(table) + @ (\forall \bigint n; + @ 0 <= n < table.length / (\bigint)2; + @ (\exists \bigint m; + @ 0 <= m < \old(table.length) / (\bigint)2; + @ table[2*n] == \old(table[2*m]) && table[2*n + 1] == \old(table[2*m + 1]))); + @*/ + /*+OPENJML@ + @ // Nothing changes if table.length == 2 * MAXIMUM_CAPACITY && + @ // size < MAXIMUM_CAPACITY - 1. + @ private normal_behavior + @ requires + @ table.length == 2 * MAXIMUM_CAPACITY && + @ size < MAXIMUM_CAPACITY - 1; + @ assignable + @ \strictly_nothing; + @ ensures + @ \result == false; + @ + @ // Nothing changes when table.length < 2 * MAXIMUM_CAPACITY && + @ // table.length >= 2 * newCapacity. + @ private normal_behavior + @ requires + @ table.length < 2 * MAXIMUM_CAPACITY && + @ table.length >= 2 * newCapacity && + @ newCapacity >= MINIMUM_CAPACITY && + @ newCapacity <= 2 * MAXIMUM_CAPACITY; + @ + @ assignable + @ \strictly_nothing; + @ + @ ensures + @ // Map is unchanged, so return false + @ \result == false; + @ + @ + @ // If we actually resize (table.length < 2 * MAXIMUM_CAPACITY && table.length < 2 * newCapacity) + @ // then rehash the table with the new length to re-establish the class invariant. + @ private normal_behavior + @ requires + @ table.length < 2 * newCapacity && + @ newCapacity <= MAXIMUM_CAPACITY && + @ newCapacity >= MINIMUM_CAPACITY && + @ (\exists int i; + @ 0 <= i < newCapacity; + @ (newCapacity & (newCapacity - 1)) == 0); + @ + @ assignable + @ table, table[*]; + @ + @ ensures + @ table.length == (newCapacity * 2); + @ + @ ensures + @ // After execution, all old entries are still present + @ (\forall int i; + @ 0 <= i < \old(table.length) && i % 2 == 0; + @ (\exists int j; + @ 0 <= j < table.length && j % 2 == 0; + @ \old(table[i]) == table[j] && \old(table[i + 1]) == table[j + 1])); + @ + @ ensures + @ // Map is changed, so return true + @ \result == true; + @ + @ ensures + @ \fresh(table); + @ + @ ensures + @ // All entries in the new table were also present in \old(table) + @ (\forall int n; + @ 0 <= n < table.length / 2; + @ (\exists int m; + @ 0 <= m < \old(table.length) / 2; + @ table[2*n] == \old(table[2*m]) && table[2*n + 1] == \old(table[2*m + 1]))); + @*/ + private boolean resize(int newCapacity) + // assert (newCapacity & -newCapacity) == newCapacity; // power of 2 + { + int newLength = newCapacity * 2; + + Object[] oldTable = table; + int oldLength = oldTable.length; + if (oldLength == 2 * MAXIMUM_CAPACITY) { // can't expand any further + if (size == MAXIMUM_CAPACITY - 1) + throw new IllegalStateException("Capacity exhausted."); + return false; + } + if (oldLength >= newLength) + return false; + + Object[] newTable = new Object[newLength]; + + /*+KEY@ + @ // All processed entries are copied to newTable + @ maintaining + @ (\forall \bigint k; + @ 0 <= k < j && k % 2 == 0; + @ (\exists \bigint l; + @ 0 <= l < newTable.length && l % 2 == 0; + @ \old(table[k]) == newTable[l] && \old(table[k + 1]) == newTable[l + 1])); + @ + @ // All (non-null) entries in newTable are also present in \old(table) + @ maintaining + @ (\forall \bigint n; + @ 0 <= n < newTable.length && n % 2 == 0 && newTable[n] != null; + @ (\exists \bigint m; + @ 0 <= m < j && m % 2 == 0; + @ newTable[n] == \old(table[m]) && newTable[n + 1] == \old(table[m + 1]))); + @ + @ // All unprocessed entries are still untouched in old table + @ maintaining + @ (\forall \bigint k; + @ j <= k < \old(table.length); + @ \old(table[k]) == oldTable[k]); + @ + @ // The number of non-null keys in newTable equals the number of copied keys + @ maintaining + @ (\num_of \bigint i; 0 <= i < j / (\bigint)2; \old(table[2 * i]) != null) + @ == (\num_of \bigint i; 0 <= i < newTable.length / (\bigint)2; newTable[2 * i] != null); + @ + @ // For all key-value pairs: if key == null, then value == null + @ maintaining + @ (\forall \bigint i; + @ 0 <= i && i < newTable.length / (\bigint)2; + @ (newTable[i * (\bigint)2] == null ==> newTable[i * (\bigint)2 + 1] == null)); + @ + @ // Non-empty keys in newTable are unique + @ maintaining + @ (\forall \bigint p; 0 <= p && p < newTable.length / (\bigint)2; + @ (\forall \bigint q; + @ p <= q && q < newTable.length / (\bigint)2; + @ (newTable[2 * p] != null && newTable[2 * p] == newTable[2 * q]) ==> p == q)); + @ + @ // There are no gaps between a key's hashed index and its actual + @ // index (if the key is at a higher index than the hash code) + @ maintaining + @ (\forall \bigint g; + @ 0 <= g < newTable.length / (\bigint)2; + @ newTable[2 * g] != null && 2 * g > \dl_genHash(newTable[2 * g], newTable.length) ==> + @ (\forall \bigint h; + @ \dl_genHash(newTable[2 * g], newTable.length) / (\bigint)2 <= h < g; + @ newTable[2 * h] != null)); + @ + @ // There are no gaps between a key's hashed index and its actual + @ // index (if the key is at a lower index than the hash code) + @ maintaining + @ (\forall \bigint g; + @ 0 <= g < newTable.length / (\bigint)2; + @ newTable[2 * g] != null && 2 * g < \dl_genHash(newTable[2 * g], newTable.length) ==> + @ (\forall \bigint h; + @ \dl_genHash(newTable[2 * g], newTable.length) <= 2 * h < newTable.length || 0 <= 2 * h < 2 * g; + @ newTable[2 * h] != null)); + @ + @ // Table must have at least one empty key-element to prevent + @ // infinite loops when a key is not present. + @ maintaining + @ (\exists \bigint i; + @ 0 <= i < newTable.length / (\bigint)2; + @ newTable[2*i] == null); + @ + @ maintaining + @ j >= 0 && j <= oldLength && j % (\bigint)2 == 0; + @ + @ assignable + @ table[*], newTable[*]; + @ + @ decreasing + @ oldLength - j; + @*/ + for (int j = 0; j < oldLength; j += 2) { + Object key = oldTable[j]; + if (key != null) { + Object value = oldTable[j + 1]; + oldTable[j] = null; + oldTable[j + 1] = null; + int i = hash(key, newLength); + + //+KEY@ ghost \bigint hash = i; + + /*+KEY@ + @ // Index i is always an even value within the array bounds + @ maintaining + @ i >= 0 && i < newLength && i % (\bigint)2 == 0; + @ + @ // There are no gaps in the segment [hash .. i) + @ // (if the current index is higher than the hash) + @ maintaining + @ (\forall \bigint g; + @ hash <= 2 * g < i; + @ newTable[2 * g] != null); + @ + @ // There are no gaps in the segment [0 .. i) and [hash .. newLength) + @ // (if the current index is lower (wrap around) than the hash) + @ maintaining + @ (i < hash) ==> + @ (\forall \bigint g; + @ (0 <= 2 * g < i) || (hash <= 2 * g < newLength); + @ newTable[2 * g] != null); + @ + @ assignable + @ \strictly_nothing; + @ + @ decreasing + @ hash > i ? hash - i : newLength + hash - i; + @*/ + while (newTable[i] != null) + i = nextKeyIndex(i, newLength); + newTable[i] = key; + newTable[i + 1] = value; + } + } + table = newTable; + return true; + } + + /** + * Copies all of the mappings from the specified map to this map. + * These mappings will replace any mappings that this map had for + * any of the keys currently in the specified map. + * + * @param m mappings to be stored in this map + * @throws NullPointerException if the specified map is null + */ + public void putAll(Map m) { + int n = m.size(); + if (n == 0) + return; + if (n > size) + resize(capacity(n)); // conservatively pre-expand + + for (Object o : m.entrySet()) { + Entry e = (Entry) o; + put(e.getKey(), e.getValue()); + } + } + + /** + * Removes the mapping for this key from this map if present. + * + * @param key key whose mapping is to be removed from the map + * @return the previous value associated with key, or + * null if there was no mapping for key. + * (A null return can also indicate that the map + * previously associated null with key.) + */ + public java.lang.Object remove(Object key) { + Object k = maskNull(key); + Object[] tab = table; + int len = tab.length; + int i = hash(k, len); + + //+KEY@ ghost \bigint hash = i; + + /*+KEY@ + @ loop_invariant true; // TODO: see containsKey() + @ decreasing len - (len + i - hash) % len; + @ assignable i, modCount, size, tab[*]; + @*/ + while (true) { + Object item = tab[i]; + if (item == k) { + modCount++; + size--; + @SuppressWarnings("unchecked") java.lang.Object oldValue = (java.lang.Object) tab[i + 1]; + tab[i + 1] = null; + tab[i] = null; + closeDeletion(i); + return oldValue; + } + if (item == null) + return null; + i = nextKeyIndex(i, len); + } + } + + /** + * Removes the specified key-value mapping from the map if it is present. + * + * @param key possible key + * @param value possible value + * @return true if and only if the specified key-value + * mapping was in the map + */ + private boolean removeMapping(Object key, Object value) { + Object k = maskNull(key); + Object[] tab = table; + int len = tab.length; + int i = hash(k, len); + + while (true) { + Object item = tab[i]; + if (item == k) { + if (tab[i + 1] != value) + return false; + modCount++; + size--; + tab[i] = null; + tab[i + 1] = null; + closeDeletion(i); + return true; + } + if (item == null) + return false; + i = nextKeyIndex(i, len); + } + } + + /** + * Rehash all possibly-colliding entries following a + * deletion. This preserves the linear-probe + * collision properties required by get, put, etc. + * + * @param d the index of a newly empty deleted slot + */ + private void closeDeletion(int d) + // Adapted from Knuth Section 6.4 Algorithm R + { + Object[] tab = table; + int len = tab.length; + + // Look for items to swap into newly vacated slot + // starting at index immediately following deletion, + // and continuing until a null slot is seen, indicating + // the end of a run of possibly-colliding keys. + Object item; + for (int i = nextKeyIndex(d, len); (item = tab[i]) != null; + i = nextKeyIndex(i, len)) + // The following test triggers if the item at slot i (which + // hashes to be at slot r) should take the spot vacated by d. + // If so, we swap it in, and then continue with d now at the + // newly vacated i. This process will terminate when we hit + // the null slot at the end of this run. + // The test is messy because we are using a circular table. + { + int r = hash(item, len); + if ((i < r && (r <= d || d <= i)) || (r <= d && d <= i)) { + tab[d] = item; + tab[d + 1] = tab[i + 1]; + tab[i] = null; + tab[i + 1] = null; + d = i; + } + } + } + + /** + * Removes all of the mappings from this map. + * The map will be empty after this call returns. + */ + /*+KEY@ + @ also + @ public normal_behavior + @ assignable + @ modCount, size, table[0 .. table.length - (\bigint)1]; + @ ensures + @ \old(modCount) != modCount && + @ \old(table.length) == table.length && + @ size == 0 && + @ (\forall \bigint i; + @ 0 <= i < table.length; + @ table[i] == null); + @*/ + /*+OPENJML@ + @ also + @ public normal_behavior + @ assignable + @ modCount, size, table[0 .. table.length - 1]; + @ ensures + @ \old(modCount) != modCount && + @ \old(table.length) == table.length && + @ size == 0 && + @ (\forall int i; + @ 0 <= i < table.length; + @ table[i] == null); + @*/ + public void clear() { + modCount++; + Object[] tab = table; + + /*+KEY@ + @ maintaining + @ 0 <= i && i <= tab.length; + @ maintaining + @ (\forall \bigint j; 0 <= j < i; tab[j] == null); + @ decreasing + @ tab.length - i; + @ assignable + @ tab[0 .. tab.length - (\bigint)1]; + @*/ + for (int i = 0; i < tab.length; i++) + tab[i] = null; + size = 0; + } + + /** + * Compares the specified object with this map for equality. Returns + * true if the given object is also a map and the two maps + * represent identical object-reference mappings. More formally, this + * map is equal to another map m if and only if + * this.entrySet().equals(m.entrySet()). + * + *

    Owing to the reference-equality-based semantics of this map it is + * possible that the symmetry and transitivity requirements of the + * Object.equals contract may be violated if this map is compared + * to a normal map. However, the Object.equals contract is + * guaranteed to hold among VerifiedIdentityHashMap instances. + * + * @param o object to be compared for equality with this map + * @return true if the specified object is equal to this map + * @see Object#equals(Object) + */ + public boolean equals(Object o) { + if (o == this) { + return true; + } else if (o instanceof VerifiedIdentityHashMap) { + VerifiedIdentityHashMap m = (VerifiedIdentityHashMap) o; + if (m.size() != size) + return false; + + Object[] tab = m.table; + for (int i = 0; i < tab.length; i += 2) { + Object k = tab[i]; + if (k != null && !containsMapping(k, tab[i + 1])) + return false; + } + return true; + } else if (o instanceof Map) { + Map m = (Map) o; + return entrySet().equals(m.entrySet()); + } else { + return false; // o is not a Map + } + } + + /** + * Returns the hash code value for this map. The hash code of a map is + * defined to be the sum of the hash codes of each entry in the map's + * entrySet() view. This ensures that m1.equals(m2) + * implies that m1.hashCode()==m2.hashCode() for any two + * VerifiedIdentityHashMap instances m1 and m2, as + * required by the general contract of {@link Object#hashCode}. + * + *

    Owing to the reference-equality-based semantics of the + * Map.Entry instances in the set returned by this map's + * entrySet method, it is possible that the contractual + * requirement of Object.hashCode mentioned in the previous + * paragraph will be violated if one of the two objects being compared is + * an VerifiedIdentityHashMap instance and the other is a normal map. + * + * @return the hash code value for this map + * @see Object#equals(Object) + * @see #equals(Object) + */ + public int hashCode() { + int result = 0; + Object[] tab = table; + for (int i = 0; i < tab.length; i += 2) { + Object key = tab[i]; + if (key != null) { + Object k = unmaskNull(key); + result += System.identityHashCode(k) ^ + System.identityHashCode(tab[i + 1]); + } + } + return result; + } + + /** + * Returns a shallow copy of this identity hash map: the keys and values + * themselves are not cloned. + * + * @return a shallow copy of this map + */ + public Object clone() { + try { + VerifiedIdentityHashMap m = (VerifiedIdentityHashMap) super.clone(); + m.entrySet = null; + m.table = table.clone(); + return m; + } catch (CloneNotSupportedException e) { + throw new InternalError(); + } + } + + private abstract class IdentityHashMapIterator implements Iterator { + int index = (size != 0 ? 0 : table.length); // current slot. + int expectedModCount = modCount; // to support fast-fail + int lastReturnedIndex = -1; // to allow remove() + boolean indexValid; // To avoid unnecessary next computation + Object[] traversalTable = table; // reference to main table or copy + + public boolean hasNext() { + Object[] tab = traversalTable; + for (int i = index; i < tab.length; i += 2) { + Object key = tab[i]; + if (key != null) { + index = i; + return indexValid = true; + } + } + index = tab.length; + return false; + } + + protected int nextIndex() { + if (modCount != expectedModCount) + throw new ConcurrentModificationException(); + if (!indexValid && !hasNext()) + throw new NoSuchElementException(); + + indexValid = false; + lastReturnedIndex = index; + index += 2; + return lastReturnedIndex; + } + + public void remove() { + if (lastReturnedIndex == -1) + throw new IllegalStateException(); + if (modCount != expectedModCount) + throw new ConcurrentModificationException(); + + expectedModCount = ++modCount; + int deletedSlot = lastReturnedIndex; + lastReturnedIndex = -1; + // back up index to revisit new contents after deletion + index = deletedSlot; + indexValid = false; + + // Removal code proceeds as in closeDeletion except that + // it must catch the rare case where an element already + // seen is swapped into a vacant slot that will be later + // traversed by this iterator. We cannot allow future + // next() calls to return it again. The likelihood of + // this occurring under 2/3 load factor is very slim, but + // when it does happen, we must make a copy of the rest of + // the table to use for the rest of the traversal. Since + // this can only happen when we are near the end of the table, + // even in these rare cases, this is not very expensive in + // time or space. + + Object[] tab = traversalTable; + int len = tab.length; + + int d = deletedSlot; + Object key = tab[d]; + tab[d] = null; // vacate the slot + tab[d + 1] = null; + + // If traversing a copy, remove in real table. + // We can skip gap-closure on copy. + if (tab != VerifiedIdentityHashMap.this.table) { + VerifiedIdentityHashMap.this.remove(key); + expectedModCount = modCount; + return; + } + + size--; + + Object item; + for (int i = nextKeyIndex(d, len); (item = tab[i]) != null; + i = nextKeyIndex(i, len)) { + int r = hash(item, len); + // See closeDeletion for explanation of this conditional + if ((i < r && (r <= d || d <= i)) || + (r <= d && d <= i)) { + + // If we are about to swap an already-seen element + // into a slot that may later be returned by next(), + // then clone the rest of table for use in future + // next() calls. It is OK that our copy will have + // a gap in the "wrong" place, since it will never + // be used for searching anyway. + + if (i < deletedSlot && d >= deletedSlot && + traversalTable == VerifiedIdentityHashMap.this.table) { + int remaining = len - deletedSlot; + Object[] newTable = new Object[remaining]; + System.arraycopy(tab, deletedSlot, + newTable, 0, remaining); + traversalTable = newTable; + index = 0; + } + + tab[d] = item; + tab[d + 1] = tab[i + 1]; + tab[i] = null; + tab[i + 1] = null; + d = i; + } + } + } + } + + private class KeyIterator extends IdentityHashMapIterator { + @SuppressWarnings("unchecked") + public java.lang.Object next() { + return (java.lang.Object) unmaskNull(traversalTable[nextIndex()]); + } + } + + private class ValueIterator extends IdentityHashMapIterator { + @SuppressWarnings("unchecked") + public java.lang.Object next() { + return (java.lang.Object) traversalTable[nextIndex() + 1]; + } + } + + private class EntryIterator + extends IdentityHashMapIterator { + private Entry lastReturnedEntry = null; + + public Map.Entry next() { + lastReturnedEntry = new Entry(nextIndex()); + return lastReturnedEntry; + } + + public void remove() { + lastReturnedIndex = + ((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index); + super.remove(); + lastReturnedEntry.index = lastReturnedIndex; + lastReturnedEntry = null; + } + + private class Entry implements Map.Entry { + private int index; + + private Entry(int index) { + this.index = index; + } + + @SuppressWarnings("unchecked") + public java.lang.Object getKey() { + checkIndexForEntryUse(); + return (java.lang.Object) unmaskNull(traversalTable[index]); + } + + @SuppressWarnings("unchecked") + public java.lang.Object getValue() { + checkIndexForEntryUse(); + return (java.lang.Object) traversalTable[index + 1]; + } + + @SuppressWarnings("unchecked") + public java.lang.Object setValue(java.lang.Object value) { + checkIndexForEntryUse(); + java.lang.Object oldValue = (java.lang.Object) traversalTable[index + 1]; + traversalTable[index + 1] = value; + // if shadowing, force into main table + if (traversalTable != VerifiedIdentityHashMap.this.table) + put((java.lang.Object) traversalTable[index], value); + return oldValue; + } + + public boolean equals(Object o) { + if (index < 0) + return super.equals(o); + + if (!(o instanceof Map.Entry)) + return false; + Map.Entry e = (Map.Entry) o; + return (e.getKey() == unmaskNull(traversalTable[index]) && + e.getValue() == traversalTable[index + 1]); + } + + public int hashCode() { + if (lastReturnedIndex < 0) + return super.hashCode(); + + return (System.identityHashCode(unmaskNull(traversalTable[index])) ^ + System.identityHashCode(traversalTable[index + 1])); + } + + public String toString() { + if (index < 0) + return super.toString(); + + return (unmaskNull(traversalTable[index]) + "=" + + traversalTable[index + 1]); + } + + private void checkIndexForEntryUse() { + if (index < 0) + throw new IllegalStateException("Entry was removed"); + } + } + } + + // Views + + /** + * This field is initialized to contain an instance of the entry set + * view the first time this view is requested. The view is stateless, + * so there's no reason to create more than one. + */ + private /*@ spec_public nullable @*/ transient Set entrySet = null; + + /** + * Returns an identity-based set view of the keys contained in this map. + * The set is backed by the map, so changes to the map are reflected in + * the set, and vice-versa. If the map is modified while an iteration + * over the set is in progress, the results of the iteration are + * undefined. The set supports element removal, which removes the + * corresponding mapping from the map, via the Iterator.remove, + * Set.remove, removeAll, retainAll, and + * clear methods. It does not support the add or + * addAll methods. + * + *

    While the object returned by this method implements the + * Set interface, it does not obey Set's general + * contract. Like its backing map, the set returned by this method + * defines element equality as reference-equality rather than + * object-equality. This affects the behavior of its contains, + * remove, containsAll, equals, and + * hashCode methods. + * + *

    The equals method of the returned set returns true + * only if the specified object is a set containing exactly the same + * object references as the returned set. The symmetry and transitivity + * requirements of the Object.equals contract may be violated if + * the set returned by this method is compared to a normal set. However, + * the Object.equals contract is guaranteed to hold among sets + * returned by this method. + * + *

    The hashCode method of the returned set returns the sum of + * the identity hashcodes of the elements in the set, rather than + * the sum of their hashcodes. This is mandated by the change in the + * semantics of the equals method, in order to enforce the + * general contract of the Object.hashCode method among sets + * returned by this method. + * + * @return an identity-based set view of the keys contained in this map + * @see Object#equals(Object) + * @see System#identityHashCode(Object) + */ + public Set keySet() { + Set ks = keySet; + if (ks != null) + return ks; + else + return keySet = new KeySet(); + } + + private class KeySet extends AbstractSet { + public Iterator iterator() { + return new KeyIterator(); + } + + public int size() { + return size; + } + + public boolean contains(Object o) { + return containsKey(o); + } + + public boolean remove(Object o) { + int oldSize = size; + VerifiedIdentityHashMap.this.remove(o); + return size != oldSize; + } + + /* + * Must revert from AbstractSet's impl to AbstractCollection's, as + * the former contains an optimization that results in incorrect + * behavior when c is a smaller "normal" (non-identity-based) Set. + */ + public boolean removeAll(Collection c) { + boolean modified = false; + for (Iterator i = iterator(); i.hasNext(); ) { + if (c.contains(i.next())) { + i.remove(); + modified = true; + } + } + return modified; + } + + public void clear() { + VerifiedIdentityHashMap.this.clear(); + } + + public int hashCode() { + int result = 0; + for (java.lang.Object key : this) + result += System.identityHashCode(key); + return result; + } + } + + /** + * Returns a {@link Collection} view of the values contained in this map. + * The collection is backed by the map, so changes to the map are + * reflected in the collection, and vice-versa. If the map is + * modified while an iteration over the collection is in progress, + * the results of the iteration are undefined. The collection + * supports element removal, which removes the corresponding + * mapping from the map, via the Iterator.remove, + * Collection.remove, removeAll, + * retainAll and clear methods. It does not + * support the add or addAll methods. + * + *

    While the object returned by this method implements the + * Collection interface, it does not obey + * Collection's general contract. Like its backing map, + * the collection returned by this method defines element equality as + * reference-equality rather than object-equality. This affects the + * behavior of its contains, remove and + * containsAll methods. + */ + public Collection values() { + Collection vs = values; + if (vs != null) + return vs; + else + return values = new Values(); + } + + private class Values extends AbstractCollection { + public Iterator iterator() { + return new ValueIterator(); + } + + public int size() { + return size; + } + + public boolean contains(Object o) { + return containsValue(o); + } + + public boolean remove(Object o) { + for (Iterator i = iterator(); i.hasNext(); ) { + if (i.next() == o) { + i.remove(); + return true; + } + } + return false; + } + + public void clear() { + VerifiedIdentityHashMap.this.clear(); + } + } + + /** + * Returns a {@link Set} view of the mappings contained in this map. + * Each element in the returned set is a reference-equality-based + * Map.Entry. The set is backed by the map, so changes + * to the map are reflected in the set, and vice-versa. If the + * map is modified while an iteration over the set is in progress, + * the results of the iteration are undefined. The set supports + * element removal, which removes the corresponding mapping from + * the map, via the Iterator.remove, Set.remove, + * removeAll, retainAll and clear + * methods. It does not support the add or + * addAll methods. + * + *

    Like the backing map, the Map.Entry objects in the set + * returned by this method define key and value equality as + * reference-equality rather than object-equality. This affects the + * behavior of the equals and hashCode methods of these + * Map.Entry objects. A reference-equality based Map.Entry + * e is equal to an object o if and only if o is a + * Map.Entry and e.getKey()==o.getKey() && + * e.getValue()==o.getValue(). To accommodate these equals + * semantics, the hashCode method returns + * System.identityHashCode(e.getKey()) ^ + * System.identityHashCode(e.getValue()). + * + *

    Owing to the reference-equality-based semantics of the + * Map.Entry instances in the set returned by this method, + * it is possible that the symmetry and transitivity requirements of + * the {@link Object#equals(Object)} contract may be violated if any of + * the entries in the set is compared to a normal map entry, or if + * the set returned by this method is compared to a set of normal map + * entries (such as would be returned by a call to this method on a normal + * map). However, the Object.equals contract is guaranteed to + * hold among identity-based map entries, and among sets of such entries. + * + * + * @return a set view of the identity-mappings contained in this map + */ + public Set entrySet() { + Set es = entrySet; + if (es != null) + return es; + else + return entrySet = new EntrySet(); + } + + private class EntrySet extends AbstractSet { + public Iterator iterator() { + return new EntryIterator(); + } + + public boolean contains(Object o) { + if (!(o instanceof Map.Entry)) + return false; + Map.Entry entry = (Map.Entry) o; + return containsMapping(entry.getKey(), entry.getValue()); + } + + public boolean remove(Object o) { + if (!(o instanceof Map.Entry)) + return false; + Map.Entry entry = (Map.Entry) o; + return removeMapping(entry.getKey(), entry.getValue()); + } + + public int size() { + return size; + } + + public void clear() { + VerifiedIdentityHashMap.this.clear(); + } + + /* + * Must revert from AbstractSet's impl to AbstractCollection's, as + * the former contains an optimization that results in incorrect + * behavior when c is a smaller "normal" (non-identity-based) Set. + */ + public boolean removeAll(Collection c) { + boolean modified = false; + for (Iterator i = iterator(); i.hasNext(); ) { + if (c.contains(i.next())) { + i.remove(); + modified = true; + } + } + return modified; + } + + public Object[] toArray() { + int size = size(); + Object[] result = new Object[size]; + Iterator it = iterator(); + for (int i = 0; i < size; i++) + result[i] = new AbstractMap.SimpleEntry(((java.util.Map.Entry) it.next())); + return result; + } + + @SuppressWarnings("unchecked") + public java.lang.Object[] toArray(java.lang.Object[] a) { + int size = size(); + if (a.length < size) + a = (java.lang.Object[]) java.lang.reflect + .Array.newInstance(a.getClass().getComponentType(), size); + Iterator it = iterator(); + for (int i = 0; i < size; i++) + a[i] = (java.lang.Object) new AbstractMap.SimpleEntry(((java.util.Map.Entry) it.next())); + if (a.length > size) + a[size] = null; + return a; + } + } + + +// private static final long serialVersionUID = 8188218128353913216L; +// +// /** +// * Saves the state of the VerifiedIdentityHashMap instance to a stream +// * (i.e., serializes it). +// * +// * @serialData The size of the HashMap (the number of key-value +// * mappings) (int), followed by the key (Object) and +// * value (Object) for each key-value mapping represented by the +// * VerifiedIdentityHashMap. The key-value mappings are emitted in no +// * particular order. +// */ +// private void writeObject(java.io.ObjectOutputStream s) +// throws java.io.IOException { +// // Write out and any hidden stuff +// s.defaultWriteObject(); +// +// // Write out size (number of Mappings) +// s.writeInt(size); +// +// // Write out keys and values (alternating) +// Object[] tab = table; +// for (int i = 0; i < tab.length; i += 2) { +// Object key = tab[i]; +// if (key != null) { +// s.writeObject(unmaskNull(key)); +// s.writeObject(tab[i + 1]); +// } +// } +// } + +// /** +// * Reconstitutes the VerifiedIdentityHashMap instance from a stream (i.e., +// * deserializes it). +// */ +// private void readObject(java.io.ObjectInputStream s) +// throws java.io.IOException, ClassNotFoundException { +// // Read in any hidden stuff +// s.defaultReadObject(); +// +// // Read in size (number of Mappings) +// int size = s.readInt(); +// if (size < 0) +// throw new java.io.StreamCorruptedException +// ("Illegal mappings count: " + size); +// int cap = capacity(size); +// SharedSecrets.getJavaOISAccess().checkArray(s, Object[].class, cap); +// init(cap); +// +// // Read the keys and values, and put the mappings in the table +// for (int i=0; i { + val j2jt = Jml2JavaTranslator() + val result = BlockStmt() + val e = j2jt.accept(expression, result) + return Pair(result, e) + } + + fun embeddLoopInvariant(stmt: ForStmt?): BlockStmt? { + return null + } + + fun containsJmlExpression(expression: Expression?): Boolean { + val search = Stack() + search.add(expression) + + while (!search.isEmpty()) { + val e = search.pop() + if (e is Jmlish) { + return true + } + + if (e is BinaryExpr) { + if (e.operator == BinaryExpr.Operator.IMPLICATION) return true + if (e.operator == BinaryExpr.Operator.RIMPLICATION) return true + if (e.operator == BinaryExpr.Operator.EQUIVALENCE) return true + if (e.operator == BinaryExpr.Operator.SUB_LOCK) return true + if (e.operator == BinaryExpr.Operator.SUB_LOCKE) return true + if (e.operator == BinaryExpr.Operator.SUBTYPE) return true + if (e.operator == BinaryExpr.Operator.RANGE) return true + } + + for (childNode in e!!.childNodes) { + if (childNode is Expression) search.add(childNode) + } + } + return false + } +} diff --git a/tools/jml2java/src/main/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTranslator.kt b/tools/jml2java/src/main/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTranslator.kt new file mode 100644 index 0000000000..c0f2ba8b5d --- /dev/null +++ b/tools/jml2java/src/main/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTranslator.kt @@ -0,0 +1,388 @@ +package io.github.jmltoolkit.jml2java + +import com.github.javaparser.ast.Modifier +import com.github.javaparser.ast.body.Parameter +import com.github.javaparser.ast.body.VariableDeclarator +import com.github.javaparser.ast.expr.* +import com.github.javaparser.ast.jml.expr.JmlLetExpr +import com.github.javaparser.ast.jml.expr.JmlMultiCompareExpr +import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr +import com.github.javaparser.ast.stmt.* +import com.github.javaparser.ast.type.PrimitiveType +import com.github.javaparser.ast.type.VarType +import com.github.javaparser.ast.visitor.GenericVisitorAdapter +import com.github.javaparser.resolution.types.ResolvedType +import io.github.jmltoolkit.utils.JMLUtils +import io.github.jmltoolkit.utils.Pattern +import java.util.concurrent.atomic.AtomicInteger + +/** + * @author Alexander Weigl + * @version 1 (04.10.22) + */ +class Jml2JavaTranslator { + private val counter = AtomicInteger() + + fun accept(e: Expression?, arg: BlockStmt): Expression? { + if (Jml2JavaFacade.containsJmlExpression(e)) { + return e!!.accept(Jml2JavaVisitor(), arg) + } + return e // createAssignmentAndAdd(e, arg); + } + + private fun createAssignmentAndAdd(e: Expression, arg: BlockStmt): Expression { + arg.addAndGetStatement(createAssignmentFor(e)) + return NameExpr(targetForAssignment) + } + + private fun createAssignmentFor(e: Expression): Statement { + val decl = VariableDeclarationExpr( + VariableDeclarator( + VarType(), + newTargetForAssignment(), e + ) + ) + decl.addModifier(Modifier.DefaultKeyword.FINAL) + return ExpressionStmt(decl) + } + + private val targetForAssignment: SimpleName + get() = SimpleName("_gen_" + counter.get()) + + private fun newTargetForAssignment(): SimpleName { + counter.getAndIncrement() + return targetForAssignment + } + + fun findPredicate(n: JmlQuantifiedExpr): Expression { + return n.expressions[n.expressions.size - 1] + } + + fun findUpperBound(n: JmlQuantifiedExpr, variable: String): Expression? { + if (n.expressions.size == 3) return n.expressions[1] + + val e = findBound(n) + + if (e is JmlMultiCompareExpr) { + if (e.expressions.size == 3 && + (e.expressions[1] as? NameExpr)?.nameAsString == variable + ) { + if (e.operators[0] == BinaryExpr.Operator.LESS_EQUALS) return e.expressions[0] + if (e.operators[0] == BinaryExpr.Operator.LESS) return BinaryExpr( + e.expressions[0], + IntegerLiteralExpr("1"), + BinaryExpr.Operator.PLUS + ) + throw IllegalStateException() + } + } + + val ph: Expression = NameExpr("_") + run { + val be = BinaryExpr(NameExpr(variable), ph, BinaryExpr.Operator.GREATER_EQUALS) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return result["min"] as Expression? + } + + run { + val be = BinaryExpr(NameExpr(variable), ph, BinaryExpr.Operator.GREATER) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return BinaryExpr( + result["min"] as Expression?, + IntegerLiteralExpr("1"), + BinaryExpr.Operator.PLUS + ) + } + + run { + val be = BinaryExpr(ph, NameExpr(variable), BinaryExpr.Operator.LESS_EQUALS) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return result["min"] as Expression? + } + + run { + val be = BinaryExpr(ph, NameExpr(variable), BinaryExpr.Operator.LESS) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return BinaryExpr( + result["min"] as Expression?, + IntegerLiteralExpr("1"), + BinaryExpr.Operator.PLUS + ) + } + + return null + } + + private inner class Jml2JavaVisitor : GenericVisitorAdapter() { + override fun visit(n: JmlQuantifiedExpr, arg: BlockStmt): Expression { + if (n.binder === JmlQuantifiedExpr.JmlDefaultBinder.FORALL) return visitForall(n, arg) + if (n.binder === JmlQuantifiedExpr.JmlDefaultBinder.EXISTS) return visitExists(n, arg) + + throw IllegalArgumentException("Unsupport quantifier " + n.binder) + } + + private fun visitForall(n: JmlQuantifiedExpr, arg: BlockStmt): Expression { + assert(n.variables.size == 1) + val rvalue = newSymbol("result_") + val highVar = newSymbol("high_") + val predVar = newSymbol("pred_") + + arg.addAndGetStatement( + ExpressionStmt( + VariableDeclarationExpr( + VariableDeclarator( + PrimitiveType(PrimitiveType.Primitive.BOOLEAN), + rvalue, BooleanLiteralExpr(true) + ) + ) + ) + ) + + val variable: Parameter = n.variables[0] + val lowCode = Jml2JavaFacade.translate(findLowerBound(n, variable.nameAsString)) + arg.addAndGetStatement( + ExpressionStmt( + VariableDeclarationExpr( + VariableDeclarator( + variable.type.clone(), variable.nameAsString + ) + ) + ) + ) + lowCode.a!!.addAndGetStatement( + ExpressionStmt( + AssignExpr( + NameExpr(variable.nameAsString), lowCode.b, + AssignExpr.Operator.ASSIGN + ) + ) + ) + arg.addAndGetStatement(lowCode.a) + + val highCode = Jml2JavaFacade.translate(findUpperBound(n, variable.nameAsString)) + arg.addAndGetStatement( + ExpressionStmt( + VariableDeclarationExpr( + VariableDeclarator( + variable.type.clone(), highVar + ) + ) + ) + ) + highCode.a!!.addAndGetStatement( + ExpressionStmt( + AssignExpr( + NameExpr(highVar), highCode.b, + AssignExpr.Operator.ASSIGN + ) + ) + ) + arg.addAndGetStatement(highCode.a!!.clone()) + + val predCode = Jml2JavaFacade.translate(findPredicate(n)) + + val whileStmt = arg.addAndGetStatement(WhileStmt()) + val lessThanExpr = BinaryExpr( + NameExpr(variable.nameAsString), + NameExpr(highVar), BinaryExpr.Operator.LESS + ) + whileStmt.setCondition( + BinaryExpr(lessThanExpr, NameExpr(rvalue), BinaryExpr.Operator.AND) + ) + val body = BlockStmt() + + body.addAndGetStatement( + ExpressionStmt( + VariableDeclarationExpr( + VariableDeclarator(PrimitiveType(PrimitiveType.Primitive.BOOLEAN), predVar) + ) + ) + ) + predCode.a!!.addAndGetStatement( + ExpressionStmt( + AssignExpr( + NameExpr(predVar), predCode.b, + AssignExpr.Operator.ASSIGN + ) + ) + ) + body.addAndGetStatement(predCode.a) + + val assignPred = ExpressionStmt( + AssignExpr( + NameExpr(rvalue), + BooleanLiteralExpr(true), AssignExpr.Operator.ASSIGN + ) + ) + body.addAndGetStatement( + IfStmt(NameExpr(predVar), assignPred, null) + ) + body.addAndGetStatement(highCode.a!!.clone()) + + whileStmt.setBody(body) + return NameExpr(rvalue) + } + + private fun newSymbol(prefix: String): String { + return prefix + counter.getAndIncrement() + } + + private fun visitExists(n: JmlQuantifiedExpr, arg: BlockStmt): Expression { + return UnaryExpr(visitForall(n, arg), UnaryExpr.Operator.LOGICAL_COMPLEMENT) + } + + + override fun visit(n: JmlLetExpr, arg: BlockStmt): Expression { + val inner = BlockStmt() + val target = newTargetForAssignment() + val type: ResolvedType = n.body.calculateResolvedType() + arg.addAndGetStatement( + ExpressionStmt( + VariableDeclarationExpr( + JMLUtils.resolvedType2Type(type), + target.asString() + ) + ) + ) + inner.addAndGetStatement(ExpressionStmt(n.variables)) + val e = accept(n.body, inner) + arg.addAndGetStatement(inner) + inner.addAndGetStatement(AssignExpr(NameExpr(target.asString()), e, AssignExpr.Operator.ASSIGN)) + return NameExpr(target.asString()) + } + + override fun visit(n: BinaryExpr, arg: BlockStmt): Expression { + val left = accept(n.left, arg) + val right = accept(n.right, arg) + return when (n.operator) { + BinaryExpr.Operator.IMPLICATION -> BinaryExpr( + UnaryExpr( + EnclosedExpr(left), + UnaryExpr.Operator.LOGICAL_COMPLEMENT + ), + right, + BinaryExpr.Operator.OR + ) + + BinaryExpr.Operator.RIMPLICATION -> BinaryExpr( + left, + UnaryExpr( + EnclosedExpr(right), + UnaryExpr.Operator.LOGICAL_COMPLEMENT + ), + BinaryExpr.Operator.OR + ) + + BinaryExpr.Operator.EQUIVALENCE -> BinaryExpr( + left, + right, + BinaryExpr.Operator.EQUALS + ) + + BinaryExpr.Operator.SUBTYPE, BinaryExpr.Operator.SUB_LOCK, BinaryExpr.Operator.SUB_LOCKE -> throw IllegalArgumentException( + "Unsupported operators." + ) + + else -> createAssignmentAndAdd( + BinaryExpr(left, right, n.operator), + arg + ) + } + } + + override fun visit(n: ArrayAccessExpr, arg: BlockStmt): Expression { + return super.visit(n, arg) + } + + override fun visit(n: ArrayCreationExpr, arg: BlockStmt): Expression { + return super.visit(n, arg) + } + + override fun visit(n: ArrayInitializerExpr, arg: BlockStmt): Expression { + return super.visit(n, arg) + } + + override fun visit(n: AssignExpr, arg: BlockStmt): Expression { + return super.visit(n, arg) + } + } + + companion object { + fun findBound(n: JmlQuantifiedExpr): Expression { + if (n.expressions.size == 2) return n.expressions[0] + else + if (n.expressions.size == 1 && n.expressions.first() is BinaryExpr) + return n.expressions.first() + throw IllegalArgumentException("Could not determine bound.") + } + + fun findLowerBound(n: JmlQuantifiedExpr, variable: String): Expression? { + if (n.expressions.size == 3) return n.expressions[0] + + val e = findBound(n) + + if (e is JmlMultiCompareExpr) { + if (e.expressions.size == 3 && + (e.expressions[1] as? NameExpr)?.nameAsString == variable + ) { + if (e.operators[0] == BinaryExpr.Operator.LESS_EQUALS) return e.expressions[0] + if (e.operators[0] == BinaryExpr.Operator.LESS) return BinaryExpr( + e.expressions[0], IntegerLiteralExpr("1"), BinaryExpr.Operator.PLUS + ) + throw IllegalStateException() + } + } + + val ph: Expression = NameExpr("_") + run { + val be = BinaryExpr(NameExpr(variable), ph, BinaryExpr.Operator.GREATER_EQUALS) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return result["min"] as Expression? + } + + run { + val be = BinaryExpr(NameExpr(variable), ph, BinaryExpr.Operator.GREATER) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return BinaryExpr( + result["min"] as Expression?, + IntegerLiteralExpr("1"), + BinaryExpr.Operator.PLUS + ) + } + + run { + val be = BinaryExpr(ph, NameExpr(variable), BinaryExpr.Operator.LESS_EQUALS) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return result["min"] as Expression? + } + + run { + val be = BinaryExpr(ph, NameExpr(variable), BinaryExpr.Operator.LESS) + val pattern = Pattern(be) + pattern.addPlaceholder(ph, "min") + val result = pattern.find(n) + if (result != null) return BinaryExpr( + result["min"] as Expression?, + IntegerLiteralExpr("1"), + BinaryExpr.Operator.PLUS + ) + } + + return null + } + } +} diff --git a/tools/jml2java/src/main/kotlin/io/github/jmltoolkit/jml2java/package-info.kt b/tools/jml2java/src/main/kotlin/io/github/jmltoolkit/jml2java/package-info.kt new file mode 100644 index 0000000000..15bf014fc1 --- /dev/null +++ b/tools/jml2java/src/main/kotlin/io/github/jmltoolkit/jml2java/package-info.kt @@ -0,0 +1,9 @@ +/** + * Transformation of JML expressions into equivalent Java code. + * + * @author Alexander Weigl + * @version 1 (04.10.22) + * @see jml2java.Jml2JavaTranslator + */ +package io.github.jmltoolkit.jml2java + diff --git a/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTests.kt b/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTests.kt new file mode 100644 index 0000000000..95ba1021bd --- /dev/null +++ b/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTests.kt @@ -0,0 +1,62 @@ +package io.github.jmltoolkit.jml2java + +import com.github.javaparser.ParseResult +import com.github.javaparser.Problem +import com.github.javaparser.ast.expr.Expression +import com.github.javaparser.printer.DefaultPrettyPrinter +import com.google.common.truth.Truth +import io.github.jmltoolkit.utils.TestWithJavaParser +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.DynamicTest +import org.junit.jupiter.api.TestFactory +import org.yaml.snakeyaml.Yaml +import java.io.IOException +import java.util.function.Consumer +import java.util.stream.Stream + +/** + * @author Alexander Weigl + * @version 1 (04.10.22) + */ +class Jml2JavaTests : TestWithJavaParser() { + @TestFactory + @Throws(IOException::class) + fun j2jTranslation(): Stream { + javaClass.getResourceAsStream("/expr.yaml").use { inputStream -> + val yaml = Yaml() + val obj: List> = yaml.load(inputStream) + return obj.stream().map { m: Map -> + val a = m["expr"] as String + val result = m["result"] as String? + DynamicTest.dynamicTest(a) { + if (result != null) jml2JavaTranslation(a, result) + } + } + } + } + + private fun jml2JavaTranslation( + input: String?, + expected: String, + ) { + val e: ParseResult = parser.parseJmlExpression(input) + if (!e.isSuccessful) { + e.problems.forEach(Consumer { x: Problem? -> System.err.println(x) }) + Assertions.fail("Error during parsing") + } + val expr = e.result.get() + expr.setParentNode(parent) + val actual = Jml2JavaFacade.translate(expr) + + val dpp = DefaultPrettyPrinter() + val sblock = dpp.print(actual.a) + val sexpr = dpp.print(actual.b) + Truth + .assertThat(trimAllWs("$sblock $sexpr")) + .isEqualTo(trimAllWs(expected)) + } + + companion object { + private fun trimAllWs(expected: String): String = expected.replace("\\s+".toRegex(), " ").trim { it <= ' ' } + } +} diff --git a/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTranslatorTest.kt b/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTranslatorTest.kt new file mode 100644 index 0000000000..d6cfa5b879 --- /dev/null +++ b/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/Jml2JavaTranslatorTest.kt @@ -0,0 +1,59 @@ +package io.github.jmltoolkit.jml2java + +import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr +import com.google.common.truth.Truth +import org.junit.jupiter.api.Test + +/** + * @author Alexander Weigl + * @version 1 (11.10.22) + */ +internal class Jml2JavaTranslatorTest { + @Test + fun test() { + val n1: JmlQuantifiedExpr = + com.github.javaparser.StaticJavaParser.parseJmlExpression("(\\forall int x; 0 <= x < a.length; x%2==0)") + val bound = Jml2JavaTranslator.findLowerBound(n1, "x") + Truth.assertThat(bound.toString()).isEqualTo("0") + } + + @Test + fun test2() { + val n1: JmlQuantifiedExpr = + com.github.javaparser.StaticJavaParser.parseJmlExpression("(\\forall int x; 5 < x < a.length; x%2==0)") + val bound = Jml2JavaTranslator.findLowerBound(n1, "x") + Truth.assertThat(bound.toString()).isEqualTo("5 + 1") + } + + @Test + fun test3() { + val n1: JmlQuantifiedExpr = + com.github.javaparser.StaticJavaParser.parseJmlExpression("(\\forall int x; 2+1 < x < a.length; x%2==0)") + val bound = Jml2JavaTranslator.findLowerBound(n1, "x") + Truth.assertThat(bound.toString()).isEqualTo("2 + 1 + 1") + } + + @Test + fun test6() { + val n1: JmlQuantifiedExpr = + com.github.javaparser.StaticJavaParser.parseJmlExpression("(\\forall int y; 2+1 < y < a.length; y%2==0)") + val bound = Jml2JavaTranslator.findLowerBound(n1, "y") + Truth.assertThat(bound.toString()).isEqualTo("2 + 1 + 1") + } + + @Test + fun test4() { + val n1: JmlQuantifiedExpr = + com.github.javaparser.StaticJavaParser.parseJmlExpression("(\\forall int x; 0 < x && x < a.length; x%2==0)") + val bound = Jml2JavaTranslator.findLowerBound(n1, "x") + Truth.assertThat(bound.toString()).isEqualTo("0 + 1") + } + + @Test + fun test5() { + val n1: JmlQuantifiedExpr = + com.github.javaparser.StaticJavaParser.parseJmlExpression("(\\forall int x; 0 <= x && x < a.length; x%2==0)") + val bound = Jml2JavaTranslator.findLowerBound(n1, "x") + Truth.assertThat(bound.toString()).isEqualTo("0") + } +} \ No newline at end of file diff --git a/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/PatternTest.kt b/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/PatternTest.kt new file mode 100644 index 0000000000..88149ab856 --- /dev/null +++ b/tools/jml2java/src/test/kotlin/io/github/jmltoolkit/jml2java/PatternTest.kt @@ -0,0 +1,25 @@ +package io.github.jmltoolkit.jml2java + +import io.github.jmltoolkit.utils.Pattern +import org.junit.jupiter.api.Test + +/** + * @author Alexander Weigl + * @version 1 (11.10.22) + */ +internal class PatternTest { + @Test + fun matchIf() { + val cond = com.github.javaparser.ast.expr.NameExpr("_") + val then = com.github.javaparser.ast.stmt.ExpressionStmt() + val other = com.github.javaparser.ast.stmt.ExpressionStmt() + val ifPattern = Pattern(com.github.javaparser.ast.stmt.IfStmt(cond, then, other)) + ifPattern.addPlaceholder(cond, "c") + ifPattern.addPlaceholder(then, "t") + ifPattern.addPlaceholder(other, "o") + + val candidate = com.github.javaparser.StaticJavaParser.parseStatement("if(a a == b + result: | + { } !(!(a != null && b != null)) || a == b + +- expr: | + a != null && b != null ==> a == b + result: | + { } !(a != null && b != null) || a == b + +- expr: | + ary[2] == 2 + result: | + { } ary[2] == 2 + +- expr: | + (\forall int i; 0<=i" + + ref = prop.get('$ref', None) + if ref: + ref = ref[14:] + enqueue(ref) + return ref + + return "type unsupported" + + +# prefix = '?' if 'null' in t else '' + + +def get_props(obj): + s = [] + for (k, v) in obj['properties'].items(): + if k.startswith('$'): continue + s.append(f"/** {v['description']} */ \n var {k} : {type(v)}") + return ',\n'.join(s) + + +queue_classes = [("Sarif", schema)] + + +def make_class(name, obj): + print(f""" + /** + * {obj['description']} + */ + data class {name}({get_props(obj)}) + """) + + +while queue_classes: + (name, c) = queue_classes.pop() + make_class(name, c) diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/JmlLintingConfig.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/JmlLintingConfig.kt new file mode 100644 index 0000000000..5808af23ef --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/JmlLintingConfig.kt @@ -0,0 +1,12 @@ +package io.github.jmltoolkit.lint + + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +data class JmlLintingConfig(val checkNameClashes: Boolean = true, val checkMissingNames: Boolean = true) { + fun isDisabled(lintRule: LintRule): Boolean { + return false + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/JmlLintingFacade.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/JmlLintingFacade.kt new file mode 100644 index 0000000000..e14bcbf359 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/JmlLintingFacade.kt @@ -0,0 +1,75 @@ +package io.github.jmltoolkit.lint + +import com.github.javaparser.ast.Node +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import se.bjurr.violations.lib.model.generated.sarif.* +import java.util.* +import java.util.function.Consumer +import kotlin.Exception + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +class JmlLintingFacade(private val config: JmlLintingConfig) { + val linters: List = getLinter(config) + + private val sarifTool: Tool + get() = Tool().withDriver( + ToolComponent().withVersion(VERSION).withName(NAME) + .withShortDescription(MultiformatMessageString().withText("Linting for the Java Modeling Language")) + .withRules(linters.map { ReportingDescriptor().withName(it.javaClass.getName()) }.toSet()) + ) + + + fun lint(reporter: LintProblemReporter, nodes: Collection) { + for (it in nodes) { + for (linter in linters) { + try { + linter.accept(it, reporter, config) + } catch (e: Exception) { + LOGGER.error("Error in linter: {}", linter.javaClass.getName(), e) + } + } + } + } + + fun lint(nodes: Collection): Collection { + val problems: ArrayList = ArrayList(1024) + val collector: Consumer = Consumer { e: LintProblem -> problems.add(e) } + lint(LintProblemReporter(collector), nodes) + problems.sortWith(Comparator.comparing { it.location!!.toRange().get().begin }) + return problems + } + + fun asSarif(problems: Collection): SarifSchema { + val results = problems.map { it: LintProblem -> this.asSarif(it) } + val runs: List = listOf(Run().withTool(sarifTool).withResults(results)) + return SarifSchema() + .withVersion("2.1.0") + .withRuns(runs) + } + + private fun asSarif(it: LintProblem): Result { + return Result().withRuleId(it.ruleId).withKind(it.category).withLevel(it.level) + .withLocations(listOf(Location())).withMessage(Message().withText(it.message)) + } + + companion object { + private val LOGGER: Logger = LoggerFactory.getLogger(JmlLintingFacade::class.java) + private val VERSION: String = JmlLintingFacade::class.java.getPackage().implementationVersion ?: "n/a" + private const val NAME = "JML-lint" + + private fun getLinter(config: JmlLintingConfig): List { + val loader: ServiceLoader = ServiceLoader.load(LintRule::class.java) + val validators: MutableList = ArrayList(64) + for (lintRule in loader) { + if (!config.isDisabled(lintRule)) { + validators.add(lintRule) + } + } + return validators + } + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintProblem.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintProblem.kt new file mode 100644 index 0000000000..d3c220770b --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintProblem.kt @@ -0,0 +1,21 @@ +package io.github.jmltoolkit.lint + +import com.github.javaparser.TokenRange + +/** + * @author Alexander Weigl + * @version 1 (13.10.22) + */ +data class LintProblem( + val level: String, + val message: String, + val location: TokenRange?, + val cause: Throwable?, + val category: String?, + val ruleId: String +) { + constructor(level: String, message: String, location: TokenRange?, ruleId: String) : this( + level, message, location, + null, null, ruleId + ) +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintProblemReporter.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintProblemReporter.kt new file mode 100644 index 0000000000..82a7dedece --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintProblemReporter.kt @@ -0,0 +1,40 @@ +package io.github.jmltoolkit.lint + +import com.github.javaparser.TokenRange +import com.github.javaparser.ast.nodeTypes.NodeWithTokenRange +import java.util.function.Consumer + +/** + * @author Alexander Weigl + * @version 1 (13.10.22) + */ +class LintProblemReporter(private val problemConsumer: Consumer) { + + fun warn(node: NodeWithTokenRange<*>, category: String?, ruleId: String, message: String, vararg args: Any?) { + report(LintRule.WARN, node.tokenRange.orElse(null), category, ruleId, message, args) + } + + fun hint(node: NodeWithTokenRange<*>, category: String?, ruleId: String, message: String, vararg args: Any?) { + report(LintRule.HINT, node.tokenRange.orElse(null), category, ruleId, message, args) + } + + fun error(node: NodeWithTokenRange<*>, category: String?, ruleId: String, message: String, vararg args: Any?) { + report(LintRule.ERROR, node.tokenRange.orElse(null), category, ruleId, message, args) + } + + fun report( + level: String, + range: TokenRange?, + category: String?, + ruleId: String, + message: String, + vararg args: Any? + ) { + problemConsumer.accept(LintProblem(level, message.format(args), range, null, category, ruleId)) + } + + fun report(lintProblem: LintProblem) { + problemConsumer.accept(lintProblem) + } +} + diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintRule.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintRule.kt new file mode 100644 index 0000000000..b15c5ebf07 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintRule.kt @@ -0,0 +1,17 @@ +package io.github.jmltoolkit.lint + +import com.github.javaparser.ast.Node + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +interface LintRule { + fun accept(node: Node, problemReporter: LintProblemReporter, config: JmlLintingConfig) + + companion object { + const val HINT: String = "HINT" + const val WARN: String = "WARN" + const val ERROR: String = "ERROR" + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintRuleVisitor.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintRuleVisitor.kt new file mode 100644 index 0000000000..c83088cf0e --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/LintRuleVisitor.kt @@ -0,0 +1,23 @@ +package io.github.jmltoolkit.lint + +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.visitor.VoidVisitorAdapter + +/** + * @author Alexander Weigl + * @version 1 (13.10.22) + */ +abstract class LintRuleVisitor : VoidVisitorAdapter(), LintRule { + /** + * A validator that uses a visitor for validation. + * This class is the visitor too. + * Implement the "visit" methods you want to use for validation. + */ + override fun accept(node: Node, problemReporter: LintProblemReporter, config: JmlLintingConfig) { + reset() + node.accept(this, problemReporter) + } + + protected open fun reset() { + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/AllowedJmlClauses.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/AllowedJmlClauses.kt new file mode 100644 index 0000000000..d991bee7a9 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/AllowedJmlClauses.kt @@ -0,0 +1,222 @@ +package com.github.jmlparser.lint.rules + +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.body.MethodDeclaration +import com.github.javaparser.ast.jml.NodeWithContracts +import com.github.javaparser.ast.jml.clauses.ContractType +import com.github.javaparser.ast.jml.clauses.JmlClause +import com.github.javaparser.ast.jml.clauses.JmlClauseKind +import com.github.javaparser.ast.jml.clauses.JmlClauseKind.* +import com.github.javaparser.ast.jml.clauses.JmlContract +import com.github.javaparser.ast.stmt.* +import io.github.jmltoolkit.lint.LintProblemReporter +import io.github.jmltoolkit.lint.LintRuleVisitor +import java.util.* + +/** + * @author Alexander Weigl + * @version 1 (13.10.22) + */ +class AllowedJmlClauses : LintRuleVisitor() { + private val LOOP_INVARIANT_CLAUSES: EnumSet = EnumSet.of( + DECREASES, + MODIFIES, + MODIFIABLE, + ASSIGNABLE, + ACCESSIBLE, + MAINTAINING, + MAINTAINING_REDUNDANTLY, + DECREASING, + DECREASES_REDUNDANTLY, + LOOP_INVARIANT, + LOOP_INVARIANT_FREE, + LOOP_INVARIANT_REDUNDANTLY + ) + + private val LOOP_CONTRACT_CLAUSES: EnumSet = EnumSet.of( + ENSURES, + ENSURES_FREE, + ENSURES_REDUNDANTLY, + REQUIRES, + REQUIRES_FREE, + REQUIRES_REDUNDANTLY, + DECREASES, + MODIFIES, + MODIFIABLE, + ASSIGNABLE, + ACCESSIBLE, + PRE, + POST, + PRE_REDUNDANTLY, + POST_REDUNDANTLY, + MAINTAINING, + MAINTAINING_REDUNDANTLY, + DECREASING, + DECREASES_REDUNDANTLY, + LOOP_INVARIANT, + LOOP_INVARIANT_FREE, + LOOP_INVARIANT_REDUNDANTLY, + MEASURED_BY, + RETURNS, + RETURNS_REDUNDANTLY, + BREAKS, + BREAKS_REDUNDANTLY, + CONTINUES, + CONTINUES_REDUNDANTLY, + OLD, + FORALL, + SIGNALS, + SIGNALS_REDUNDANTLY, + SIGNALS_ONLY, + WHEN, + WORKING_SPACE, + WORKING_SPACE_REDUNDANTLY, + CAPTURES, + CAPTURES_REDUNDANTLY, + INITIALLY, + INVARIANT_REDUNDANTLY, + INVARIANT, + ASSIGNABLE_REDUNDANTLY, + MODIFIABLE_REDUNDANTLY, + MODIFIES_REDUNDANTLY, + CALLABLE, + CALLABLE_REDUNDANTLY, + DIVERGES, + DIVERGES_REDUNDANTLY, + DURATION, + DURATION_REDUNDANTLY + ) + + private val BLOCK_CONTRACT_CLAUSES: EnumSet = EnumSet.of( + ENSURES, + ENSURES_FREE, + ENSURES_REDUNDANTLY, + REQUIRES, + REQUIRES_FREE, + REQUIRES_REDUNDANTLY, + DECREASES, + MODIFIES, + MODIFIABLE, + ASSIGNABLE, + ACCESSIBLE, + PRE, + POST, + PRE_REDUNDANTLY, + POST_REDUNDANTLY, + MAINTAINING, + MAINTAINING_REDUNDANTLY, + DECREASING, + DECREASES_REDUNDANTLY, + LOOP_INVARIANT, + LOOP_INVARIANT_FREE, + LOOP_INVARIANT_REDUNDANTLY, + MEASURED_BY, + RETURNS, + RETURNS_REDUNDANTLY, + BREAKS, + BREAKS_REDUNDANTLY, + CONTINUES, + CONTINUES_REDUNDANTLY, + OLD, + FORALL, + SIGNALS, + SIGNALS_REDUNDANTLY, + SIGNALS_ONLY, + WHEN, + WORKING_SPACE, + WORKING_SPACE_REDUNDANTLY, + CAPTURES, + CAPTURES_REDUNDANTLY, + INITIALLY, + INVARIANT_REDUNDANTLY, + INVARIANT, + ASSIGNABLE_REDUNDANTLY, + MODIFIABLE_REDUNDANTLY, + MODIFIES_REDUNDANTLY, + CALLABLE, + CALLABLE_REDUNDANTLY, + DIVERGES, + DIVERGES_REDUNDANTLY, + DURATION, + DURATION_REDUNDANTLY + ) + + private val currentlyAllowed: Set = HashSet() + + override fun visit(n: JmlContract, arg: LintProblemReporter) { + val a: Optional> = n.findAncestor(NodeWithContracts::class.java) + if (a.isPresent) { + val owner: NodeWithContracts<*> = a.get() + if (owner is ForEachStmt + || owner is ForStmt + || owner is WhileStmt + || owner is DoStmt + ) { + if (n.type === ContractType.LOOP_INV) checkClauses( + arg, + n.clauses, + LOOP_INVARIANT_CLAUSES, + "loop_invariant" + ) + else checkClauses(arg, n.clauses, LOOP_CONTRACT_CLAUSES, "loop") + } else if (owner is MethodDeclaration) { + checkClauses(arg, n.clauses, METHOD_CONTRACT_CLAUSES, "method") + } else if (owner is BlockStmt) { + checkClauses(arg, n.clauses, BLOCK_CONTRACT_CLAUSES, "block") + } + } + } + + private fun checkClauses( + arg: LintProblemReporter, clauses: NodeList, + allowed: EnumSet, type: String + ) { + for (clause in clauses) { + if (!allowed.contains(clause.kind)) { + arg.warn(clause, "", "", "%s clause not allowed in a %s contract", clause.kind, type) + } + } + } + + companion object { + val METHOD_CONTRACT_CLAUSES: EnumSet = EnumSet.of( + ENSURES, + ENSURES_FREE, + ENSURES_REDUNDANTLY, + REQUIRES, + REQUIRES_FREE, + REQUIRES_REDUNDANTLY, + DECREASES, + MODIFIES, + MODIFIABLE, + ASSIGNABLE, + ACCESSIBLE, + PRE, + POST, + PRE_REDUNDANTLY, + POST_REDUNDANTLY, + DECREASING, + DECREASES_REDUNDANTLY, + MEASURED_BY, + OLD, + FORALL, + SIGNALS, + SIGNALS_REDUNDANTLY, + SIGNALS_ONLY, + WHEN, + WORKING_SPACE, + WORKING_SPACE_REDUNDANTLY, + CAPTURES, + CAPTURES_REDUNDANTLY, + ASSIGNABLE_REDUNDANTLY, + MODIFIABLE_REDUNDANTLY, + MODIFIES_REDUNDANTLY, + CALLABLE, + CALLABLE_REDUNDANTLY, + DIVERGES, + DIVERGES_REDUNDANTLY, + DURATION, + DURATION_REDUNDANTLY + ) + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/AssignableValidator.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/AssignableValidator.kt new file mode 100644 index 0000000000..4615e2a5ae --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/AssignableValidator.kt @@ -0,0 +1,50 @@ +package io.github.jmltoolkit.lint.rules + +import com.github.javaparser.ast.body.FieldDeclaration +import com.github.javaparser.ast.jml.clauses.JmlClauseKind +import com.github.javaparser.ast.jml.clauses.JmlMultiExprClause +import io.github.jmltoolkit.lint.LintProblemReporter +import io.github.jmltoolkit.lint.LintRuleVisitor +import kotlin.jvm.optionals.getOrNull + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +class AssignableValidator : LintRuleVisitor() { + override fun visit(n: JmlMultiExprClause, arg: LintProblemReporter) { + if (n.kind === JmlClauseKind.ASSIGNABLE || + n.kind === JmlClauseKind.ASSIGNABLE_REDUNDANTLY + ) { + checkFinalFieldsInAssignableClause(n, arg) + } + } + + private fun checkFinalFieldsInAssignableClause(n: JmlMultiExprClause, arg: LintProblemReporter) { + for (e in n.expression) { + if (e.isNameExpr) { + if (e.asNameExpr().nameAsString.equals("this")) { + arg.error(e, "", "", "This reference is not re-assignable!") + continue + } + val value = e.asNameExpr().resolve() + if (value.isEnumConstant) { + arg.error(e, "", "", "Enum constants are not re-assignable!") + } else if (value.isField) { + val ast = value.asField().toAst().getOrNull() + if (ast is FieldDeclaration && ast.isFinal) { + arg.error(e, "", "", "This variable is final, so cannot be assigned") + } + } + } else if (e.isArrayAccessExpr) { + //TODO weigl check for array-ness of name expr + val rtype = e.asArrayAccessExpr().name.calculateResolvedType() + if (!rtype.isArray) { + arg.error(e, "", "", "Array access to non-array. Calculated type is %s", rtype.describe()) + } + } else { + arg.error(e, "", "", "Strange expression type found: %s", e.metaModel.typeName) + } + } + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/ContextSensitiveForbiddenFunctionsValidator.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/ContextSensitiveForbiddenFunctionsValidator.kt new file mode 100644 index 0000000000..ce6f127b26 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/ContextSensitiveForbiddenFunctionsValidator.kt @@ -0,0 +1,42 @@ +package com.github.jmlparser.lint.rules + +import com.github.javaparser.ast.jml.clauses.JmlClauseKind +import com.github.javaparser.ast.jml.clauses.JmlContract +import io.github.jmltoolkit.lint.LintProblemReporter +import io.github.jmltoolkit.lint.LintRuleVisitor + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +class ContextSensitiveForbiddenFunctionsValidator : LintRuleVisitor() { + private var signalsOnlyCounter = 0 + + override fun visit(n: JmlContract, arg: LintProblemReporter) { + signalsOnlyCounter = 0 + reportMultipleSignalsOnlyClauses(n, arg) + } + + private fun reportMultipleSignalsOnlyClauses(n: JmlContract, arg: LintProblemReporter) { + for (clause in n.clauses) { + if (clause.kind === JmlClauseKind.SIGNALS_ONLY) signalsOnlyCounter++ + + if (signalsOnlyCounter > 1) { + arg.warn(clause, "", "", MULTIPLE_SIGNALS_ONLY) + } + } + + for (subContract in n.subContracts) { + reportMultipleSignalsOnlyClauses(subContract, arg) + } + } + + companion object { + const val MULTIPLE_SIGNALS_ONLY: String = "Use a single signals_only clause to avoid confusion" + const val NOT_SPECIFIED_REDUNDANT: String = + "This clause containing \\not_specified is redundant because you already specified it" + const val BACKSLASH_RESULT_NOT_ALLOWED: String = "You can only use \\result in an ensures clause" + const val OLD_EXPR_NOT_ALLOWED: String = + "You can only use an \\old() expressions in ensures and signals clauses, assert and assume statements, and in loop invariants" + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JavaContainsJmlConstruct.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JavaContainsJmlConstruct.kt new file mode 100644 index 0000000000..f1b995a2ac --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JavaContainsJmlConstruct.kt @@ -0,0 +1,31 @@ +package io.github.jmltoolkit.lint.rules + +import com.github.javaparser.ast.Jmlish +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.jml.clauses.JmlContract +import com.github.javaparser.ast.jml.stmt.JmlStatement +import com.github.javaparser.ast.validator.ProblemReporter +import java.util.function.Predicate + +/** + * @author Alexander Weigl + * @version 1 (19.02.22) + */ +class JavaContainsJmlConstruct : com.github.javaparser.ast.validator.Validator { + override fun accept(node: Node, problemReporter: ProblemReporter) { + accept(node, false, problemReporter) + } + + private fun accept(current: Node, inJml: Boolean, problemReporter: ProblemReporter) { + val openJml: Predicate = Predicate { it: Node? -> it is JmlStatement || it is JmlContract} + + if (!inJml && (current is Jmlish) && !openJml.test(current)) { + problemReporter.report(current, "Jml construct used in Java part") + return + } + + for (it in current.childNodes) { + accept(it, inJml || openJml.test(current), problemReporter) + } + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JmlJavaNameClashes.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JmlJavaNameClashes.kt new file mode 100644 index 0000000000..127f7031a5 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JmlJavaNameClashes.kt @@ -0,0 +1,7 @@ +package com.github.jmlparser.lint.rules + +/** + * @author Alexander Weigl + * @version 1 (19.02.22) + */ +class JmlJavaNameClashes diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JmlNameClashWithJava.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JmlNameClashWithJava.kt new file mode 100644 index 0000000000..b649cd09fd --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/JmlNameClashWithJava.kt @@ -0,0 +1,47 @@ +package io.github.jmltoolkit.lint.rules + +import com.github.javaparser.ast.jml.clauses.JmlForallClause +import com.github.javaparser.ast.jml.clauses.JmlSignalsClause +import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause +import com.github.javaparser.jml.JmlUtility +import io.github.jmltoolkit.lint.LintProblemReporter +import io.github.jmltoolkit.lint.LintRule +import io.github.jmltoolkit.lint.LintRuleVisitor + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +class JmlNameClashWithJava : LintRuleVisitor() { + override fun visit(n: JmlSignalsClause, arg: LintProblemReporter) { + val rtype= n.parameter.type.resolve() + val exception= JmlUtility.resolveException(n) + if (exception.isAssignableBy(rtype)) { + arg.report(NOT_AN_EXCEPTION_CLASS.create(n)) + } + super.visit(n, arg) + } + + + override fun visit(n: JmlForallClause, arg: LintProblemReporter?) { + super.visit(n, arg) + } + + override fun visit(n: JmlSimpleExprClause, arg: LintProblemReporter?) { + super.visit(n, arg) + } + + companion object { + val NOT_AN_EXCEPTION_CLASS + : LintProblemMeta = LintProblemMeta("JML-1", "This is not an exception class", LintRule.ERROR) + + const val PUT_IN_THROWS_CLAUSE: String = + "This exception (or a superclass or subclass of it) should be mentioned in the throws clause of this method" + + const val CLASS_REFERENCE_NOT_FOUND: String = "This class could not be resolved, did you forget to import it?" + + + const val NOT_A_TYPE_NAME: String = "This is not the name of a primitive type or a class" + const val NO_ARRAY: String = "This is not an array" + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/LintProblemMeta.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/LintProblemMeta.kt new file mode 100644 index 0000000000..975047d481 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/LintProblemMeta.kt @@ -0,0 +1,16 @@ +package io.github.jmltoolkit.lint.rules + +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.nodeTypes.NodeWithTokenRange +import io.github.jmltoolkit.lint.LintProblem + +/** + * @author Alexander Weigl + * @version 1 (21.10.22) + */ +@JvmRecord +data class LintProblemMeta(val id: String, val message: String, val level: String) { + fun create(n: NodeWithTokenRange): LintProblem { + return LintProblem(level, message, n.tokenRange.orElse(null), null, id, "") + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/LocationSetValidator.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/LocationSetValidator.kt new file mode 100644 index 0000000000..ee330e38d8 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/LocationSetValidator.kt @@ -0,0 +1,13 @@ +package io.github.jmltoolkit.lint.rules + +import io.github.jmltoolkit.lint.LintRuleVisitor + + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +object LocationSetValidator : LintRuleVisitor() { + const val ASSIGNABLE_ARRAY_ONLY: String = "You can only use '[*]' on arrays" + const val ASSIGNABLE_CLASS_ONLY: String = "You can only use '.*' on classes and interfaces" +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/MethodBodyHasNoContract.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/MethodBodyHasNoContract.kt new file mode 100644 index 0000000000..474ffa73e7 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/MethodBodyHasNoContract.kt @@ -0,0 +1,14 @@ +package io.github.jmltoolkit.lint.rules + +import com.github.javaparser.ast.body.MethodDeclaration +import com.github.javaparser.ast.validator.ProblemReporter +import com.github.javaparser.ast.validator.VisitorValidator + +class MethodBodyHasNoContract : VisitorValidator() { + override fun visit(n: MethodDeclaration, arg: ProblemReporter) { + if (n.body.isPresent && !n.body.get().contracts.isEmpty()) { + arg.report(n, "Body of method has a block contract.") + } + super.visit(n, arg) + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/OverridingLocalNamesInGhost.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/OverridingLocalNamesInGhost.kt new file mode 100644 index 0000000000..0d631734cc --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/OverridingLocalNamesInGhost.kt @@ -0,0 +1,40 @@ +package io.github.jmltoolkit.lint.rules + +import com.github.javaparser.ast.expr.VariableDeclarationExpr +import com.github.javaparser.ast.jml.stmt.JmlGhostStmt +import com.github.javaparser.resolution.declarations.ResolvedValueDeclaration +import io.github.jmltoolkit.lint.LintProblemReporter +import io.github.jmltoolkit.lint.LintRuleVisitor + +/** + * @author Alexander Weigl + * @version 1 (14.10.22) + */ +class OverridingLocalNamesInGhost : LintRuleVisitor() { + private var inGhost = false + + override fun reset() { + inGhost = false + } + + override fun visit(n: JmlGhostStmt, arg: LintProblemReporter) { + inGhost = true + super.visit(n, arg) + inGhost = false + } + + override fun visit(n: VariableDeclarationExpr, arg: LintProblemReporter) { + if (inGhost) { + val s: JmlGhostStmt = n.findAncestor(JmlGhostStmt::class.java).get() + for (variable in n.variables) { + val name = variable.nameAsExpression + name.setParentNode(s) + val value = s.symbolResolver.resolveDeclaration(name, ResolvedValueDeclaration::class.java) + name.setParentNode(null) + if (value != null) { + arg.error(variable, "", "", "Variable %s already declared in Java.", variable.nameAsString) + } + } + } + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/PurityValidator.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/PurityValidator.kt new file mode 100644 index 0000000000..9540bbfe46 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/PurityValidator.kt @@ -0,0 +1,91 @@ +package com.github.jmlparser.lint.rules + +import com.github.javaparser.ast.Modifier +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.expr.AssignExpr +import com.github.javaparser.ast.expr.MethodCallExpr +import com.github.javaparser.ast.expr.UnaryExpr +import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration +import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause +import com.github.javaparser.ast.jml.stmt.JmlExpressionStmt +import com.github.javaparser.ast.nodeTypes.NodeWithModifiers +import com.github.javaparser.ast.visitor.VoidVisitorAdapter +import io.github.jmltoolkit.lint.LintProblemReporter +import io.github.jmltoolkit.lint.LintRuleVisitor +import kotlin.jvm.optionals.getOrNull + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +class PurityValidator : LintRuleVisitor() { + override fun visit(n: JmlSimpleExprClause, arg: LintProblemReporter) { + val r = PurityVisitor() + n.expression.accept(r, null) + if (r.reason != null) { + arg.error(r.reason!!, "", "", "Expression in JML clause must be pure." + r.text) + } + } + + + override fun visit(n: JmlClassExprDeclaration, arg: LintProblemReporter) { + val r = PurityVisitor() + n.invariant.accept(r, null) + if (r.reason != null) { + arg.error(r.reason!!, "", "", "Expression in JML invariant clause must be pure." + r.text) + } + } + + override fun visit(n: JmlExpressionStmt, arg: LintProblemReporter) { + val r = PurityVisitor() + n.expression.accept(r, null) + if (r.reason != null) { + arg.error(r.reason!!, "", "", "Expression in JML statements must be pure." + r.text) + } + } + + + private class PurityVisitor : VoidVisitorAdapter() { + var reason: Node? = null + var text: String? = null + + override fun visit(n: AssignExpr, arg: Void?) { + reason = n + } + + override fun visit(n: UnaryExpr, arg: Void?) { + when (n.operator) { + UnaryExpr.Operator.POSTFIX_DECREMENT, UnaryExpr.Operator.POSTFIX_INCREMENT -> { + reason = n + text = "Postfix de-/increment operator found." + } + + UnaryExpr.Operator.PREFIX_INCREMENT, UnaryExpr.Operator.PREFIX_DECREMENT -> { + reason = n + text = "Prefix de-/increment operator found" + } + + else -> n.expression.accept(this, arg) + } + } + + override fun visit(n: MethodCallExpr, arg: Void?) { + val r = n.resolve().toAst().getOrNull() + val mods = r as? NodeWithModifiers<*> + + if (mods?.hasModifier(Modifier.DefaultKeyword.JML_PURE) == true + || mods?.hasModifier(Modifier.DefaultKeyword.JML_STRICTLY_PURE) == true + ) { + super.visit(n, arg) + } else { + reason = n + text = METHOD_NOT_PURE + } + } + } + + companion object { + const val METHOD_NOT_PURE: String = "JML expressions should be pure and this method might not be pure" + const val ASSIGNMENT_NOT_PURE: String = "JML expressions should be pure and assignments are not pure" + } +} diff --git a/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/ResultVarCheck.kt b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/ResultVarCheck.kt new file mode 100644 index 0000000000..ea87d61b83 --- /dev/null +++ b/tools/lint/src/main/kotlin/io/github/jmltoolkit/lint/rules/ResultVarCheck.kt @@ -0,0 +1,46 @@ +package io.github.jmltoolkit.lint.rules + +import com.github.javaparser.ast.body.MethodDeclaration +import com.github.javaparser.ast.expr.NameExpr +import com.github.javaparser.ast.jml.clauses.* +import io.github.jmltoolkit.lint.LintProblemReporter +import io.github.jmltoolkit.lint.LintRuleVisitor + +/** + * @author Alexander Weigl + * @version 1 (14.10.22) + */ +class ResultVarCheck : LintRuleVisitor() { + private var inMethodWithNonVoidReturnType = false + private var inPostCondition = false + + override fun reset() { + inPostCondition = false + } + + override fun visit(n: MethodDeclaration, arg: LintProblemReporter) { + inMethodWithNonVoidReturnType = !n.type.isVoidType + n.contracts.forEach { v -> v.accept(this, arg) } + inMethodWithNonVoidReturnType = false + n.body.ifPresent { l -> l.accept(this, arg) } + } + + override fun visit(n: JmlSimpleExprClause, arg: LintProblemReporter?) { + inPostCondition = + n.kind === JmlClauseKind.ENSURES || n.kind === JmlClauseKind.ENSURES_FREE || n.kind === JmlClauseKind.ENSURES_REDUNDANTLY || n.kind === JmlClauseKind.POST || n.kind === JmlClauseKind.POST_REDUNDANTLY + super.visit(n, arg) + inPostCondition = false + } + + override fun visit(n: NameExpr, arg: LintProblemReporter) { + if (n.nameAsString.equals("\\result")) { + if (!inPostCondition) arg.error(n, "", "", "Use of \\result in non-post-conditional clause.") + if (!inMethodWithNonVoidReturnType) arg.error(n, "", "", NO_METHOD_RESULT) + } + } + + companion object { + const val NO_METHOD_RESULT: String = + "Cannot use \\result here, as this method / constructor does not return anything" + } +} diff --git a/tools/lint/src/main/resources/META-INF/services/com.github.jmlparser.lint.LintRule b/tools/lint/src/main/resources/META-INF/services/com.github.jmlparser.lint.LintRule new file mode 100644 index 0000000000..dbcb1c680e --- /dev/null +++ b/tools/lint/src/main/resources/META-INF/services/com.github.jmlparser.lint.LintRule @@ -0,0 +1,9 @@ +com.github.jmlparser.lint.rules.JmlNameClashWithJava +com.github.jmlparser.lint.rules.AssignableValidator +com.github.jmlparser.lint.rules.ContextSensitiveForbiddenFunctionsValidator +com.github.jmlparser.lint.rules.JmlNameClashWithJava +com.github.jmlparser.lint.rules.LocationSetValidator +com.github.jmlparser.lint.rules.PurityValidator +com.github.jmlparser.lint.rules.OverridingLocalNamesInGhost +com.github.jmlparser.lint.rules.AllowedJmlClauses +io.github.jmltoolkit.lint.rules.ResultVarCheck diff --git a/tools/lint/src/sarif-schema-2.1.0.json b/tools/lint/src/sarif-schema-2.1.0.json new file mode 100644 index 0000000000..f9c54b8a6c --- /dev/null +++ b/tools/lint/src/sarif-schema-2.1.0.json @@ -0,0 +1,3389 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema", + "id": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", + "description": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.", + "additionalProperties": false, + "type": "object", + "properties": { + + "$schema": { + "description": "The URI of the JSON schema corresponding to the version.", + "type": "string", + "format": "uri" + }, + + "version": { + "description": "The SARIF format version of this log file.", + "enum": [ "2.1.0" ], + "type": "string" + }, + + "runs": { + "description": "The set of runs contained in this log file.", + "type": [ "array", "null" ], + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/run" + } + }, + + "inlineExternalProperties": { + "description": "References to external property files that share data between runs.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/externalProperties" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the log file.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "version", "runs" ], + + "definitions": { + + "address": { + "description": "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).", + "additionalProperties": false, + "type": "object", + "properties": { + + "absoluteAddress": { + "description": "The address expressed as a byte offset from the start of the addressable region.", + "type": "integer", + "minimum": -1, + "default": -1 + + }, + + "relativeAddress": { + "description": "The address expressed as a byte offset from the absolute address of the top-most parent object.", + "type": "integer" + + }, + + "length": { + "description": "The number of bytes in this range of addresses.", + "type": "integer" + }, + + "kind": { + "description": "An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.", + "type": "string" + }, + + "name": { + "description": "A name that is associated with the address, e.g., '.text'.", + "type": "string" + }, + + "fullyQualifiedName": { + "description": "A human-readable fully qualified name that is associated with the address.", + "type": "string" + }, + + "offsetFromParent": { + "description": "The byte offset of this address from the absolute or relative address of the parent object.", + "type": "integer" + }, + + "index": { + "description": "The index within run.addresses of the cached object for this address.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "parentIndex": { + "description": "The index within run.addresses of the parent object.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the address.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "artifact": { + "description": "A single artifact. In some cases, this artifact might be nested within another artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "description": { + "description": "A short description of the artifact.", + "$ref": "#/definitions/message" + }, + + "location": { + "description": "The location of the artifact.", + "$ref": "#/definitions/artifactLocation" + }, + + "parentIndex": { + "description": "Identifies the index of the immediate parent of the artifact, if this artifact is nested.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "offset": { + "description": "The offset in bytes of the artifact within its containing artifact.", + "type": "integer", + "minimum": 0 + }, + + "length": { + "description": "The length of the artifact in bytes.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "roles": { + "description": "The role or roles played by the artifact in the analysis.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "enum": [ + "analysisTarget", + "attachment", + "responseFile", + "resultFile", + "standardStream", + "tracedFile", + "unmodified", + "modified", + "added", + "deleted", + "renamed", + "uncontrolled", + "driver", + "extension", + "translation", + "taxonomy", + "policy", + "referencedOnCommandLine", + "memoryContents", + "directory", + "userSpecifiedConfiguration", + "toolSpecifiedConfiguration", + "debugOutputFile" + ], + "type": "string" + } + }, + + "mimeType": { + "description": "The MIME type (RFC 2045) of the artifact.", + "type": "string", + "pattern": "[^/]+/.+" + }, + + "contents": { + "description": "The contents of the artifact.", + "$ref": "#/definitions/artifactContent" + }, + + "encoding": { + "description": "Specifies the encoding for an artifact object that refers to a text file.", + "type": "string" + }, + + "sourceLanguage": { + "description": "Specifies the source language for any artifact object that refers to a text file that contains source code.", + "type": "string" + }, + + "hashes": { + "description": "A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "lastModifiedTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the artifact.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "artifactChange": { + "description": "A change to a single artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "artifactLocation": { + "description": "The location of the artifact to change.", + "$ref": "#/definitions/artifactLocation" + }, + + "replacements": { + "description": "An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.", + "type": "array", + "minItems": 1, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/replacement" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the change.", + "$ref": "#/definitions/propertyBag" + } + + }, + + "required": [ "artifactLocation", "replacements" ] + }, + + "artifactContent": { + "description": "Represents the contents of an artifact.", + "type": "object", + "additionalProperties": false, + "properties": { + + "text": { + "description": "UTF-8-encoded content from a text artifact.", + "type": "string" + }, + + "binary": { + "description": "MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.", + "type": "string" + }, + + "rendered": { + "description": "An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).", + "$ref": "#/definitions/multiformatMessageString" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the artifact content.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "artifactLocation": { + "description": "Specifies the location of an artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "uri": { + "description": "A string containing a valid relative or absolute URI.", + "type": "string", + "format": "uri-reference" + }, + + "uriBaseId": { + "description": "A string which indirectly specifies the absolute URI with respect to which a relative URI in the \"uri\" property is interpreted.", + "type": "string" + }, + + "index": { + "description": "The index within the run artifacts array of the artifact object associated with the artifact location.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "description": { + "description": "A short description of the artifact location.", + "$ref": "#/definitions/message" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the artifact location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "attachment": { + "description": "An artifact relevant to a result.", + "type": "object", + "additionalProperties": false, + "properties": { + + "description": { + "description": "A message describing the role played by the attachment.", + "$ref": "#/definitions/message" + }, + + "artifactLocation": { + "description": "The location of the attachment.", + "$ref": "#/definitions/artifactLocation" + }, + + "regions": { + "description": "An array of regions of interest within the attachment.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/region" + } + }, + + "rectangles": { + "description": "An array of rectangles specifying areas of interest within the image.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/rectangle" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the attachment.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "artifactLocation" ] + }, + + "codeFlow": { + "description": "A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.", + "additionalProperties": false, + "type": "object", + "properties": { + + "message": { + "description": "A message relevant to the code flow.", + "$ref": "#/definitions/message" + }, + + "threadFlows": { + "description": "An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.", + "type": "array", + "minItems": 1, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/threadFlow" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the code flow.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "threadFlows" ] + }, + + "configurationOverride": { + "description": "Information about how a specific rule or notification was reconfigured at runtime.", + "type": "object", + "additionalProperties": false, + "properties": { + + "configuration": { + "description": "Specifies how the rule or notification was configured during the scan.", + "$ref": "#/definitions/reportingConfiguration" + }, + + "descriptor": { + "description": "A reference used to locate the descriptor whose configuration was overridden.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the configuration override.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "configuration", "descriptor" ] + }, + + "conversion": { + "description": "Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.", + "additionalProperties": false, + "type": "object", + "properties": { + + "tool": { + "description": "A tool object that describes the converter.", + "$ref": "#/definitions/tool" + }, + + "invocation": { + "description": "An invocation object that describes the invocation of the converter.", + "$ref": "#/definitions/invocation" + }, + + "analysisToolLogFiles": { + "description": "The locations of the analysis tool's per-run log files.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/artifactLocation" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the conversion.", + "$ref": "#/definitions/propertyBag" + } + + }, + + "required": [ "tool" ] + }, + + "edge": { + "description": "Represents a directed edge in a graph.", + "type": "object", + "additionalProperties": false, + "properties": { + + "id": { + "description": "A string that uniquely identifies the edge within its graph.", + "type": "string" + }, + + "label": { + "description": "A short description of the edge.", + "$ref": "#/definitions/message" + }, + + "sourceNodeId": { + "description": "Identifies the source node (the node at which the edge starts).", + "type": "string" + }, + + "targetNodeId": { + "description": "Identifies the target node (the node at which the edge ends).", + "type": "string" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the edge.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "id", "sourceNodeId", "targetNodeId" ] + }, + + "edgeTraversal": { + "description": "Represents the traversal of a single edge during a graph traversal.", + "type": "object", + "additionalProperties": false, + "properties": { + + "edgeId": { + "description": "Identifies the edge being traversed.", + "type": "string" + }, + + "message": { + "description": "A message to display to the user as the edge is traversed.", + "$ref": "#/definitions/message" + }, + + "finalState": { + "description": "The values of relevant expressions after the edge has been traversed.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "stepOverEdgeCount": { + "description": "The number of edge traversals necessary to return from a nested graph.", + "type": "integer", + "minimum": 0 + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the edge traversal.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "edgeId" ] + }, + + "exception": { + "description": "Describes a runtime exception encountered during the execution of an analysis tool.", + "type": "object", + "additionalProperties": false, + "properties": { + + "kind": { + "type": "string", + "description": "A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal." + }, + + "message": { + "description": "A message that describes the exception.", + "type": "string" + }, + + "stack": { + "description": "The sequence of function calls leading to the exception.", + "$ref": "#/definitions/stack" + }, + + "innerExceptions": { + "description": "An array of exception objects each of which is considered a cause of this exception.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/exception" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the exception.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "externalProperties": { + "description": "The top-level element of an external property file.", + "type": "object", + "additionalProperties": false, + "properties": { + + "schema": { + "description": "The URI of the JSON schema corresponding to the version of the external property file format.", + "type": "string", + "format": "uri" + }, + + "version": { + "description": "The SARIF format version of this external properties object.", + "enum": [ "2.1.0" ], + "type": "string" + }, + + "guid": { + "description": "A stable, unique identifier for this external properties object, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "runGuid": { + "description": "A stable, unique identifier for the run associated with this external properties object, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "conversion": { + "description": "A conversion object that will be merged with a separate run.", + "$ref": "#/definitions/conversion" + }, + + "graphs": { + "description": "An array of graph objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/graph" + } + }, + + "externalizedProperties": { + "description": "Key/value pairs that provide additional information that will be merged with a separate run.", + "$ref": "#/definitions/propertyBag" + }, + + "artifacts": { + "description": "An array of artifact objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifact" + } + }, + + "invocations": { + "description": "Describes the invocation of the analysis tool that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/invocation" + } + }, + + "logicalLocations": { + "description": "An array of logical locations such as namespaces, types or functions that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + + "threadFlowLocations": { + "description": "An array of threadFlowLocation objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + + "results": { + "description": "An array of result objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/result" + } + }, + + "taxonomies": { + "description": "Tool taxonomies that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "driver": { + "description": "The analysis tool object that will be merged with a separate run.", + "$ref": "#/definitions/toolComponent" + }, + + "extensions": { + "description": "Tool extensions that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "policies": { + "description": "Tool policies that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "translations": { + "description": "Tool translations that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "addresses": { + "description": "Addresses that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/address" + } + }, + + "webRequests": { + "description": "Requests that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webRequest" + } + }, + + "webResponses": { + "description": "Responses that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webResponse" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the external properties.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "externalPropertyFileReference": { + "description": "Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run.", + "type": "object", + "additionalProperties": false, + "properties": { + + "location": { + "description": "The location of the external property file.", + "$ref": "#/definitions/artifactLocation" + }, + + "guid": { + "description": "A stable, unique identifier for the external property file in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "itemCount": { + "description": "A non-negative integer specifying the number of items contained in the external property file.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the external property file.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { "required": [ "location" ] }, + { "required": [ "guid" ] } + ] + }, + + "externalPropertyFileReferences": { + "description": "References to external property files that should be inlined with the content of a root log file.", + "additionalProperties": false, + "type": "object", + "properties": { + + "conversion": { + "description": "An external property file containing a run.conversion object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + + "graphs": { + "description": "An array of external property files containing a run.graphs object to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "externalizedProperties": { + "description": "An external property file containing a run.properties object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + + "artifacts": { + "description": "An array of external property files containing run.artifacts arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "invocations": { + "description": "An array of external property files containing run.invocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "logicalLocations": { + "description": "An array of external property files containing run.logicalLocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "threadFlowLocations": { + "description": "An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "results": { + "description": "An array of external property files containing run.results arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "taxonomies": { + "description": "An array of external property files containing run.taxonomies arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "addresses": { + "description": "An array of external property files containing run.addresses arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "driver": { + "description": "An external property file containing a run.driver object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + + "extensions": { + "description": "An array of external property files containing run.extensions arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "policies": { + "description": "An array of external property files containing run.policies arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "translations": { + "description": "An array of external property files containing run.translations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "webRequests": { + "description": "An array of external property files containing run.requests arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "webResponses": { + "description": "An array of external property files containing run.responses arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the external property files.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "fix": { + "description": "A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.", + "additionalProperties": false, + "type": "object", + "properties": { + + "description": { + "description": "A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.", + "$ref": "#/definitions/message" + }, + + "artifactChanges": { + "description": "One or more artifact changes that comprise a fix for a result.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifactChange" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the fix.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "artifactChanges" ] + }, + + "graph": { + "description": "A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph).", + "type": "object", + "additionalProperties": false, + "properties": { + + "description": { + "description": "A description of the graph.", + "$ref": "#/definitions/message" + }, + + "nodes": { + "description": "An array of node objects representing the nodes of the graph.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/node" + } + }, + + "edges": { + "description": "An array of edge objects representing the edges of the graph.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/edge" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the graph.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "graphTraversal": { + "description": "Represents a path through a graph.", + "type": "object", + "additionalProperties": false, + "properties": { + + "runGraphIndex": { + "description": "The index within the run.graphs to be associated with the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "resultGraphIndex": { + "description": "The index within the result.graphs to be associated with the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "description": { + "description": "A description of this graph traversal.", + "$ref": "#/definitions/message" + }, + + "initialState": { + "description": "Values of relevant expressions at the start of the graph traversal that may change during graph traversal.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "immutableState": { + "description": "Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "edgeTraversals": { + "description": "The sequences of edges traversed by this graph traversal.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/edgeTraversal" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the graph traversal.", + "$ref": "#/definitions/propertyBag" + } + }, + "oneOf": [ + { "required": [ "runGraphIndex" ] }, + { "required": [ "resultGraphIndex" ] } + ] + }, + + "invocation": { + "description": "The runtime environment of the analysis tool run.", + "additionalProperties": false, + "type": "object", + "properties": { + + "commandLine": { + "description": "The command line used to invoke the tool.", + "type": "string" + }, + + "arguments": { + "description": "An array of strings, containing in order the command line arguments passed to the tool from the operating system.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "type": "string" + } + }, + + "responseFiles": { + "description": "The locations of any response files specified on the tool's command line.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifactLocation" + } + }, + + "startTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation started. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + + "endTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation ended. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + + "exitCode": { + "description": "The process exit code.", + "type": "integer" + }, + + "ruleConfigurationOverrides": { + "description": "An array of configurationOverride objects that describe rules related runtime overrides.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/configurationOverride" + } + }, + + "notificationConfigurationOverrides": { + "description": "An array of configurationOverride objects that describe notifications related runtime overrides.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/configurationOverride" + } + }, + + "toolExecutionNotifications": { + "description": "A list of runtime conditions detected by the tool during the analysis.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/notification" + } + }, + + "toolConfigurationNotifications": { + "description": "A list of conditions detected by the tool that are relevant to the tool's configuration.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/notification" + } + }, + + "exitCodeDescription": { + "description": "The reason for the process exit.", + "type": "string" + }, + + "exitSignalName": { + "description": "The name of the signal that caused the process to exit.", + "type": "string" + }, + + "exitSignalNumber": { + "description": "The numeric value of the signal that caused the process to exit.", + "type": "integer" + }, + + "processStartFailureMessage": { + "description": "The reason given by the operating system that the process failed to start.", + "type": "string" + }, + + "executionSuccessful": { + "description": "Specifies whether the tool's execution completed successfully.", + "type": "boolean" + }, + + "machine": { + "description": "The machine on which the invocation occurred.", + "type": "string" + }, + + "account": { + "description": "The account under which the invocation occurred.", + "type": "string" + }, + + "processId": { + "description": "The id of the process in which the invocation occurred.", + "type": "integer" + }, + + "executableLocation": { + "description": "An absolute URI specifying the location of the executable that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "workingDirectory": { + "description": "The working directory for the invocation.", + "$ref": "#/definitions/artifactLocation" + }, + + "environmentVariables": { + "description": "The environment variables associated with the analysis tool process, expressed as key/value pairs.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "stdin": { + "description": "A file containing the standard input stream to the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "stdout": { + "description": "A file containing the standard output stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "stderr": { + "description": "A file containing the standard error stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "stdoutStderr": { + "description": "A file containing the interleaved standard output and standard error stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the invocation.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "executionSuccessful" ] + }, + + "location": { + "description": "A location within a programming artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "id": { + "description": "Value that distinguishes this location from all other locations within a single result object.", + "type": "integer", + "minimum": -1, + "default": -1 + }, + + "physicalLocation": { + "description": "Identifies the artifact and region.", + "$ref": "#/definitions/physicalLocation" + }, + + "logicalLocations": { + "description": "The logical locations associated with the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + + "message": { + "description": "A message relevant to the location.", + "$ref": "#/definitions/message" + }, + + "annotations": { + "description": "A set of regions relevant to the location.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/region" + } + }, + + "relationships": { + "description": "An array of objects that describe relationships between this location and others.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/locationRelationship" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "locationRelationship": { + "description": "Information about the relation of one location to another.", + "type": "object", + "additionalProperties": false, + "properties": { + + "target": { + "description": "A reference to the related location.", + "type": "integer", + "minimum": 0 + }, + + "kinds": { + "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.", + "type": "array", + "default": [ "relevant" ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "description": { + "description": "A description of the location relationship.", + "$ref": "#/definitions/message" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the location relationship.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "target" ] + }, + + "logicalLocation": { + "description": "A logical location of a construct that produced a result.", + "additionalProperties": false, + "type": "object", + "properties": { + + "name": { + "description": "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.", + "type": "string" + }, + + "index": { + "description": "The index within the logical locations array.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "fullyQualifiedName": { + "description": "The human-readable fully qualified name of the logical location.", + "type": "string" + }, + + "decoratedName": { + "description": "The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.", + "type": "string" + }, + + "parentIndex": { + "description": "Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "kind": { + "description": "The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.", + "type": "string" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the logical location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "message": { + "description": "Encapsulates a message intended to be read by the end user.", + "type": "object", + "additionalProperties": false, + + "properties": { + + "text": { + "description": "A plain text message string.", + "type": "string" + }, + + "markdown": { + "description": "A Markdown message string.", + "type": "string" + }, + + "id": { + "description": "The identifier for this message.", + "type": "string" + }, + + "arguments": { + "description": "An array of strings to substitute into the message string.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "type": "string" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the message.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { "required": [ "text" ] }, + { "required": [ "id" ] } + ] + }, + + "multiformatMessageString": { + "description": "A message string or message format string rendered in multiple formats.", + "type": "object", + "additionalProperties": false, + + "properties": { + + "text": { + "description": "A plain text message string or format string.", + "type": "string" + }, + + "markdown": { + "description": "A Markdown message string or format string.", + "type": "string" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the message.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "text" ] + }, + + "node": { + "description": "Represents a node in a graph.", + "type": "object", + "additionalProperties": false, + + "properties": { + + "id": { + "description": "A string that uniquely identifies the node within its graph.", + "type": "string" + }, + + "label": { + "description": "A short description of the node.", + "$ref": "#/definitions/message" + }, + + "location": { + "description": "A code location associated with the node.", + "$ref": "#/definitions/location" + }, + + "children": { + "description": "Array of child nodes.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/node" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the node.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "id" ] + }, + + "notification": { + "description": "Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.", + "type": "object", + "additionalProperties": false, + "properties": { + + "locations": { + "description": "The locations relevant to this notification.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + + "message": { + "description": "A message that describes the condition that was encountered.", + "$ref": "#/definitions/message" + }, + + "level": { + "description": "A value specifying the severity level of the notification.", + "default": "warning", + "enum": [ "none", "note", "warning", "error" ], + "type": "string" + }, + + "threadId": { + "description": "The thread identifier of the code that generated the notification.", + "type": "integer" + }, + + "timeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.", + "type": "string", + "format": "date-time" + }, + + "exception": { + "description": "The runtime exception, if any, relevant to this notification.", + "$ref": "#/definitions/exception" + }, + + "descriptor": { + "description": "A reference used to locate the descriptor relevant to this notification.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "associatedRule": { + "description": "A reference used to locate the rule descriptor associated with this notification.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the notification.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "message" ] + }, + + "physicalLocation": { + "description": "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "address": { + "description": "The address of the location.", + "$ref": "#/definitions/address" + }, + + "artifactLocation": { + "description": "The location of the artifact.", + "$ref": "#/definitions/artifactLocation" + }, + + "region": { + "description": "Specifies a portion of the artifact.", + "$ref": "#/definitions/region" + }, + + "contextRegion": { + "description": "Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.", + "$ref": "#/definitions/region" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the physical location.", + "$ref": "#/definitions/propertyBag" + } + }, + + "anyOf": [ + { + "required": [ "address" ] + }, + { + "required": [ "artifactLocation" ] + } + ] + }, + + "propertyBag": { + "description": "Key/value pairs that provide additional information about the object.", + "type": "object", + "additionalProperties": true, + "properties": { + "tags": { + + "description": "A set of distinct strings that provide additional information.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + } + } + }, + + "rectangle": { + "description": "An area within an image.", + "additionalProperties": false, + "type": "object", + "properties": { + + "top": { + "description": "The Y coordinate of the top edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "left": { + "description": "The X coordinate of the left edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "bottom": { + "description": "The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "right": { + "description": "The X coordinate of the right edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "message": { + "description": "A message relevant to the rectangle.", + "$ref": "#/definitions/message" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the rectangle.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "region": { + "description": "A region within an artifact where a result was detected.", + "additionalProperties": false, + "type": "object", + "properties": { + + "startLine": { + "description": "The line number of the first character in the region.", + "type": "integer", + "minimum": 1 + }, + + "startColumn": { + "description": "The column number of the first character in the region.", + "type": "integer", + "minimum": 1 + }, + + "endLine": { + "description": "The line number of the last character in the region.", + "type": "integer", + "minimum": 1 + }, + + "endColumn": { + "description": "The column number of the character following the end of the region.", + "type": "integer", + "minimum": 1 + }, + + "charOffset": { + "description": "The zero-based offset from the beginning of the artifact of the first character in the region.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "charLength": { + "description": "The length of the region in characters.", + "type": "integer", + "minimum": 0 + }, + + "byteOffset": { + "description": "The zero-based offset from the beginning of the artifact of the first byte in the region.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "byteLength": { + "description": "The length of the region in bytes.", + "type": "integer", + "minimum": 0 + }, + + "snippet": { + "description": "The portion of the artifact contents within the specified region.", + "$ref": "#/definitions/artifactContent" + }, + + "message": { + "description": "A message relevant to the region.", + "$ref": "#/definitions/message" + }, + + "sourceLanguage": { + "description": "Specifies the source language, if any, of the portion of the artifact specified by the region object.", + "type": "string" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the region.", + "$ref": "#/definitions/propertyBag" + } + }, + + "anyOf": [ + { "required": [ "startLine" ] }, + { "required": [ "charOffset" ] }, + { "required": [ "byteOffset" ] } + ] + }, + + "replacement": { + "description": "The replacement of a single region of an artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "deletedRegion": { + "description": "The region of the artifact to delete.", + "$ref": "#/definitions/region" + }, + + "insertedContent": { + "description": "The content to insert at the location specified by the 'deletedRegion' property.", + "$ref": "#/definitions/artifactContent" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the replacement.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "deletedRegion" ] + }, + + "reportingDescriptor": { + "description": "Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting.", + "additionalProperties": false, + "type": "object", + "properties": { + + "id": { + "description": "A stable, opaque identifier for the report.", + "type": "string" + }, + + "deprecatedIds": { + "description": "An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "guid": { + "description": "A unique identifier for the reporting descriptor in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "deprecatedGuids": { + "description": "An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + } + }, + + "name": { + "description": "A report identifier that is understandable to an end user.", + "type": "string" + }, + + "deprecatedNames": { + "description": "An array of readable identifiers by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "shortDescription": { + "description": "A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "fullDescription": { + "description": "A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "messageStrings": { + "description": "A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "defaultConfiguration": { + "description": "Default reporting configuration information.", + "$ref": "#/definitions/reportingConfiguration" + }, + + "helpUri": { + "description": "A URI where the primary documentation for the report can be found.", + "type": "string", + "format": "uri" + }, + + "help": { + "description": "Provides the primary documentation for the report, useful when there is no online documentation.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "relationships": { + "description": "An array of objects that describe relationships between this reporting descriptor and others.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorRelationship" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the report.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "id" ] + }, + + "reportingConfiguration": { + "description": "Information about a rule or notification that can be configured at runtime.", + "type": "object", + "additionalProperties": false, + "properties": { + + "enabled": { + "description": "Specifies whether the report may be produced during the scan.", + "type": "boolean", + "default": true + }, + + "level": { + "description": "Specifies the failure level for the report.", + "default": "warning", + "enum": [ "none", "note", "warning", "error" ], + "type": "string" + }, + + "rank": { + "description": "Specifies the relative priority of the report. Used for analysis output only.", + "type": "number", + "default": -1.0, + "minimum": -1.0, + "maximum": 100.0 + }, + + "parameters": { + "description": "Contains configuration information specific to a report.", + "$ref": "#/definitions/propertyBag" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the reporting configuration.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "reportingDescriptorReference": { + "description": "Information about how to locate a relevant reporting descriptor.", + "type": "object", + "additionalProperties": false, + "properties": { + + "id": { + "description": "The id of the descriptor.", + "type": "string" + }, + + "index": { + "description": "The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "guid": { + "description": "A guid that uniquely identifies the descriptor.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "toolComponent": { + "description": "A reference used to locate the toolComponent associated with the descriptor.", + "$ref": "#/definitions/toolComponentReference" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the reporting descriptor reference.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { "required": [ "index" ] }, + { "required": [ "guid" ] }, + { "required": [ "id" ] } + ] + }, + + "reportingDescriptorRelationship": { + "description": "Information about the relation of one reporting descriptor to another.", + "type": "object", + "additionalProperties": false, + "properties": { + + "target": { + "description": "A reference to the related reporting descriptor.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "kinds": { + "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.", + "type": "array", + "default": [ "relevant" ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "description": { + "description": "A description of the reporting descriptor relationship.", + "$ref": "#/definitions/message" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the reporting descriptor reference.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "target" ] + }, + + "result": { + "description": "A result produced by an analysis tool.", + "additionalProperties": false, + "type": "object", + "properties": { + + "ruleId": { + "description": "The stable, unique identifier of the rule, if any, to which this result is relevant.", + "type": "string" + }, + + "ruleIndex": { + "description": "The index within the tool component rules array of the rule object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "rule": { + "description": "A reference used to locate the rule descriptor relevant to this result.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "kind": { + "description": "A value that categorizes results by evaluation state.", + "default": "fail", + "enum": [ "notApplicable", "pass", "fail", "review", "open", "informational" ], + "type": "string" + }, + + "level": { + "description": "A value specifying the severity level of the result.", + "default": "warning", + "enum": [ "none", "note", "warning", "error" ], + "type": "string" + }, + + "message": { + "description": "A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.", + "$ref": "#/definitions/message" + }, + + "analysisTarget": { + "description": "Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.", + "$ref": "#/definitions/artifactLocation" + }, + + "locations": { + "description": "The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + + "guid": { + "description": "A stable, unique identifier for the result in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "correlationGuid": { + "description": "A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "occurrenceCount": { + "description": "A positive integer specifying the number of times this logically unique result was observed in this run.", + "type": "integer", + "minimum": 1 + }, + + "partialFingerprints": { + "description": "A set of strings that contribute to the stable, unique identity of the result.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "fingerprints": { + "description": "A set of strings each of which individually defines a stable, unique identity for the result.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "stacks": { + "description": "An array of 'stack' objects relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/stack" + } + }, + + "codeFlows": { + "description": "An array of 'codeFlow' objects relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/codeFlow" + } + }, + + "graphs": { + "description": "An array of zero or more unique graph objects associated with the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graph" + } + }, + + "graphTraversals": { + "description": "An array of one or more unique 'graphTraversal' objects.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graphTraversal" + } + }, + + "relatedLocations": { + "description": "A set of locations relevant to this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + + "suppressions": { + "description": "A set of suppressions relevant to this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/suppression" + } + }, + + "baselineState": { + "description": "The state of a result relative to a baseline of a previous run.", + "enum": [ + "new", + "unchanged", + "updated", + "absent" + ], + "type": "string" + }, + + "rank": { + "description": "A number representing the priority or importance of the result.", + "type": "number", + "default": -1.0, + "minimum": -1.0, + "maximum": 100.0 + }, + + "attachments": { + "description": "A set of artifacts relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/attachment" + } + }, + + "hostedViewerUri": { + "description": "An absolute URI at which the result can be viewed.", + "type": "string", + "format": "uri" + }, + + "workItemUris": { + "description": "The URIs of the work items associated with this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "format": "uri" + } + }, + + "provenance": { + "description": "Information about how and when the result was detected.", + "$ref": "#/definitions/resultProvenance" + }, + + "fixes": { + "description": "An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/fix" + } + }, + + "taxa": { + "description": "An array of references to taxonomy reporting descriptors that are applicable to the result.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorReference" + } + }, + + "webRequest": { + "description": "A web request associated with this result.", + "$ref": "#/definitions/webRequest" + }, + + "webResponse": { + "description": "A web response associated with this result.", + "$ref": "#/definitions/webResponse" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the result.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "message" ] + }, + + "resultProvenance": { + "description": "Contains information about how and when a result was detected.", + "additionalProperties": false, + "type": "object", + "properties": { + + "firstDetectionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the result was first detected. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + + "lastDetectionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + + "firstDetectionRunGuid": { + "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "lastDetectionRunGuid": { + "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "invocationIndex": { + "description": "The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "conversionSources": { + "description": "An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/physicalLocation" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the result.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "run": { + "description": "Describes a single run of an analysis tool, and contains the reported output of that run.", + "additionalProperties": false, + "type": "object", + "properties": { + + "tool": { + "description": "Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.", + "$ref": "#/definitions/tool" + }, + + "invocations": { + "description": "Describes the invocation of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/invocation" + } + }, + + "conversion": { + "description": "A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.", + "$ref": "#/definitions/conversion" + }, + + "language": { + "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", + "type": "string", + "default": "en-US", + "pattern": "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" + }, + + "versionControlProvenance": { + "description": "Specifies the revision in version control of the artifacts that were scanned.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/versionControlDetails" + } + }, + + "originalUriBaseIds": { + "description": "The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/artifactLocation" + } + }, + + "artifacts": { + "description": "An array of artifact objects relevant to the run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifact" + } + }, + + "logicalLocations": { + "description": "An array of logical locations such as namespaces, types or functions.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + + "graphs": { + "description": "An array of zero or more unique graph objects associated with the run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graph" + } + }, + + "results": { + "description": "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/result" + } + }, + + "automationDetails": { + "description": "Automation details that describe this run.", + "$ref": "#/definitions/runAutomationDetails" + }, + + "runAggregates": { + "description": "Automation details that describe the aggregate of runs to which this run belongs.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/runAutomationDetails" + } + }, + + "baselineGuid": { + "description": "The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "redactionTokens": { + "description": "An array of strings used to replace sensitive information in a redaction-aware property.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + }, + + "defaultEncoding": { + "description": "Specifies the default encoding for any artifact object that refers to a text file.", + "type": "string" + }, + + "defaultSourceLanguage": { + "description": "Specifies the default source language for any artifact object that refers to a text file that contains source code.", + "type": "string" + }, + + "newlineSequences": { + "description": "An ordered list of character sequences that were treated as line breaks when computing region information for the run.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "default": [ "\r\n", "\n" ], + "items": { + "type": "string" + } + }, + + "columnKind": { + "description": "Specifies the unit in which the tool measures columns.", + "enum": [ "utf16CodeUnits", "unicodeCodePoints" ], + "type": "string" + }, + + "externalPropertyFileReferences": { + "description": "References to external property files that should be inlined with the content of a root log file.", + "$ref": "#/definitions/externalPropertyFileReferences" + }, + + "threadFlowLocations": { + "description": "An array of threadFlowLocation objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + + "taxonomies": { + "description": "An array of toolComponent objects relevant to a taxonomy in which results are categorized.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "addresses": { + "description": "Addresses associated with this run instance, if any.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/address" + } + }, + + "translations": { + "description": "The set of available translations of the localized data provided by the tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "policies": { + "description": "Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "webRequests": { + "description": "An array of request objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webRequest" + } + }, + + "webResponses": { + "description": "An array of response objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webResponse" + } + }, + + "specialLocations": { + "description": "A specialLocations object that defines locations of special significance to SARIF consumers.", + "$ref": "#/definitions/specialLocations" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the run.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "tool" ] + }, + + "runAutomationDetails": { + "description": "Information that describes a run's identity and role within an engineering system process.", + "additionalProperties": false, + "type": "object", + "properties": { + + "description": { + "description": "A description of the identity and role played within the engineering system by this object's containing run object.", + "$ref": "#/definitions/message" + }, + + "id": { + "description": "A hierarchical string that uniquely identifies this object's containing run object.", + "type": "string" + }, + + "guid": { + "description": "A stable, unique identifier for this object's containing run object in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "correlationGuid": { + "description": "A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the run automation details.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "specialLocations": { + "description": "Defines locations of special significance to SARIF consumers.", + "type": "object", + "additionalProperties": false, + "properties": { + + "displayBase": { + "description": "Provides a suggestion to SARIF consumers to display file paths relative to the specified location.", + "$ref": "#/definitions/artifactLocation" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the special locations.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "stack": { + "description": "A call stack that is relevant to a result.", + "additionalProperties": false, + "type": "object", + "properties": { + + "message": { + "description": "A message relevant to this call stack.", + "$ref": "#/definitions/message" + }, + + "frames": { + "description": "An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/stackFrame" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the stack.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "frames" ] + }, + + "stackFrame": { + "description": "A function call within a stack trace.", + "additionalProperties": false, + "type": "object", + "properties": { + + "location": { + "description": "The location to which this stack frame refers.", + "$ref": "#/definitions/location" + }, + + "module": { + "description": "The name of the module that contains the code of this stack frame.", + "type": "string" + }, + + "threadId": { + "description": "The thread identifier of the stack frame.", + "type": "integer" + }, + + "parameters": { + "description": "The parameters of the call that is executing.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "type": "string", + "default": [] + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the stack frame.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "suppression": { + "description": "A suppression that is relevant to a result.", + "additionalProperties": false, + "type": "object", + "properties": { + + "guid": { + "description": "A stable, unique identifier for the suprression in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "kind": { + "description": "A string that indicates where the suppression is persisted.", + "enum": [ + "inSource", + "external" + ], + "type": "string" + }, + + "status": { + "description": "A string that indicates the review status of the suppression.", + "enum": [ + "accepted", + "underReview", + "rejected" + ], + "type": "string" + }, + + "justification": { + "description": "A string representing the justification for the suppression.", + "type": "string" + }, + + "location": { + "description": "Identifies the location associated with the suppression.", + "$ref": "#/definitions/location" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the suppression.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "kind" ] + }, + + "threadFlow": { + "description": "Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.", + "type": "object", + "additionalProperties": false, + "properties": { + + "id": { + "description": "An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.", + "type": "string" + }, + + "message": { + "description": "A message relevant to the thread flow.", + "$ref": "#/definitions/message" + }, + + + "initialState": { + "description": "Values of relevant expressions at the start of the thread flow that may change during thread flow execution.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "immutableState": { + "description": "Values of relevant expressions at the start of the thread flow that remain constant.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "locations": { + "description": "A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.", + "type": "array", + "minItems": 1, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the thread flow.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "locations" ] + }, + + "threadFlowLocation": { + "description": "A location visited by an analysis tool while simulating or monitoring the execution of a program.", + "additionalProperties": false, + "type": "object", + "properties": { + + "index": { + "description": "The index within the run threadFlowLocations array.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "location": { + "description": "The code location.", + "$ref": "#/definitions/location" + }, + + "stack": { + "description": "The call stack leading to this location.", + "$ref": "#/definitions/stack" + }, + + "kinds": { + "description": "A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + }, + + "taxa": { + "description": "An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorReference" + } + }, + + "module": { + "description": "The name of the module that contains the code that is executing.", + "type": "string" + }, + + "state": { + "description": "A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "nestingLevel": { + "description": "An integer representing a containment hierarchy within the thread flow.", + "type": "integer", + "minimum": 0 + }, + + "executionOrder": { + "description": "An integer representing the temporal order in which execution reached this location.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "executionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which this location was executed.", + "type": "string", + "format": "date-time" + }, + + "importance": { + "description": "Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \"essential\", \"important\", \"unimportant\". Default: \"important\".", + "enum": [ "important", "essential", "unimportant" ], + "default": "important", + "type": "string" + }, + + "webRequest": { + "description": "A web request associated with this thread flow location.", + "$ref": "#/definitions/webRequest" + }, + + "webResponse": { + "description": "A web response associated with this thread flow location.", + "$ref": "#/definitions/webResponse" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the threadflow location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "tool": { + "description": "The analysis tool that was run.", + "additionalProperties": false, + "type": "object", + "properties": { + + "driver": { + "description": "The analysis tool that was run.", + "$ref": "#/definitions/toolComponent" + }, + + "extensions": { + "description": "Tool extensions that contributed to or reconfigured the analysis tool that was run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the tool.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "driver" ] + }, + + "toolComponent": { + "description": "A component, such as a plug-in or the driver, of the analysis tool that was run.", + "additionalProperties": false, + "type": "object", + "properties": { + + "guid": { + "description": "A unique identifier for the tool component in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "name": { + "description": "The name of the tool component.", + "type": "string" + }, + + "organization": { + "description": "The organization or company that produced the tool component.", + "type": "string" + }, + + "product": { + "description": "A product suite to which the tool component belongs.", + "type": "string" + }, + + "productSuite": { + "description": "A localizable string containing the name of the suite of products to which the tool component belongs.", + "type": "string" + }, + + "shortDescription": { + "description": "A brief description of the tool component.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "fullDescription": { + "description": "A comprehensive description of the tool component.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "fullName": { + "description": "The name of the tool component along with its version and any other useful identifying information, such as its locale.", + "type": "string" + }, + + "version": { + "description": "The tool component version, in whatever format the component natively provides.", + "type": "string" + }, + + "semanticVersion": { + "description": "The tool component version in the format specified by Semantic Versioning 2.0.", + "type": "string" + }, + + "dottedQuadFileVersion": { + "description": "The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).", + "type": "string", + "pattern": "[0-9]+(\\.[0-9]+){3}" + }, + + "releaseDateUtc": { + "description": "A string specifying the UTC date (and optionally, the time) of the component's release.", + "type": "string" + }, + + "downloadUri": { + "description": "The absolute URI from which the tool component can be downloaded.", + "type": "string", + "format": "uri" + }, + + "informationUri": { + "description": "The absolute URI at which information about this version of the tool component can be found.", + "type": "string", + "format": "uri" + }, + + "globalMessageStrings": { + "description": "A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "notifications": { + "description": "An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/reportingDescriptor" + } + }, + + "rules": { + "description": "An array of reportingDescriptor objects relevant to the analysis performed by the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/reportingDescriptor" + } + }, + + "taxa": { + "description": "An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/reportingDescriptor" + } + }, + + "locations": { + "description": "An array of the artifactLocation objects associated with the tool component.", + "type": "array", + "minItems": 0, + "default": [], + "items": { + "$ref": "#/definitions/artifactLocation" + } + }, + + "language": { + "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", + "type": "string", + "default": "en-US", + "pattern": "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" + }, + + "contents": { + "description": "The kinds of data contained in this object.", + "type": "array", + "uniqueItems": true, + "default": [ "localizedData", "nonLocalizedData" ], + "items": { + "enum": [ + "localizedData", + "nonLocalizedData" + ], + "type": "string" + } + }, + + "isComprehensive": { + "description": "Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.", + "type": "boolean", + "default": false + }, + + "localizedDataSemanticVersion": { + "description": "The semantic version of the localized strings defined in this component; maintained by components that provide translations.", + "type": "string" + }, + + "minimumRequiredLocalizedDataSemanticVersion": { + "description": "The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.", + "type": "string" + }, + + "associatedComponent": { + "description": "The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.", + "$ref": "#/definitions/toolComponentReference" + }, + + "translationMetadata": { + "description": "Translation metadata, required for a translation, not populated by other component types.", + "$ref": "#/definitions/translationMetadata" + }, + + "supportedTaxonomies": { + "description": "An array of toolComponentReference objects to declare the taxonomies supported by the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponentReference" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the tool component.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "name" ] + }, + + "toolComponentReference": { + "description": "Identifies a particular toolComponent object, either the driver or an extension.", + "type": "object", + "additionalProperties": false, + "properties": { + + "name": { + "description": "The 'name' property of the referenced toolComponent.", + "type": "string" + }, + + "index": { + "description": "An index into the referenced toolComponent in tool.extensions.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "guid": { + "description": "The 'guid' property of the referenced toolComponent.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the toolComponentReference.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "translationMetadata": { + "description": "Provides additional metadata related to translation.", + "type": "object", + "additionalProperties": false, + "properties": { + + "name": { + "description": "The name associated with the translation metadata.", + "type": "string" + }, + + "fullName": { + "description": "The full name associated with the translation metadata.", + "type": "string" + }, + + "shortDescription": { + "description": "A brief description of the translation metadata.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "fullDescription": { + "description": "A comprehensive description of the translation metadata.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "downloadUri": { + "description": "The absolute URI from which the translation metadata can be downloaded.", + "type": "string", + "format": "uri" + }, + + "informationUri": { + "description": "The absolute URI from which information related to the translation metadata can be downloaded.", + "type": "string", + "format": "uri" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the translation metadata.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "name" ] + }, + + "versionControlDetails": { + "description": "Specifies the information necessary to retrieve a desired revision from a version control system.", + "type": "object", + "additionalProperties": false, + "properties": { + + "repositoryUri": { + "description": "The absolute URI of the repository.", + "type": "string", + "format": "uri" + }, + + "revisionId": { + "description": "A string that uniquely and permanently identifies the revision within the repository.", + "type": "string" + }, + + "branch": { + "description": "The name of a branch containing the revision.", + "type": "string" + }, + + "revisionTag": { + "description": "A tag that has been applied to the revision.", + "type": "string" + }, + + "asOfTimeUtc": { + "description": "A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.", + "type": "string", + "format": "date-time" + }, + + "mappedTo": { + "description": "The location in the local file system to which the root of the repository was mapped at the time of the analysis.", + "$ref": "#/definitions/artifactLocation" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the version control details.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "repositoryUri" ] + }, + + "webRequest": { + "description": "Describes an HTTP request.", + "type": "object", + "additionalProperties": false, + "properties": { + + "index": { + "description": "The index within the run.webRequests array of the request object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + + }, + + "protocol": { + "description": "The request protocol. Example: 'http'.", + "type": "string" + }, + + "version": { + "description": "The request version. Example: '1.1'.", + "type": "string" + }, + + "target": { + "description": "The target of the request.", + "type": "string" + }, + + "method": { + "description": "The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.", + "type": "string" + }, + + "headers": { + "description": "The request headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "parameters": { + "description": "The request parameters.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "body": { + "description": "The body of the request.", + "$ref": "#/definitions/artifactContent" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the request.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "webResponse": { + "description": "Describes the response to an HTTP request.", + "type": "object", + "additionalProperties": false, + "properties": { + + "index": { + "description": "The index within the run.webResponses array of the response object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "protocol": { + "description": "The response protocol. Example: 'http'.", + "type": "string" + }, + + "version": { + "description": "The response version. Example: '1.1'.", + "type": "string" + }, + + "statusCode": { + "description": "The response status code. Example: 451.", + "type": "integer" + }, + + "reasonPhrase": { + "description": "The response reason. Example: 'Not found'.", + "type": "string" + }, + + "headers": { + "description": "The response headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "body": { + "description": "The body of the response.", + "$ref": "#/definitions/artifactContent" + }, + + "noResponseReceived": { + "description": "Specifies whether a response was received from the server.", + "type": "boolean", + "default": false + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the response.", + "$ref": "#/definitions/propertyBag" + } + } + } + } +} \ No newline at end of file diff --git a/tools/lint/src/test/kotlin/LinterTest.kt b/tools/lint/src/test/kotlin/LinterTest.kt new file mode 100644 index 0000000000..cd0f8ae9b2 --- /dev/null +++ b/tools/lint/src/test/kotlin/LinterTest.kt @@ -0,0 +1,22 @@ +import io.github.jmltoolkit.lint.JmlLintingConfig +import io.github.jmltoolkit.lint.JmlLintingFacade +import io.github.jmltoolkit.utils.TestWithJavaParser +import org.junit.jupiter.api.Assumptions +import org.junit.jupiter.api.Test + +/** + * @author Alexander Weigl + * @version 1 (14.10.22) + */ +internal class LinterTest : TestWithJavaParser() { + @Test + fun everythingWrong() { + val result = parser.parse(javaClass.getResourceAsStream("EverythingWrong.java")) + Assumptions.assumeTrue(result.isSuccessful) + val actual = JmlLintingFacade(JmlLintingConfig()).lint(listOf(result.result.get())) + + for (lintProblem in actual) { + println(lintProblem) + } + } +} diff --git a/tools/lint/src/test/resources/EverythingWrong.java b/tools/lint/src/test/resources/EverythingWrong.java new file mode 100644 index 0000000000..19d082fe5b --- /dev/null +++ b/tools/lint/src/test/resources/EverythingWrong.java @@ -0,0 +1,30 @@ +public class EverythingWrong { + public void foo(int x) { + //@ghost int x = 0; + } + + /*@ ensures \result>0; */ + public void bar(int x) { + } + + /*@ requires \result>0; */ + public int bar(int x) { + return 0; + } + + /*@ requires x++; ensures x=2; */ + public int baf(int x) { + return 0; + } + + public void bar(int x) { + /*@ ensures true; requires true; */ + while (true) ; + } + + public final int x; + + /*@ assignable x; */ + public void bear() { + } +} \ No newline at end of file diff --git a/tools/lint/src/test/resources/Test.java b/tools/lint/src/test/resources/Test.java new file mode 100644 index 0000000000..0b8bc08599 --- /dev/null +++ b/tools/lint/src/test/resources/Test.java @@ -0,0 +1,2 @@ +public class Test { +} \ No newline at end of file diff --git a/tools/lsp/build.gradle.kts b/tools/lsp/build.gradle.kts new file mode 100644 index 0000000000..4720457ae2 --- /dev/null +++ b/tools/lsp/build.gradle.kts @@ -0,0 +1,43 @@ +plugins { + id("standard-kotlin") + kotlin("plugin.serialization") version libs.versions.kotlin.get() + id("com.gradleup.shadow") version "9.3.2" + id("application") +} + +version = "1.0-SNAPSHOT" + +dependencies { + api(project(":jmlparser-symbol-solver-core")) + + testImplementation(kotlin("test")) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.10.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0") + //implementation(kotlin("serialization")) + implementation(kotlin("serialization")) + runtimeOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0") + + implementation(project(":tools:utils")) + implementation(project(":tools:smt")) + implementation(project(":tools:wd")) + implementation(project(":tools:stat")) + implementation(project(":tools:redux")) + implementation(project(":tools:lint")) + implementation(project(":tools:jml2java")) + + implementation("org.tinylog:tinylog-api-kotlin:2.7.0") + implementation("org.tinylog:tinylog-api:2.8.0-M1") + implementation("org.tinylog:tinylog-impl:2.7.0") + + implementation("org.eclipse.lsp4j:org.eclipse.lsp4j:1.0.0") + + implementation(libs.clickt) + + implementation("org.key-project:key.core:2.12.3") + implementation("org.key-project:key.ui:2.12.3") +} + +application { + mainClass = "io.github.jmltoolkit.lsp.Main" +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/CodeActionCollector.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/CodeActionCollector.kt new file mode 100644 index 0000000000..796865fae5 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/CodeActionCollector.kt @@ -0,0 +1,64 @@ +package io.github.jmltoolkit.lsp + +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.expr.Expression +import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration +import com.github.javaparser.ast.jml.clauses.JmlSignalsClause +import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause +import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr +import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr.JmlDefaultBinder +import com.github.javaparser.ast.jml.stmt.JmlExpressionStmt +import org.eclipse.lsp4j.CodeAction +import org.eclipse.lsp4j.CodeActionContext +import org.eclipse.lsp4j.Command +import org.eclipse.lsp4j.jsonrpc.messages.Either +import kotlin.jvm.optionals.getOrNull + +/** + * This visitor gathers actions, that can be executed on nodes within the given range. + */ +class CodeActionCollector(val context: CodeActionContext?, private val range: com.github.javaparser.Range) : + ResultingVisitor>>() { + override val result = arrayListOf>() + fun add(x: Command) = result.add(Either.forLeft(x)) + fun add(x: CodeAction) = result.add(Either.forRight(x)) + + override fun visit(n: JmlExpressionStmt, arg: Unit?) { + if (n.kind != JmlExpressionStmt.JmlStmtKind.SET && n.kind != JmlExpressionStmt.JmlStmtKind.HENCE_BY) { + addWelldefinedCheck(n.expression) + } + super.visit(n, arg) + } + + override fun visit(n: JmlSimpleExprClause, arg: Unit?) { + addWelldefinedCheck(n.expression) + } + + override fun visit(n: JmlSignalsClause, arg: Unit?) { + addWelldefinedCheck(n.expression) + super.visit(n, arg) + } + + override fun visit(n: JmlClassExprDeclaration, arg: Unit?) { + addWelldefinedCheck(n.invariant) + super.visit(n, arg) + } + + private fun addWelldefinedCheck(n: Expression): Boolean { + /*if (inRange(n)) { + return add(WellDefinednessCheck.createCodeAction(n)) + }*/ + return false + } + + private fun inRange(n: Node): Boolean { + return n.range.getOrNull()?.contains(range) ?: false + } + + override fun visit(n: JmlQuantifiedExpr, arg: Unit?) { + if (n.binder == JmlDefaultBinder.FORALL || n.binder == JmlDefaultBinder.EXISTS) { + val ca = CodeAction("Add boundary") + add(ca) + } + } +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/CodeLensCollector.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/CodeLensCollector.kt new file mode 100644 index 0000000000..9db39b59e4 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/CodeLensCollector.kt @@ -0,0 +1,20 @@ +package io.github.jmltoolkit.lsp + +import com.github.javaparser.ast.jml.clauses.ContractType +import com.github.javaparser.ast.jml.clauses.JmlContract +import io.github.jmltoolkit.lsp.actions.VerifyAgainstParent +import org.eclipse.lsp4j.CodeLens +import org.eclipse.lsp4j.Command + +/** + * Runs through the AST and collect code lens actions. + */ +class CodeLensCollector : ResultingVisitor>() { + override val result = arrayListOf() + + override fun visit(n: JmlContract, arg: Unit?) { + if (n.type == ContractType.METHOD) { + //result.add(VerifyAgainstParent.createCodeLens(n)) + } + } +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlLanguageServer.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlLanguageServer.kt new file mode 100644 index 0000000000..dc03fc8863 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlLanguageServer.kt @@ -0,0 +1,90 @@ +package io.github.jmltoolkit.lsp + +import io.github.jmltoolkit.lsp.actions.LspAction +import io.github.jmltoolkit.lsp.highlighting.LEGEND +import org.eclipse.lsp4j.* +import org.eclipse.lsp4j.jsonrpc.messages.Either +import org.eclipse.lsp4j.services.* +import java.util.* +import java.util.concurrent.CompletableFuture +import java.util.concurrent.ExecutorService +import java.util.concurrent.ForkJoinPool +import kotlin.system.exitProcess + + +class JmlLanguageServer : LanguageServer, LanguageClientAware { + internal val executorService: ExecutorService = ForkJoinPool.commonPool() + internal val jmlTextDocumentService by lazy { JmlTextDocumentService(this) } + internal val jmlWorkspaceService by lazy { JmlWorkspaceService(this) } + + internal lateinit var client: LanguageClient + internal var capabilities: ClientCapabilities? = null + internal lateinit var workspaceFolders: List + internal val jmlNotebookDocumentServices by lazy { JmlNotebookDocumentServices() } + + internal val config = ProjectDefinitionService() + + internal val actions by lazy { + ServiceLoader.load(LspAction::class.java).toList() + } + + override fun initialize(params: InitializeParams): CompletableFuture { + workspaceFolders = params.workspaceFolders + capabilities = params.capabilities + + config.update(workspaceFolders.map { Uri(it.uri) }) + + return CompletableFuture.supplyAsync { + val capabilities = ServerCapabilities() + capabilities.setTextDocumentSync(TextDocumentSyncKind.Full) + capabilities.diagnosticProvider = DiagnosticRegistrationOptions(true, false) + capabilities.setDocumentSymbolProvider(true) + capabilities.setWorkspaceSymbolProvider(true) + + capabilities.setDeclarationProvider(DeclarationRegistrationOptions("JML")) + + // capabilities.signatureHelpProvider = SignatureHelpOptions() + capabilities.setHoverProvider(true) + + // capabilities.codeLensProvider = CodeLensOptions(false) + capabilities.setSelectionRangeProvider(true) + + //capabilities.setDefinitionProvider(true) + //capabilities.setDocumentHighlightProvider(true) + //capabilities.completionProvider = CompletionOptions(true, null) + + capabilities.semanticTokensProvider = SemanticTokensWithRegistrationOptions( + LEGEND, SemanticTokensServerFull(false), false, + listOf( + DocumentFilter("java", "file", Either.forLeft("*.java")), + DocumentFilter("key", "file", Either.forLeft("*.key")), + ) + ) + + // capabilities.setCodeActionProvider(CodeActionOptions(listOf("validity"))) + // capabilities.executeCommandProvider = ExecuteCommandOptions(actions.map { it.id }) + + return@supplyAsync InitializeResult(capabilities) + } + } + + override fun shutdown(): CompletableFuture { + executorService.shutdownNow() + return CompletableFuture.completedFuture("finish") + } + + override fun exit() { + shutdown() + exitProcess(0) + } + + override fun getNotebookDocumentService(): NotebookDocumentService = jmlNotebookDocumentServices + + override fun getTextDocumentService(): TextDocumentService = jmlTextDocumentService + + override fun getWorkspaceService(): WorkspaceService = jmlWorkspaceService + + override fun connect(client: LanguageClient) { + this.client = client + } +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlNotebookDocumentServices.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlNotebookDocumentServices.kt new file mode 100644 index 0000000000..81dee33593 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlNotebookDocumentServices.kt @@ -0,0 +1,18 @@ +package io.github.jmltoolkit.lsp + +import org.eclipse.lsp4j.DidChangeNotebookDocumentParams +import org.eclipse.lsp4j.DidCloseNotebookDocumentParams +import org.eclipse.lsp4j.DidOpenNotebookDocumentParams +import org.eclipse.lsp4j.DidSaveNotebookDocumentParams +import org.eclipse.lsp4j.services.NotebookDocumentService + +class JmlNotebookDocumentServices : NotebookDocumentService { + override fun didOpen(params: DidOpenNotebookDocumentParams?) {} + + override fun didChange(params: DidChangeNotebookDocumentParams?) {} + + override fun didSave(params: DidSaveNotebookDocumentParams?) {} + + override fun didClose(params: DidCloseNotebookDocumentParams?) {} + +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlTextDocumentService.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlTextDocumentService.kt new file mode 100644 index 0000000000..15d66f7ca6 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlTextDocumentService.kt @@ -0,0 +1,542 @@ +package io.github.jmltoolkit.lsp + +import com.github.javaparser.JavaParser +import com.github.javaparser.ParseResult +import com.github.javaparser.ParserConfiguration +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.Jmlish +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.expr.NameExpr +import com.github.javaparser.resolution.TypeSolver +import com.github.javaparser.resolution.declarations.AssociableToAST +import com.github.javaparser.symbolsolver.JavaSymbolSolver +import com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver +import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver +import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver +import com.google.common.hash.Hashing.crc32 +import io.github.jmltoolkit.lint.JmlLintingConfig +import io.github.jmltoolkit.lint.JmlLintingFacade +import io.github.jmltoolkit.lsp.highlighting.JmlDocumentHighlighter +import io.github.jmltoolkit.lsp.highlighting.KeyDocumentHighlighter +import io.github.jmltoolkit.lsp.hover.JmlDocumentationIndex +import io.github.jmltoolkit.lsp.symbols.JmlCatchSymbols +import io.github.jmltoolkit.lsp.symbols.KeyCatchSymbols +import org.eclipse.lsp4j.* +import org.eclipse.lsp4j.jsonrpc.messages.Either +import org.eclipse.lsp4j.services.TextDocumentService +import org.tinylog.kotlin.Logger +import java.io.File +import java.nio.file.Path +import java.nio.file.Paths +import java.util.* +import java.util.concurrent.CompletableFuture +import kotlin.io.path.readText + + +private val Node?.parentalSelectionRange: SelectionRange? + get() = when { + this == null -> null + !this.parentNode.isPresent -> SelectionRange(asRange, null) + else -> SelectionRange(asRange, parentNode.get().parentalSelectionRange) + } + + +class AstRepository(val server: JmlLanguageServer) { + private val sourceFolders = Collections.synchronizedList(arrayListOf()) + + val config: ParserConfiguration = ParserConfiguration() + + val inParsing: MutableMap>> = + Collections.synchronizedMap(mutableMapOf>>()) + val cached: MutableMap> = + Collections.synchronizedMap(mutableMapOf>()) + val version: MutableMap = Collections.synchronizedMap(mutableMapOf()) + + val typeSolver: TypeSolver + get() { + synchronized(sourceFolders) { + val elements: MutableList = + sourceFolders.asSequence().map { JavaParserTypeSolver(it) }.toMutableList() + val classLoaderTypeSolver = ClassLoaderTypeSolver(ClassLoader.getSystemClassLoader()) + elements.add(0, classLoaderTypeSolver) + return CombinedTypeSolver(elements) + } + } + + val symbolSolver: JavaSymbolSolver + get() = JavaSymbolSolver(typeSolver) + + init { + config.setSymbolResolver(symbolSolver) + config.isProcessJml = true + } + + fun createJavaParser() = JavaParser(config) + + private fun isUpToDate(uri: Uri, content: String): Boolean { + if (uri !in cached) return false + return uri in version && crc32(content) == version[uri] + } + + fun crc32(content: String) = crc32().hashBytes(content.toByteArray()).asLong() + + private fun parseSync(path: Uri): ParseResult { + val jp = createJavaParser() + val content = path.path.readText() + if (isUpToDate(path, content)) { + return cached[path]!! + } + val result = jp.parse(content) + result.result.ifPresent { + it.setStorage(path.path, jp.parserConfiguration.characterEncoding) + addSourceFolder(it.storage.get().sourceRoot) + } + announceResult(path, result) + return result + } + + private fun parse(path: Uri): CompletableFuture> { + val future = CompletableFuture.supplyAsync { parseSync(path) } + synchronized(inParsing) { + inParsing[path] = future + } + return future + } + + private fun announceResult(path: Uri, result: ParseResult) { + synchronized(cached) { + synchronized(inParsing) { + inParsing.remove(path) + } + cached[path] = result + if (result.isSuccessful && result.result.isPresent) { + server.client.showMessage(MessageParams(MessageType.Log, "$path parsed")) + } else { + /* + val diagnostics = result.problems.map { + if (it.cause.isPresent) + Logger.error("Found exception in errors: {}", it.cause.get()) + val jml.lsp.actions.LspAction = Diagnostic(it.location.asRange, it.verboseMessage, DiagnosticSeverity.Error, "jmlparser") + jml.lsp.actions.LspAction + } + server.client.publishDiagnostics( + PublishDiagnosticsParams(path.value, diagnostics) + ) + */ + } + } + } + + private fun getSourcePath(cu: CompilationUnit): Path? = + cu.storage.map { it.sourceRoot }.orElse(null) + + + fun addSourceFolder(folder: Path) { + if (folder !in sourceFolders) { + sourceFolders.add(folder) + updateTypeSolver() + } + } + + fun updateTypeSolver() { + val copy = synchronized(cached) { cached.toMap() } + val solver = symbolSolver + for (value in copy.values) { + value.result.ifPresent { it.setData(Node.SYMBOL_RESOLVER_KEY, solver) } + } + } + + fun getDiagnostics(path: Uri): CompletableFuture> = + get(path).thenApply { result -> + if (result.isSuccessful) + JmlLintingFacade(JmlLintingConfig()).lint(listOf(result.result.get())).map { + Diagnostic(it.location.asRange, it.message, DiagnosticSeverity.Error, "jml-lint") + }.toMutableList() + else + result.problems.map { + Diagnostic(it.location.asRange, it.verboseMessage, DiagnosticSeverity.Error, "jmlparser") + }.toMutableList() + } + + fun get(path: Uri): CompletableFuture> { + synchronized(inParsing) { + inParsing[path]?.let { return it } + } + return parse(path) + } +} + +/** + * Represents URIs send from the client. These are different than Java URI class! + * Incoming URIs have full protocol specifiers: `file://`. + */ +@JvmInline +value class Uri(val value: String) { + val isKeyFile: Boolean + get() = file.extension == "key" + + val localFilePath: String + get() = value.removePrefix("file://") + val path: Path + get() = Paths.get(localFilePath) + val file: File + get() = File(localFilePath) +} + +class JmlTextDocumentService(private val server: JmlLanguageServer) : TextDocumentService { + val repo = AstRepository(server) + + val jmlDocumentHighlighter = JmlDocumentHighlighter() + val keyDocumentHighlighter = KeyDocumentHighlighter() + val highlighters = listOf(jmlDocumentHighlighter, keyDocumentHighlighter) + + override fun didOpen(params: DidOpenTextDocumentParams) { + Logger.info("didOpen: {}", params) + Logger.info(params.textDocument.languageId) + if (params.textDocument.languageId != "text/java") + return + } + + override fun didChange(params: DidChangeTextDocumentParams) { + Logger.info("didChange: {}", params) + } + + override fun didClose(params: DidCloseTextDocumentParams) { + Logger.info("didClose: {}", params) + } + + override fun didSave(params: DidSaveTextDocumentParams) { + Logger.info("didSave: {}", params) + } + + override fun completion(position: CompletionParams?): CompletableFuture, CompletionList>> { + return super.completion(position) + } + + override fun resolveCompletionItem(unresolved: CompletionItem?): CompletableFuture { + return super.resolveCompletionItem(unresolved) + } + + override fun hover(params: HoverParams): CompletableFuture { + return repo.get(Uri(params.textDocument.uri)) + .thenApplyAsync { + val symbol = findSymbol(params.position, it) + if (symbol == null) + findKeyword(params, it) + else + Hover( + MarkupContent( + "markdown", + "Hover message for name: ${symbol.nameAsString}" + ) + ) + } + } + + private fun findKeyword(params: HoverParams, cu: ParseResult): Hover? { + val node = findTopMostJmlishNode(params.position, cu) + if (node != null) { + val tokenRange = node.tokenRange.get() + val pos = params.position.asPosition + val javaToken = tokenRange.find { it.range.get().contains(pos) } + return javaToken?.text?.let { retrieveDocumentation(it) } + } + return null + } + + + private val jmlDocumentationIndex by lazy { JmlDocumentationIndex() } + + private fun retrieveDocumentation(tokenText: String): Hover? = + jmlDocumentationIndex.get(tokenText) + ?.let { text -> Hover(MarkupContent("markdown", text)) } + + override fun signatureHelp(params: SignatureHelpParams): CompletableFuture { + /*val path = Uri(params.textDocument.uri) + val pos = params.position + val active = + params.context.activeSignatureHelp.signatures[params.context.activeSignatureHelp.activeSignature] + */ + return CompletableFuture.supplyAsync { + SignatureHelp() + } + } + + override fun declaration(params: DeclarationParams) + : CompletableFuture, MutableList>> { + val uri = Uri(params.textDocument.uri) + return repo.get(uri) + .thenApplyAsync { findSymbol(params.position, it) } + .thenApplyAsync { resolveSymbolInDocument(it) } + } + + private fun resolveSymbolInDocument(nameExpr: NameExpr?) + : Either, MutableList> { + if (nameExpr != null) { + val r = nameExpr.resolve() + if (r is AssociableToAST && r.toAst().isPresent) { + val ast = r.toAst().get() + val targetUri = "file://${ast.findCompilationUnit().get().storage.get().path.toFile()}" + val targetRange = ast.asRange + val targetSelectionRange = targetRange + // TODO be more specific dependening targeted type + return Either.forRight(arrayListOf(LocationLink(targetUri, targetRange, targetSelectionRange))) + } + } + return Either.forLeft(arrayListOf()) + } + + private fun findSymbol(position: Position, it: ParseResult): NameExpr? { + if (!it.isSuccessful) return null + val p = position.toJavaParser() + val queue: Queue = LinkedList() + queue.add(it.result.get()) + while (queue.isNotEmpty()) { + val n = queue.poll() + if (n.range.get().contains(p) && n is NameExpr) + return n + queue.addAll(n.childNodes) + } + return null + } + + private fun findSymbolByRange(position: Position, it: ParseResult): NameExpr? { + if (!it.result.isPresent) return null + var current: Node = it.result.get() + val pos = position.toJavaParser() + + next@ while (current.range.get().contains(pos)) { + if (current is NameExpr) + return current + + for (child in current.childNodes) { + if (child.range.get().contains(pos)) { + current = child + continue@next + } + } + } + return null + } + + override fun definition(params: DefinitionParams?): CompletableFuture, MutableList>> { + return super.definition(params) + } + + override fun typeDefinition(params: TypeDefinitionParams?): CompletableFuture, MutableList>> { + return super.typeDefinition(params) + } + + override fun implementation(params: ImplementationParams?): CompletableFuture, MutableList>> { + return super.implementation(params) + } + + override fun references(params: ReferenceParams?): CompletableFuture> { + return super.references(params) + } + + override fun documentSymbol(params: DocumentSymbolParams): CompletableFuture>> { + Logger.info("params: {}", params) + val uri = Uri(params.textDocument.uri) + return if (uri.isKeyFile) + CompletableFuture.supplyAsync { KeyCatchSymbols(uri).run() } + else + repo.get(uri).thenApply { + Logger.info("Parse: {}", it) + if (!it.result.isPresent) mutableListOf() + else resolveSymbol(it.result.get()) + } + } + + private fun resolveSymbol(compilationUnit: CompilationUnit) + : MutableList> { + Logger.info("Resolve symbols for compiluation unit: {}", compilationUnit.storage.get().path) + val visitor = JmlCatchSymbols() + val a = compilationUnit.accept(visitor, null) ?: arrayListOf() + Logger.info("Symbols caught: {}", a.size) + val b = a.map { Either.forRight(it) } + return b.toMutableList() + } + + override fun codeAction(params: CodeActionParams): CompletableFuture>> { + Logger.info("codeAction: {}", params) + + return repo.get(Uri(params.textDocument.uri)) + .applyOn(CodeActionCollector(params.context, params.range.asRange), arrayListOf()) + } + + override fun resolveCodeAction(unresolved: CodeAction?): CompletableFuture { + return super.resolveCodeAction(unresolved) + } + + override fun codeLens(params: CodeLensParams): CompletableFuture> { + Logger.info("codeLens: {}", params) + return repo.get(Uri(params.textDocument.uri)).applyOn(CodeLensCollector(), arrayListOf()) + } + + override fun resolveCodeLens(unresolved: CodeLens): CompletableFuture { + Logger.info("codeLens: {}", unresolved) + return CompletableFuture.completedFuture(CodeLens()) + } + + override fun formatting(params: DocumentFormattingParams?): CompletableFuture> { + return super.formatting(params) + } + + override fun rangeFormatting(params: DocumentRangeFormattingParams?): CompletableFuture> { + return super.rangeFormatting(params) + } + + override fun onTypeFormatting(params: DocumentOnTypeFormattingParams?): CompletableFuture> { + return super.onTypeFormatting(params) + } + + override fun rename(params: RenameParams?): CompletableFuture { + return super.rename(params) + } + + override fun linkedEditingRange(params: LinkedEditingRangeParams?): CompletableFuture { + return super.linkedEditingRange(params) + } + + override fun willSave(params: WillSaveTextDocumentParams?) { + super.willSave(params) + } + + override fun willSaveWaitUntil(params: WillSaveTextDocumentParams?): CompletableFuture> { + return super.willSaveWaitUntil(params) + } + + override fun documentLink(params: DocumentLinkParams?): CompletableFuture> { + return super.documentLink(params) + } + + override fun documentLinkResolve(params: DocumentLink?): CompletableFuture { + return super.documentLinkResolve(params) + } + + override fun documentColor(params: DocumentColorParams?): CompletableFuture> { + return super.documentColor(params) + } + + override fun colorPresentation(params: ColorPresentationParams?): CompletableFuture> { + return super.colorPresentation(params) + } + + override fun foldingRange(params: FoldingRangeRequestParams?): CompletableFuture> { + return super.foldingRange(params) + } + + override fun prepareTypeHierarchy(params: TypeHierarchyPrepareParams?): CompletableFuture> { + return super.prepareTypeHierarchy(params) + } + + override fun typeHierarchySupertypes(params: TypeHierarchySupertypesParams?): CompletableFuture> { + return super.typeHierarchySupertypes(params) + } + + override fun typeHierarchySubtypes(params: TypeHierarchySubtypesParams?): CompletableFuture> { + return super.typeHierarchySubtypes(params) + } + + override fun prepareCallHierarchy(params: CallHierarchyPrepareParams?): CompletableFuture> { + return super.prepareCallHierarchy(params) + } + + override fun callHierarchyIncomingCalls(params: CallHierarchyIncomingCallsParams?): CompletableFuture> { + return super.callHierarchyIncomingCalls(params) + } + + override fun callHierarchyOutgoingCalls(params: CallHierarchyOutgoingCallsParams?): CompletableFuture> { + return super.callHierarchyOutgoingCalls(params) + } + + private fun findTopMostJmlishNode(position: Position, cu: ParseResult): Node? = + findNode(position, cu) { + it is Jmlish + } + + + private fun findNode( + position: Position, + it: ParseResult, + pred: (Node) -> Boolean = { it.childNodes.isEmpty() } + ): Node? { + if (!it.isSuccessful) return null + val p = position.toJavaParser() + val queue: Queue = LinkedList() + queue.add(it.result.get()) + while (queue.isNotEmpty()) { + val n = queue.poll() + if (n.range.get().contains(p) && pred(n)) + return n + queue.addAll(n.childNodes) + } + return null + } + + override fun selectionRange(params: SelectionRangeParams): CompletableFuture> = + repo.get(Uri(params.textDocument.uri)) + .thenApplyAsync { it -> + val nodes = params.positions.map { p -> findNode(p, it) } + nodes.mapNotNull { it.parentalSelectionRange } + .toMutableList() + } + + override fun semanticTokensFull(params: SemanticTokensParams): CompletableFuture = + CompletableFuture.supplyAsync { + val doc = Uri(params.textDocument.uri) + val text = doc.file.readText() + when (doc.file.extension) { + "java" -> jmlDocumentHighlighter.analyzeJmlToken(text) + "key" -> keyDocumentHighlighter.analyzeJmlToken(text) + else -> SemanticTokens() + } + } + + override fun semanticTokensFullDelta(params: SemanticTokensDeltaParams?): CompletableFuture> { + return super.semanticTokensFullDelta(params) + } + + override fun semanticTokensRange(params: SemanticTokensRangeParams?): CompletableFuture { + return super.semanticTokensRange(params) + } + + override fun moniker(params: MonikerParams?): CompletableFuture> { + return super.moniker(params) + } + + override fun inlayHint(params: InlayHintParams?): CompletableFuture> { + return super.inlayHint(params) + } + + override fun resolveInlayHint(unresolved: InlayHint?): CompletableFuture { + return super.resolveInlayHint(unresolved) + } + + override fun inlineValue(params: InlineValueParams?): CompletableFuture> { + return super.inlineValue(params) + } + + override fun diagnostic(params: DocumentDiagnosticParams): CompletableFuture { + Logger.info("diagnostic: {}", params) + val path = Uri(params.textDocument.uri) + return repo.getDiagnostics(path).thenApply { + Logger.info("Found errors: {}", it) + DocumentDiagnosticReport(RelatedFullDocumentDiagnosticReport(it)) + } + } +} + +private fun Position.toJavaParser() = com.github.javaparser.Position(line, character) + +private fun CompletableFuture>.applyOn(collector: ResultingVisitor, default: T) + : CompletableFuture = this.thenApplyAsync { + if (it.result.isPresent) { + it.result.get().accept(collector, null) + val r = collector.result + Logger.info("Result: {}", r) + r + } else + default +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlWorkspaceService.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlWorkspaceService.kt new file mode 100644 index 0000000000..c5a2260348 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/JmlWorkspaceService.kt @@ -0,0 +1,64 @@ +package io.github.jmltoolkit.lsp + +import org.eclipse.lsp4j.* +import org.eclipse.lsp4j.jsonrpc.messages.Either +import org.eclipse.lsp4j.services.WorkspaceService +import org.tinylog.kotlin.Logger +import java.util.concurrent.CompletableFuture + +class JmlWorkspaceService(val jmlLanguageServer: JmlLanguageServer) : WorkspaceService { + override fun didChangeConfiguration(params: DidChangeConfigurationParams) { + Logger.info("didChangeConfiguration {}", params) + } + + override fun didChangeWatchedFiles(params: DidChangeWatchedFilesParams) { + Logger.info("didChangeWatchedFiles {}", params) + } + + override fun executeCommand(params: ExecuteCommandParams): CompletableFuture { + Logger.info("executeCommand {}", params) + return jmlLanguageServer.actions.find { it.id == params.command } + ?.execute(jmlLanguageServer, params.arguments) + ?: CompletableFuture.completedFuture("") + } + + override fun symbol(params: WorkspaceSymbolParams?): CompletableFuture, MutableList>> { + return super.symbol(params) + } + + override fun resolveWorkspaceSymbol(workspaceSymbol: WorkspaceSymbol?): CompletableFuture { + return super.resolveWorkspaceSymbol(workspaceSymbol) + } + + override fun didChangeWorkspaceFolders(params: DidChangeWorkspaceFoldersParams?) { + super.didChangeWorkspaceFolders(params) + } + + override fun willCreateFiles(params: CreateFilesParams?): CompletableFuture { + return super.willCreateFiles(params) + } + + override fun didCreateFiles(params: CreateFilesParams?) { + super.didCreateFiles(params) + } + + override fun willRenameFiles(params: RenameFilesParams?): CompletableFuture { + return super.willRenameFiles(params) + } + + override fun didRenameFiles(params: RenameFilesParams?) { + super.didRenameFiles(params) + } + + override fun willDeleteFiles(params: DeleteFilesParams?): CompletableFuture { + return super.willDeleteFiles(params) + } + + override fun didDeleteFiles(params: DeleteFilesParams?) { + super.didDeleteFiles(params) + } + + override fun diagnostic(params: WorkspaceDiagnosticParams?): CompletableFuture { + return super.diagnostic(params) + } +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/ProjectDefinitionService.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/ProjectDefinitionService.kt new file mode 100644 index 0000000000..d841b9eb95 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/ProjectDefinitionService.kt @@ -0,0 +1,77 @@ +package io.github.jmltoolkit.lsp + +import io.github.jmltoolkit.lsp.project.Project +import io.github.jmltoolkit.lsp.project.ProjectDefinition +import java.nio.file.Path +import java.nio.file.StandardWatchEventKinds +import java.nio.file.WatchService + +class ProjectDefinitionService { + private var rootFolders: List = listOf() + private var configFiles: List = listOf() + + private var config: MutableMap = hashMapOf() + + private var backgroundThread: Thread? = null + + fun get(path: Path): ProjectDefinition? { + var cp: Path? = path + while (cp != null && cp != cp.root && cp !in configFiles) { + cp = cp.parent + } + + synchronized(config) { + return config[path] + } + } + + fun update(workspaceFolders: List) { + removeWatchers() + synchronized(config) { + rootFolders = workspaceFolders.map { it.path } + configFiles = rootFolders.map { Project.create(it) } + config = configFiles.associateWith { Project.read(it) }.toMutableMap() + } + newWatchers() + } + + private fun removeWatchers() { + backgroundThread?.interrupt() + } + + private fun newWatchers() { + val fs = rootFolders.firstOrNull()?.fileSystem + if (fs != null) { + val ws = fs.newWatchService() + configFiles.map { + it.parent.register(ws, StandardWatchEventKinds.ENTRY_MODIFY) + } + backgroundThread = Thread(Watcher(ws)).also { it.start() } + } + } + + private fun updateConfig(configPath: Path) { + synchronized(config) { + config[configPath] = Project.read(configPath) + } + } + + + inner class Watcher( + private var ws: WatchService + ) : Runnable { + override fun run() { + ws.use { + while (!Thread.interrupted()) { + ws.poll()?.let { key -> + for (pollEvent in key.pollEvents()) { + val configPath = pollEvent.context() as Path + updateConfig(configPath) + } + key.reset() + } + } + } + } + } +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/ResultingVisitor.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/ResultingVisitor.kt new file mode 100644 index 0000000000..16dcfd48d1 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/ResultingVisitor.kt @@ -0,0 +1,12 @@ +package io.github.jmltoolkit.lsp + +import com.github.javaparser.ast.visitor.VoidVisitorAdapter + +/** + * Defines a visitor which produces a result of type `T`. + * @author Alexander Weigl + * @version 1 (20.07.22) + */ +abstract class ResultingVisitor : VoidVisitorAdapter() { + abstract val result: T +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/SmtRunner.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/SmtRunner.kt new file mode 100644 index 0000000000..f1c393ef66 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/SmtRunner.kt @@ -0,0 +1,47 @@ +package io.github.jmltoolkit.lsp + +import java.io.File +import java.util.concurrent.CompletableFuture + +/** + * + * @author Alexander Weigl + * @version 1 (12.10.22) + */ +data class SmtResult(val out: String, val err: String, val exitCode: Int) +class SmtRunner(val z3Path: String) { + constructor() : this(findZ3()) + + fun retrieveVersion(): CompletableFuture = + CompletableFuture.supplyAsync { + // z3 --version + run("--version") + } + + private fun run(vararg args: String): SmtResult { + val seq = args.toMutableList() + seq.add(0, z3Path) + val process = ProcessBuilder(seq) + .start() + process.waitFor() + return SmtResult( + process.inputReader().readText(), + process.errorReader().readText(), + process.exitValue() + ) + } + + fun executeSmt(smt: File): CompletableFuture = + CompletableFuture.supplyAsync { + run("--smt2", smt.absolutePath) + } + + fun executeSmt(smt: String): CompletableFuture = + CompletableFuture.supplyAsync { + val f = File.createTempFile("jml-lsp", ".smt2") + f.writeText(smt) + f + }.thenApply { executeSmt(it).get() } +} + +private fun findZ3() = "z3" diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/LspAction.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/LspAction.kt new file mode 100644 index 0000000000..e9a55b8d55 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/LspAction.kt @@ -0,0 +1,23 @@ +package io.github.jmltoolkit.lsp.actions + +import com.github.javaparser.ast.Node +import io.github.jmltoolkit.lsp.JmlLanguageServer +import org.eclipse.lsp4j.CodeLens +import org.eclipse.lsp4j.Command +import java.util.concurrent.CompletableFuture + +/** + * This class encapsulates both the execution of an action on the ast, and the metadata. + * @author Alexander Weigl + * @version 1 (16.10.22) + */ +interface LspAction { + val id: String + val title: String + + fun command(args: List? = null): Command = Command(title, id, args) + + fun execute(server: JmlLanguageServer, value: List): CompletableFuture + + fun createCodeLens(node: T): CodeLens +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/VerifyAgainstParent.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/VerifyAgainstParent.kt new file mode 100644 index 0000000000..1b261743ba --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/VerifyAgainstParent.kt @@ -0,0 +1,31 @@ +package io.github.jmltoolkit.lsp.actions + +import com.github.javaparser.ast.jml.clauses.JmlContract +import com.google.common.cache.CacheBuilder +import io.github.jmltoolkit.lsp.JmlLanguageServer +import io.github.jmltoolkit.lsp.asRange +import org.eclipse.lsp4j.CodeLens +import org.eclipse.lsp4j.MessageParams +import org.eclipse.lsp4j.MessageType +import java.util.concurrent.CompletableFuture + +object VerifyAgainstParent : LspAction { + override val id: String = "jml.verify.liskov" + override val title: String = "Verify against parent" + + private val cache = CacheBuilder.newBuilder().softValues().build() + + override fun execute(server: JmlLanguageServer, value: List): CompletableFuture { + cache.getIfPresent(value.first())?.let { + server.client.showMessage( + MessageParams(MessageType.Warning, "Prove is not implemented yet.") + ) + } + return CompletableFuture.completedFuture("") + } + + override fun createCodeLens(node: JmlContract): CodeLens { + cache.put(node.hashCode(), node) + return CodeLens(node.asRange, command(listOf(node.hashCode())), null) + } +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/WellDefinednessCheck.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/WellDefinednessCheck.kt new file mode 100644 index 0000000000..1b47ba1ed2 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/actions/WellDefinednessCheck.kt @@ -0,0 +1,30 @@ +package io.github.jmltoolkit.lsp.actions + +import com.github.javaparser.ast.expr.Expression +import io.github.jmltoolkit.lsp.JmlLanguageServer +import io.github.jmltoolkit.lsp.asRange +import org.eclipse.lsp4j.* +import java.util.concurrent.CompletableFuture + +object WellDefinednessCheck : LspAction { + override val id: String + get() = "jml.welldefinedness-check" + override val title: String + get() = "Check expression for well-definedness" + + override fun execute(server: JmlLanguageServer, value: List): CompletableFuture { + println("WellDefinednessCheck.execute server = [${server}], value = [${value}]") + return CompletableFuture.completedFuture(null) + } + + fun createCommand(node: Expression): Command = command(listOf(node.hashCode())) + + override fun createCodeLens(node: Expression): CodeLens = TODO() // CodeLens(node.asRange, command(), null) + fun createCodeAction(n: Expression): CodeAction = + CodeAction(title).also { + it.command = command() + it.kind = CodeActionKind.QuickFix + } +} + +// val ca = Command("WD-check", "jml.welldefinedCheck", listOf(r)) \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/conversion.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/conversion.kt new file mode 100644 index 0000000000..a0d2693d92 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/conversion.kt @@ -0,0 +1,60 @@ +package io.github.jmltoolkit.lsp + +import com.github.javaparser.JavaToken +import com.github.javaparser.TokenRange +import com.github.javaparser.ast.Node +import org.eclipse.lsp4j.Position +import org.eclipse.lsp4j.Range +import java.util.* +import kotlin.jvm.optionals.getOrNull + + +val com.github.javaparser.Position.asPosition: Position + get() = Position(line - 1, column - 1) + +val Optional.asRange: Range + get() = + if (isPresent) { + val r = get().toRange().get() + r.asRange + } else { + Range(Position(-1, -1), Position(-1, 0)) + } + +fun Optional.asRange(): Range = + if (isPresent) { + this.get().asRange + } else { + Range() + } + +val com.github.javaparser.Range.asRange: Range + get() = Range(begin.asPosition, end.withColumn(end.column + 1).asPosition) + +val Node.asRange: Range + get() = range.asRange() + +val Range.asRange: com.github.javaparser.Range + get() = com.github.javaparser.Range(start.asPosition, end.asPosition) + +val Position?.toPosition: com.github.javaparser.Position? + get() = this?.asPosition +val Position.asPosition: com.github.javaparser.Position + get() = com.github.javaparser.Position(this.line + 1, this.character + 1) + + +private val JavaToken.asStartPosition: Position? + get() = this.range.getOrNull()?.asStartPosition + + +val com.github.javaparser.Range.asStartPosition: Position + get() = this.begin.asPosition + +val com.github.javaparser.Range.asEndPosition: Position + get() = this.end.asPosition + +val JavaToken.asEndPosition: Position? + get() = this.range.getOrNull()?.asEndPosition + +val TokenRange?.asRange: Range? + get() = this?.let { Range(begin.asStartPosition, end.asEndPosition) } diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/DocumentHighlighter.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/DocumentHighlighter.kt new file mode 100644 index 0000000000..f003dfcfcc --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/DocumentHighlighter.kt @@ -0,0 +1,76 @@ +package io.github.jmltoolkit.lsp.highlighting + +import com.github.javaparser.Token +import org.eclipse.lsp4j.* + +/** + * + * @author Alexander Weigl + * @version 1 (04.02.24) + */ + +interface DocumentHighlighter { + fun analyzeJmlToken(text: String): SemanticTokens +} + +enum class SupportedTokenTypes(val kind: String) { + COMMENT(SemanticTokenTypes.Comment), + VARIABLE(SemanticTokenTypes.Variable), + KEYWORD(SemanticTokenTypes.Keyword), + STRING(SemanticTokenTypes.String), + NUMBER(SemanticTokenTypes.Number), + MODIFIER(SemanticTokenTypes.Modifier), +} + +enum class SupportedTokenModifier(val kind: String) { + DECLARATION(SemanticTokenModifiers.Declaration), + DOCUMENTATION(SemanticTokenModifiers.Documentation), + DEPRECATED(SemanticTokenModifiers.Deprecated), + STATIC(SemanticTokenModifiers.Static), +} + +private val Token.asRange: Range + get() = Range(Position(beginLine, beginColumn), Position(endLine, endColumn)) + +val tokenTypes = SupportedTokenTypes.entries.map { it.kind } +val tokenModifiers = SupportedTokenModifier.entries.map { it.kind } +val LEGEND: SemanticTokensLegend = SemanticTokensLegend(tokenTypes, tokenModifiers) + + +/* + There are different ways how the position of a token can be expressed in a file. + Absolute positions or relative positions. The protocol for the token format relative uses + relative positions, because most tokens remain stable relative to each other when edits + are made in a file. This simplifies the computation of a delta if a server supports it. + So each token is represented using 5 integers. A specific token i in the file consists + of the following array indices: + + at index 5*i - deltaLine: token line number, relative to the previous token + at index 5*i+1 - deltaStart: token start character, relative to the previous token (relative to 0 or the previous + token’s start if they are on the same line) + at index 5*i+2 - length: the length of the token. + at index 5*i+3 - tokenType: will be looked up in SemanticTokensLegend.tokenTypes. We currently ask that tokenType < 65536. + at index 5*i+4 - tokenModifiers: each set bit will be looked up in SemanticTokensLegend.tokenModifiers + */ +data class SemanticTokensBuilder(val data: ArrayList = ArrayList(4096)) { + private var lastLineStart = 0 + private var lastColumnStart = 0 + fun add(tok: Token, tokenType: Int, modifiers: Int) { + add(tok.beginLine, tok.beginColumn, tok.image.length, tokenType, modifiers) + } + + fun add(beginLine: Int, beginColumn: Int, length: Int, tokenType: Int, modifiers: Int) { + data.ensureCapacity(data.size + 5) + if (beginLine != lastLineStart) + lastColumnStart = 0 + + data.add(beginLine - lastLineStart) + data.add(beginColumn - lastColumnStart) + data.add(length) + data.add(tokenType) + data.add(modifiers) + + lastLineStart = beginLine + lastColumnStart = beginColumn + } +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/JmlDocumentHighlighter.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/JmlDocumentHighlighter.kt new file mode 100644 index 0000000000..f9ab0b646d --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/JmlDocumentHighlighter.kt @@ -0,0 +1,63 @@ +package io.github.jmltoolkit.lsp.highlighting + +import com.github.javaparser.* +import com.github.javaparser.GeneratedJavaParserConstants.EOF +import com.github.javaparser.jml.JmlDocSanitizer +import org.eclipse.lsp4j.SemanticTokens + +/** + * + * @author Alexander Weigl + * @version 1 (13.01.24) + */ +class JmlDocumentHighlighter : DocumentHighlighter { + private fun analyzeJmlToken(result: SemanticTokensBuilder, tokens: MutableList) { + val sanitizer = JmlDocSanitizer(setOf()) + val text = sanitizer.asString(tokens, true) + val lexer = GeneratedJavaParserTokenManager( + SimpleCharStream(Providers.provider(text)), + GeneratedJavaParserConstants.JML_MULTI_CONTRACT + ) + + do { + val token = lexer.nextToken + val tokenType = tokenType(token) + if (tokenType != null) + result.add(token, tokenType, tokenModifier(token)) + } while (token.kind != EOF) + } + + private fun tokenType(token: Token): Int? { + val cat = TokenTypes.getCategory(token.kind) + return when (cat) { + JavaToken.Category.COMMENT -> SupportedTokenTypes.COMMENT.ordinal + JavaToken.Category.IDENTIFIER -> SupportedTokenTypes.VARIABLE.ordinal + JavaToken.Category.KEYWORD -> SupportedTokenTypes.KEYWORD.ordinal + JavaToken.Category.LITERAL -> SupportedTokenTypes.NUMBER.ordinal + else -> null + } + } + + private fun tokenModifier(token: Token): Int = when (token.kind) { + else -> 0 + } + + override fun analyzeJmlToken(text: String): SemanticTokens { + val provider = Providers.provider(text) + val lexer = GeneratedJavaParserTokenManager(SimpleCharStream(provider)) + val result = SemanticTokensBuilder() + var token = lexer.nextToken + val bag = mutableListOf() + while (token != null && token.kind != EOF) { + when (token.kind) { + GeneratedJavaParserConstants.JML_LINE_COMMENT, + GeneratedJavaParserConstants.JML_BLOCK_COMMENT -> { + bag.add(token) + } + } + token = lexer.nextToken + } + analyzeJmlToken(result, bag) + return SemanticTokens(result.data) + } +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/KeyDocumentHighlighter.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/KeyDocumentHighlighter.kt new file mode 100644 index 0000000000..e8fa8b050a --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/highlighting/KeyDocumentHighlighter.kt @@ -0,0 +1,88 @@ +package io.github.jmltoolkit.lsp.highlighting + +import de.uka.ilkd.key.nparser.KeYLexer +import de.uka.ilkd.key.nparser.ParsingFacade +import org.antlr.v4.runtime.CharStreams +import org.antlr.v4.runtime.Token +import org.eclipse.lsp4j.SemanticTokens + +class KeyDocumentHighlighter : DocumentHighlighter { + override fun analyzeJmlToken(text: String): SemanticTokens { + val lexer = ParsingFacade.createLexer(CharStreams.fromString(text)) + val tb = SemanticTokensBuilder() + do { + val token = lexer.nextToken() + if (token.type == KeYLexer.EOF) { + break + } + tokenType(token)?.let { tt -> + tb.add(token.line, token.charPositionInLine, token.text.length, tt, tokenModifier(token)) + } + } while (token.type == KeYLexer.EOF) + return SemanticTokens(tb.data) + } + + private fun tokenType(token: Token): Int? { + return when (token.type) { + KeYLexer.COMMENT -> SupportedTokenTypes.COMMENT.ordinal + KeYLexer.VARIABLE -> SupportedTokenTypes.VARIABLE.ordinal + KeYLexer.VARCOND, + KeYLexer.IF, + KeYLexer.IFEX, + KeYLexer.RULES, + KeYLexer.AXIOMS, + KeYLexer.ABSTRACT, + KeYLexer.ASSIGN, + KeYLexer.ASSUMES, + KeYLexer.ADD, + KeYLexer.FIND, + KeYLexer.FINAL, + KeYLexer.ANTECEDENTPOLARITY, + KeYLexer.SUCCEDENTPOLARITY, + KeYLexer.UPDATE, + KeYLexer.UNIQUE, + KeYLexer.FUNCTIONS, + KeYLexer.PREDICATES, + KeYLexer.SORTS, + KeYLexer.HASSORT, + KeYLexer.HAS_INVARIANT, + KeYLexer.AT, + KeYLexer.THEN, + KeYLexer.TERM, + KeYLexer.DIFFERENT, + KeYLexer.CONTRACTS, + KeYLexer.CONTAINERTYPE, + KeYLexer.ENUM_CONST, + KeYLexer.IS_LABELED, + KeYLexer.IS_ABSTRACT_OR_INTERFACE, + KeYLexer.ISCONSTANT, + KeYLexer.ONEOF, + KeYLexer.OPTIONSDECL, + KeYLexer.WITHOPTIONS, + KeYLexer.MODALITYB, + KeYLexer.MORE, + KeYLexer.MODALITY, + KeYLexer.MODIFIABLE, + KeYLexer.APPLY_UPDATE_ON_RIGID, + KeYLexer.ADDRULES, + -> SupportedTokenTypes.KEYWORD.ordinal + + KeYLexer.BIN_LITERAL, + KeYLexer.HEX_LITERAL, + KeYLexer.INT_LITERAL, + KeYLexer.CHAR_LITERAL, + KeYLexer.REAL_LITERAL, + KeYLexer.DOUBLE_LITERAL, + KeYLexer.FLOAT_LITERAL, + KeYLexer.STRING_LITERAL, + KeYLexer.QUOTED_STRING_LITERAL, + -> SupportedTokenTypes.NUMBER.ordinal + else -> null + } + } + + private fun tokenModifier(token: Token): Int = when (token.type) { + else -> 0 + } + +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/hover/JmlDocumentationIndex.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/hover/JmlDocumentationIndex.kt new file mode 100644 index 0000000000..d5602f0f6c --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/hover/JmlDocumentationIndex.kt @@ -0,0 +1,31 @@ +package io.github.jmltoolkit.lsp.hover + +class JmlDocumentationIndex { + private val index by lazy { + val map = mutableMapOf() + val lines = javaClass.getResourceAsStream("/doc.md") + ?.bufferedReader()?.readLines() + ?: error("Could not load /doc/index.properties") + + var keys = setOf() + val builder = StringBuilder() + for (line in lines) { + if (line.startsWith("%keywords")) { + keys = line.substringAfter(' ').splitToSequence(' ').toSet() + } else { + if (line.startsWith("-----")) { + val s = builder.toString().intern() + for (key in keys) { + map[key] = s + } + builder.clear() + } else { + builder.appendLine(line) + } + } + } + map + } + + fun get(entry: String) = index[entry] +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/linter/LinterHelper.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/linter/LinterHelper.kt new file mode 100644 index 0000000000..50b2c5e628 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/linter/LinterHelper.kt @@ -0,0 +1,42 @@ +package io.github.jmltoolkit.lsp.linter + +import com.github.javaparser.ast.Node +import io.github.jmltoolkit.lint.JmlLintingConfig +import io.github.jmltoolkit.lint.JmlLintingFacade +import io.github.jmltoolkit.lint.LintProblem +import io.github.jmltoolkit.lint.LintProblemReporter + +/** + * + * @author Alexander Weigl + * @version 1 (21.10.22) + */ +object LinterHelper { + private val config = JmlLintingConfig() + private val linters = JmlLintingFacade(config).linters + + private val loadedFolders = mutableSetOf() + + /*private fun enableFolder(folder: String) { + if (folder !in loadedFolders) { + loadedFolders.add(folder) + val loader = GroovyClassLoader(javaClass.classLoader) + File(folder).walkTopDown().forEach { + val clazz = loader.parseClass(it) + if (clazz.isInstance(LintRule::class.java)) { + val instance = clazz.newInstance() + linters.add(instance as LintRule?) + } + } + } + }*/ + + fun lint(n: List): List { + val result = arrayListOf() + val reporter = LintProblemReporter(result::add) + for (rule in linters) { + n.forEach { rule.accept(it, reporter, config) } + } + return result + } +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/main.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/main.kt new file mode 100644 index 0000000000..8dd1bd6ade --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/main.kt @@ -0,0 +1,74 @@ +package io.github.jmltoolkit.lsp + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.main +import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.option +import com.github.ajalt.clikt.parameters.types.int +import org.eclipse.lsp4j.launch.LSPLauncher +import org.eclipse.lsp4j.services.LanguageClient +import org.tinylog.Logger +import java.io.InputStream +import java.io.OutputStream +import java.net.InetAddress +import java.net.ServerSocket +import java.net.Socket + +/** + * @author Alexander Weigl + * @version 1 (10.07.22) + */ +object Main { + @JvmStatic + fun main(args: Array) { + JmlLspCommand().main(args) + } +} + +class JmlLspCommand : CliktCommand() { + private val mode by option("--mode", "-m").default("client") + private val port by option("--port", "-p").int() + + override fun run() { + try { + when (mode) { + "server" -> runAsServer() + "client" -> runAsClient() + "local" -> launchLanguageServer(System.`in`, System.out) + else -> require(false) { "Wrong mode given" } + } + } catch (e: Exception) { + Logger.error(e) + } + } + + private fun runAsClient() { + require(port != null) + val socket = Socket("localhost", port!!) + launchLanguageServer(socket.getInputStream(), socket.getOutputStream()) + } + + private fun launchLanguageServer(input: InputStream, output: OutputStream) { + val server = JmlLanguageServer() + val launcher = LSPLauncher.createServerLauncher(server, input, output) + val client: LanguageClient = launcher.remoteProxy + server.connect(client) + launcher.startListening() + } + + private fun runAsServer() { + require(port != null) + while (true) { + try { + ServerSocket(port!!, 1, InetAddress.getLoopbackAddress()).use { serverSocket -> + Logger.info("Listening on {}", serverSocket.localSocketAddress) + val socket = serverSocket.accept() + launchLanguageServer(socket.getInputStream(), socket.getOutputStream()) + } + } catch (e: Exception) { + Logger.error(e) + } + } + } + +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/project/Project.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/project/Project.kt new file mode 100644 index 0000000000..f2a09f913e --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/project/Project.kt @@ -0,0 +1,55 @@ +package io.github.jmltoolkit.lsp.project + +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import java.nio.file.Files +import java.nio.file.Path +import kotlin.io.path.exists +import kotlin.io.path.readText +import kotlin.io.path.writeText + +/** + * + * @author Alexander Weigl + * @version 1 (04.02.24) + */ +object Project { + private const val FILENAME = "jmlproject.json" + + @OptIn(ExperimentalSerializationApi::class) + private val json = Json { + prettyPrint = true + this.isLenient = true + this.encodeDefaults = true + this.allowStructuredMapKeys = true + this.allowTrailingComma = true + this.coerceInputValues = true + this.ignoreUnknownKeys = true + } + + fun save(path: Path, pd: ProjectDefinition): Path { + val string = json.encodeToString(pd) + path.writeText(string) + return path + } + + fun read(path: Path): ProjectDefinition = + json.decodeFromString(path.readText()) + + fun create(path: Path): Path = + path.resolve(FILENAME).let { + if (!it.exists()) save(it, ProjectDefinition()) + it + } + + + tailrec fun find(path: Path): Path? { + val candidate = path.resolve(FILENAME) + return if (Files.exists(candidate)) { + candidate + } else { + find(path.parent) + } + } +} \ No newline at end of file diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/project/ProjectDefinition.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/project/ProjectDefinition.kt new file mode 100644 index 0000000000..f8630de1d1 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/project/ProjectDefinition.kt @@ -0,0 +1,25 @@ +package io.github.jmltoolkit.lsp.project + +import io.github.jmltoolkit.lsp.actions.VerifyAgainstParent +import io.github.jmltoolkit.lsp.actions.WellDefinednessCheck +import kotlinx.serialization.Serializable + +/** + * + * @author Alexander Weigl + * @version 1 (04.02.24) + */ +@Serializable +data class ProjectDefinition( + var enabledKeys: Set = setOf(), + var usedKeys: Set> = setOf(), + var sourcePaths: List = listOf(), + var disabledLinter: Set = setOf(), + var disabledCodeActions: Set = setOf( + VerifyAgainstParent.id, + WellDefinednessCheck.id, + ), +) + +@Serializable +data class SourcePath(var path: String, var dependsOn: List = listOf()) diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/symbols/JmlCatchSymbols.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/symbols/JmlCatchSymbols.kt new file mode 100644 index 0000000000..f541422498 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/symbols/JmlCatchSymbols.kt @@ -0,0 +1,224 @@ +package io.github.jmltoolkit.lsp.symbols + +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.body.* +import com.github.javaparser.ast.expr.VariableDeclarationExpr +import com.github.javaparser.ast.jml.body.* +import com.github.javaparser.ast.jml.clauses.* +import com.github.javaparser.ast.modules.ModuleDeclaration +import com.github.javaparser.ast.visitor.GenericVisitorAdapter +import io.github.jmltoolkit.lsp.asRange +import org.eclipse.lsp4j.DocumentSymbol +import org.eclipse.lsp4j.SymbolKind +import java.util.* + +/** + * Runs through an AST and gathers symbols within JML annotations. + * + * @author Alexander Weigl + */ +class JmlCatchSymbols : GenericVisitorAdapter?, Unit?>() { + override fun visit(n: CompilationUnit, arg: Unit?): MutableList { + val children = acceptAll(n.types) + return arrayListOf( + DocumentSymbol( + n.storage.get().fileName, + SymbolKind.File, + n.asRange, n.primaryType.map { it.name.asRange }.orElse(n.asRange), "", children + ) + ) + } + + override fun visit(n: AnnotationDeclaration, arg: Unit?): MutableList { + val children = acceptAll(n.members) + return arrayListOf( + DocumentSymbol( + n.nameAsString, + SymbolKind.Interface, + n.asRange, n.name.asRange, "", children + ) + ) + } + + override fun visit(n: AnnotationMemberDeclaration, arg: Unit?): MutableList { + return arrayListOf( + DocumentSymbol( + n.nameAsString, + SymbolKind.Field, + n.asRange, n.name.asRange, "" + ) + ) + } + + override fun visit(n: ClassOrInterfaceDeclaration, arg: Unit?): MutableList { + val children = acceptAll(n.members) + return arrayListOf( + DocumentSymbol( + n.nameAsString, + if (n.isInterface) SymbolKind.Interface else SymbolKind.Class, + n.asRange, n.name.asRange, "", children + ) + ) + } + + private fun acceptAll(members: NodeList<*>?): MutableList { + if (members == null) return arrayListOf() + return members.flatMap { it.accept(this, null) ?: arrayListOf() }.toMutableList() + } + + private fun acceptAllo(members: Optional>?): MutableList = + acceptAll(members?.orElse(null)) + + override fun visit(n: ConstructorDeclaration, arg: Unit?): MutableList { + val children = acceptAll(n.contracts) + return arrayListOf( + DocumentSymbol( + n.nameAsString, + SymbolKind.Constructor, + n.asRange, n.name.asRange, "", children + ) + ) + } + + + override fun visit(n: EnumConstantDeclaration, arg: Unit?): MutableList { + return arrayListOf( + DocumentSymbol( + n.nameAsString, + SymbolKind.EnumMember, + n.asRange, n.name.asRange, + ) + ) + } + + override fun visit(n: EnumDeclaration, arg: Unit?): MutableList { + val children = acceptAll(n.members) + return arrayListOf( + DocumentSymbol( + n.nameAsString, + SymbolKind.Enum, + n.asRange, n.name.asRange, "", children + ) + ) + } + + override fun visit(n: FieldDeclaration, arg: Unit?): MutableList { + return n.variables.map { + DocumentSymbol( + it.nameAsString, + SymbolKind.Field, + it.asRange, it.name.asRange, it.typeAsString, arrayListOf() + ) + }.toMutableList() + } + + override fun visit(n: MethodDeclaration, arg: Unit?): MutableList { + val children = acceptAll(n.contracts) + return arrayListOf( + DocumentSymbol( + n.nameAsString, + SymbolKind.Method, + n.asRange, n.name.asRange, "", children + ) + ) + } + + override fun visit(n: JmlMethodDeclaration, arg: Unit?): MutableList? { + return n.methodDeclaration.accept(this, arg) + } + + override fun visit(n: VariableDeclarationExpr?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } + + override fun visit(n: ModuleDeclaration, arg: Unit?): MutableList { + return arrayListOf( + DocumentSymbol( + n.nameAsString, + SymbolKind.Module, + n.asRange, n.name.asRange, "", arrayListOf() + ) + ) + } + + override fun visit(n: JmlContract, arg: Unit?): MutableList { + val children = acceptAll(n.subContracts) + acceptAll(n.clauses) + return arrayListOf( + DocumentSymbol( + n.name.map { it.asString() }.orElse(n.behavior.asString()), + SymbolKind.Key, + n.asRange, n.asRange, "${n.jmlTags}", children + ) + ) + } + + override fun visit(n: JmlRepresentsDeclaration?, arg: Unit?): MutableList { + return arrayListOf()//return super.visit(n, arg) + } + + override fun visit(n: JmlFieldDeclaration, arg: Unit?): MutableList { + val decl = n.decl + return decl.variables.map { v -> + DocumentSymbol( + v.nameAsString, + SymbolKind.Property, + n.asRange, n.asRange, "Jml model method: activated with ${n.jmlTags}", listOf() + ) + }.toMutableList() + + } + + override fun visit(n: JmlClassAccessibleDeclaration, arg: Unit?): MutableList { + return arrayListOf() //super.visit(n, arg) + } + + override fun visit(n: JmlClassExprDeclaration, arg: Unit?): MutableList { + return arrayListOf( + DocumentSymbol( + n.name.map { it.asString() }.orElse("anon invariant"), + SymbolKind.Property, + n.asRange, n.asRange, "Jml class invariant", listOf() + ) + ) + } + + override fun visit(n: JmlSimpleExprClause, arg: Unit?): MutableList { + return arrayListOf( + DocumentSymbol( + n.name.map { "$it : ${n.kind}" }.orElse("Clause ${n.kind}"), + SymbolKind.EnumMember, + n.asRange, n.asRange, "Jml clause", listOf() + ) + ) + } + + override fun visit(n: JmlSignalsClause?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } + + override fun visit(n: JmlSignalsOnlyClause?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } + + override fun visit(n: JmlCallableClause?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } + + override fun visit(n: JmlForallClause?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } + + override fun visit(n: JmlClauseIf?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } + + override fun visit(n: JmlOldClause?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } + + override fun visit(n: JmlMultiExprClause?, arg: Unit?): MutableList? { + return super.visit(n, arg) + } +} diff --git a/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/symbols/KeyCatchSymbols.kt b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/symbols/KeyCatchSymbols.kt new file mode 100644 index 0000000000..bff3551353 --- /dev/null +++ b/tools/lsp/src/main/kotlin/io/github/jmltoolkit/lsp/symbols/KeyCatchSymbols.kt @@ -0,0 +1,90 @@ +package io.github.jmltoolkit.lsp.symbols + +import de.uka.ilkd.key.nparser.KeYParser +import de.uka.ilkd.key.nparser.KeYParserBaseVisitor +import de.uka.ilkd.key.nparser.ParsingFacade +import io.github.jmltoolkit.lsp.Uri +import org.antlr.v4.runtime.ParserRuleContext +import org.antlr.v4.runtime.Token +import org.antlr.v4.runtime.tree.ParseTree +import org.eclipse.lsp4j.* +import org.eclipse.lsp4j.jsonrpc.messages.Either + +private val Token.asRange: Range + get() = Range(asStartPosition, asStopPosition) +private val Token.asStopPosition: Position + get() = Position(line, charPositionInLine + startIndex - stopIndex) +private val Token.asStartPosition: Position + get() = Position(line, charPositionInLine) +private val ParserRuleContext.asRange: Range + get() = Range(start.asStartPosition, stop.asStopPosition) + +/** + * + * @author Alexander Weigl + * @version 1 (04.02.24) + */ +class KeyCatchSymbols(private val uri: Uri) { + fun run(): MutableList> { + val file = ParsingFacade.parseFile(uri.path) + val ctx = ParsingFacade.getParseRuleContext(file) + val v = Visitor() + val l = ctx.accept(v) + return l.map { Either.forRight(it) }.toMutableList() + } + + private class Visitor : KeYParserBaseVisitor>() { + override fun visitFile(ctx: KeYParser.FileContext): List = acceptAll(ctx.children) + @JvmName("acceptAllPt") + private fun acceptAll(children: List): List = + children.mapNotNull { it as? ParserRuleContext } + .flatMap { it.accept(this) }.toMutableList() + + private fun acceptAll(children: List): MutableList = + children.flatMap { it.accept(this) }.toMutableList() + + override fun visitDecls(ctx: KeYParser.DeclsContext): List = acceptAll(ctx.children) + + override fun visitSort_decls(ctx: KeYParser.Sort_declsContext) = listOf( + DocumentSymbol( + "Sorts", SymbolKind.Namespace, ctx.asRange, + Range(), + null, + acceptAll(ctx.one_sort_decl()) + ) + ) + + override fun visitOne_sort_decl(ctx: KeYParser.One_sort_declContext): List = + ctx.sortIds.simple_ident_dots().flatMap { + symbol(it.text, SymbolKind.Class, it.asRange, it.asRange, ctx.doc?.text) + } + + private fun symbol( + name: String, + kind: SymbolKind, + range: Range, + selectionRange: Range, + detail: String? = null, + children: MutableList? = null + ): List = listOf( + DocumentSymbol(name, kind, range, selectionRange, detail, children) + ) + + + override fun visitPreferences(ctx: KeYParser.PreferencesContext): List = + symbol("Preferences", SymbolKind.String, ctx.KEYSETTINGS().symbol.asRange, ctx.asRange, ctx.text) + + + override fun visitFunc_decls(ctx: KeYParser.Func_declsContext) = symbol( + "Functions", SymbolKind.Function, + ctx.start.asRange, Range(), null, + acceptAll(ctx.func_decl()) + ) + + override fun visitRulesOrAxioms(ctx: KeYParser.RulesOrAxiomsContext) = symbol( + (if (ctx.RULES() != null) "Rules" else "Axioms") + " ${ctx.choices.text}", + SymbolKind.Namespace, ctx.start.asRange, ctx.asRange, ctx.doc?.text, + acceptAll(ctx.taclet()) + ) + } +} \ No newline at end of file diff --git a/tools/lsp/src/main/resources/META-INF/services/io.github.jmltoolkit.lsp.actions.LspAction b/tools/lsp/src/main/resources/META-INF/services/io.github.jmltoolkit.lsp.actions.LspAction new file mode 100644 index 0000000000..2762d1d9cc --- /dev/null +++ b/tools/lsp/src/main/resources/META-INF/services/io.github.jmltoolkit.lsp.actions.LspAction @@ -0,0 +1,2 @@ +io.github.jmltoolkit.lsp.actions.VerifyAgainstParent +io.github.jmltoolkit.lsp.actions.WellDefinednessCheck \ No newline at end of file diff --git a/tools/lsp/src/main/resources/doc.md b/tools/lsp/src/main/resources/doc.md new file mode 100644 index 0000000000..df376c93a4 --- /dev/null +++ b/tools/lsp/src/main/resources/doc.md @@ -0,0 +1,271 @@ +%keywords continue_behavior continue_behaviour exceptional_behavior return_behavior normal_behavior model_behavior + +## Behavior + +----- +%keywords post ensures ensures_free ensures_redundantly + +## post conditions + +* `ensures` +* `pre` + +allowed suffixes `_free` and `_redundantly`. + +----- +%keywords pre requires requires_free requires_redundantly + +## pre condition + +`requires` and `pre` clause form the pre-condition of a method, a loop or a code block. + +```java +//@ requires ; +``` + +Both can occur with a `_redundantly` prefix. In KeY `requires_free` is also valid. + +----- +%keywords non_null_by_default nullable_by_default nullable + +## Null modifiers + +`non_null_by_default`, `nullable_by_default`, `@NonNullByDefault`, `@NullableByDefault` + +The `non_null_by_default` and `nullable_by_default` modifiers or, equivalently, the `@NonNullByDefault` and +`@NullableByDefault` Java annotations, specify the default nullity declaration within the class. Nullness is described +in \S\ref{TODO`. The default applies to all typenames in declarations and in expressions (e.g. cast expressions), and +recursively to any nested or inner +classes that do not have default nullity declarations of their own. + +These default nullity modifiers are not inherited by derived classes. + +A class cannot be modified by both modifiers at once. If a class has no nullity modifier, it uses the nullity modifier +of the enclosing class; the default for a top-level class is +`non_null_by_default`. This top-level default may be altered by tools. + +----- +%keywords pure @Pure + +## Purity of functions + +Specifying that a class is `pure` means that each method and nested class within the class is specified as pure. +The `pure` modifier on a class is not inherited by derived classes, though `pure` modifiers on methods are. + +There is no modifier to disable an enclosing `pure` specification. + + +----- + +\subsection{`@Options`` +The `@Options` modifier takes as argument either a String literal or an array of String +literals (with the syntax `@Options({\emph{s1 ...``)`) with each literal being just like a command-line argument, +that is beginning with one or two hyphens and possibly containing +an `=` character with a value. +These command-line options are applied to the processing (e.g., ESC or RAC) of each method within the class. The options may be augmented or disabled by corresponding ` +@Options` modifiers on nested methods or classes. In effect, the options that apply to a given class are the +concatenation of the options given for each enclosing class, from the outermost in. + +An Options modifier is not inherited by derived classes. + +Not all command-line options can be applied to an individual method or class. + + + + + +----- +`invariant clause`` +\label{invariant-clause` +Grammar:\\ +\begin{grammar` +\gntd{invariant-clause` \gis \gterm{invariant` \gnt{opt-name` \gnt{predicate` \gterm{;` +\end{grammar` + +\jmlxtodo{TODO` + +\jmlxtodo{visibility modifiers? ` + +----- +`constraint clause`` +\label{consstraint-clause` +Grammar:\\ +\begin{grammar` +\gntd{constraint-clause` \gis \gterm{constraint` \gnt{opt-name` \gnt{predicate` \gterm{;` +\end{grammar` + +Type information: The \gnt{predicate` has boolean type and is evaluated in the post-state. + +An `constraint` clause for a type is equivalent to an additional postcondition for each +non-constructor method of the type, as if an additional `ensures` clause (with the predicate stated by the `constraint` +clause) were added to every behavior of each method in the type. +like an `ensures` clause, an `initially` clause is evaluated in the post-state. + +`Constraint` clauses are used only by methods of the class in which the clause appears. The clause is not `` +inherited" by derived classes. + +\jmlxtodo{visibility modifiers? ` + +----- +`initially clause`` +\label{initially-clause` +Grammar:\\ +\begin{grammar` +\gntd{initially-clause` \gis \gterm{initially` \gnt{opt-name` \gnt{predicate` \gterm{;` +\end{grammar` + +Type information: The \gnt{predicate` has boolean type and is evaluated in the post-state. + +\jmlxtodo{visibility modifiers? ` + +An `initially` clause for a type is equivalent to an additional postcondition for each +constructor of the type, as if an additional `ensures` clause (with the predicate stated by the `initially` clause) is +added to every behavior of each constructor in the type. +like an `ensures` clause, an `initially` clause were evaluated in the post-state. + +`Constraint` clauses are used only by methods of the class in which the clause appears. The clause is not `` +inherited" by derived classes. + +A typical use of a `constraint` clause is to require some condition about the fields of a class to hold between +the pre- and post-states of every method of the class. For example, \\ +\centerline{`constraint count >= \bs old{count`;``\\ +states that the field `count` never decreases when methods of the class are called. + +----- +%keywords ghost + +## `ghost` fields + +A ghost field declaration has the same syntax as a Java declaration except that it contains the +`ghost` modifier and is in a JML annotation. It declares a field that is visible only in +specifications. Runtime-assertion-checking compilers would compile a ghost field like a normal +Java field. + +The type of a ghost field may be any JML or Java type. + +----- +%keyword model + +## `model` fields + +A ghost field declaration has the same syntax as a Java declaration except that it contains the +`model` modifier and is in a JML annotation. However, a model field is not a ``real" field in the sense that it is not compiled into an executable representation of its containing class, even for RAC compilation. Rather a model field designates some abstract property of its containing class. The value of that property may be completely uninterpreted, determined only by the constraints imposed by various other specifications. Alternately, the value of a model field may be given directly by a `represents` +clause. + +A model field is also implicitly a +\emph{datagroup` in that it designates a set of memory locations (store-refs), given by various `in` and `maps` +clauses. + +----- +`represents clause`` +Grammar:\\ +\begin{grammar` +\gntd{represents-clause` \gis \glb \gterm{static` \grb +\gnt{represents-keyword` \gnt{ident` \\ +\gindentb \glp \gterm{=` \gnt{jml-expression` \gterm{;`\\ +\gindentb \gbar \gterm{\bs such_that` \gnt{predicate` \gterm{;` \\ +\gindentb \grp \\ +\gntd{represents-keyword` \gis \gterm{represents` \gbar \gterm{represents_redundantly` +\end{grammar` + +Type information: +\begin{itemize`[noitemsep] +\item The identifier named in the represents clause must be a model field declared in or inherited by the class containing +the represents clause. +\item the \gnt{jml-expression` in the first form must have a type assignable to the type of +the given field (that is, \emph{ident` `==` \emph{expr` must be type-correct). +\item the \gnt{predicate` in the second form must be a \gnt{jml-expression` with boolean type +\item A represents-clause can be declared as static. In a static represents clause, only static elements can be referenced both in the left-hand side and the right-hand side. In addition, a static represents clause must be declared in the type where the model field on the left-hand side is declared. +\item A non-static represents clause must not have a static model field in its left-hand side. +\end{itemize` + +The first form of a represents clause is called a functional abstraction. This form defines the value of the given +identifier in a visible state as the value of the expression that follows the =. The represents clause for field +\emph{f` with expression \emph{e` in class \emph{C` is equivalent to assuming\\ +\centerline{`forall non_null C c; c.f == e_c`` +where $e_c$ is `e` with `c` replacing `this`. + +The second form (with `\such_that`) is called a relational abstraction. This form constrains the value of the identifier +in a visible state to satisfy the given predicate. + +A represents clause does not take a visibility modifier. In essence, its visibility is that of +the field whose representation is is defining. However, there is no restriction on the +visibility of names on the right-hand-side. For example, the representation of a public model field may be an expression +containing private concrete fields. + +Note that represents clauses can be recursive. That is, a represents clause may name a field on its right hand side that +is the same as the field being represented (named on the left hand side). It is the specifier's responsibility to make +sure such definitions are well-defined. But such recursive represents clauses can be useful when dealing with recursive +datatypes \cite{Mueller-Poetzsch-Heffter-Leavens03`. + +----- +%keywords model + +## `model methods` and `model classes` + +----- +%keywords axiom + +## axiom-clause + +``` +axiom-clause: 'axiom' [name ':'] predicate ';' +``` + +Type information: The `predicate` has boolean type. An axiom must be a state-independent formula. + +Axioms always have public visibility. + +Axioms are assumptions introduced into the proof. An axiom must be a state-independent formula. Typically it might express a property of a mathematical type that is too difficult for an +automated tool to prove. As assumptions, axioms are a soundness risk for verification, unless they are separately proved. + +----- +%keyword readable-if-clause writeable-if-clause + +## readable if clause and writable if clause + +``` +\gntd{readable-if-clause` \gis \gterm{readable` \gnt{ident` \gterm{if` \gnt{jml-expression` ';' \\ +\gntd{writable-if-clause` \gis 'writable ident \gterm{if` \gnt{jml-expression` ';' +``` + +Type information: +\begin{itemize`[noitemsep] +\item the \gnt{ident` must name a field (possibly inherited) visible in the class containing the clause +\item the \gnt{jml-expression` must have boolean type +\item Any name used on the right-hand-side must be visible in any context in which the given \gnt{ident` is visible. +\end{itemize` + +The `readable-if` clause states a condition that must be true at any program point at which the given field is read. + +The `writable-if` clause states a condition that must be true at any program point at which the given field is +written. + + +----- +%keywords monitor_for + +## `monitors_for` clause + +```bnf +monitors-for-clause: + monitors_for ident '=' jml-expression ... term ';' +``` + +Type information: +\begin{itemize`[noitemsep] +\item the \gnt{ident` must name a field (possibly inherited) visible in the class containing the clause +\item the \gnt{jml-expression`s must evaluate to a (possibly null) reference +\end{itemize` + +A monitors-for-clause such as `monitors_for f = e1, e2;` specifies a relationship between the field, `f`, and a set of +objects, denoted by a specification expression list `e1, e2`. The meaning of this declaration is that all of the ( +non-null) objects in the list, in this example, the objects denoted by `e1` and `e2`, must be locked at the program +point at +which the given field (f in the example) is read or written. + +Note that the righthand-side of the monitors-for-clause is not just a list of memory locations, but is in fact a list of +expressions, where each expression evaluates to a reference to an object. + +The monitors-for-clause is adapted from ESC/Java. + diff --git a/tools/lsp/src/test/kotlin/tests.kt b/tools/lsp/src/test/kotlin/tests.kt new file mode 100644 index 0000000000..53fd4aa289 --- /dev/null +++ b/tools/lsp/src/test/kotlin/tests.kt @@ -0,0 +1,225 @@ +import com.google.common.truth.Truth +import io.github.jmltoolkit.lsp.hover.JmlDocumentationIndex +import io.github.jmltoolkit.lsp.JmlLanguageServer +import io.github.jmltoolkit.lsp.Uri +import org.eclipse.lsp4j.* +import org.eclipse.lsp4j.services.LanguageClient +import org.junit.jupiter.api.DynamicTest +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.TestFactory +import java.io.File +import java.util.concurrent.CompletableFuture +import kotlin.test.assertTrue + +private val File.toUri: String + get() = "file://${absolutePath}" + + +val workspace = File("workspace") +val languageServer = JmlLanguageServer().also { + val params = InitializeParams() + val workspaceFolder = WorkspaceFolder(workspace.toUri, "Test Bed") + params.workspaceFolders = arrayListOf(workspaceFolder) + it.connect(EmptyLanguageClient()) + it.initialize(params).get() +} + +val docService = languageServer.textDocumentService + +class EmptyLanguageClient : LanguageClient { + override fun telemetryEvent(`object`: Any?) { + } + + override fun publishDiagnostics(diagnostics: PublishDiagnosticsParams?) { + } + + override fun showMessage(messageParams: MessageParams?) { + } + + override fun showMessageRequest(requestParams: ShowMessageRequestParams?): CompletableFuture { + return CompletableFuture.completedFuture(MessageActionItem("Test!")) + } + + override fun logMessage(message: MessageParams?) { + } +} + +class HoverTest { + + @Test + fun docIndex() { + val idx = JmlDocumentationIndex() + val mbtext = idx.get("model_behavior") + val btext = idx.get("behavior") + Truth.assertThat(mbtext).isEqualTo(btext) + } + + @Test + fun test1() { + val file = TextDocumentIdentifier(File(workspace, "Example.java").toUri) + val params = HoverParams(file, Position(12, 10)) // requires + val resp = docService.hover(params).get() + println(resp.range) + println(resp.contents.right.value) + } +} + +class CodeActionTests { + @Test + fun test1() { + val file = TextDocumentIdentifier(File(workspace, "Example.java").toUri) + val params = CodeActionParams( + file, Range(Position(6, 35), Position(6, 35)), + CodeActionContext(listOf(), null) + ) + val resp = docService.codeAction(params).get() + println(resp) + with(Truth.assertThat(resp)) { + isNotNull() + isNotEmpty() + } + } +} + +class FileDiagnosticTests { + @Test + fun test1() { + val file = TextDocumentIdentifier(File(workspace, "Errors.java").toUri) + val params = DocumentDiagnosticParams(file) + val resp = docService.diagnostic(params).get() + resp.left.items.forEach { + println(it.message) + } + } +} + +class DeclarationTests { + @Test + fun test1() { + val file = TextDocumentIdentifier(File(workspace, "Declarations.java").toUri) + val variableInClause = DeclarationParams(file, Position(5, 16)) + val variableInAssert = DeclarationParams(file, Position(10, 18)) + val forall = DeclarationParams(file, Position(7, 16)) + + val result0 = docService.declaration(forall).get() + println(result0) + + //val result1 = docService.declaration(variableInClause).get() + //val result2 = docService.declaration(variableInAssert).get() + + } +} + +class HighlighterTest { + data class Entry( + val line: Int, + val column: Int, + val len: Int, + val type: Int, + val modifiers: Int + ) { + constructor(pos: Int, data: List) : this( + data[pos], + data[pos + 1], + data[pos + 2], + data[pos + 3], + data[pos + 4] + ) + } + + @Test + fun test1() { + val file = TextDocumentIdentifier(File(workspace, "Declarations.java").toUri) + val res = docService.semanticTokensFull(SemanticTokensParams(file)).get() + + assertTrue { res.data.size % 5 == 0 } + val entries = mutableListOf() + for (i in 0 until res.data.size / 5) { + val entry = Entry(5 * i, res.data) + assertTrue { entry.column >= 0 } + assertTrue { entry.line >= 0 } + assertTrue { entry.len >= 1 } + assertTrue { entry.type >= 0 } + entries.add(entry) + } + + var line = -1 + var column = 0 + val text = Uri(file.uri).file.readText().split("\n") + + for (entry in entries) { + line += entry.line + if (entry.line != 0) column = entry.column + else column += entry.column + val image = text[line].substring(column - 1, column - 1 + entry.len) + println(image) + } + + + /* + at index 5*i - deltaLine: token line number, relative to the previous token + at index 5*i+1 - deltaStart: token start character, relative to the previous token (relative to 0 or the previous + token’s start if they are on the same line) + at index 5*i+2 - length: the length of the token. + at index 5*i+3 - tokenType: will be looked up in SemanticTokensLegend.tokenTypes. We currently ask that tokenType < 65536. + at index 5*i+4 - tokenModifiers: each set bit will be looked up in SemanticTokensLegend.tokenModifiers + */ + + } +} + +/** + * + * @author Alexander Weigl + * @version 1 (20.07.22) + */ +class DocumentSymbolTests { + private fun testDocumentSymbols(javaFile: File, symbolsTruth: File) { + val params = DocumentSymbolParams(TextDocumentIdentifier(javaFile.toUri)) + val result = docService.documentSymbol(params).get() + val sb = toCsv(result.map { it.right }, javaFile.name) + Truth.assertThat(sb.toString()) + .isEqualTo(symbolsTruth.readText()) + } + + @TestFactory + fun documentSymbols(): List { + println(workspace.absoluteFile) + + return workspace.absoluteFile.walkTopDown().asSequence() + .filter { + File("$it.symbols").exists() + } + .filter { it.name.endsWith(".java") } + .map { file -> + DynamicTest.dynamicTest(file.name) { + testDocumentSymbols(file, File("$file.symbols")) + } + } + .toList() + } + + private fun toCsv( + result: List, + file: String, + sb: StringBuilder = StringBuilder(), + depth: Int = 0, + ): StringBuilder { + for (right in result) { + sb.append(">".repeat(depth)) + .append(" ") + .append(right.name) + .append("\t") + .append(right.kind) + .append("\t") + .append(file) + .append(":") + .append(right.selectionRange.start.line + 1) + .append(":") + .append(right.selectionRange.start.character + 1) + .append("\n") + toCsv(right.children, file, sb, depth + 1) + } + return sb + } +} \ No newline at end of file diff --git a/tools/lsp/workspace/Declarations.java b/tools/lsp/workspace/Declarations.java new file mode 100644 index 0000000000..926a426b56 --- /dev/null +++ b/tools/lsp/workspace/Declarations.java @@ -0,0 +1,12 @@ +public class Declarations { + //@ public model int abc; + + /*@ + ensures abc == 9; + forall int local; + requires local != 0; + */ + public void foo() { + //@assert abc == 0; + } +} diff --git a/tools/lsp/workspace/Errors.java b/tools/lsp/workspace/Errors.java new file mode 100644 index 0000000000..ab5ec4dd57 --- /dev/null +++ b/tools/lsp/workspace/Errors.java @@ -0,0 +1,38 @@ +class EverythingWrong { + public void foo(int x) { + //@ghost int x = 0; + } + + /*@ ensures \result>0; */ + public void bar(int x) {} + + /*@ requires \result>0; */ + public int bar(int x) { return 0;} + + /*@ requires x++; ensures x=2; */ + public int baf(int x) { return 0;} + + public void bar(int x) { + /*@ ensures true; requires true; */ + while(true); + } + + public final int x; + /*@ assignable x; */ + public void bear() {} + + + /*@ + public normal_behavior + ensures true; + {| + also + requires a<0; + also + requires a>0; + also + requires a==0; + |} + */ + public void bbbbb() {} +} \ No newline at end of file diff --git a/tools/lsp/workspace/Example.java b/tools/lsp/workspace/Example.java new file mode 100644 index 0000000000..5c3273937b --- /dev/null +++ b/tools/lsp/workspace/Example.java @@ -0,0 +1,18 @@ +//-*- jml-keys: openjml + +public class Example { + /*+key@ public invariant 2*a == invariant;*/ + /*+openjml@ public invariant stupid_name : 2*a == invariant;*/ + /*@ public invariant 2*a == invariant;*/ + + public int foo = 2; + + /*@ + model_behavior + requires req1 : true; + ensures true; + assignable \nothing; + public model int bar(int a); + */ +} + \ No newline at end of file diff --git a/tools/lsp/workspace/Example.java.symbols b/tools/lsp/workspace/Example.java.symbols new file mode 100644 index 0000000000..9638f4a46a --- /dev/null +++ b/tools/lsp/workspace/Example.java.symbols @@ -0,0 +1,8 @@ + Example.java File Example.java:3:14 +> Example Class Example.java:3:14 +>> anon invariant Property Example.java:6:9 +>> foo Field Example.java:8:16 +>> bar Method Example.java:15:22 +>>> model_behavior Key Example.java:11:5 +>>>> req1 : REQUIRES EnumMember Example.java:12:5 +>>>> Clause ENSURES EnumMember Example.java:13:5 diff --git a/tools/lsp/workspace/jmlproject.json b/tools/lsp/workspace/jmlproject.json new file mode 100644 index 0000000000..3275c27f9c --- /dev/null +++ b/tools/lsp/workspace/jmlproject.json @@ -0,0 +1,10 @@ +{ + "enabledKeys": [], + "usedKeys": [], + "sourcePaths": [], + "disabledLinter": [], + "disabledCodeActions": [ + "jml.verify.liskov", + "jml.welldefinedness-check" + ] +} \ No newline at end of file diff --git a/tools/prettyprinting/build.gradle.kts b/tools/prettyprinting/build.gradle.kts new file mode 100644 index 0000000000..2e90047b4a --- /dev/null +++ b/tools/prettyprinting/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("standard-kotlin") +} +dependencies { + implementation(project(":tools:utils")) + implementation("com.google.googlejavaformat:google-java-format:1.35.0") +} diff --git a/tools/prettyprinting/src/main/kotlin/JmlFmt.kt b/tools/prettyprinting/src/main/kotlin/JmlFmt.kt new file mode 100644 index 0000000000..b8d530d2d5 --- /dev/null +++ b/tools/prettyprinting/src/main/kotlin/JmlFmt.kt @@ -0,0 +1,122 @@ +import com.google.common.base.CharMatcher +import com.google.common.base.Strings +import com.google.common.collect.ImmutableList +import com.google.common.collect.Range +import com.google.googlejavaformat.* +import com.google.googlejavaformat.java.* +import java.util.* +import java.util.regex.Pattern + +/** + * + * @author Alexander Weigl + * @version 1 (30.06.24) + */ +class JmlFmt { + fun pp(x: String): String? { + val input = JavaInput(x) + val output = JavaOutput("\n", input, JmlCommentsHelper("\n", JavaFormatterOptions.defaultOptions())) + val builder = OpsBuilder(input, output) + builder.drain() + val ops = builder.build() + val doc = DocBuilder().withOps(ops).build() + doc.computeBreaks(output.commentsHelper, 80, Doc.State(+0, 0)) + doc.write(output) + output.flush() + return output.getLine(0) + } +} + +class JmlCommentsHelper( + private val lineSeparator: String, + private val options: JavaFormatterOptions +) : CommentsHelper { + private val javaCommentsHelper = JavaCommentsHelper(lineSeparator, options) + + override fun rewrite(tok: Input.Tok, maxWidth: Int, column0: Int): String { + if (tok.isComment && tok.originalText.startsWith("/*@")) { + var text = tok.originalText + //TODO + return text + } else { + return javaCommentsHelper.rewrite(tok, maxWidth, column0) + } + } + + // For non-javadoc-shaped block comments, shift the entire block to the correct + // column, but do not adjust relative indentation. + private fun preserveIndentation(lines: List, column0: Int): String { + val builder = StringBuilder() + + // find the leftmost non-whitespace character in all trailing lines + var startCol = -1 + for (i in 1 until lines.size) { + val lineIdx = CharMatcher.whitespace().negate().indexIn(lines[i]) + if (lineIdx >= 0 && (startCol == -1 || lineIdx < startCol)) { + startCol = lineIdx + } + } + + // output the first line at the current column + builder.append(lines[0]) + + // output all trailing lines with plausible indentation + for (i in 1 until lines.size) { + builder.append(lineSeparator).append(Strings.repeat(" ", column0)) + // check that startCol is valid index, e.g. for blank lines + if (lines[i].length >= startCol) { + builder.append(lines[i].substring(startCol)) + } else { + builder.append(lines[i]) + } + } + return builder.toString() + } + + // Wraps and re-indents line comments. + private fun indentLineComments(lines: List, column0: Int): String { + var lines = lines + //lines = wrapLineComments(lines, column0) + val builder = StringBuilder() + builder.append(lines[0].trim { it <= ' ' }) + val indentString = Strings.repeat(" ", column0) + for (i in 1 until lines.size) { + builder.append(lineSeparator).append(indentString).append(lines[i].trim { it <= ' ' }) + } + return builder.toString() + } + + // Preserve special `//noinspection` and `//$NON-NLS-x$` comments used by IDEs, which cannot + // contain leading spaces. + val LINE_COMMENT_MISSING_SPACE_PREFIX: Pattern = + Pattern.compile("^(//+)(?!noinspection|\\\$NON-NLS-\\d+\\$)[^\\s/]") + + // Remove leading whitespace (trailing was already removed), and re-indent. + // Add a +1 indent before '*', and add the '*' if necessary. + private fun indentJavadoc(lines: List, column0: Int): String { + val builder = StringBuilder() + builder.append(lines[0].trim { it <= ' ' }) + val indent = column0 + 1 + val indentString = Strings.repeat(" ", indent) + for (i in 1 until lines.size) { + builder.append(lineSeparator).append(indentString) + val line = lines[i].trim { it <= ' ' } + if (!line.startsWith("*")) { + builder.append("* ") + } + builder.append(line) + } + return builder.toString() + } + + // Returns true if the comment looks like javadoc + private fun javadocShaped(lines: List): Boolean { + val it = lines.iterator() + if (!it.hasNext()) { + return false + } + val first = it.next().trim { it <= ' ' } + // if it's actually javadoc, we're done + return first.startsWith("/*@") //TODO + } +} \ No newline at end of file diff --git a/tools/prettyprinting/src/main/kotlin/mlpp/FeatureExtractor.kt b/tools/prettyprinting/src/main/kotlin/mlpp/FeatureExtractor.kt new file mode 100644 index 0000000000..290c725150 --- /dev/null +++ b/tools/prettyprinting/src/main/kotlin/mlpp/FeatureExtractor.kt @@ -0,0 +1,132 @@ +package mlpp + +import com.github.javaparser.JavaParser +import com.github.javaparser.JavaToken +import com.github.javaparser.ParserConfiguration +import com.github.javaparser.TokenRange +import com.github.javaparser.ast.Node +import io.github.jmltoolkit.utils.Helper.findAllJmlContainers +import java.io.IOException +import java.io.PrintWriter +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths + +/** + * @author Alexander Weigl + * @version 1 (07.04.23) + */ +class FeatureExtractor { + private val parser: JavaParser + internal val out = PrintWriter("features.csv") + + init { + val config = ParserConfiguration() + config.setProcessJml(true) + parser = JavaParser(config) + } + + @Throws(IOException::class) + fun extract(path: Path?) { + val cu = parser.parse(path) + if (cu.isSuccessful) { + val nodes = findAllJmlContainers(cu.result.get()) + + extractN(nodes) + } + } + + private fun extractN(nodes: List) { + for (node in nodes) { + val tokenRange = node.tokenRange + tokenRange.ifPresent { javaTokens: TokenRange -> extract(javaTokens.begin, javaTokens.end) } + } + } + + private fun extract(begin: JavaToken, end: JavaToken) { + var cur: JavaToken? = begin + val seq = ArrayList(1024) + while (cur != null && cur !== end) { + if (!cur.category.isWhitespaceOrComment) { + seq.add(cur) + } + cur = cur.nextToken.orElse(null) + } + extract(seq) + } + + private fun extract(seq: List) { + val iter = FillNull(seq.iterator()) + var prev2: JavaToken? = null + var prev1: JavaToken? = null + var cur: JavaToken? = iter.next() + var next: JavaToken? = iter.next() + while (cur != null) { + val tokenid0 = getKind(cur) + val tokenid1 = getKind(prev1) + val tokenid2 = getKind(prev2) + val tokenidn = getKind(next) + + val widthleft = 120 - cur.range.get().end.column + + val lineident = 0 + + val followedByNewline = next != null && cur.range.get().end.line != next.range.get().begin.line + val followedByIndent = next?.range?.get()?.begin?.column ?: 0 + + + out.format( + "%d\t%d\t%d\t%d\t%d\t%d\t%s\t%d\n", + tokenid0, + tokenid1, + tokenid2, + tokenidn, + widthleft, + lineident, + followedByNewline, + followedByIndent + ) + + prev2 = prev1 + prev1 = cur + cur = next + next = if (next == null) null else iter.next() + } + } + + internal fun printHead() { + out.format("tokenid0\ttokenid1\ttokenid2\ttokenidn\twidthleft\tlineident\tfollowed_by_newline\tfollowed_by_indent\n") + } +} + +private class FillNull(private val iter: Iterator) : Iterator { + override fun hasNext(): Boolean { + return iter.hasNext() + } + + override fun next(): JavaToken? { + if (iter.hasNext()) return iter.next() + return null + } +} + +private fun getKind(cur: JavaToken?): Int { + if (cur == null) return -1 + return cur.kind +} + +@Throws(IOException::class) +fun main(args: Array) { + val e = FeatureExtractor() + e.printHead() + for (arg in args) { + Files.walk(Paths.get(arg)).forEach { it: Path? -> + try { + e.extract(it) + } catch (ex: IOException) { + ex.printStackTrace() + } + } + } + e.out.flush() +} diff --git a/tools/redux/build.gradle.kts b/tools/redux/build.gradle.kts new file mode 100644 index 0000000000..abac6b958e --- /dev/null +++ b/tools/redux/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("standard-kotlin") +} + +dependencies { + implementation(project(":tools:utils")) +} diff --git a/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/AddForeachCountVariable.kt b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/AddForeachCountVariable.kt new file mode 100644 index 0000000000..00413bb479 --- /dev/null +++ b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/AddForeachCountVariable.kt @@ -0,0 +1,52 @@ +package io.github.jmltoolkit.redux + +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.expr.NameExpr +import com.github.javaparser.ast.expr.SimpleName +import com.github.javaparser.ast.expr.UnaryExpr +import com.github.javaparser.ast.expr.VariableDeclarationExpr +import com.github.javaparser.ast.jml.stmt.JmlGhostStmt +import com.github.javaparser.ast.stmt.BlockStmt +import com.github.javaparser.ast.stmt.ExpressionStmt +import com.github.javaparser.ast.stmt.ForEachStmt +import com.github.javaparser.ast.type.PrimitiveType +import io.github.jmltoolkit.utils.Helper + +/** + * @author Alexander Weigl + * @version 1 (08.02.22) + */ +class AddForeachCountVariable : Transformer { + override fun apply(a: Node): Node { + return Helper.findAndApply(ForEachStmt::class.java, a) { forEachStmt: ForEachStmt -> + addCountVariableInForeach( + forEachStmt + ) + } + } + + companion object { + const val VARIABLE_NAME_COUNT: String = "\\count" + + fun addCountVariableInForeach(forEachStmt: ForEachStmt): BlockStmt { + val stmt = BlockStmt() + forEachStmt.replace(stmt) + val vdecl = VariableDeclarationExpr(PrimitiveType.intType(), VARIABLE_NAME_COUNT) + val decl = JmlGhostStmt(NodeList(), ExpressionStmt(vdecl)) + stmt.addStatement(decl) + stmt.addStatement(forEachStmt) + val loopBody = forEachStmt.body + val increment = UnaryExpr(NameExpr(VARIABLE_NAME_COUNT), UnaryExpr.Operator.PREFIX_INCREMENT) + if (loopBody.isBlockStmt) { + (loopBody as BlockStmt).addStatement(0, increment) + } else { + val newLoopBody = BlockStmt() + loopBody.replace(newLoopBody) + newLoopBody.addStatement(increment) + newLoopBody.addStatement(loopBody) + } + return stmt + } + } +} diff --git a/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/LambdaReplacer.kt b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/LambdaReplacer.kt new file mode 100644 index 0000000000..e5831f6d7a --- /dev/null +++ b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/LambdaReplacer.kt @@ -0,0 +1,159 @@ +package io.github.jmltoolkit.redux + + +import com.github.javaparser.Position +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration +import com.github.javaparser.ast.body.MethodDeclaration +import com.github.javaparser.ast.body.TypeDeclaration +import com.github.javaparser.ast.expr.LambdaExpr +import com.github.javaparser.ast.expr.ObjectCreationExpr +import com.github.javaparser.ast.stmt.BlockStmt +import com.github.javaparser.ast.stmt.ExpressionStmt +import com.github.javaparser.ast.stmt.Statement +import com.github.javaparser.ast.type.ClassOrInterfaceType +import com.github.javaparser.utils.Pair +import io.github.jmltoolkit.utils.Helper + +/** + * Replaces lambda expression by an internal named class. + * + * + * Code was donated by Carsten Czisky @ciskar + */ +class LambdaReplacer(private val nameGenerator: NameGenerator) : Transformer { + override fun apply(a: Node): Node { + return Helper.findAndApply(LambdaExpr::class.java, a) { expr: LambdaExpr -> this.rewriteLambda(expr) } + } + + private fun rewriteLambda(expr: LambdaExpr): Node { + val enclosingType = expr.getParentNodeOfType( + TypeDeclaration::class.java + ) + check(!enclosingType.isEmpty) { "LambdaExpr is not enclosed in a type declaration" } + val decl = liftToInnerClass(expr) + enclosingType.get().addMember(decl) + return instantiate(decl) + } + + + private fun instantiate(decl: ClassOrInterfaceDeclaration): ObjectCreationExpr { + val type = ClassOrInterfaceType(null, decl.nameAsString) + return ObjectCreationExpr(null, type, NodeList()) + } + + private fun liftToInnerClass(lambdaExpr: LambdaExpr): ClassOrInterfaceDeclaration { + val sai = findSingleAbstractInterface(lambdaExpr) + val interfazeName = sai.a + val method = sai.b + val name = nameGenerator.generate("__GENERATED_", lambdaExpr.range.orElse(null).begin) + val it = ClassOrInterfaceDeclaration(NodeList(), false, name) + it.addImplementedType(interfazeName) + it.addMember(method) + return it + } + + private fun findSingleAbstractInterface(lambdaExpr: LambdaExpr): Pair { + val type = assignToType(lambdaExpr) + return if (type == null) { + inferDefaultAbstractInterface(lambdaExpr) + } else { + Pair( + type.nameAsString, + MethodDeclaration() + ) + } + } + + private fun inferDefaultAbstractInterface(lambdaExpr: LambdaExpr): Pair { + var interfaze = "" + val md = MethodDeclaration() + + val body = lambdaExpr.body + var returnType: String? = null + + if (body is BlockStmt) { + val last: Statement? = body.statements.lastOrNull() + returnType = last?.let { it: Statement -> it.asReturnStmt().expression() } + ?.calculateResolvedType()?.toString() + } + + if (body is ExpressionStmt) { + returnType = body.expression.calculateResolvedType().toString() + } + + + when (lambdaExpr.parameters.size) { + 0 -> { + if (returnType == null) { + interfaze = "Runnable" + md.setName("run") + } else { + interfaze = "java.util.function.Supplier<\$returnType>" + md.setName("accept") + } + } + + 1 -> { + val firstParam = lambdaExpr.parameters.firstOrNull()?.typeAsString + if (returnType == null) { + interfaze = "java.util.function.Consumer<$firstParam>" + md.setName("get") + } else { + interfaze = "java.util.function.Function<$firstParam, $returnType>" + md.setName("invoke") + } + } + + 2 -> { + val firstParam = lambdaExpr.parameters.first()?.typeAsString + val secondParam = lambdaExpr.parameters[1].typeAsString + if (returnType == null) { + interfaze = "java.util.function.BiConsumer<$firstParam,$secondParam>" + md.setName("get") + } else { + interfaze = "java.util.function.BiFunction<$firstParam, $secondParam, $returnType>" + md.setName("invoke") + } + } + + else -> throw IllegalStateException("ASM could not be infered") + } + //TODO md.type = returnType + for (parameter in lambdaExpr.parameters) { + md.addParameter(parameter.clone()) + } + return Pair(interfaze, md) + } + + private fun assignToType(lambdaExpr: LambdaExpr): ClassOrInterfaceType? { + val type = lambdaExpr.calculateResolvedType() + println("TEST: \$type") + return null //TODO + } +} + +/** + * generates names guaranteeing uniqueness in generated names by onw instance of NameGenerator + */ +class NameGenerator { + private val generatedNames: MutableSet = HashSet() + + fun generate(prefix: String, pos: Position?): String { + return generate(prefix, pos, null) + } + + private fun generate(prefix: String, pos: Position?, counter: Int?): String { + val line = pos?.line + var newName = prefix + "L" + line + if (counter != null) { + newName += "_$counter" + } + if (generatedNames.contains(newName)) { + return generate(prefix, pos, if (counter != null) counter + 1 else 0) + } + generatedNames.add(newName) + return newName + } +} diff --git a/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/ReduxConfig.kt b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/ReduxConfig.kt new file mode 100644 index 0000000000..bf60ccc8fc --- /dev/null +++ b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/ReduxConfig.kt @@ -0,0 +1,25 @@ +package io.github.jmltoolkit.redux + + +/** + * Configuration for the Redux transformation pipeline. + */ +class ReduxConfig { + private val disabled: MutableSet = HashSet() + + fun enable(clazz: Class<*>) { + disabled.remove(clazz.toString()) + } + + fun disable(clazz: Class<*>) { + disabled.add(clazz.toString()) + } + + fun getDisabled(): Set { + return disabled + } + + fun isEnabled(clazz: String): Boolean { + return !disabled.contains(clazz) + } +} \ No newline at end of file diff --git a/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/ReduxFacade.kt b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/ReduxFacade.kt new file mode 100644 index 0000000000..8bbc0bc757 --- /dev/null +++ b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/ReduxFacade.kt @@ -0,0 +1,36 @@ +package io.github.jmltoolkit.redux + + +import com.github.javaparser.ast.Node +import java.util.* + +/** + * @author Alexander Weigl + * @version 1 (12/29/21) + */ +class ReduxFacade(private val config: ReduxConfig) { + private val transformers: MutableList = ArrayList() + + constructor(config: ReduxConfig, transformers: List) : this(config) { + this.transformers.addAll(transformers) + } + + fun apply(nodes: List): List { + val n: MutableList = ArrayList(nodes.size) + for (node in nodes) { + var new = node + for (transformer in transformers) { + new = transformer.apply(new) + } + n.add(new) + } + return n + } + + companion object { + fun create(config: ReduxConfig): ReduxFacade { + val sl = ServiceLoader.load(Transformer::class.java) + return ReduxFacade(config, sl.filter { config.isEnabled(it.javaClass.name) }) + } + } +} diff --git a/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/Transformer.kt b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/Transformer.kt new file mode 100644 index 0000000000..6642a65f5a --- /dev/null +++ b/tools/redux/src/main/kotlin/io/github/jmltoolkit/redux/Transformer.kt @@ -0,0 +1,12 @@ +package io.github.jmltoolkit.redux + + +import com.github.javaparser.ast.Node + +/** + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +interface Transformer { + fun apply(a: Node): Node +} diff --git a/tools/redux/src/test/resources/lambda/Test.java b/tools/redux/src/test/resources/lambda/Test.java new file mode 100644 index 0000000000..33ae9006dc --- /dev/null +++ b/tools/redux/src/test/resources/lambda/Test.java @@ -0,0 +1,24 @@ +class A { + private final int test; + + public A() { + this.test = 1; + } + + void m(int i) { + int outer = 10; + make(a -> { + MyFunctionalInterface g = (x) -> test * 2 + x; + return test + g.apply(a) * 2; + }); + } + + void make(MyFunctionalInterface f) { + f.apply(10); + } + + @java.lang.FunctionalInterface + interface MyFunctionalInterface { + public int apply(int i); + } +} diff --git a/tools/redux/src/test/resources/lambda/TestGeneric.java b/tools/redux/src/test/resources/lambda/TestGeneric.java new file mode 100644 index 0000000000..bacbe73ace --- /dev/null +++ b/tools/redux/src/test/resources/lambda/TestGeneric.java @@ -0,0 +1,26 @@ +class A { + private final int test; + + public A() { + this.test = 1; + } + + void m(int i) { + int outer = 10; + make(a -> { + MyFunctionalInterface g = (x) -> (test * 2 + x) > 0; + + return g.apply(a) && a > 2; + }); + } + + void make(MyFunctionalInterface f) { + f.apply(10); + } + + @java.lang.FunctionalInterface + interface MyFunctionalInterface { + + public boolean apply(T i); + } +} diff --git a/tools/redux/src/test/resources/lambda/TestPredicateInline.java b/tools/redux/src/test/resources/lambda/TestPredicateInline.java new file mode 100644 index 0000000000..86726069bc --- /dev/null +++ b/tools/redux/src/test/resources/lambda/TestPredicateInline.java @@ -0,0 +1,49 @@ +import java.util.Objects; + +class A { + private final int test; + + public A() { + this.test = 1; + } + + void m(int i) { + int outer = 10; + Predicate tester = (a) -> a > 10; + tester.test(outer); + } + + + @FunctionalInterface + public interface Predicate { + boolean test(T var1); + + default Predicate and(Predicate var1) { + Objects.requireNonNull(var1); + return (var2) -> { + return this.test(var2) && var1.test(var2); + }; + } + + default Predicate negate() { + return (var1) -> { + return !this.test(var1); + }; + } + + default Predicate or(Predicate var1) { + Objects.requireNonNull(var1); + return (var2) -> { + return this.test(var2) || var1.test(var2); + }; + } + + static Predicate isEqual(Object var0) { + return null == var0 ? Objects::isNull : (var1) -> { + return var0.equals(var1); + }; + } + + } + +} diff --git a/tools/smt/build.gradle.kts b/tools/smt/build.gradle.kts new file mode 100644 index 0000000000..04c6703c66 --- /dev/null +++ b/tools/smt/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("standard-kotlin") +} + +dependencies { + //implementation(libs) + implementation(project(":tools:utils")) + + + testImplementation(libs.snakeyaml) +} diff --git a/tools/smt/preamble.smt2 b/tools/smt/preamble.smt2 new file mode 100644 index 0000000000..910f44c356 --- /dev/null +++ b/tools/smt/preamble.smt2 @@ -0,0 +1,62 @@ +(set-option :produce-unsat-cores true) +(set-option :produce-models true) +(set-logic ALL) + +(declare-sort T 0) +(declare-sort U 0) + +(declare-fun instanceof (U T) Bool) +(declare-fun exactinstanceof (U T) Bool) +(declare-fun subtype (T T) Bool) +(declare-fun typeof (U) T) + +(assert (forall ((t1 T)) (subtype t1 t1))) +(assert (forall ((t1 T) (t2 T)) (! (=> (and (subtype t1 t2) (subtype t2 t1)) (= t1 t2)) :pattern ((subtype t1 t2) (subtype t2 t1))))) +(assert (forall ((t1 T) (t2 T) (t3 T)) (! (=> (and (subtype t1 t2) (subtype t2 t3)) (subtype t1 t3)) :pattern ((subtype t1 t2) (subtype t2 t3))))) +(assert (forall ((u U) (t T)) (! (= (instanceof u t) (subtype (typeof u) t)) :pattern ((instanceof u t))))) +(assert (forall ((u U) (t T)) (! (= (exactinstanceof u t) (= (typeof u) t)) :pattern ((exactinstanceof u t))))) + +;; Integer +(declare-fun u2i (U) Int) +(declare-fun i2u (Int) U) +(declare-const sort_int T) + +(assert (forall ((i Int)) (= (u2i (i2u i)) i))) +(assert (forall ((x U)) (! (=> (= (typeof x) sort_int) (= (i2u (u2i x)) x)) :pattern ((typeof x))))) +(assert (forall ((t T)) (! (=> (subtype t sort_int) (= t sort_int)) :pattern ((subtype t sort_int))))) +; (assert (forall ((x U)) (! (=> (instanceof x sort_int) (= (typeof x ) sort_int)) :pattern ((instanceof x sort_int))))) +(assert (forall ((i Int)) (! (= (typeof (i2u i)) sort_int) :pattern ((i2u i))))) + +(declare-fun u2b (U) Bool) +(declare-fun b2u (Bool) U) +(declare-const sort_boolean T) + +(assert (instanceof (b2u true) sort_boolean)) +(assert (instanceof (b2u false) sort_boolean)) +(assert (forall ((b Bool)) (= (u2b (b2u b)) b))) +; This seems to improve Z3 performance: Needs investigation (probably triggers above) +(assert (not (u2b (b2u false)))) +(assert (forall ((u U)) (! (=> (= (typeof u) sort_boolean) (or (= u (b2u true)) (= u (b2u false)))) :pattern ((typeof u))))) +(assert (forall ((x U)) (! (=> (instanceof x sort_boolean) (= (typeof x ) sort_boolean)) :pattern ((instanceof x sort_boolean))))) + +(declare-fun cast (U T) U) +(assert (forall ((x U) (t T)) (! (subtype (typeof (cast x t)) t) :pattern ((cast x t))))) +(assert (forall ((x U) (t T)) (! (=> (subtype (typeof x) t) (= (cast x t) x)) :pattern ((cast x t))))) + + +(declare-fun u2f (U) Float32) +(declare-fun f2u (Float32) U) +;(declare-const sort_float T) + +(declare-fun u2d (U) Float64) +(declare-fun d2u (Float64) U) +;(declare-const sort_double T) +(assert (forall ((f Float32)) (= (u2f (f2u f)) f))) +(assert (forall ((x U)) (=> (= (typeof x) sort_float) (= (f2u (u2f x)) x)))) +(assert (forall ((x U)) (=> (instanceof x sort_float) (= (typeof x ) sort_float)))) +(assert (forall ((f Float32)) (= (typeof (f2u f)) sort_float))) + +(assert (forall ((d Float64)) (= (u2d (d2u d)) d))) +(assert (forall ((x U)) (=> (= (typeof x) sort_double) (= (d2u (u2d x)) x)))) +(assert (forall ((x U)) (=> (instanceof x sort_double) (= (typeof x ) sort_double)))) +(assert (forall ((d Float64)) (= (typeof (d2u d)) sort_double))) diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/ArithmeticTranslator.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/ArithmeticTranslator.kt new file mode 100644 index 0000000000..9810958d1f --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/ArithmeticTranslator.kt @@ -0,0 +1,45 @@ +package io.github.jmltoolkit.smt + +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.body.Parameter +import com.github.javaparser.ast.expr.* +import com.github.javaparser.resolution.types.ResolvedType +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.model.SmtType +import java.math.BigInteger + +/** + * @author Alexander Weigl + * @version 1 (01.07.22) + */ +interface ArithmeticTranslator { + fun binary(operator: BinaryExpr.Operator, left: SExpr, right: SExpr): SExpr + + fun makeChar(n: CharLiteralExpr): SExpr + + fun unary(operator: UnaryExpr.Operator, accept: SExpr): SExpr + + fun makeLong(n: LongLiteralExpr): SExpr + + fun makeInt(n: IntegerLiteralExpr): SExpr + + fun makeInt(i: BigInteger): SExpr + + fun makeIntVar(): SExpr + + fun getVariable(variables: NodeList): List { + return variables.map { getVariable(it) } + } + + fun getVariable(jmlBoundVariable: Parameter): SExpr + + fun makeBoolean(value: Boolean): SExpr + + fun getType(asPrimitive: ResolvedType): SmtType + + fun arrayLength(obj: SExpr): SExpr + + fun makeInt(i: Long): SExpr + + fun makeVar(rtype: ResolvedType): SExpr +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/BitVectorArithmeticTranslator.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/BitVectorArithmeticTranslator.kt new file mode 100644 index 0000000000..1f80b8dcfc --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/BitVectorArithmeticTranslator.kt @@ -0,0 +1,133 @@ +package io.github.jmltoolkit.smt + +import com.github.javaparser.ast.body.Parameter +import com.github.javaparser.ast.expr.* +import com.github.javaparser.ast.expr.BinaryExpr.Operator.* +import com.github.javaparser.ast.expr.UnaryExpr.Operator.* +import com.github.javaparser.resolution.types.ResolvedArrayType +import com.github.javaparser.resolution.types.ResolvedPrimitiveType +import com.github.javaparser.resolution.types.ResolvedPrimitiveType.* +import com.github.javaparser.resolution.types.ResolvedType +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.model.SmtType +import java.math.BigInteger + +/** + * @author Alexander Weigl + * @version 1 (01.07.22) + */ +open class BitVectorArithmeticTranslator(val smtLog: SmtQuery) : ArithmeticTranslator { + var cnt: Int = 0 + + override fun binary(operator: BinaryExpr.Operator, left: SExpr, right: SExpr): SExpr = + when (operator) { + IMPLICATION -> term.impl(left, right) + SUBTYPE -> error("") + RANGE -> error("") + SUB_LOCK -> error("") + SUB_LOCKE -> error("") + RIMPLICATION -> term.impl(right, left) + EQUIVALENCE -> term.equiv(left, right) + ANTIVALENCE -> term.not(term.equiv(left, right)) + OR -> term.or(left, right) + AND -> term.and(left, right) + BINARY_OR -> term.bor(left, right) + BINARY_AND -> term.band(left, right) + XOR -> term.xor(left, right) + EQUALS -> term.equality(left, right) + NOT_EQUALS -> term.not(term.equality(left, right)) + LESS -> term.lessThan(left, right) + GREATER -> term.greaterThan(left, right) + LESS_EQUALS -> term.lessOrEquals(left, right, true) + GREATER_EQUALS -> term.greaterOrEquals(left, right, true) + LEFT_SHIFT -> term.shiftLeft(left, right) + SIGNED_RIGHT_SHIFT -> term.shiftRight(left, right, true) + UNSIGNED_RIGHT_SHIFT -> term.shiftRight(left, right, true) + BinaryExpr.Operator.PLUS -> term.add(left, right) + BinaryExpr.Operator.MINUS -> term.subtract(left, right) + MULTIPLY -> term.multiply(left, right) + DIVIDE -> term.divide(left, right, true) + REMAINDER -> term.modulo(left, right, true) + } + + override fun makeChar(n: CharLiteralExpr): SExpr { + return term.makeBitvector(16, n.value!![0].code.toLong()) + } + + override fun unary(operator: UnaryExpr.Operator, accept: SExpr) = + when (operator) { + UnaryExpr.Operator.PLUS, POSTFIX_INCREMENT, POSTFIX_DECREMENT -> accept + UnaryExpr.Operator.MINUS -> term.negate(accept) + PREFIX_INCREMENT -> term.add(accept, term.makeBitvector(32, 1)) + PREFIX_DECREMENT -> term.subtract(accept, term.makeBitvector(32, 1)) + LOGICAL_COMPLEMENT -> term.not(accept) + BITWISE_COMPLEMENT -> term.not(accept) + } + + override fun makeLong(n: LongLiteralExpr) = term.makeBitvector(64, n.value.toBigInteger()) + + override fun makeInt(n: IntegerLiteralExpr) = term.makeBitvector(32, n.asNumber().toLong()) + + override fun makeInt(i: BigInteger) = term.makeBitvector(32, i) + + override fun makeIntVar(): SExpr { + val name = "__RAND_" + (++cnt) + smtLog.declareConst(name, SmtType.BV32) + return term.symbol(name) + } + + override fun getVariable(jmlBoundVariable: Parameter): SExpr { + val rType = jmlBoundVariable.type.resolve() + return term.list(null, SmtType.BOOL, jmlBoundVariable.nameAsString, term.type(getType(rType))) + } + + override fun makeBoolean(value: Boolean) = term.makeBoolean(value) + + override fun getType(asPrimitive: ResolvedType): SmtType { + if (asPrimitive.isPrimitive) { + val rType: ResolvedPrimitiveType = asPrimitive.asPrimitive() + return getPrimitiveType(rType) + } + + if (asPrimitive.isArray) { + val aType: ResolvedArrayType = asPrimitive.asArrayType() + val cType: SmtType = getType(aType.componentType) + val intType: SmtType = getType(INT) + return SmtType.Array(intType, cType) + } + + if (asPrimitive.isReferenceType) { + return SmtType.JAVA_OBJECT + } + + throw RuntimeException("Unsupported type") + } + + override fun arrayLength(obj: SExpr): SExpr { + return term.list(INT, SmtType.BV32, term.symbol("bv\$length"), obj) + } + + override fun makeInt(i: Long): SExpr { + return makeInt(BigInteger.valueOf(i)) + } + + override fun makeVar(rtype: ResolvedType): SExpr { + TODO("Not yet implemented") + } + + open fun getPrimitiveType(rType: ResolvedPrimitiveType) = + when (rType) { + BOOLEAN -> SmtType.BOOL + BYTE -> SmtType.BV8 + SHORT -> SmtType.BV16 + CHAR -> SmtType.BV16 + INT -> SmtType.BV32 + LONG -> SmtType.BV64 + FLOAT -> SmtType.FP32 + DOUBLE -> SmtType.FP64 + } + + companion object { + private val term: SmtTermFactory = SmtTermFactory + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/IntArithmeticTranslator.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/IntArithmeticTranslator.kt new file mode 100644 index 0000000000..e4e7f4e2f0 --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/IntArithmeticTranslator.kt @@ -0,0 +1,48 @@ +package io.github.jmltoolkit.smt + +import com.github.javaparser.ast.expr.CharLiteralExpr +import com.github.javaparser.ast.expr.IntegerLiteralExpr +import com.github.javaparser.ast.expr.LongLiteralExpr +import com.github.javaparser.resolution.types.ResolvedPrimitiveType +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.model.SmtType +import java.math.BigInteger + +/** + * @author Alexander Weigl + * @version 1 (07.08.22) + */ +class IntArithmeticTranslator(smtLog: SmtQuery) : BitVectorArithmeticTranslator((smtLog)) { + private val term: SmtTermFactory = SmtTermFactory + + override fun makeChar(n: CharLiteralExpr): SExpr { + return term.makeInt("" + n.asChar().code) + } + + override fun makeLong(n: LongLiteralExpr): SExpr { + return term.makeInt("" + n.value) + } + + override fun makeInt(n: IntegerLiteralExpr): SExpr { + return term.makeInt("" + n.value) + } + + override fun makeInt(i: BigInteger): SExpr { + return term.makeInt(i.toString()) + } + + override fun makeIntVar(): SExpr { + val name = "__RAND_" + (++cnt) + smtLog.declareConst(name, SmtType.BV32) + return term.symbol(name) + } + + override fun getPrimitiveType(rType: ResolvedPrimitiveType) = when (rType) { + ResolvedPrimitiveType.FLOAT, ResolvedPrimitiveType.DOUBLE -> SmtType.REAL + else -> SmtType.INT + } + + override fun arrayLength(obj: SExpr): SExpr { + return term.list(ResolvedPrimitiveType.INT, SmtType.INT, term.symbol("int\$length"), obj) + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/JmlExpr2Smt.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/JmlExpr2Smt.kt new file mode 100644 index 0000000000..86632ec81e --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/JmlExpr2Smt.kt @@ -0,0 +1,360 @@ +package io.github.jmltoolkit.smt + +import com.github.javaparser.ast.ArrayCreationLevel +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.body.Parameter +import com.github.javaparser.ast.expr.* +import com.github.javaparser.ast.jml.NodeWithContracts +import com.github.javaparser.ast.jml.expr.* +import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr.JmlDefaultBinder +import com.github.javaparser.ast.visitor.GenericVisitorAdapter +import io.github.jmltoolkit.smt.model.SAtom +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.model.SmtType +import io.github.jmltoolkit.utils.JMLUtils +import java.math.BigInteger +import kotlin.jvm.optionals.getOrNull + +/** + * @author Alexander Weigl + * @version 1 (01.07.22) + */ +class JmlExpr2Smt(private val smtLog: SmtQuery, val translator: ArithmeticTranslator) : + GenericVisitorAdapter() { + + private val boundedVars = VariableStack() + + override fun visit(n: ArrayAccessExpr, arg: Any?): SExpr { + val array = n.name.accept(this, arg) + val index = n.index.accept(this, arg) + val rtype = n.calculateResolvedType() + val stypes = translator.getType(rtype) + return termFactory.select(stypes, rtype, array, index) + } + + override fun visit(n: ArrayCreationExpr, arg: Any?): SExpr? { + if (n.initializer.isPresent) + return n.initializer.get().accept(this, arg) + + val name = "anon_array_" + (++anonCnt) + val rType = n.calculateResolvedType() + val type = translator.getType(rType) + smtLog.declareConst(name, type) + val variable: SExpr = termFactory.variable(type, rType, name) + val zero: SExpr = translator.makeInt(BigInteger.ZERO) + val arrayLength: SExpr = translator.arrayLength(variable) + + val boundedVars = ArrayList() + var accessLevel: SExpr = variable + for (i in 0 until n.levels.size) { + val level: ArrayCreationLevel = n.levels[i] + if (i == 0) { + if (level.dimension.isPresent) { + val length: SExpr = level.dimension.get().accept(this, arg)!! + smtLog.addAssert(termFactory.equality(arrayLength, length)) + } else { + smtLog.addAssert(termFactory.lessOrEquals(zero, arrayLength, true)) + } + } else { + if (level.dimension.isPresent) { + val length: SExpr = level.dimension.get().accept(this, arg)!! + smtLog.addAssert( + termFactory.forall( + boundedVars, + termFactory.equality(translator.arrayLength(accessLevel), length) + ) + ) + } else { + smtLog.addAssert( + termFactory.forall( + boundedVars, + termFactory.lessOrEquals(zero, translator.arrayLength(accessLevel), true) + ) + ) + } + } + boundedVars.add(termFactory.binder(SmtType.INT, "idx$i")) + accessLevel = termFactory.select( + SmtType.JAVA_OBJECT, null, accessLevel, + termFactory.variable(SmtType.INT, null, "idx$i") + ) + } + return variable + } + + override fun visit(n: ArrayInitializerExpr, arg: Any?): SExpr { + val name = "anon_array_" + (++anonCnt) + val seq = n.values.map { it.accept(this, arg) } + val myType: SmtType.Array = SmtType.Array(SmtType.INT, seq.first().smtType!!) + smtLog.declareConst(name, myType) + val `var`: SExpr = termFactory.variable(myType, null, name) + for (i in seq.indices) { + smtLog.addAssert( //(store ary idx sub) + termFactory.store(`var`, translator.makeInt(i.toLong()), seq[i]) + ) + } + + val zero: SExpr = translator.makeInt(0) + val length: SExpr = translator.arrayLength(`var`) + smtLog.addAssert(termFactory.equality(length, translator.makeInt(n.values.size.toLong()))) + return `var` + } + + override fun visit(n: AssignExpr?, arg: Any?): SExpr? { + return super.visit(n, arg) + } + + override fun visit(n: BinaryExpr, arg: Any?): SExpr { + val left = n.left.accept(this, arg) + val right = n.right.accept(this, arg) + return translator.binary(n.operator, left, right) + } + + override fun visit(n: ThisExpr?, arg: Any?): SExpr { + return termFactory.makeThis() + } + + override fun visit(n: SuperExpr?, arg: Any?): SExpr { + return termFactory.makeSuper() + } + + override fun visit(n: NameExpr, arg: Any?): SExpr { + val resolved = n.resolve() + val rType = resolved.type + val type: SmtType = translator.getType(rType) + if (!isBound(n.nameAsString)) { + smtLog.declareConst(n.nameAsString, type) + } + return termFactory.variable(type, rType, n.nameAsString) + } + + private fun isBound(nameAsString: String): Boolean { + return boundedVars.contains(nameAsString) + } + + + override fun visit(n: NullLiteralExpr?, arg: Any?): SExpr { + return termFactory.makeNull() + } + + override fun visit(n: BooleanLiteralExpr, arg: Any?): SExpr { + return translator.makeBoolean(n.value) + } + + override fun visit(n: CastExpr?, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: CharLiteralExpr, arg: Any?): SExpr { + return translator.makeChar(n) + } + + override fun visit(n: ClassExpr?, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: ConditionalExpr, arg: Any?): SExpr { + return termFactory.ite( + n.condition.accept(this, arg), + n.thenExpr.accept(this, arg), + n.elseExpr.accept(this, arg) + ) + } + + override fun visit(n: DoubleLiteralExpr?, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: FieldAccessExpr, arg: Any?): SExpr { + val scopeType = n.scope.calculateResolvedType() + val javaType = n.calculateResolvedType() + val stype: SmtType = translator.getType(javaType) + val obj: SExpr = n.scope.accept(this, arg) + + if (n.nameAsString.equals("length") && scopeType.isArray) { + return translator.arrayLength(obj) + } + + return termFactory.fieldAccess(javaType, stype, n.nameAsString, obj) + } + + override fun visit(n: InstanceOfExpr, arg: Any?): SExpr { + val leftType = n.expression.calculateResolvedType() + val rightType = n.type.resolve() + + //TODO weigl return leftType.asReferenceType() + //Pattern matching + return termFactory.makeTrue() + } + + override fun visit(n: IntegerLiteralExpr, arg: Any?): SExpr { + return translator.makeInt(n) + } + + override fun visit(n: LongLiteralExpr, arg: Any?): SExpr { + return translator.makeLong(n) + } + + override fun visit(n: MethodCallExpr, arg: Any?): SExpr { + val method = n.resolve() + val variable: SExpr = translator.makeVar(method.returnType) + val ast = method.toAst().getOrNull() + if (ast is NodeWithContracts<*>) { + val contract = JMLUtils.createJointContract(ast.contracts) + //TODO weigl add assertion for the return variable + //TODO weigl add assertion for each parameter + // smtLog.addAssert(); + } + return variable + } + + private var anonCnt: Int = 0 + + override fun visit(n: ObjectCreationExpr?, arg: Any?): SExpr { + val name = "anon" + (++anonCnt) + smtLog.declareConst(name, SmtType.JAVA_OBJECT) + val `var`: SExpr = termFactory.variable(SmtType.JAVA_OBJECT, null, name) + smtLog.addAssert(termFactory.nonNull(`var`)) + return `var` + } + + override fun visit(n: StringLiteralExpr, arg: Any?): SExpr { + return SAtom(SmtType.STRING, null, ("\"" + n.asString()).toString() + "\"") + } + + override fun visit(n: UnaryExpr, arg: Any?): SExpr { + return translator.unary(n.operator, n.expression.accept(this, arg)) + } + + override fun visit(n: LambdaExpr?, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: TypeExpr?, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: SwitchExpr?, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: TextBlockLiteralExpr, arg: Any?): SExpr { + return SAtom(SmtType.STRING, null, ("\"" + n.asString()).toString() + "\"") + } + + + override fun visit(n: RecordPatternExpr, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: TypePatternExpr, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: JmlQuantifiedExpr, arg: Any?): SExpr? { + return boundedVars.bind(n.variables) { + when (n.binder as JmlDefaultBinder) { + JmlDefaultBinder.FORALL -> { + val e: Expression = + if (n.expressions.size == 2 + ) BinaryExpr( + n.expressions[0], + n.expressions[1], + BinaryExpr.Operator.IMPLICATION + ) + else n.expressions[0] + e.setParentNode(n) + return@bind termFactory.forall( + translator.getVariable(n.variables), + e.accept(this, arg) + ) + } + + JmlDefaultBinder.EXISTS -> { + val e1: Expression = + if (n.expressions.size == 2 + ) BinaryExpr(n.expressions[0], n.expressions[1], BinaryExpr.Operator.AND) + else n.expressions[0] + e1.setParentNode(n) + return@bind termFactory.forall( + translator.getVariable(n.variables), + e1.accept(this, arg) + ) + } + + JmlDefaultBinder.BSUM, JmlDefaultBinder.MIN, JmlDefaultBinder.MAX, JmlDefaultBinder.PRODUCT -> + return@bind translator.makeIntVar() + + else -> return@bind null + } + } + } + + override fun visit(n: JmlLabelExpr, arg: Any?): SExpr { + return n.expression.accept(this, arg) + } + + override fun visit(n: JmlLetExpr, arg: Any?): SExpr { + return boundedVars.bind(n.variables) { + val vars = mutableListOf() + for (variable in n.variables.variables) { + vars.add( + termFactory.list( + null, SmtType.BOOL, variable.nameAsString, + variable.initializer.get().accept(this, arg) + ) + ) + } + val body: SExpr = n.body.accept(this, arg) + return@bind termFactory.let(vars, body) + } + } + + override fun visit(n: JmlMultiCompareExpr, arg: Any?): SExpr { + return JMLUtils.unroll(n).accept(this, arg) + } + + override fun visit(n: JmlBinaryInfixExpr, arg: Any?): SExpr { + val left: SExpr = n.left.accept(this, arg) + val right: SExpr = n.right.accept(this, arg) + return termFactory.list(null, SmtType.BOOL, n.operator.identifier, left, right) + } + + override fun visit(n: JmlTypeExpr?, arg: Any?): SExpr { + return super.visit(n, arg) + } + + companion object { + private val termFactory: SmtTermFactory = SmtTermFactory + } +} + +internal class VariableStack { + private val seq = ArrayList(16) + + fun bind(variables: VariableDeclarationExpr, block: () -> T): T { + val curPosition = seq.size + for (variable in variables.variables) seq.add(variable.nameAsString) + val v = block() + truncate(curPosition) + return v + } + + fun bind(variables: NodeList, block: () -> T): T { + val curPosition = seq.size + for (variable in variables) seq.add(variable.nameAsString) + val value = block() + truncate(curPosition) + return value + } + + private fun truncate(curPosition: Int) { + while (seq.size > curPosition) { + seq.removeAt(seq.size - 1) + } + } + + fun contains(nameAsString: String): Boolean { + return seq.contains(nameAsString) + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SMTFacade.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SMTFacade.kt new file mode 100644 index 0000000000..6615274acf --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SMTFacade.kt @@ -0,0 +1,18 @@ +package io.github.jmltoolkit.smt + +import com.github.javaparser.ast.expr.Expression +import io.github.jmltoolkit.smt.model.SExpr + +/** + * @author Alexander Weigl + * @version 1 (07.08.22) + */ +object SMTFacade { + fun toSmt(expr: Expression, smtLog: SmtQuery, useInt: Boolean): SExpr { + val visitor = JmlExpr2Smt( + smtLog, if (useInt) IntArithmeticTranslator(smtLog) + else BitVectorArithmeticTranslator(smtLog) + ) + return expr.accept(visitor, null) + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SmtQuery.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SmtQuery.kt new file mode 100644 index 0000000000..1e86cdf8dc --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SmtQuery.kt @@ -0,0 +1,87 @@ +package io.github.jmltoolkit.smt + +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.model.SmtType +import io.github.jmltoolkit.smt.solver.AppendableTo +import java.io.PrintWriter +import java.io.StringWriter +import java.util.function.Consumer + +/** + * @author Alexander Weigl + * @version 1 (07.08.22) + */ +class SmtQuery : AppendableTo { + private val commands: MutableList = ArrayList(1024) + private val variableStack: MutableList> = ArrayList() + + init { + variableStack.add(HashMap()) + } + + fun declareConst(name: String, type: SmtType): Boolean { + if (!declared(name)) { + val a = term.list( + null, SmtType.COMMAND, + "declare-const", name, term.type(type) + ) + commands.add(a) + currentFrame[name] = type + return true + } + return false + } + + fun push() { + variableStack.add(HashMap()) + commands.add(term.command("push")) + } + + fun pop() { + variableStack.remove(currentFrame) + commands.add(term.command("pop")) + } + + private fun declared(name: String): Boolean { + return currentFrame.containsKey(name) + } + + private val currentFrame + get() = variableStack[variableStack.size - 1] + + override fun appendTo(writer: PrintWriter) { + for (command in commands) { + command.appendTo(writer) + writer.println() + } + } + + + fun defineThis() { + declareConst("this", SmtType.JAVA_OBJECT) + addAssert(term.nonNull(term.variable(SmtType.JAVA_OBJECT, null, "this"))) + } + + fun addAssert(nonNull: SExpr) { + commands.add(term.command("assert", nonNull)) + } + + fun checkSat() { + commands.add(term.command("check-sat")) + } + + + override fun toString(): String { + val sw = StringWriter() + val pw = PrintWriter(sw) + commands.forEach(Consumer { a: SExpr -> + a.appendTo(pw) + pw.println() + }) + return sw.toString() + } + + companion object { + private val term: SmtTermFactory = SmtTermFactory + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SmtTermFactory.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SmtTermFactory.kt new file mode 100644 index 0000000000..9638dfabb1 --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/SmtTermFactory.kt @@ -0,0 +1,378 @@ +package io.github.jmltoolkit.smt + +import com.github.javaparser.resolution.types.ResolvedPrimitiveType.BOOLEAN +import com.github.javaparser.resolution.types.ResolvedPrimitiveType.INT +import com.github.javaparser.resolution.types.ResolvedType +import com.google.common.cache.Cache +import com.google.common.cache.CacheBuilder +import io.github.jmltoolkit.smt.model.SAtom +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.model.SList +import io.github.jmltoolkit.smt.model.SmtType +import io.github.jmltoolkit.smt.model.SmtType.BitVec +import java.math.BigInteger + +/** + * @author Alexander Weigl + * @version 1 (07.08.22) + */ +object SmtTermFactory { + private val symbolAndValueCache: Cache = CacheBuilder.newBuilder().softValues().build() + + //region boolean operators + fun and(vararg terms: SExpr): SExpr = and(terms.toList()) + fun and(seq: List): SExpr = fnApply(BOOLEAN, SmtType.BOOL, "and", seq) + + fun or(vararg terms: SExpr): SExpr = or(terms.toList()) + fun or(terms: List) = fnApply(BOOLEAN, SmtType.BOOL, "or", terms) + + fun impl(premise: SExpr, concl: SExpr): SExpr = fnApply(BOOLEAN, SmtType.BOOL, "=>", premise, concl) + + //endregion + fun ite(cond: SExpr, then: SExpr, otherwise: SExpr): SExpr = + fnApply(then.javaType!!, then.smtType!!, "ite", cond, then, otherwise) + + fun fnApply(javaType: ResolvedType?, smtType: SmtType, fn: String, arg: SExpr): SExpr = + SList(smtType, javaType, listOf(symbol(fn), arg)) + + private fun fnApply(javaType: ResolvedType?, smtType: SmtType, fn: String, arg1: SExpr, arg2: SExpr): SExpr = + SList(smtType, javaType, listOf(symbol(fn), arg1, arg2)) + + private fun fnApply( + javaType: ResolvedType?, + smtType: SmtType, + fn: String, + arg1: SExpr, + arg2: SExpr, + arg3: SExpr + ): SExpr = SList(smtType, javaType, listOf(symbol(fn), arg1, arg2, arg3)) + + private fun fnApply(javaType: ResolvedType?, smtType: SmtType, fn: String, args: List): SExpr { + val nargs = mutableListOf(symbol(fn)) + nargs.addAll(args) + return SList(smtType, javaType, nargs) + } + + fun symbol(fn: String): SAtom = symbolAndValueCache.get(fn) { SAtom(SmtType.SYMBOL, null, fn) } + + fun forall(variables: List, formula: SExpr): SExpr = + fnApply(BOOLEAN, SmtType.BOOL, "forall", list(variables), formula) + + fun exists(variables: List, formula: SExpr): SExpr = + fnApply(BOOLEAN, SmtType.BOOL, "exists", list(variables), formula) + + + fun list(javaType: ResolvedType, smtType: SmtType, symbol: SAtom, args: Array): SExpr { + val nargs = mutableListOf() + nargs.add(symbol) + nargs.addAll(args) + return SList(smtType, javaType, nargs) + } + + //TODO weigl correct? + fun list(variables: List): SExpr { + return SList(null, null, listOf()) + } + + //region polymorphic operators + fun bor(left: SExpr, right: SExpr): SExpr { + if (isBool(left, right)) return or(left, right) + if (isBv(left, right)) return bvor(left, right) + return typeException() + } + + + fun add(left: SExpr, right: SExpr): SExpr { + if (isInt(left, right)) return iadd(left, right) + if (isBv(left, right)) return bvadd(left, right) + return typeException() + } + + fun subtract(left: SExpr, right: SExpr): SExpr { + if (isInt(left, right)) return isubstract(left, right) + if (isBv(left, right)) return bvsubstract(left, right) + return typeException() + } + + fun modulo(left: SExpr, right: SExpr, b: Boolean): SExpr { + if (isInt(left, right)) return imodulo(left, right) + if (isBv(left, right)) return bvmodulo(left, right) + return typeException() + } + + fun shiftLeft(left: SExpr, right: SExpr): SExpr { + if (isBv(left, right)) return bvshiftLeft(left, right) + return typeException() + } + + + fun shiftRight(left: SExpr, right: SExpr, sign: Boolean): SExpr { + if (isBv(left, right)) return bvshiftRight(left, right, sign) + return typeException() + } + + fun lessOrEquals(left: SExpr, right: SExpr, sign: Boolean): SExpr { + if (isInt(left, right)) return ilessOrEquals(left, right) + if (isBv(left, right)) return bvlessOrEquals(left, right) + return typeException("Could not handle types '%s <= %s'", left.smtType, right.smtType) + } + + fun greaterOrEquals(left: SExpr, right: SExpr, b: Boolean): SExpr { + if (isInt(left, right)) return igreaterOrEquals(left, right) + if (isBv(left, right)) return bvgreaterOrEquals(left, right) + return typeException() + } + + fun lessThan(left: SExpr, right: SExpr): SExpr { + if (isInt(left, right)) return ilessThan(left, right) + if (isBv(left, right)) return bvlessThan(left, right) + return typeException("Could not handle types '%s <%s'", left.smtType!!, right.smtType!!) + } + + fun equiv(left: SExpr, right: SExpr): SExpr = fnApply(BOOLEAN, SmtType.BOOL, "=", left, right) + + fun not(expr: SExpr): SExpr { + if (isBv(expr)) return bvnot(expr) + if (isBool(expr)) return fnApply(BOOLEAN, SmtType.BOOL, "not", expr) + return typeException() + } + + + fun xor(left: SExpr, right: SExpr): SExpr = fnApply(BOOLEAN, SmtType.BOOL, "xor", left, right) + + fun equality(left: SExpr, right: SExpr): SExpr = fnApply(BOOLEAN, SmtType.BOOL, "=", left, right) + + fun band(left: SExpr, right: SExpr): SExpr { + if (isBool(left, right)) return and(left, right) + + if (isBv(left, right)) return bvand(left, right) + + return typeException() + } + + + private fun fnApplyToBool(symbol: String, left: SExpr, right: SExpr): SExpr = + fnApply(BOOLEAN, SmtType.BOOL, symbol, left, right) + + fun greaterThan(left: SExpr, right: SExpr): SExpr { + if (isInt(left, right)) return igreaterThan(left, right) + if (isBv(left, right)) return bvgreaterThan(left, right) + return typeException("Could not handle types '%s > %s'", left.smtType, right.smtType) + } + + + fun negate(sexpr: SExpr): SExpr { + if (isBool(sexpr)) return not(sexpr) + if (isBv(sexpr)) return bvnegate(sexpr) + return typeException() + } + + + fun multiply(left: SExpr, right: SExpr): SExpr { + if (isInt(left, right)) return imultiply(left, right) + if (isBv(left, right)) return bvmultiply(left, right) + return typeException() + } + + fun divide(left: SExpr, right: SExpr, b: Boolean): SExpr { + if (isInt(left, right)) return idivide(left, right) + if (isBv(left, right)) return bvdivide(left, right) + return typeException() + } + + + //endregion + //region integer operations + fun intValue(svalue: String): SAtom = symbolAndValueCache.get(svalue) { SAtom(SmtType.INT, INT, svalue) } + + fun intValue(value: Long): SAtom = intValue("" + value) + + fun intValue(value: BigInteger): SAtom = intValue("" + value) + + fun iadd(left: SExpr, right: SExpr): SExpr = fnApplyToInt("+", left, right) + + fun ilessThan(left: SExpr, right: SExpr): SExpr = fnApplyToBool("<", left, right) + + fun ilessOrEquals(left: SExpr, right: SExpr): SExpr = fnApplyToBool("<=", left, right) + + fun igreaterThan(left: SExpr, right: SExpr): SExpr = fnApplyToBool(">", left, right) + + fun igreaterOrEquals(left: SExpr, right: SExpr): SExpr = fnApplyToBool(">=", left, right) + + fun isubstract(left: SExpr, right: SExpr): SExpr = fnApplyToInt("-", left, right) + + fun imultiply(left: SExpr, right: SExpr): SExpr = fnApplyToInt("*", left, right) + + fun intType(): SExpr = symbol("Int") + + fun imodulo(left: SExpr, right: SExpr): SExpr = fnApplyToInt("mod", left, right) + + fun idivide(left: SExpr, right: SExpr): SExpr = fnApplyToInt("/", left, right) + + //endregion + //region bit vectors + fun bvor(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvor", left, right) + + fun bvnot(expr: SExpr): SExpr = fnApplyToBV("bvnot", expr) + + fun bvnegate(sexpr: SExpr): SExpr = fnApplyToBV("bvneg", sexpr) + + fun bvlessThan(left: SExpr, right: SExpr): SExpr = fnApplyToBool("bvslt", left, right) + + fun bvlessOrEquals(left: SExpr, right: SExpr): SExpr = fnApplyToBool("bvsle", left, right) + + fun bvgreaterThan(left: SExpr, right: SExpr): SExpr = fnApplyToBool("bvsgt", left, right) + + fun bvgreaterOrEquals(left: SExpr, right: SExpr): SExpr = fnApplyToBool("bvsge", left, right) + + fun bvshiftRight(left: SExpr, right: SExpr, sign: Boolean): SExpr = + fnApplyToBV(if (sign) "bvashr" else "bvshr", left, right) + + fun bvshiftLeft(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvshl", left, right) + + fun bvand(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvand", left, right) + + fun bvadd(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvadd", left, right) + + private fun bvsubstract(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvsub", left, right) + + private fun bvmultiply(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvmul", left, right) + + private fun bvdivide(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvsdiv", left, right) + + private fun bvmodulo(left: SExpr, right: SExpr): SExpr = fnApplyToBV("bvsrem", left, right) + + private fun fnApplyToBV(symbol: String, left: SExpr): SExpr = fnApply(null, left.smtType!!, symbol, left) + + + fun makeBitvector(width: Int, value: Long): SExpr = makeBitvector(width, BigInteger.valueOf(value)) + + + fun makeBitvector(width: Int, value: BigInteger): SExpr { + val type = SmtType.getBitVec(width) + return SList( + type, null, + listOf( + SList(null, null, listOf(symbol("_"), symbol("int2bv"), symbol("" + width))), + intValue(value) + ) + ) + } + + + fun bvType(width: Int): SExpr = + SList(SmtType.TYPE, null, listOf(symbol("_"), symbol("BitVec"), intValue(width.toLong()))) + + //endregion + private fun isBool(sexpr: SExpr): Boolean = sexpr.smtType == SmtType.BOOL + + private fun isBool(left: SExpr, right: SExpr): Boolean = left.smtType === right.smtType && isBool(left) + + private fun isBv(left: SExpr, right: SExpr): Boolean = left.smtType === right.smtType && isBv(left) + + private fun isBv(left: SExpr): Boolean = left.smtType is BitVec + + private fun isInt(left: SExpr, right: SExpr): Boolean = left.smtType === right.smtType && isInt(left) + + private fun isInt(left: SExpr): Boolean = left.smtType === SmtType.INT + + private fun typeException(): SExpr { + throw RuntimeException("Type mismatch!") + } + + + private fun fnApplyToInt(symbol: String, left: SExpr, right: SExpr): SExpr = + fnApply(INT, SmtType.INT, symbol, left, right) + + private fun fnApplyToBV(symbol: String, left: SExpr, right: SExpr): SExpr = + fnApply(null, left.smtType!!, symbol, left, right) + + + fun fpType(width: Int): SExpr = + SList(SmtType.TYPE, null, listOf(symbol("_"), symbol("FloatingPoint"), intValue(width.toLong()))) + + fun arrayType(from: SExpr, to: SExpr): SExpr = SList(SmtType.TYPE, null, listOf(symbol("Array"), from, to)) + + + fun list(javaType: ResolvedType?, stype: SmtType, vararg args: Any): SExpr { + val nargs = mutableListOf() + for (i in args.indices) { + val arg = args[i] + nargs.add( + when (arg) { + is SExpr -> arg + is String -> symbol(arg) + else -> typeException("Unhandled type %s", arg.javaClass) + } + ) + } + return SList(stype, javaType, nargs) + } + + fun makeTrue(): SExpr = makeBoolean(true) + + + fun makeFalse(): SExpr = makeBoolean(false) + + fun makeBoolean(value: Boolean): SExpr { + val v = if (value) "true" else "false" + return symbolAndValueCache.get(v) { SAtom(SmtType.BOOL, BOOLEAN, v) } + } + + fun makeInt(value: String): SExpr = intValue(value) + + fun makeNull(): SExpr = symbol("null") + + fun makeThis(): SExpr = symbol("this") + + fun makeSuper(): SExpr = symbol("super") + + fun boolType(): SExpr = symbol("Bool") + + fun javaObjectType(): SExpr = symbol("Object") + + fun type(type: SmtType): SExpr { + if (type === SmtType.JAVA_OBJECT) return javaObjectType() + if (type === SmtType.INT) return intType() + if (type === SmtType.REAL) return realType() + if (type === SmtType.FP32) return fpType(32) + if (type === SmtType.FP64) return fpType(64) + if (type === SmtType.BOOL) return boolType() + if (type is SmtType.Array) return arrayType( + type(type.from), + type(type.to) + ) + if (type is BitVec) return bvType(type.width) + + return typeException() + } + + + private fun realType(): SExpr = symbol("Int") + + fun variable(type: SmtType, javaType: ResolvedType?, name: String): SExpr = + //nocache, conflict in type could be created + SAtom(type, javaType, name) + + fun command(symbol: String, vararg args: SExpr): SExpr = + fnApply(null, SmtType.COMMAND, symbol, args.toList()) + + fun select(stype: SmtType, javaType: ResolvedType?, array: SExpr, index: SExpr): SExpr = + list(javaType, stype, symbol("select"), array, index) + + fun store(array: SExpr, index: SExpr, value: SExpr): SExpr = + list(array.javaType, array.smtType!!, symbol("store"), array, index, value) + + fun fieldAccess(javaType: ResolvedType?, stype: SmtType, field: String, obj: SExpr): SExpr = + fnApply(javaType, stype, field, obj) + + private fun typeException(fmt: String, vararg args: Any?): SExpr { + throw RuntimeException(String.format(fmt, *args)) + } + + fun let(vars: List, body: SExpr): SExpr = list(body.javaType, body.smtType!!, "let", list(vars), body) + + fun nonNull(expr: SExpr): SExpr = not(equality(expr, makeNull())) + + fun binder(type: SmtType, name: String): SExpr = list(null, SmtType.JAVA_OBJECT, name, type(type)) +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/Z3.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/Z3.kt new file mode 100644 index 0000000000..4f716c01f0 --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/Z3.kt @@ -0,0 +1,18 @@ +package io.github.jmltoolkit.smt + +/** + * + * @author Alexander Weigl + * @version 1 (28.01.24) + */ +object Z3 { + private var z3Installed: Boolean? = null + fun z3Installed(): Boolean { + if (z3Installed != null) return z3Installed!! + try { + return (ProcessBuilder("sh", "-c", "which z3").start().waitFor() == 0).also { z3Installed = it } + } catch (e: Exception) { + } + return false.also { z3Installed = it } + } +} \ No newline at end of file diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SAtom.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SAtom.kt new file mode 100644 index 0000000000..224af312ec --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SAtom.kt @@ -0,0 +1,14 @@ +package io.github.jmltoolkit.smt.model + +import com.github.javaparser.resolution.types.ResolvedType +import java.io.PrintWriter + +/** + * @author Alexander Weigl + * @version 1 (07.08.22) + */ +class SAtom(stype: SmtType?, javaType: ResolvedType?, val value: String) : SExpr(javaType, stype) { + override fun appendTo(writer: PrintWriter) { + writer.write(value) + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SExpr.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SExpr.kt new file mode 100644 index 0000000000..2ee0dc3f57 --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SExpr.kt @@ -0,0 +1,30 @@ +package io.github.jmltoolkit.smt.model + +import com.github.javaparser.resolution.types.ResolvedType +import io.github.jmltoolkit.smt.solver.AppendableTo +import java.io.PrintWriter +import java.io.StringWriter + +/** + * @author Alexander Weigl + * @version 1 (07.08.22) + */ +abstract class SExpr( + var javaType: ResolvedType? = null, + var smtType: SmtType? = null +) : AppendableTo { + + fun asList(): SList { + return this as SList + } + + fun asSymbolValue(): String { + return (this as SAtom).value + } + + override fun toString(): String { + val sw = StringWriter() + appendTo(PrintWriter(sw)) + return sw.toString() + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SList.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SList.kt new file mode 100644 index 0000000000..7192796a61 --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SList.kt @@ -0,0 +1,23 @@ +package io.github.jmltoolkit.smt.model + +import com.github.javaparser.resolution.types.ResolvedType +import java.io.PrintWriter + +/** + * @author Alexander Weigl + * @version 1 (07.08.22) + */ +class SList(stype: SmtType?, javaType: ResolvedType?, private val value: List) : SExpr(javaType, stype) { + override fun appendTo(writer: PrintWriter) { + writer.write('('.code) + for (i in value.indices) { + value[i].appendTo(writer) + if (i < value.size - 1) writer.write(' '.code) + } + writer.write(')'.code) + } + + fun get(i: Int): SExpr { + return value[i] + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SmtType.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SmtType.kt new file mode 100644 index 0000000000..24cf256c7d --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/model/SmtType.kt @@ -0,0 +1,38 @@ +package io.github.jmltoolkit.smt.model + +open class SmtType private constructor(private val name: String) { + class BitVec internal constructor(val width: Int) : SmtType("(_ BitVec $width)") + + + override fun toString(): String { + return name + } + + class Array(val from: SmtType, val to: SmtType) : SmtType("(Array " + from.name + " " + to.name + ")") + + companion object { + val FP32: SmtType = SmtType("(_ FloatingPoint 32)") + val FP64: SmtType = SmtType("(_ FloatingPoint 64)") + val STRING: SmtType = SmtType("String") + + private val bvCache: MutableMap = HashMap(8) + + val COMMAND: SmtType = SmtType("_COMMAND_") + val INT: SmtType = SmtType("Int") + val REAL: SmtType = SmtType("Real") + val BOOL: SmtType = SmtType("Bool") + val BV8: SmtType = getBitVec(8) + val BV16: SmtType = getBitVec(16) + val BV32: SmtType = getBitVec(32) + val BV64: SmtType = getBitVec(64) + val SYMBOL: SmtType = SmtType("_SYMBOL_") + val TYPE: SmtType = SmtType("_TYPE_") + + val JAVA_OBJECT: SmtType = SmtType("_TYPE_") + + + fun getBitVec(width: Int): BitVec { + return bvCache.computeIfAbsent(width) { width: Int -> BitVec(width) } + } + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/AppendableTo.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/AppendableTo.kt new file mode 100644 index 0000000000..8fbbf1c9dc --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/AppendableTo.kt @@ -0,0 +1,11 @@ +package io.github.jmltoolkit.smt.solver + +import java.io.PrintWriter + +/** + * @author Alexander Weigl + * @version 1 (08.08.22) + */ +fun interface AppendableTo { + fun appendTo(writer: PrintWriter) +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/SExprParser.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/SExprParser.kt new file mode 100644 index 0000000000..ab83575c1d --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/SExprParser.kt @@ -0,0 +1,173 @@ +package io.github.jmltoolkit.smt.solver + +import io.github.jmltoolkit.smt.model.SAtom +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.model.SList +import java.io.IOException +import java.io.PushbackReader +import java.io.Reader +import java.io.StringReader +import java.util.function.Predicate + +object SExprParser { + @Throws(IOException::class) + fun parse(input: String): SExpr? { + return parse(StringReader(input)) + } + + @Throws(IOException::class) + fun parse(reader: Reader): SExpr? { + return parse(PushbackReader(reader)) + } + + @Throws(IOException::class) + fun parse(reader: PushbackReader): SExpr? { + val eof = (-1).toChar().code + var c = peekChar(reader) + if (c == eof) // end of input + return null + else if (c == '('.code) { + consumeChar(reader) // consume '(' + val seq = arrayListOf() + do { + c = peekChar(reader) + if (c == ')'.code) { + consumeChar(reader) + break + } + val child: SExpr = parse(reader) ?: throw IllegalArgumentException("List not closed.") + seq.add(child) + } while (true) + return SList(null, null, listOf()) + } else if (Character.isDigit(c) || c == '-'.code) { + return parseNumber(reader) + } else if (Character.isAlphabetic(c) || c == ':'.code) { + return parseSymbol(reader) + } else if (c == '"'.code) { + return parseString(reader) + } else { + } + throw IllegalStateException(String.format("Unexpected character: %c (%d)", c, c)) + } + + @Throws(IOException::class) + private fun parseString(reader: PushbackReader): SExpr { + val symbol = StringBuilder("\"") + consumeChar(reader) + var c: Int + do { + c = reader.read() + if (c == -1) throw RuntimeException("String literal early aborted") + symbol.append(c.toChar()) + } while (c != '"'.code) + return SAtom(null, null, symbol.toString()) + } + + @Throws(IOException::class) + private fun consumeChar(reader: PushbackReader): Int { + return reader.read() + } + + @Throws(IOException::class) + private fun peekChar(reader: PushbackReader): Int { + consumeEmptiness(reader) + val c = reader.read() + reader.unread(c) + return c + } + + @Throws(IOException::class) + private fun consumeEmptiness(reader: PushbackReader) { + var c: Int + do { + consumeWhitespace(reader) + consumeComment(reader) + c = reader.read() + reader.unread(c) + } while (Character.isWhitespace(c) || c == ';'.code) + } + + @Throws(IOException::class) + private fun consumeWhitespace(reader: PushbackReader) { + consumeUntil(reader) { x: Int? -> + !Character.isWhitespace( + x!! + ) + } + } + + @Throws(IOException::class) + private fun consumeComment(reader: PushbackReader) { + val c: Int = reader.read() + if (c == ';'.code) { + consumeUntil(reader) { x: Int -> x != '\n'.code } + } else { + reader.unread(c) + } + } + + @Throws(IOException::class) + private fun consumeUntil(reader: PushbackReader, pred: Predicate): Int { + var c: Int + do { + c = reader.read() + } while (!pred.test(c) && c != -1) + reader.unread(c) + return c + } + + @Throws(IOException::class) + private fun parseNumber(reader: PushbackReader): SExpr { + var num = 0 + var factor = 1 + var c: Int = reader.read() + if (c == '-'.code) { + factor = -1 + } else { + reader.unread(c) + } + + do { + c = reader.read() + if (c == -1) break + if (c == ')'.code || Character.isWhitespace(c) || c == ':'.code) { + reader.unread(c) + break + } + if (Character.isDigit(c)) { + num = (num * 10) + (c - '0'.code) + } else { + throw IllegalStateException("Given number is invalid. Char " + c.toChar() + " found") + } + } while (true) + return SAtom(null, null, "" + (num * factor)) + } + + @Throws(IOException::class) + private fun parseSymbol(reader: PushbackReader): SExpr { + val symbol = StringBuilder() + do { + val c: Int = reader.read() + if (c == -1) break + if (c == ')'.code || Character.isWhitespace(c)) { + reader.unread(c) + break + } + symbol.append(c.toChar()) + } while (true) + return SAtom(null, null, symbol.toString()) + } + + @Throws(IOException::class) + fun parseAll(input: Reader): List { + val r = PushbackReader(input) + val exprs: MutableList = ArrayList(1024) + var c: Int + while ((r.read().also { c = it }) != -1) { + r.unread(c) + val sexpr: SExpr = parse(r) ?: break + exprs.add(sexpr) + } + return exprs + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/Solver.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/Solver.kt new file mode 100644 index 0000000000..b51fcf0d48 --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/Solver.kt @@ -0,0 +1,44 @@ +package io.github.jmltoolkit.smt.solver + +import java.io.IOException +import java.io.InputStreamReader +import java.io.PrintWriter +import java.util.concurrent.ForkJoinPool +import java.util.concurrent.ForkJoinTask + +/** + * @author Alexander Weigl + * @version 1 (08.08.22) + */ +class Solver { + fun runAsync(input: String): ForkJoinTask { + return ForkJoinPool.commonPool().submit { run(input) } + } + + @Throws(IOException::class) + fun run(input: String): SolverAnswer { + return run { writer: PrintWriter -> writer.println(input) } + } + + @Throws(IOException::class) + protected fun startSmtSolver(): Process { + val pb = ProcessBuilder("sh", "-c", "z3 -smt2 -in") + return pb.start() + } + + @Throws(IOException::class) + fun run(query: AppendableTo): SolverAnswer { + val p = startSmtSolver() + try { + PrintWriter(p.outputStream).use { out -> + InputStreamReader(p.inputStream).use { + query.appendTo(out) + out.close() + return SolverAnswer(SExprParser.parseAll(it)) + } + } + } finally { + p.destroyForcibly() + } + } +} diff --git a/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/SolverAnswer.kt b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/SolverAnswer.kt new file mode 100644 index 0000000000..a0981e21fe --- /dev/null +++ b/tools/smt/src/main/kotlin/io/github/jmltoolkit/smt/solver/SolverAnswer.kt @@ -0,0 +1,78 @@ +package io.github.jmltoolkit.smt.solver + +import io.github.jmltoolkit.smt.model.SAtom +import io.github.jmltoolkit.smt.model.SExpr +import java.io.PrintWriter +import java.io.StringWriter +import java.util.function.Consumer + +/** + * @author Alexander Weigl + * @version 1 (08.08.22) + */ +class SolverAnswer(private val answers: List) { + private var currentPos = 0 + fun expectSat(): SolverAnswer { + return expectSymbol("sat") + } + + fun expectUnsat(): SolverAnswer { + return expectSymbol("unsat") + } + + fun expectUnknown(): SolverAnswer { + return expectSymbol("unknown") + } + + fun expectSymbol(symbol: String): SolverAnswer { + if (!isSymbol(symbol)) { + throw RuntimeException("Unexpected symbol") + } + return this + } + + fun isSymbol(symbol: String): Boolean { + return symbol == (peek() as SAtom).value + } + + fun peek(): SExpr { + return answers[currentPos] + } + + fun consume() { + currentPos++ + } + + fun consumeErrors(): List { + val seq: MutableList = ArrayList() + while (currentPos < answers.size) { + if (isError) { + seq.add(errorMessage) + consume() + } else { + break + } + } + return seq + } + + private val errorMessage: String + get() = peek().asList().get(1).asSymbolValue() + + private val isError: Boolean + get() = try { + peek().asList().get(0).asSymbolValue().equals("error") + } catch (e: ClassCastException) { + false + } + + override fun toString(): String { + val sw = StringWriter() + val pw = PrintWriter(sw) + answers.forEach(Consumer { a: SExpr -> + a.appendTo(pw) + pw.println() + }) + return sw.toString() + } +} diff --git a/tools/smt/src/test/kotlin/SmtTest.kt b/tools/smt/src/test/kotlin/SmtTest.kt new file mode 100644 index 0000000000..455d45cc75 --- /dev/null +++ b/tools/smt/src/test/kotlin/SmtTest.kt @@ -0,0 +1,81 @@ +import com.github.javaparser.JavaParser +import com.github.javaparser.ParserConfiguration +import com.github.javaparser.Problem +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.expr.Expression +import com.github.javaparser.symbolsolver.JavaSymbolSolver +import com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver +import com.google.common.truth.Truth +import io.github.jmltoolkit.smt.SMTFacade +import io.github.jmltoolkit.smt.SmtQuery +import io.github.jmltoolkit.smt.model.SExpr +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.DynamicTest +import org.junit.jupiter.api.TestFactory +import org.junit.jupiter.api.function.Executable +import org.yaml.snakeyaml.Yaml +import java.io.PrintWriter +import java.io.StringWriter +import java.util.function.Consumer +import java.util.function.Function +import java.util.stream.Stream + +/** + * @author Alexander Weigl + * @version 1 (14.06.22) + */ +class SmtTest { + private val parser: JavaParser + private val parent: Node + + init { + val config = ParserConfiguration() + config.setSymbolResolver(JavaSymbolSolver(ClassLoaderTypeSolver(ClassLoader.getSystemClassLoader()))) + parser = JavaParser(config) + + val r = parser.parse(javaClass.getResourceAsStream("Test.java")) + if (!r.isSuccessful) { + r.problems.forEach(Consumer { x: Problem? -> System.err.println(x) }) + Assertions.fail("Error during parsing") + } + parent = r.result.get().getType(0) + } + + @TestFactory + fun smtTranslation(): Stream { + javaClass.getResourceAsStream("expr.yaml").use { inputStream -> + val yaml = Yaml() + val obj: List> = yaml.load(inputStream) + return obj.stream().map(Function, DynamicTest> { m: Map -> + val a = m["expr"] as String + val result = m["result"] as String? + val resultInt = m["resultInt"] as String? + val resultBv = m["resultBv"] as String? + DynamicTest.dynamicTest(a) { + if (resultInt != null) smtTranslation(a, resultInt, true) + if (resultBv != null) smtTranslation(a, resultBv, false) + if (result != null) smtTranslation(a, result, false) + } + }) + } + } + + fun smtTranslation(input: String?, expected: String, useInt: Boolean) { + val e = parser.parseJmlExpression(input) + if (!e.isSuccessful) { + e.problems.forEach(Consumer { x: Problem? -> System.err.println(x) }) + Assertions.fail("Error during parsing") + } + val expr = e.result.get() + expr.setParentNode(parent) + val smtLog = SmtQuery() + val actualExpr: SExpr = SMTFacade.toSmt(expr, smtLog, useInt) + + val sw = StringWriter() + val pw = PrintWriter(sw) + smtLog.appendTo(pw) + actualExpr.appendTo(pw) + val actual = sw.toString() + Truth.assertThat(actual.trim { it <= ' ' }).isEqualTo(expected.trim { it <= ' ' }) + } +} diff --git a/tools/smt/src/test/kotlin/SolverTest.kt b/tools/smt/src/test/kotlin/SolverTest.kt new file mode 100644 index 0000000000..e63df712d6 --- /dev/null +++ b/tools/smt/src/test/kotlin/SolverTest.kt @@ -0,0 +1,21 @@ +package io.github.jmltoolkit.smt + +import io.github.jmltoolkit.smt.solver.* +import org.junit.jupiter.api.Assumptions +import org.junit.jupiter.api.Test +import java.io.IOException + +/** + * @author Alexander Weigl + * @version 1 (08.08.22) + */ +class SolverTest { + @Test + @Throws(IOException::class) + fun startZ3Mini() { + Assumptions.assumeTrue(Z3.z3Installed()) + val s = Solver() + val result = s.run("(assert (= (* 2 3) 6)) (check-sat) (get-model) (exit)") + result.expectSat().consume() + } +} diff --git a/tools/smt/src/test/resources/Test.java b/tools/smt/src/test/resources/Test.java new file mode 100644 index 0000000000..019b6b7d2e --- /dev/null +++ b/tools/smt/src/test/resources/Test.java @@ -0,0 +1,5 @@ +public class Test { + Test self = new Test(); + Object a, b; + int[] ary; +} \ No newline at end of file diff --git a/tools/smt/src/test/resources/expr.yaml b/tools/smt/src/test/resources/expr.yaml new file mode 100644 index 0000000000..a0ae652812 --- /dev/null +++ b/tools/smt/src/test/resources/expr.yaml @@ -0,0 +1,91 @@ +- expr: | + true + result: | + true +- expr: | + 2 + 3 + resultBv: | + (bvadd ((_ int2bv 32) 2) ((_ int2bv 32) 3)) + resultInt: | + (+ 2 3) +- expr: | + a != null && b != null ==> a == b + result: | + (declare-const a Object) + (declare-const b Object) + (=> (and (not (= a null)) (not (= b null))) (= a b)) + +- expr: | + ary[2] == 2 + resultInt: | + (declare-const ary (Array Int Int)) + (= (select ary 2) 2) + resultBv: | + (declare-const ary (Array (_ BitVec 32) (_ BitVec 32))) + (= (select ary ((_ int2bv 32) 2)) ((_ int2bv 32) 2)) + +- expr: | + (\forall int i; 0<=i (and (<= 0 i) (< i (int$length ary))) (= (select ary i) i))) + resultBv: | + (declare-const ary (Array (_ BitVec 32) (_ BitVec 32))) + (forall ((i (_ BitVec 32))) (=> (and (bvsle ((_ int2bv 32) 0) i) (bvslt i (bv$length ary))) (= (select ary i) i))) + +- expr: | + this.self.self.ary[0] == 1 + resultInt: | + (= (select (ary (self (self this))) 0) 1) + +- expr: | + this.self.self.ary[0] == 1 + resultInt: | + (= (select (ary (self (self this))) 0) 1) + +- expr: | + (new int[] {1,2,3}).length == 3 + resultInt: | + (declare-const anon_array_1 (Array Int Int)) + (assert (store anon_array_1 0 1)) + (assert (store anon_array_1 1 2)) + (assert (store anon_array_1 2 3)) + (assert (= (int$length anon_array_1) 3)) + (= (int$length anon_array_1) 3) + +- expr: | + (new int[3]).length == 3 + resultInt: | + (declare-const anon_array_1 (Array Int Int)) + (assert (= (int$length anon_array_1) 3)) + (= (int$length anon_array_1) 3) + +- expr: | + (new int[3][2]).length == 3 + resultInt: | + (declare-const anon_array_1 (Array Int (Array Int Int))) + (assert (= (int$length anon_array_1) 3)) + (assert (forall ((idx0 Int)) (= (int$length (select anon_array_1 idx0)) 2))) + (= (int$length anon_array_1) 3) + +- expr: | + (\let int[][] x = { {1}, {2} }; x.length ) == 2 + resultInt: | + (declare-const anon_array_2 (Array Int Int)) + (assert (store anon_array_2 0 1)) + (assert (= (int$length anon_array_2) 1)) + (declare-const anon_array_3 (Array Int Int)) + (assert (store anon_array_3 0 2)) + (assert (= (int$length anon_array_3) 1)) + (declare-const anon_array_1 (Array Int (Array Int Int))) + (assert (store anon_array_1 0 anon_array_2)) + (assert (store anon_array_1 1 anon_array_3)) + (assert (= (int$length anon_array_1) 2)) + (= (let ((x anon_array_1)) (int$length x)) 2) + + + +- expr: | + (\let int x = 5; x) + resultInt: | + (let ((x 5)) x) diff --git a/tools/stat/build.gradle.kts b/tools/stat/build.gradle.kts new file mode 100644 index 0000000000..55d9eba3b3 --- /dev/null +++ b/tools/stat/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + id("standard-kotlin") +} + diff --git a/tools/stat/src/main/kotlin/io/github/jmltoolkit/stat/ExpressionCosts.kt b/tools/stat/src/main/kotlin/io/github/jmltoolkit/stat/ExpressionCosts.kt new file mode 100644 index 0000000000..5a8b9f6314 --- /dev/null +++ b/tools/stat/src/main/kotlin/io/github/jmltoolkit/stat/ExpressionCosts.kt @@ -0,0 +1,35 @@ +package io.github.jmltoolkit.stat + + +/** + * @author Alexander Weigl + * @version 1 (02.06.22) + */ +data class ExpressionCosts( + val sum: Int = 1, + val minus: Int = 1, + val divide: Int = 1, + val mult: Int = 1, + val mod: Int = 1, + val land: Int = 1, + val lor: Int = 1, + val lnot: Int = 1, + val band: Int = 1, + val bor: Int = 2, + val bnot: Int = 1, + val quantor: Int = 3, + val binderCostsPerVariable: Int = 1, + val nullLiteral: Int = 0, + val charLiteral: Int = 0, + val stringLiteral: Int = 0, + val integerLiteral: Int = 0, + val longLiteral: Int = 0, + val name: Int = 0, + val methodCall: Int = 2, + val conditional: Int = 2, + val cast: Int = 1, + val assign: Int = 1, + val let: Int = 1, + val compare: Int = 1, + val instanceof: Int = 1 +) \ No newline at end of file diff --git a/tools/stat/src/main/kotlin/io/github/jmltoolkit/stat/StatVisitor.kt b/tools/stat/src/main/kotlin/io/github/jmltoolkit/stat/StatVisitor.kt new file mode 100644 index 0000000000..58569b5412 --- /dev/null +++ b/tools/stat/src/main/kotlin/io/github/jmltoolkit/stat/StatVisitor.kt @@ -0,0 +1,436 @@ +package io.github.jmltoolkit.stat + +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.body.* +import com.github.javaparser.ast.expr.* +import com.github.javaparser.ast.jml.NodeWithJmlTags +import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration +import com.github.javaparser.ast.jml.body.JmlFieldDeclaration +import com.github.javaparser.ast.jml.body.JmlMethodDeclaration +import com.github.javaparser.ast.jml.body.JmlRepresentsDeclaration +import com.github.javaparser.ast.jml.clauses.* +import com.github.javaparser.ast.jml.doc.* +import com.github.javaparser.ast.jml.expr.* +import com.github.javaparser.ast.jml.stmt.* +import com.github.javaparser.ast.modules.ModuleDeclaration +import com.github.javaparser.ast.nodeTypes.NodeWithModifiers +import com.github.javaparser.ast.nodeTypes.NodeWithName +import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName +import com.github.javaparser.ast.stmt.LocalClassDeclarationStmt +import com.github.javaparser.ast.visitor.GenericVisitorAdapter +import com.github.javaparser.ast.visitor.VoidVisitorAdapter +import com.github.javaparser.jml.JmlDocSanitizer +import org.w3c.dom.Document +import org.w3c.dom.Element +import java.util.* + +/** + * @author Alexander Weigl + * @version 1 (24.05.22) + */ +class StatVisitor( + private val xmlDocument: Document, + private val keys: List, + private val expressionCosts: ExpressionCosts +) : VoidVisitorAdapter() { + //region Java Stuff + override fun visit(n: CompilationUnit, arg: Element) { + super.visit(n, newJavaContext(arg, n.javaClass.getSimpleName(), n.storage.get().fileName)) + } + + override fun visit(n: MethodDeclaration, arg: Element) { + val arg = newJavaContext( + arg, n.javaClass.getSimpleName(), + n.getDeclarationAsString(false, false, true) + ) + super.visit(n, arg) + } + + override fun visit(n: ClassOrInterfaceDeclaration, arg: Element) { + val e = newJavaContext(arg, n) + super.visit(n, e) + } + + override fun visit(n: ConstructorDeclaration, arg: Element) { + var e = newJavaContext( + arg, n.javaClass.getSimpleName(), + n.getDeclarationAsString(false, false, true) + ) + super.visit(n, e) + } + + override fun visit(n: AnnotationDeclaration, arg: Element) { + val e = newJavaContext(arg, n) + super.visit(n, e) + } + + override fun visit(n: AnnotationMemberDeclaration, arg: Element) { + super.visit(n, arg) + } + + override fun visit(n: EnumDeclaration, arg: Element) { + super.visit(n, newJavaContext(arg, n)) + } + + override fun visit(n: LocalClassDeclarationStmt, arg: Element) { + super.visit(n, arg) + } + + override fun visit(n: ModuleDeclaration, arg: Element) { + super.visit(n, newJavaContext(arg, n)) + } + + private fun newJavaContext(parent: Element, node: NodeWithName<*>): Element = + newJavaContext(parent, node.javaClass.getSimpleName(), node.nameAsString) + + private fun newJavaContext(parent: Element, node: NodeWithSimpleName<*>): Element = + newJavaContext(parent, node.javaClass.getSimpleName(), node.nameAsString) + + private fun newJavaContext(parent: Element, simpleName: String, name: String): Element { + val e = xmlDocument.createElement(simpleName) + e.setAttribute("name", name) + parent.appendChild(e) + return e + } + + //endregion + //region plain text reporting + override fun visit(n: JmlDocDeclaration, arg: Element) { + reportPlainText(n, arg) + } + + override fun visit(n: JmlDoc, arg: Element) { + } + + override fun visit(n: JmlDocStmt, arg: Element) { + reportPlainText(n, arg) + } + + override fun visit(n: JmlDocType, arg: Element) { + reportPlainText(n, arg) + } + + private fun reportPlainText(n: JmlDocContainer, arg: Element) { + val doc = JmlDocSanitizer(keys.toSet()) + val san: String = doc.asString(n.jmlComments, false) + val newlines = newlines(san) + val e = xmlDocument.createElement("jml-comment") + arg.appendChild(e) + e.setAttribute("newlines", "" + newlines) + e.setAttribute("type", n.javaClass.getSimpleName()) + e.setAttribute("chars", "" + san.length) + } + + //endregion + override fun visit(n: JmlClassExprDeclaration, arg: Element) { + if (active(n)) { + val e = newElement(arg, n.kind.identifier) + val expr = getExpressionStat(n.invariant) + e.appendChild(expr) + if (n.name.isPresent) { + e.setAttribute("name", n.name.get().asString()) + } + setModifierAsAttributes(n, e) + } + } + + private fun setModifierAsAttributes(n: NodeWithModifiers<*>, e: Element) { + for (modifier in n.modifiers) { + e.setAttribute("has" + modifier.keyword.asString(), "true") + } + } + + private fun getExpressionStat(expr: Expression): Element { + val e = xmlDocument.createElement("expr") + val costs: Int = expr.accept(ExpressionComplexity(), expressionCosts) + val numOfVariables = numberOfVariables(expr) + val length = lengthOf(expr) + e.setAttribute("complexity", "" + costs) + e.setAttribute("numOfVariables", "" + numOfVariables) + e.setAttribute("length", "" + length) + + val map = count(expr) + map.forEach { k, v -> e.setAttribute(k.simpleName, "" + v) } + return e + } + + private fun lengthOf(expr: Expression): Int = expr.toString().length + + private fun numberOfVariables(expr: Expression): Int { + var sum = 0 + for (childNode in expr.childNodes) { + if (childNode is NameExpr) sum++ + else if (childNode is Expression && !childNode.getChildNodes().isEmpty()) { + sum += numberOfVariables(childNode) + } + } + return sum + } + + private fun newElement(parent: Element, tag: String): Element { + val e = xmlDocument.createElement(tag) + parent.appendChild(e) + return e + } + + private fun active(n: NodeWithJmlTags<*>): Boolean = equal(keys, n.jmlTags) + + + override fun visit(n: JmlRepresentsDeclaration, arg: Element) { + if (active(n)) { + val a = newElement(arg, "represents") + a.setAttribute("name", n.nameAsString) + setModifierAsAttributes(n, a) + } + } + + override fun visit(n: JmlMethodDeclaration, arg: Element) { + var e = arg + if (active(n)) { + e = newJavaContext(e, n.javaClass.getSimpleName(), n.methodDeclaration.nameAsString) + setModifierAsAttributes(n.methodDeclaration, e) + super.visit(n.methodDeclaration, e) + } + } + + + override fun visit(n: JmlContract, arg: Element) { + if (active(n)) { + var name = "contract_" + n.range.get().begin.line + if (n.name.isPresent) { + name = n.name.get().identifier + } + val e = newJavaContext(arg, n.javaClass.getSimpleName(), name) + e.setAttribute("type", n.type.toString()) + setModifierAsAttributes(n, e) + e.setAttribute("behavior", "" + n.behavior) + super.visit(n, e) + } + } + + override fun visit(n: JmlExpressionStmt, arg: Element) { + if (active(n)) { + val e = newElement(arg, n.kind.jmlSymbol()) + e.appendChild(getExpressionStat(n.expression)) + } + } + + override fun visit(n: JmlUnreachableStmt, arg: Element) { + if (active(n)) { + val e = newElement(arg, "jml-unreachable") + } + } + + override fun visit(n: JmlBeginStmt, arg: Element) { + if (active(n)) { + newElement(arg, "jml-begin") + } + } + + override fun visit(n: JmlEndStmt, arg: Element) { + if (active(n)) { + newElement(arg, "jml-end") + } + } + + override fun visit(n: JmlGhostStmt, arg: Element) { + if (active(n)) { + val e = newElement(arg, "jml-ghost") + e.setAttribute("statements", "") + super.visit(n, e) + } + } + + + override fun visit(n: JmlLabelStmt, arg: Element) { + if (active(n)) { + newElement(arg, "jml-label") + } + } + + override fun visit(n: JmlSimpleExprClause, arg: Element) { + val e = newElement(arg, n.kind.jmlSymbol) + e.appendChild(getExpressionStat(n.expression)) + } + + override fun visit(n: JmlSignalsClause, arg: Element) { + newElement(arg, n.kind.jmlSymbol) + } + + override fun visit(n: JmlSignalsOnlyClause, arg: Element) { + val e = newElement(arg, n.kind.jmlSymbol) + e.setAttribute("numOfTypes", "" + n.types.size) + } + + override fun visit(n: JmlOldClause, arg: Element) { + val e = newElement(arg, n.kind.jmlSymbol) + e.setAttribute("numOfDecls", "" + n.declarations.variables.size) + } + + override fun visit(n: JmlMultiExprClause, arg: Element) { + val e = newElement(arg, n.kind.jmlSymbol) + for (expression in n.expressions) { + e.appendChild(getExpressionStat(expression)) + } + } + + override fun visit(n: JmlCallableClause, arg: Element) { + val e = newElement(arg, n.kind.jmlSymbol) + } + + override fun visit(n: JmlForallClause, arg: Element) { + val e = newElement(arg, n.kind.jmlSymbol) + e.setAttribute("numVars", "" + n.boundedVariables.size) + } + + override fun visit(n: JmlRefiningStmt, arg: Element) { + if (active(n)) { + val e = newElement(arg, "jml-refining") + } + } + + override fun visit(n: JmlClauseIf, arg: Element) { + super.visit(n, arg) + } + + override fun visit(n: JmlFieldDeclaration, arg: Element) { + //update(n, this::update) + } + + interface Update { + fun fn(parent: Element, node: R) + } + + private fun > update(n: R, update: Update) { + } + + private fun update(parent: JmlFieldDeclaration, n: JmlFieldDeclaration) { + /*if (n.getDecl().hasModifier(Modifier.DefaultKeyword.JML_GHOST)) { + getClassStat(stat, n).addNumOfGhostFields(1); + } else if (n.getDecl().hasModifier(Modifier.DefaultKeyword.JML_MODEL)) { + getClassStat(stat, n).addNumOfModelFields(1); + } + */ + } + + + private fun count(e: Expression): Map, Int> { + val occCounter: MutableMap, Int> = HashMap() + val q: ArrayDeque = ArrayDeque() + q.add(e) + + while (!q.isEmpty()) { + val n: Node = q.pop() + occCounter.compute(n.javaClass) { k: Class<*>, i: Int? -> i?.let { it + 1 } ?: 1 } + for (childNode in n.childNodes) { + if (childNode is Expression) { + q.add(childNode) + } + } + } + return occCounter + } + + companion object { + private fun newlines(text: String): Int { + val chars = text.toCharArray() + var n = 0 + for (aChar in chars) { + if (aChar == '\n') { + n++ + } + } + return n + } + + + private fun equal(keySet: List, jmlTags: NodeList): Boolean { + if (keySet.size != jmlTags.size) { + return false + } + + for (i in keySet.indices) { + if (keySet[i] != jmlTags.get(i).identifier) { + return false + } + } + return true + } + } +} + +internal class ExpressionComplexity : GenericVisitorAdapter() { + override fun visit(n: ArrayAccessExpr, arg: ExpressionCosts): Int = super.visit(n, arg) + + override fun visit(n: ArrayCreationExpr, arg: ExpressionCosts): Int = super.visit(n, arg) + + override fun visit(n: ArrayInitializerExpr, arg: ExpressionCosts): Int = super.visit(n, arg) + + override fun visit(n: AssignExpr, arg: ExpressionCosts): Int = + arg.assign + n.target.accept(this, arg) + n.value.accept(this, arg) + + override fun visit(n: BinaryExpr, arg: ExpressionCosts): Int = + //TODO distinguish by operator + arg.minus + n.left.accept(this, arg) + n.right.accept(this, arg) + + override fun visit(n: UnaryExpr, arg: ExpressionCosts): Int = super.visit(n, arg) + + override fun visit(n: LambdaExpr, arg: ExpressionCosts): Int = super.visit(n, arg) + + override fun visit(n: CastExpr, arg: ExpressionCosts): Int = arg.cast + n.expression.accept(this, arg) + + override fun visit(n: CharLiteralExpr, arg: ExpressionCosts): Int = arg.charLiteral + + override fun visit(n: ConditionalExpr, arg: ExpressionCosts): Int { + return arg.conditional + n.condition.accept(this, arg) + n.thenExpr + .accept(this, arg) + n.elseExpr.accept( + this, arg + ) + } + + override fun visit(n: EnclosedExpr, arg: ExpressionCosts): Int = n.inner.accept(this, arg) + + override fun visit(n: IntegerLiteralExpr, arg: ExpressionCosts): Int = arg.integerLiteral + + override fun visit(n: LongLiteralExpr, arg: ExpressionCosts): Int = arg.longLiteral + + override fun visit(n: MethodCallExpr, arg: ExpressionCosts): Int = arg.methodCall + sum(n.arguments, arg) + + override fun visit(n: NameExpr, arg: ExpressionCosts): Int = arg.name + + override fun visit(n: NullLiteralExpr, arg: ExpressionCosts): Int = arg.nullLiteral + + override fun visit(n: JmlQuantifiedExpr, arg: ExpressionCosts): Int = + arg.quantor + n.variables.size * arg.binderCostsPerVariable + sum(n.expressions, arg) + + private fun sum(n: NodeList, arg: ExpressionCosts): Int { + return n.stream().mapToInt { it -> Objects.requireNonNull(it.accept(this, arg), it.javaClass.getSimpleName()) } + .sum() + } + + override fun visit(n: JmlTypeExpr, arg: ExpressionCosts): Int = 1 + + override fun visit(n: SuperExpr, arg: ExpressionCosts): Int = 0 + + override fun visit(n: SwitchExpr, arg: ExpressionCosts): Int { + return n.selector.accept(this, arg) + n.entries.stream() + .mapToInt { it -> sum(it.labels, arg) + 1 } + .sum() + } + + override fun visit(n: TypePatternExpr, arg: ExpressionCosts): Int = 0 + override fun visit(n: RecordPatternExpr, arg: ExpressionCosts?): Int = super.visit(n, arg) + + override fun visit(n: BooleanLiteralExpr, arg: ExpressionCosts): Int = 0 + + override fun visit(n: InstanceOfExpr, arg: ExpressionCosts): Int = arg.instanceof + n.expression.accept(this, arg) + + override fun visit(n: JmlLabelExpr, arg: ExpressionCosts): Int = super.visit(n, arg) + + override fun visit(n: JmlLetExpr, arg: ExpressionCosts): Int = + arg.let + arg.binderCostsPerVariable * n.variables.variables.size + + override fun visit(n: JmlMultiCompareExpr, arg: ExpressionCosts): Int = arg.compare * n.operators.size +} \ No newline at end of file diff --git a/tools/utils/build.gradle.kts b/tools/utils/build.gradle.kts new file mode 100644 index 0000000000..73f6e80c2c --- /dev/null +++ b/tools/utils/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id("standard-kotlin") +} + +dependencies { + api(project(":jmlparser-symbol-solver-core")) + testImplementation(libs.snakeyaml) +} diff --git a/tools/utils/src/main/kotlin/Helper.kt b/tools/utils/src/main/kotlin/Helper.kt new file mode 100644 index 0000000000..09bd6fe8f0 --- /dev/null +++ b/tools/utils/src/main/kotlin/Helper.kt @@ -0,0 +1,51 @@ +package io.github.jmltoolkit.utils + +import com.github.javaparser.ast.Jmlish +import com.github.javaparser.ast.Node +import java.util.* +import java.util.function.Function + +/** + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +object Helper { + fun findAndApply(clazz: Class, node: Node, fn: Function): Node { + if (clazz.isAssignableFrom(node.javaClass)) { + return fn.apply(node as T) + } + + val queue: Queue = ArrayDeque(1024) + queue.add(node) + + while (!queue.isEmpty()) { + val n: Node = queue.poll() + if (clazz.isAssignableFrom(node.javaClass)) { + val other: Node = fn.apply(n as T) + if (other !== n) { + n.replace(n, other) + } + } else { + //traverse + queue.addAll(node.childNodes) + } + } + + return node + } + + fun findAllJmlContainers(cu: Node): List { + val queue: LinkedList = LinkedList() + queue.add(cu) + val res: MutableList = ArrayList(128) + while (!queue.isEmpty()) { + val n: Node = queue.pollLast() + if (n is Jmlish) { + res.add(n) + } else { + queue.addAll(n.childNodes) + } + } + return res + } +} diff --git a/tools/utils/src/main/kotlin/JMLUtils.kt b/tools/utils/src/main/kotlin/JMLUtils.kt new file mode 100644 index 0000000000..2ac3de894f --- /dev/null +++ b/tools/utils/src/main/kotlin/JMLUtils.kt @@ -0,0 +1,118 @@ +package io.github.jmltoolkit.utils + +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.expr.BinaryExpr +import com.github.javaparser.ast.expr.BooleanLiteralExpr +import com.github.javaparser.ast.expr.Expression +import com.github.javaparser.ast.expr.SimpleName +import com.github.javaparser.ast.jml.clauses.JmlContract +import com.github.javaparser.ast.jml.expr.JmlMultiCompareExpr +import com.github.javaparser.ast.type.ArrayType +import com.github.javaparser.ast.type.ClassOrInterfaceType +import com.github.javaparser.ast.type.PrimitiveType +import com.github.javaparser.ast.type.Type +import com.github.javaparser.resolution.types.ResolvedArrayType +import com.github.javaparser.resolution.types.ResolvedPrimitiveType.* +import com.github.javaparser.resolution.types.ResolvedType + +/** + * @author Alexander Weigl + * @version 1 (02.07.22) + */ +object JMLUtils { + const val GENERATED_COMBINED: String = "_generated_combined_" + + @Suppress("unused") + fun unroll(n: JmlMultiCompareExpr): Expression { + val r: Expression = + if (n.expressions.isEmpty()) { + BooleanLiteralExpr(true) + } else if (n.expressions.size == 1) { + n.expressions[0] + } else { + var e: Expression? = null + for (i in 0 until n.expressions.size - 1) { + val cmp = BinaryExpr( + n.expressions[i].clone(), + n.expressions[i + 1].clone(), + n.operators[i] + ) + e = if (e == null) cmp else BinaryExpr(e, cmp, BinaryExpr.Operator.AND) + } + e!! + } + r.setParentNode(n.parentNode.orElse(null)) + return r + } + + fun unroll(old: NodeList) { + if (old.isEmpty()) return + val target: ArrayList = ArrayList(128) + for (c in old) { + target.addAll(unroll(c)) + } + old.clear() + old.addAll(target) + } + + private fun unroll(c: JmlContract): List { + if (c.subContracts.isEmpty()) return listOf(c) + val seq= c.subContracts.stream() + .flatMap { e -> unroll(e).stream() } + .toList() + for (sub in seq) { + for (clause in c.clauses) { + sub.clauses.add(clause.clone()) + } + } + return seq + } + + @Suppress("unused") + fun createJointContract(m: NodeList): JmlContract { + val find = m.stream() + .filter { name -> + name.name.map { simpleName -> simpleName.asString().equals(GENERATED_COMBINED) } + .orElse(false) + }.findFirst() + if (find.isPresent) return find.get() + + unroll(m) + + val contract = JmlContract() + contract.setName(SimpleName(GENERATED_COMBINED)) + //TODO weigl combine all requires, ensures ... clauses + m.add(contract) + return contract + } + + fun resolvedType2Type(type: ResolvedType): Type { + if (type.isPrimitive) { + val rType = type.asPrimitive()!! + return PrimitiveType( + when (rType) { + BYTE -> PrimitiveType.Primitive.BYTE + SHORT -> PrimitiveType.Primitive.SHORT + CHAR -> PrimitiveType.Primitive.CHAR + INT -> PrimitiveType.Primitive.INT + LONG -> PrimitiveType.Primitive.LONG + BOOLEAN -> PrimitiveType.Primitive.BOOLEAN + FLOAT -> PrimitiveType.Primitive.FLOAT + DOUBLE -> PrimitiveType.Primitive.DOUBLE + } + ) + } + + if (type.isArray) { + val aType: ResolvedArrayType = type.asArrayType() + return ArrayType(resolvedType2Type(aType.componentType)) + } + + if (type.isReferenceType) { + val rType = type.asReferenceType() + return ClassOrInterfaceType(rType.qualifiedName) + } + + throw RuntimeException("Unsupported type") + } +} diff --git a/tools/utils/src/main/kotlin/JavaTemplate.kt b/tools/utils/src/main/kotlin/JavaTemplate.kt new file mode 100644 index 0000000000..6cc275b1a7 --- /dev/null +++ b/tools/utils/src/main/kotlin/JavaTemplate.kt @@ -0,0 +1,70 @@ +package io.github.jmltoolkit.utils + +import com.github.javaparser.StaticJavaParser +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.body.BodyDeclaration +import com.github.javaparser.ast.body.TypeDeclaration +import com.github.javaparser.ast.expr.SimpleName +import com.github.javaparser.ast.stmt.BlockStmt +import com.github.javaparser.ast.stmt.Statement + +/** + * @author Alexander Weigl + * @version 1 (10.10.22) + */ +class JavaTemplate(private val template: T) { + fun instantiate(substitutionFactory: SubstitutionFactory): T { + val copy = template.clone() + replace(copy, substitutionFactory) + return copy as T + } + + private fun replace(node: Node, factory: SubstitutionFactory) { + for (childNode in node.childNodes) { + replace(childNode, factory) + if (factory.replacable(childNode)) { + node.replace(childNode, factory.substitutionOf(childNode)) + } + } + } + + interface SubstitutionFactory { + fun replacable(node: Node): Boolean + + fun substitutionOf(node: Node): Node + } + + class IdentifierSubstitution @JvmOverloads constructor(private val map: MutableMap = HashMap()) : + SubstitutionFactory { + fun add(name: String?, newName: String?) { + map[name] = newName + } + + override fun replacable(node: Node): Boolean { + return node is SimpleName && map.containsKey(node.asString()) + } + + override fun substitutionOf(node: Node): Node { + if (node is SimpleName) node.setIdentifier(map[node.asString()]!!) + return node + } + } + + companion object { + fun fromBlock(javaCode: String?): JavaTemplate { + return JavaTemplate(StaticJavaParser.parseBlock(javaCode)) + } + + fun fromStatement(javaCode: String?): JavaTemplate { + return JavaTemplate(StaticJavaParser.parseStatement(javaCode)) + } + + fun fromType(javaCode: String?): JavaTemplate> { + return JavaTemplate(StaticJavaParser.parseTypeDeclaration(javaCode)) + } + + fun fromBodyDecl(javaCode: String?): JavaTemplate> { + return JavaTemplate(StaticJavaParser.parseBodyDeclaration(javaCode)) + } + } +} diff --git a/tools/utils/src/main/kotlin/LineColumnIndex.kt b/tools/utils/src/main/kotlin/LineColumnIndex.kt new file mode 100644 index 0000000000..a1617d377e --- /dev/null +++ b/tools/utils/src/main/kotlin/LineColumnIndex.kt @@ -0,0 +1,45 @@ +package io.github.jmltoolkit.utils + +import com.github.javaparser.Position +import com.github.javaparser.Range + +/** + * The index is 1-based. The first character also begins in line 1 and column 1. + * + * @author Alexander Weigl + * @version 1 (18.10.22) + */ +class LineColumnIndex(private val content: String) { + var lineOffsets: IntArray = + IntArray(1 + content.chars().filter { it: Int -> it == '\n'.code }.count().toInt()) + + init { + var cur = 1 + val chars = content.toCharArray() + for (i in chars.indices) { + if (chars[i] == '\n') lineOffsets[cur++] = i + 1 + } + } + + fun substring(range: Range): String { + return substring(range.begin, range.end) + } + + private fun substring(begin: Position, end: Position): String { + return substring(begin.line, begin.column, end.line, end.column) + } + + fun substring(beginLine: Int, beginColumn: Int, endLine: Int, endColumn: Int): String { + val a = positionToOffset(beginLine, beginColumn) + val b = positionToOffset(endLine, endColumn) + return content.substring(a, b + 1) + } + + fun positionToOffset(p: Position): Int { + return positionToOffset(p.line, p.column) + } + + fun positionToOffset(line: Int, column: Int): Int { + return lineOffsets[line - 1] + column - 1 + } +} diff --git a/tools/utils/src/main/kotlin/Pattern.kt b/tools/utils/src/main/kotlin/Pattern.kt new file mode 100644 index 0000000000..402b93e9e2 --- /dev/null +++ b/tools/utils/src/main/kotlin/Pattern.kt @@ -0,0 +1,84 @@ +package io.github.jmltoolkit.utils + +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.NodeList +import java.util.* + +/** + * @author Alexander Weigl + * @version 1 (11.10.22) + */ +class Pattern(private val pattern: T) { + private val placeholders: MutableMap = IdentityHashMap() + fun match(tree: Node?): Map? { + return match(pattern, tree, HashMap()) + } + + private fun match(pattern: Node?, tree: Node?, map: MutableMap): MutableMap? { + if (pattern == null && tree == null) + return map + + if ((pattern != null) xor (tree != null)) + return null + + require(pattern != null) + require(tree != null) + + var rmap: MutableMap? = map + + if (placeholders.containsKey(pattern)) { + val key = placeholders[pattern] + if (map.containsKey(key) && map[key] != tree) return null + else { + map[key!!] = tree + } + return map + } + + if (pattern.javaClass !== tree.javaClass) return null + + + for (prop in pattern.metaModel.allPropertyMetaModels) { + val childPattern = prop.getValue(pattern) + val childTree = prop.getValue(tree) + + if (prop.isNode) { + rmap = match(childPattern as Node?, childTree as Node?, map) + if (rmap == null) + return null + } else if (prop.isNodeList) { + val a = childPattern as NodeList + val b = childTree as NodeList + if (a.size != b.size) return null + + for (i in 0 until a.size) { + rmap = match(a[i], b[i], map) + if (rmap == null) + return null + } + } else { + if (!childPattern.equals(childTree)) return null + } + } + + return rmap + } + + + fun find(n: Node): Map? { + val queue: ArrayDeque = ArrayDeque() + queue.add(n) + while (!queue.isEmpty()) { + val e: Node = queue.pop() + val r = match(e) + if (r != null) + return r + queue.addAll(e.childNodes) + } + return null + } + + fun addPlaceholder(placeholder: Node, label: String) { + placeholders[placeholder] = label + } +} diff --git a/tools/utils/src/main/kotlin/TestWithJavaParser.kt b/tools/utils/src/main/kotlin/TestWithJavaParser.kt new file mode 100644 index 0000000000..4a9ad94897 --- /dev/null +++ b/tools/utils/src/main/kotlin/TestWithJavaParser.kt @@ -0,0 +1,37 @@ +package io.github.jmltoolkit.utils + +import com.github.javaparser.JavaParser +import com.github.javaparser.ParserConfiguration +import com.github.javaparser.Problem +import com.github.javaparser.ast.Node +import com.github.javaparser.symbolsolver.JavaSymbolSolver +import com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver +import java.util.function.Consumer + +/** + * @author Alexander Weigl + * @version 1 (14.10.22) + */ +open class TestWithJavaParser { + protected val parser: JavaParser + protected var parent: Node? = null + + init { + val config = ParserConfiguration() + config.setProcessJml(true) + config.setSymbolResolver(JavaSymbolSolver(ClassLoaderTypeSolver(ClassLoader.getSystemClassLoader()))) + parser = JavaParser(config) + + val resourceAsStream = javaClass.getResourceAsStream("Test.java") + if (resourceAsStream != null) { + val r = parser.parse(resourceAsStream) + if (!r.isSuccessful) { + r.problems.forEach(Consumer { x: Problem? -> System.err.println(x) }) + error("Error during parsing") + } + parent = r.result.get().getType(0) + } else { + parent = null + } + } +} diff --git a/tools/utils/src/test/kotlin/TestTokenRangesPreciseness.kt b/tools/utils/src/test/kotlin/TestTokenRangesPreciseness.kt new file mode 100644 index 0000000000..515c3b0a87 --- /dev/null +++ b/tools/utils/src/test/kotlin/TestTokenRangesPreciseness.kt @@ -0,0 +1,98 @@ +import com.github.javaparser.GeneratedJavaParserConstants +import com.github.javaparser.TokenRange +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.jml.NodeWithJmlTags +import com.github.javaparser.jml.JmlUtility +import com.google.common.collect.Streams +import com.google.common.truth.Truth +import io.github.jmltoolkit.utils.LineColumnIndex +import io.github.jmltoolkit.utils.TestWithJavaParser +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.DynamicTest +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.TestFactory +import java.nio.file.Files +import java.nio.file.Paths +import java.util.stream.Stream + +/** + * @author Alexander Weigl + * @version 1 (18.10.22) + */ +internal class TestTokenRangesPreciseness : TestWithJavaParser() { + @Test + fun lineColumnIndex() { + val lci = LineColumnIndex( + """ + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam + nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea + takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, + consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore + et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo + duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + + """.trimIndent() + ) + + + Truth.assertThat(lci.substring(1, 1, 1, 5)) + .isEqualTo("Lorem") + + Truth.assertThat(lci.substring(2, 1, 2, 6)) + .isEqualTo("nonumy") + + Truth.assertThat(lci.substring(6, 18, 6, 25)) + .isEqualTo("aliquyam") + } + + @TestFactory + @Throws(Throwable::class) + fun ihm(): Stream { + val content = + Files.readString(Paths.get("../examples/ihm/VerifiedIdentityHashMap.java")) + val result = parser.parse(content) + Assertions.assertTrue(result.isSuccessful) + return testTokenRanges(result.result.get(), content) + } + + + @TestFactory + @Throws(Throwable::class) + fun test(): Stream { + val content = Files.readString(Paths.get("src/test/kotlin/TokenTest.java")) + val result = parser.parse(content) + Assertions.assertTrue(result.isSuccessful) + return testTokenRanges(result.result.get(), content) + } + + private fun testTokenRanges(node: CompilationUnit, content: String): Stream { + val lci = LineColumnIndex(content) + return JmlUtility.getAllNodes(node) + .filter { it: Node? -> it is NodeWithJmlTags<*> } + .flatMap { it: Node -> checkTokenRange(lci, it) } + //checkTokenRange(lci, node); + } + + private fun checkTokenRange(lci: LineColumnIndex, it: Node): Stream { + val tr = it.tokenRange + return tr.map { javaTokens: TokenRange -> checkTokenRange(lci, javaTokens) } + .orElse(Stream.empty()) + } + + private fun checkTokenRange(lci: LineColumnIndex, javaTokens: TokenRange): Stream { + return Streams.stream(javaTokens) + .filter { it.kind != GeneratedJavaParserConstants.EOF } + .map { javaToken -> + DynamicTest.dynamicTest(javaToken.toString()) { + val substring = lci.substring(javaToken.range.get()) + val text = javaToken.text + if (!(substring == "@" && text == " ")) { + Truth.assertThat(substring).isEqualTo(text) + } + } + } + } +} diff --git a/tools/utils/src/test/kotlin/TokenTest.java b/tools/utils/src/test/kotlin/TokenTest.java new file mode 100644 index 0000000000..504d94ec5a --- /dev/null +++ b/tools/utils/src/test/kotlin/TokenTest.java @@ -0,0 +1,10 @@ +class TokenTest { + //@ invariant test : x == x; + + /*@ private normal_behavior + @ ensures key == null ==> \result == NULL_KEY; + @ ensures key != null ==> \result == key; + @*/ + public void foo() { + } +} \ No newline at end of file diff --git a/tools/wd/build.gradle.kts b/tools/wd/build.gradle.kts new file mode 100644 index 0000000000..d11ae09831 --- /dev/null +++ b/tools/wd/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id("standard-kotlin") +} + +dependencies { + api(project(":jmlparser-symbol-solver-core")) + api(project(":tools:smt")) +} diff --git a/tools/wd/src/main/kotlin/WDVisitor.kt b/tools/wd/src/main/kotlin/WDVisitor.kt new file mode 100644 index 0000000000..e87bb0850e --- /dev/null +++ b/tools/wd/src/main/kotlin/WDVisitor.kt @@ -0,0 +1,252 @@ +package io.github.jmltoolkit.wd + +import com.github.javaparser.ast.expr.* +import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration +import com.github.javaparser.ast.jml.clauses.JmlMultiExprClause +import com.github.javaparser.ast.jml.expr.JmlLabelExpr +import com.github.javaparser.ast.jml.expr.JmlLetExpr +import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr +import com.github.javaparser.ast.jml.expr.JmlTypeExpr +import com.github.javaparser.ast.jml.stmt.JmlExpressionStmt +import com.github.javaparser.ast.visitor.GenericVisitorAdapter +import com.github.javaparser.ast.visitor.VoidVisitorAdapter +import io.github.jmltoolkit.smt.ArithmeticTranslator +import io.github.jmltoolkit.smt.JmlExpr2Smt +import io.github.jmltoolkit.smt.SmtQuery +import io.github.jmltoolkit.smt.SmtTermFactory +import io.github.jmltoolkit.smt.model.SExpr +import java.math.BigInteger + +/** + * + * @author Alexander Weigl + * @version 1 (14.06.22) + */ +class WDVisitor : VoidVisitorAdapter() { + override fun visit(n: JmlExpressionStmt, arg: Any?) { + n.expression.accept(this, arg) + } +} + +class WDVisitorExpr(smtLog: SmtQuery, private val translator: ArithmeticTranslator) : + GenericVisitorAdapter() { + private val smtFormula: JmlExpr2Smt = JmlExpr2Smt(smtLog, translator) + + override fun visit(n: NameExpr, arg: Any?): SExpr { + val name = n.nameAsString + return when (name) { + "\\result", "\\exception" -> term.makeTrue() + else -> term.makeTrue() + } + } + + override fun visit(n: ArrayAccessExpr, arg: Any?): SExpr { + return term.and( + n.name.accept(this, arg), + n.index.accept(this, arg) + ) + } + + override fun visit(n: ArrayCreationExpr, arg: Any?): SExpr { + //TODO + return n.initializer.get().accept(this, arg) + } + + override fun visit(n: ArrayInitializerExpr, arg: Any?): SExpr { + val seq = n.values.map { it.accept(this, arg) } + return term.and(seq) + } + + override fun visit(n: AssignExpr, arg: Any?): SExpr { + return term.makeFalse() + } + + override fun visit(n: BinaryExpr, arg: Any?): SExpr { + when (n.operator) { + BinaryExpr.Operator.IMPLICATION -> { + val be = BinaryExpr( + UnaryExpr(n.left, UnaryExpr.Operator.LOGICAL_COMPLEMENT), + n.right, BinaryExpr.Operator.OR + ) + return be.accept(this, arg) + } + + BinaryExpr.Operator.DIVIDE, BinaryExpr.Operator.REMAINDER -> { + val fml = n.right.accept(smtFormula, arg) + return term.and( + n.right.accept(this, arg), + n.left.accept(this, arg), + term.not( + translator.binary( + BinaryExpr.Operator.EQUALS, + fml, smtFormula.translator.makeInt(BigInteger.ZERO) + ) + ) + ) + } + + else -> return term.and( + n.right.accept(this, arg), + n.left.accept(this, arg) + ) + } + } + + override fun visit(n: BooleanLiteralExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: CastExpr, arg: Any?): SExpr { + //TODO Type-check? + return n.expression.accept(this, arg) + } + + override fun visit(n: CharLiteralExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: ClassExpr, arg: Any?): SExpr { + return term.makeFalse() + } + + override fun visit(n: DoubleLiteralExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: EnclosedExpr, arg: Any?): SExpr { + return wd(n.inner) + } + + override fun visit(n: FieldAccessExpr, arg: Any?): SExpr { + return wd(n.scope) + } + + override fun visit(n: InstanceOfExpr, arg: Any?): SExpr { + return n.expression.accept(this, arg) + } + + override fun visit(n: IntegerLiteralExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: StringLiteralExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: SuperExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: ThisExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: UnaryExpr, arg: Any?): SExpr { + return n.expression.accept(this, arg) + } + + override fun visit(n: LambdaExpr, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: MethodReferenceExpr, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: TypeExpr, arg: Any?): SExpr { + return super.visit(n, arg) + } + + override fun visit(n: SwitchExpr, arg: Any?): SExpr { + return term.and(wd(n.selector)) + } + + override fun visit(n: TextBlockLiteralExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: RecordPatternExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: TypePatternExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: JmlQuantifiedExpr, arg: Any?): SExpr { + /*The quantified-expression is well-defined iff the two sub-expressions are well-defined. For a quantifier Q*/ + val seq: List = n.expressions.map { it.accept(this, arg) } + val r: Expression = n.expressions[0] + val v: Expression = n.expressions[0] + + val args: List = ArrayList() + + if (JmlQuantifiedExpr.JmlDefaultBinder.CHOOSE == n.binder) { + return term.and( + term.forall(args, wd(r)), + term.forall(args, term.impl(valueOf(r), wd(v))), + term.exists( + args, term.and( + valueOf(r), + valueOf(v) + ) + ) + ) + } + return term.and( + term.forall(args, wd(r)), + term.forall(args, term.impl(valueOf(r), wd(v))) + ) + } + + private fun valueOf(e: Expression): SExpr { + return e.accept(smtFormula, null) + } + + private fun wd(e: Expression): SExpr { + return e.accept(this, null) + } + + override fun visit(n: JmlExpressionStmt, arg: Any?): SExpr { + return wd(n.expression) + } + + override fun visit(n: JmlLabelExpr, arg: Any?): SExpr { + return wd(n.expression) + } + + override fun visit(n: JmlLetExpr, arg: Any?): SExpr { + return term.and(wd(n.body), /* TODO arguments */term.makeTrue()) + } + + override fun visit(n: JmlClassExprDeclaration, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: JmlTypeExpr, arg: Any?): SExpr { + return term.makeTrue() + } + + override fun visit(n: JmlMultiExprClause, arg: Any?) = + term.and(n.expressions.map { e: Expression -> this.wd(e) }) + + override fun visit(n: MethodCallExpr, arg: Any?): SExpr { + val name = n.nameAsString + when (name) { + "\\old", "\\pre", "\\past" -> /* Well-definedness: The expression is well-defined if the first argument is well-defined + and any label argument names either a built-in label (§11.611.6) or an in-scope Java or + JML ghost label (S11.511.5).*/ + return n.arguments[0].accept(this, arg) + + "\\fresh" -> /* Well-definedness: The argument must be well-defined and non-null. The second argument, + if present, must be the identifier corresponding to an in-scope label or a built-in label. */ + return n.arguments[0].accept(this, arg) + } + val seq = n.arguments.map { it: Expression -> it.accept(this, arg) } + return term.and(seq) + } + + companion object { + private val term: SmtTermFactory = SmtTermFactory + } +} diff --git a/tools/wd/src/main/kotlin/WdFacade.kt b/tools/wd/src/main/kotlin/WdFacade.kt new file mode 100644 index 0000000000..27199b0dbe --- /dev/null +++ b/tools/wd/src/main/kotlin/WdFacade.kt @@ -0,0 +1,52 @@ +package io.github.jmltoolkit.wd + +import com.github.javaparser.JavaParser +import com.github.javaparser.ParserConfiguration +import com.github.javaparser.ast.expr.Expression +import io.github.jmltoolkit.smt.ArithmeticTranslator +import io.github.jmltoolkit.smt.BitVectorArithmeticTranslator +import io.github.jmltoolkit.smt.SmtQuery +import io.github.jmltoolkit.smt.SmtTermFactory +import io.github.jmltoolkit.smt.model.SExpr +import io.github.jmltoolkit.smt.solver.SolverAnswer + +/** + * Facade to dive into *well-definedness* checks. + * + * @author Alexander Weigl + * @version 1 (28.01.24) + */ +object WdFacade { + fun isWelldefined(expr: String): Boolean { + val config = ParserConfiguration() + config.setProcessJml(false) + val parser = JavaParser(config) + return isWelldefined(parser, expr) + } + + fun isWelldefined(parser: JavaParser, expr: String): Boolean { + val e = parser.parseJmlExpression(expr) + if (e.isSuccessful && e.result.isPresent) { + return isWelldefined(e.result.get()) + } + return false + } + + private fun isWelldefined(e: Expression): Boolean { + val query = SmtQuery() + val translator: ArithmeticTranslator = BitVectorArithmeticTranslator(query) + val visitor = WDVisitorExpr(query, translator) + val res: SExpr = e.accept(visitor, null) + if ("true" == res.toString()) { + return true + } + query.addAssert(SmtTermFactory.not(res)) + query.checkSat() + val solver = io.github.jmltoolkit.smt.solver.Solver() + val ans: SolverAnswer = solver.run(query) + println(query.toString()) + println(ans.toString()) + ans.consumeErrors() + return ans.isSymbol("unsat") + } +} \ No newline at end of file diff --git a/tools/wd/src/test/kotlin/WDVisitorExprTest.kt b/tools/wd/src/test/kotlin/WDVisitorExprTest.kt new file mode 100644 index 0000000000..3fcfb7307f --- /dev/null +++ b/tools/wd/src/test/kotlin/WDVisitorExprTest.kt @@ -0,0 +1,29 @@ +import com.github.javaparser.JavaParser +import io.github.jmltoolkit.smt.Z3 +import io.github.jmltoolkit.wd.WdFacade.isWelldefined +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.Assumptions +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.CsvFileSource + +/** + * @author Alexander Weigl + * @version 1 (14.06.22) + */ +internal class WDVisitorExprTest { + private val parser = JavaParser() + + @ParameterizedTest + @CsvFileSource(resources = ["wd-expr.csv"], delimiterString = "§") + fun wdExpression(expr: String) { + Assumptions.assumeTrue(Z3.z3Installed()) + Assertions.assertTrue(isWelldefined(parser, expr)) + } + + @ParameterizedTest + @CsvFileSource(resources = ["not-wd-expr.csv"], delimiterString = "§") + fun wdExpressionError(expr: String) { + Assumptions.assumeTrue(Z3.z3Installed()) + Assertions.assertFalse(isWelldefined(parser, expr)) + } +} diff --git a/tools/wd/src/test/resources/not-wd-expr.csv b/tools/wd/src/test/resources/not-wd-expr.csv new file mode 100644 index 0000000000..d056a94578 --- /dev/null +++ b/tools/wd/src/test/resources/not-wd-expr.csv @@ -0,0 +1,2 @@ +x / 0 +x / (1 - 1) \ No newline at end of file diff --git a/tools/wd/src/test/resources/wd-expr.csv b/tools/wd/src/test/resources/wd-expr.csv new file mode 100644 index 0000000000..cf92a05bda --- /dev/null +++ b/tools/wd/src/test/resources/wd-expr.csv @@ -0,0 +1,12 @@ +true +false +1 == 2 +5 * 2 == 2 +42 / 2 +"""a"" + 'c'" +x - 2 == 3 +'x' == 65 + + +'x' != 65 +'x' != 65 diff --git a/tools/web/build.gradle.kts b/tools/web/build.gradle.kts new file mode 100644 index 0000000000..9bf448b653 --- /dev/null +++ b/tools/web/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id("standard-kotlin") +} + + +dependencies { + testImplementation("org.jetbrains.kotlin:kotlin-test") + api(project(":jmlparser-symbol-solver-core")) + + implementation(libs.ktor.core) + implementation(libs.ktor.html) + implementation(libs.ktor.netty) + implementation(libs.ktor.statuspages) + implementation(libs.ktor.severhtml) + implementation(libs.logback) +} diff --git a/tools/web/src/main/kotlin/main.kt b/tools/web/src/main/kotlin/main.kt new file mode 100644 index 0000000000..239a07dbb8 --- /dev/null +++ b/tools/web/src/main/kotlin/main.kt @@ -0,0 +1,357 @@ +import com.github.javaparser.JavaParser +import com.github.javaparser.JavaParserBuild +import com.github.javaparser.ParserConfiguration +import com.github.javaparser.Problem +import com.github.javaparser.ast.Jmlish +import com.github.javaparser.ast.Node +import com.github.javaparser.metamodel.NodeMetaModel +import com.github.javaparser.metamodel.PropertyMetaModel +import com.github.javaparser.printer.DefaultPrettyPrinter +import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration +import io.ktor.html.* +import io.ktor.html.Placeholder +import io.ktor.http.* +import io.ktor.server.application.* +import io.ktor.server.engine.* +import io.ktor.server.html.* +import io.ktor.server.http.content.* +import io.ktor.server.netty.* +import io.ktor.server.plugins.statuspages.* +import io.ktor.server.request.* +import io.ktor.server.routing.* +import kotlinx.html.* +import java.io.StringReader +import java.util.* +import java.util.stream.Collectors + +const val version = "${JavaParserBuild.PROJECT_VERSION}" + +fun main() { + embeddedServer(Netty, port = 8000, watchPaths = listOf("classes", "resources")) { + install(StatusPages) + routing { + get("/") { renderPage() } + post("parse") { + val params = call.receiveParameters() + renderPage(params) + } + staticResources("assets", "assets") + } + }.start(wait = true) +} + +private suspend fun RoutingContext.renderPage(params: Parameters? = null) { + val inputText = params?.get("input") + val keyKey = params?.get("keyKey") + val keyOpenJml = params?.get("keyOpenJml") + val keyESC = params?.get("keyESC") + val keyRAC = params?.get("keyRAC") + val doNotProcessJml = params?.get("doNotProcessJml") != null + + call.respondHtmlTemplate(DefaultPage()) { + body { + div("form-group") { + form(action = "/parse", method = FormMethod.post) { + div { + spectreCheckBox(name = "doNotProcessJml") { +"Do not process JML" } + span { +" Active keys: " } + spectreCheckBox(name = "keyKey") { +"KEY" } + spectreCheckBox(name = "keyOpenJml") { +"OpenJml" } + spectreCheckBox(name = "keyESC") { +"ESC" } + spectreCheckBox(name = "keyRAC") { +"RAC" } + submitInput(classes = "btn btn-primary") { } + } + textArea { + name = "input" + id = "input" + rows = "100" + cols = "120" + if (inputText != null) { + +inputText + } else { + + + """ + public class JmlTest { + /*@ + requires true; + ensures true; + assignable \strictly_nothing; + */ + public void foo() { + + } + } + """.trimIndent() + } + } + } + } + } + right { + if (inputText != null) { + val config = ParserConfiguration() + + config.isProcessJml = !doNotProcessJml + + if (keyKey != null) { + config.jmlKeys.add(arrayListOf("key")) + } + if (keyESC != null) { + config.jmlKeys.add(arrayListOf("openjml")) + } + if (keyOpenJml != null) { + config.jmlKeys.add(arrayListOf("ESC")) + } + if (keyRAC != null) { + config.jmlKeys.add(arrayListOf("RAC")) + } + + val jpb = JavaParser(config) + + val startTime = System.nanoTime() + val result = jpb.parse(StringReader(inputText)) + val stopTime = System.nanoTime() + val durationNano = stopTime - startTime + + accordion("Processing Information") { + ul { + li { +"Activated keys: ${config.jmlKeys}" } + li { +"Parsing took: ${durationNano / 1000.0 / 1000.0} ms " } + li { if (result.isSuccessful) +"Parsing was successful" else +"Parsing has errors" } + } + } + + accordion("Parse Issues (${result.problems.size})", isOpen = result.problems.isNotEmpty()) { + if (!result.isSuccessful) { + code { + pre { + result.problems.forEach { + +it.toString() + } + } + } + } else { + +"No issues detected" + } + } + + val problems = Collections.emptyList() + /*if (result.isSuccessful) + //JmlLintingFacade.lint(JmlLintingConfig(), Collections.singleton(result.result.get())) + else + Collections.emptyList()*/ + + accordion("Linting Issues (${problems.size})", isOpen = problems.isNotEmpty()) { + if (result.isSuccessful) { + code { + pre { + problems.forEach { + +it.toString() + } + } + } + } else { + +"Linting issues skipped due to parsing errors." + } + } + + result.result.ifPresent { + val c = DefaultPrinterConfiguration() + val v = DefaultPrettyPrinter(c) + val pp = v.print(it) + accordion("Pretty Printed") { + code { pre { +pp } } + } + } + + accordion("AST", isOpen = true) { + val cu = result.result.get() + ul("ast") { + this.printNode(cu, "[0]") + } + } + + /*accordion("Original sources") { + textArea { + name = "input" + id = "input" + rows = "100" + cols = "120" + +inputText + } + //code { pre { +inputText } } + }*/ + } + } + } +} + +@HtmlTagMarker +inline fun FlowContent.accordion( + title: String = "", + icon: String = "", + isOpen: Boolean = false, + crossinline block: DIV.() -> Unit, +) { + details("accordion") { + open = isOpen + summary("accordion-header") { + i(classes = "icon icon-arrow-right mr-1 $icon") {} + +title + } + div("accordion-body") { + block(this) + } + } +} + +@HtmlTagMarker +inline fun FlowOrInteractiveOrPhrasingContent.spectreCheckBox( + name: String? = null, + label: String = "", + crossinline block: INPUT.() -> Unit, +) { + label("form-checkbox d-inline-block") { + input(type = InputType.checkBox, name = name) { block(this) } + i("form-icon") { +label } + } +} + +open class DefaultPage : io.ktor.server.html.Template { + val body = Placeholder() + val right = Placeholder() + val top = Placeholder() + + override fun HTML.apply() { + head { + title("JmlParser -- Playground") + + styleLink("/assets/spectre.min.css") + // styleLink("/assets/spectre-exp.min.css") + styleLink("/assets/spectre-icons.min.css") + styleLink("/assets/style.css") + + script { src = "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.min.js" } + script { src = "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.0/mode/clike/clike.min.js" } + + link { + rel = "stylesheet" + href = "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.min.css" + } + } + + body { + div("content") + h1 { + +"JmlParser — Playground" + span("version label label-rounded label-secondary") { + +version + } + } + + div("inner") { + div("container") { + div("column col-12") { insert(top) } + } + div("container") { + div("columns") { + div("column col-5") { insert(body) } + div("divider-vert") { /*attributes["data-content"] = "|"*/ } + div("column col-5") { insert(right) } + } + } + } + script { + unsafe { + +""" + var editor = CodeMirror.fromTextArea(document.getElementById('input'), + { lineNumbers: true, mode: "text/x-java", matchBrackets: true }); + editor.setSize("100%", "90%"); + function select(l1, c1, l2, c2) { + editor.doc.setSelection({'line':l1-1, 'ch':c1-1}, {'line':l2-1, 'ch':c2}, {'scroll': true}); + } + """ + } + } + } + } +} + +private fun UL.printNode( + n: Node, + text: String = "", +) { + val isJml = n is Jmlish + val clazz = if (isJml) "jmlish" else "" + + li(clazz) { + span("attrib-name") { +text } + +": " + span("type-name") { +n.metaModel.typeName } + + n.range.ifPresent { + span("range label") { + a { + val l1 = it.begin.line + val c1 = it.begin.column + val l2 = it.end.line + val c2 = it.end.column + onClick = "javascript:select($l1,$c1, $l2, $c2);" + +"$l1/$c1 - $l2/$c2" + } + } + } + + ul { + val metaModel: NodeMetaModel = n.metaModel + val allPropertyMetaModels = metaModel.allPropertyMetaModels + val attributes = + allPropertyMetaModels + .filter { obj: PropertyMetaModel -> obj.isAttribute } + .filter { obj: PropertyMetaModel -> obj.isSingular } + val subNodes = + allPropertyMetaModels + .filter { obj: PropertyMetaModel -> obj.isNode } + .filter { obj: PropertyMetaModel -> obj.isSingular } + val subLists = + allPropertyMetaModels + .filter { obj: PropertyMetaModel -> obj.isNodeList } + + for (attributeMetaModel in attributes) { + li { + span("attrib-name") { +attributeMetaModel.name } + +": " + span("type-name") { +attributeMetaModel.typeName } + +" = " + span("value") { + attributeMetaModel.getValue(n)?.let { +it.toString() } ?: +"value is null" + } + } + } + + for (subNodeMetaModel in subNodes) { + val value = subNodeMetaModel.getValue(n) as Node? + if (value != null) { + printNode(value, subNodeMetaModel.name) + } + } + + for (subListMetaModel in subLists) { + val subList = subListMetaModel.getValue(n) as com.github.javaparser.ast.NodeList + if (!subList.isEmpty()) { + val listName = subListMetaModel.name + li { + span("attrib-name") { +listName } + +": " + span("type-name") { +subListMetaModel.typeName } + ul { + subList.forEachIndexed { idx, it -> + printNode(it, "[$idx]") + } + } + } + } + } + } + } +} diff --git a/tools/web/src/main/resources/assets/spectre-exp.min.css b/tools/web/src/main/resources/assets/spectre-exp.min.css new file mode 100644 index 0000000000..d3137743a6 --- /dev/null +++ b/tools/web/src/main/resources/assets/spectre-exp.min.css @@ -0,0 +1 @@ +/*! Spectre.css Experimentals v0.5.9 | MIT License | github.com/picturepan2/spectre */.form-autocomplete{position:relative}.form-autocomplete .form-autocomplete-input{align-content:flex-start;display:-ms-flexbox;display:flex;-ms-flex-line-pack:start;-ms-flex-wrap:wrap;flex-wrap:wrap;height:auto;min-height:1.6rem;padding:.1rem}.form-autocomplete .form-autocomplete-input.is-focused{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-autocomplete .form-autocomplete-input .form-input{border-color:transparent;box-shadow:none;display:inline-block;-ms-flex:1 0 auto;flex:1 0 auto;height:1.2rem;line-height:.8rem;margin:.1rem;width:auto}.form-autocomplete .menu{left:0;position:absolute;top:100%;width:100%}.form-autocomplete.autocomplete-oneline .form-autocomplete-input{-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto}.form-autocomplete.autocomplete-oneline .chip{-ms-flex:1 0 auto;flex:1 0 auto}.calendar{border:.05rem solid #dadee4;border-radius:.1rem;display:block;min-width:280px}.calendar .calendar-nav{align-items:center;background:#f7f8f9;border-top-left-radius:.1rem;border-top-right-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-align:center;font-size:.9rem;padding:.4rem}.calendar .calendar-body,.calendar .calendar-header{display:-ms-flexbox;display:flex;-ms-flex-pack:center;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-content:center;padding:.4rem 0}.calendar .calendar-body .calendar-date,.calendar .calendar-header .calendar-date{-ms-flex:0 0 14.28%;flex:0 0 14.28%;max-width:14.28%}.calendar .calendar-header{background:#f7f8f9;border-bottom:.05rem solid #dadee4;color:#bcc3ce;font-size:.7rem;text-align:center}.calendar .calendar-body{color:#66758c}.calendar .calendar-date{border:0;padding:.2rem}.calendar .calendar-date .date-item{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:.05rem solid transparent;border-radius:50%;color:#66758c;cursor:pointer;font-size:.7rem;height:1.4rem;line-height:1rem;outline:0;padding:.1rem;position:relative;text-align:center;text-decoration:none;transition:background .2s,border .2s,box-shadow .2s,color .2s;vertical-align:middle;white-space:nowrap;width:1.4rem}.calendar .calendar-date .date-item.date-today{border-color:#e5e5f9;color:#5755d9}.calendar .calendar-date .date-item:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.calendar .calendar-date .date-item:focus,.calendar .calendar-date .date-item:hover{background:#fefeff;border-color:#e5e5f9;color:#5755d9;text-decoration:none}.calendar .calendar-date .date-item.active,.calendar .calendar-date .date-item:active{background:#4b48d6;border-color:#3634d2;color:#fff}.calendar .calendar-date .date-item.badge::after{position:absolute;right:3px;top:3px;transform:translate(50%,-50%)}.calendar .calendar-date .calendar-event.disabled,.calendar .calendar-date .calendar-event:disabled,.calendar .calendar-date .date-item.disabled,.calendar .calendar-date .date-item:disabled{cursor:default;opacity:.25;pointer-events:none}.calendar .calendar-date.next-month .calendar-event,.calendar .calendar-date.next-month .date-item,.calendar .calendar-date.prev-month .calendar-event,.calendar .calendar-date.prev-month .date-item{opacity:.25}.calendar .calendar-range{position:relative}.calendar .calendar-range::before{background:#f1f1fc;content:"";height:1.4rem;left:0;position:absolute;right:0;top:50%;transform:translateY(-50%)}.calendar .calendar-range.range-start::before{left:50%}.calendar .calendar-range.range-end::before{right:50%}.calendar .calendar-range.range-end .date-item,.calendar .calendar-range.range-start .date-item{background:#4b48d6;border-color:#3634d2;color:#fff}.calendar .calendar-range .date-item{color:#5755d9}.calendar.calendar-lg .calendar-body{padding:0}.calendar.calendar-lg .calendar-body .calendar-date{border-bottom:.05rem solid #dadee4;border-right:.05rem solid #dadee4;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:5.5rem;padding:0}.calendar.calendar-lg .calendar-body .calendar-date:nth-child(7n){border-right:0}.calendar.calendar-lg .calendar-body .calendar-date:nth-last-child(-n+7){border-bottom:0}.calendar.calendar-lg .date-item{align-self:flex-end;-ms-flex-item-align:end;height:1.4rem;margin-right:.2rem;margin-top:.2rem}.calendar.calendar-lg .calendar-range::before{top:19px}.calendar.calendar-lg .calendar-range.range-start::before{left:auto;width:19px}.calendar.calendar-lg .calendar-range.range-end::before{right:19px}.calendar.calendar-lg .calendar-events{flex-grow:1;-ms-flex-positive:1;line-height:1;overflow-y:auto;padding:.2rem}.calendar.calendar-lg .calendar-event{border-radius:.1rem;display:block;font-size:.7rem;margin:.1rem auto;overflow:hidden;padding:3px 4px;text-overflow:ellipsis;white-space:nowrap}.carousel .carousel-locator:nth-of-type(1):checked~.carousel-container .carousel-item:nth-of-type(1),.carousel .carousel-locator:nth-of-type(2):checked~.carousel-container .carousel-item:nth-of-type(2),.carousel .carousel-locator:nth-of-type(3):checked~.carousel-container .carousel-item:nth-of-type(3),.carousel .carousel-locator:nth-of-type(4):checked~.carousel-container .carousel-item:nth-of-type(4),.carousel .carousel-locator:nth-of-type(5):checked~.carousel-container .carousel-item:nth-of-type(5),.carousel .carousel-locator:nth-of-type(6):checked~.carousel-container .carousel-item:nth-of-type(6),.carousel .carousel-locator:nth-of-type(7):checked~.carousel-container .carousel-item:nth-of-type(7),.carousel .carousel-locator:nth-of-type(8):checked~.carousel-container .carousel-item:nth-of-type(8){animation:carousel-slidein .75s ease-in-out 1;opacity:1;z-index:100}.carousel .carousel-locator:nth-of-type(1):checked~.carousel-nav .nav-item:nth-of-type(1),.carousel .carousel-locator:nth-of-type(2):checked~.carousel-nav .nav-item:nth-of-type(2),.carousel .carousel-locator:nth-of-type(3):checked~.carousel-nav .nav-item:nth-of-type(3),.carousel .carousel-locator:nth-of-type(4):checked~.carousel-nav .nav-item:nth-of-type(4),.carousel .carousel-locator:nth-of-type(5):checked~.carousel-nav .nav-item:nth-of-type(5),.carousel .carousel-locator:nth-of-type(6):checked~.carousel-nav .nav-item:nth-of-type(6),.carousel .carousel-locator:nth-of-type(7):checked~.carousel-nav .nav-item:nth-of-type(7),.carousel .carousel-locator:nth-of-type(8):checked~.carousel-nav .nav-item:nth-of-type(8){color:#f7f8f9}.carousel{background:#f7f8f9;display:block;overflow:hidden;-webkit-overflow-scrolling:touch;position:relative;width:100%;z-index:1}.carousel .carousel-container{height:100%;left:0;position:relative}.carousel .carousel-container::before{content:"";display:block;padding-bottom:56.25%}.carousel .carousel-container .carousel-item{animation:carousel-slideout 1s ease-in-out 1;height:100%;left:0;margin:0;opacity:0;position:absolute;top:0;width:100%}.carousel .carousel-container .carousel-item:hover .item-next,.carousel .carousel-container .carousel-item:hover .item-prev{opacity:1}.carousel .carousel-container .item-next,.carousel .carousel-container .item-prev{background:rgba(247,248,249,.25);border-color:rgba(247,248,249,.5);color:#f7f8f9;opacity:0;position:absolute;top:50%;transform:translateY(-50%);transition:all .4s;z-index:100}.carousel .carousel-container .item-prev{left:1rem}.carousel .carousel-container .item-next{right:1rem}.carousel .carousel-nav{bottom:.4rem;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;left:50%;position:absolute;transform:translateX(-50%);width:10rem;z-index:100}.carousel .carousel-nav .nav-item{color:rgba(247,248,249,.5);display:block;-ms-flex:1 0 auto;flex:1 0 auto;height:1.6rem;margin:.2rem;max-width:2.5rem;position:relative}.carousel .carousel-nav .nav-item::before{background:currentColor;content:"";display:block;height:.1rem;position:absolute;top:.5rem;width:100%}@keyframes carousel-slidein{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes carousel-slideout{0%{opacity:1;transform:translateX(0)}100%{opacity:1;transform:translateX(-50%)}}.comparison-slider{height:50vh;overflow:hidden;-webkit-overflow-scrolling:touch;position:relative;width:100%}.comparison-slider .comparison-after,.comparison-slider .comparison-before{height:100%;left:0;margin:0;overflow:hidden;position:absolute;top:0}.comparison-slider .comparison-after img,.comparison-slider .comparison-before img{height:100%;object-fit:cover;object-position:left center;position:absolute;width:100%}.comparison-slider .comparison-before{width:100%;z-index:1}.comparison-slider .comparison-before .comparison-label{right:.8rem}.comparison-slider .comparison-after{max-width:100%;min-width:0;z-index:2}.comparison-slider .comparison-after::before{background:0 0;content:"";cursor:default;height:100%;left:0;position:absolute;right:.8rem;top:0;z-index:1}.comparison-slider .comparison-after::after{background:currentColor;border-radius:50%;box-shadow:0 -5px,0 5px;color:#fff;content:"";height:3px;pointer-events:none;position:absolute;right:.4rem;top:50%;transform:translate(50%,-50%);width:3px}.comparison-slider .comparison-after .comparison-label{left:.8rem}.comparison-slider .comparison-resizer{animation:first-run 1.5s 1 ease-in-out;cursor:ew-resize;height:.8rem;left:0;max-width:100%;min-width:.8rem;opacity:0;outline:0;position:relative;resize:horizontal;top:50%;transform:translateY(-50%) scaleY(30);width:0}.comparison-slider .comparison-label{background:rgba(48,55,66,.5);bottom:.8rem;color:#fff;padding:.2rem .4rem;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@keyframes first-run{0%{width:0}25%{width:2.4rem}50%{width:.8rem}75%{width:1.2rem}100%{width:0}}.filter .filter-tag#tag-0:checked~.filter-nav .chip[for=tag-0],.filter .filter-tag#tag-1:checked~.filter-nav .chip[for=tag-1],.filter .filter-tag#tag-2:checked~.filter-nav .chip[for=tag-2],.filter .filter-tag#tag-3:checked~.filter-nav .chip[for=tag-3],.filter .filter-tag#tag-4:checked~.filter-nav .chip[for=tag-4],.filter .filter-tag#tag-5:checked~.filter-nav .chip[for=tag-5],.filter .filter-tag#tag-6:checked~.filter-nav .chip[for=tag-6],.filter .filter-tag#tag-7:checked~.filter-nav .chip[for=tag-7],.filter .filter-tag#tag-8:checked~.filter-nav .chip[for=tag-8]{background:#5755d9;color:#fff}.filter .filter-tag#tag-1:checked~.filter-body .filter-item:not([data-tag~=tag-1]),.filter .filter-tag#tag-2:checked~.filter-body .filter-item:not([data-tag~=tag-2]),.filter .filter-tag#tag-3:checked~.filter-body .filter-item:not([data-tag~=tag-3]),.filter .filter-tag#tag-4:checked~.filter-body .filter-item:not([data-tag~=tag-4]),.filter .filter-tag#tag-5:checked~.filter-body .filter-item:not([data-tag~=tag-5]),.filter .filter-tag#tag-6:checked~.filter-body .filter-item:not([data-tag~=tag-6]),.filter .filter-tag#tag-7:checked~.filter-body .filter-item:not([data-tag~=tag-7]),.filter .filter-tag#tag-8:checked~.filter-body .filter-item:not([data-tag~=tag-8]){display:none}.filter .filter-nav{margin:.4rem 0}.filter .filter-body{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.meter{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#f7f8f9;border:0;border-radius:.1rem;display:block;height:.8rem;width:100%}.meter::-webkit-meter-inner-element{display:block}.meter::-webkit-meter-bar,.meter::-webkit-meter-even-less-good-value,.meter::-webkit-meter-optimum-value,.meter::-webkit-meter-suboptimum-value{border-radius:.1rem}.meter::-webkit-meter-bar{background:#f7f8f9}.meter::-webkit-meter-optimum-value{background:#32b643}.meter::-webkit-meter-suboptimum-value{background:#ffb700}.meter::-webkit-meter-even-less-good-value{background:#e85600}.meter:-moz-meter-optimum,.meter:-moz-meter-sub-optimum,.meter:-moz-meter-sub-sub-optimum,.meter::-moz-meter-bar{border-radius:.1rem}.meter:-moz-meter-optimum::-moz-meter-bar{background:#32b643}.meter:-moz-meter-sub-optimum::-moz-meter-bar{background:#ffb700}.meter:-moz-meter-sub-sub-optimum::-moz-meter-bar{background:#e85600}.off-canvas{display:-ms-flexbox;display:flex;-ms-flex-flow:nowrap;flex-flow:nowrap;height:100%;position:relative;width:100%}.off-canvas .off-canvas-toggle{display:block;left:.4rem;position:absolute;top:.4rem;transition:none;z-index:1}.off-canvas .off-canvas-sidebar{background:#f7f8f9;bottom:0;left:0;min-width:10rem;overflow-y:auto;position:fixed;top:0;transform:translateX(-100%);transition:transform .25s;z-index:200}.off-canvas .off-canvas-content{-ms-flex:1 1 auto;flex:1 1 auto;height:100%;padding:.4rem .4rem .4rem 4rem}.off-canvas .off-canvas-overlay{background:rgba(48,55,66,.1);border-color:transparent;border-radius:0;bottom:0;display:none;height:100%;left:0;position:fixed;right:0;top:0;width:100%}.off-canvas .off-canvas-sidebar.active,.off-canvas .off-canvas-sidebar:target{transform:translateX(0)}.off-canvas .off-canvas-sidebar.active~.off-canvas-overlay,.off-canvas .off-canvas-sidebar:target~.off-canvas-overlay{display:block;z-index:100}@media (min-width:960px){.off-canvas.off-canvas-sidebar-show .off-canvas-toggle{display:none}.off-canvas.off-canvas-sidebar-show .off-canvas-sidebar{-ms-flex:0 0 auto;flex:0 0 auto;position:relative;transform:none}.off-canvas.off-canvas-sidebar-show .off-canvas-overlay{display:none!important}}.parallax{display:block;height:auto;position:relative;width:auto}.parallax .parallax-content{box-shadow:0 1rem 2.1rem rgba(48,55,66,.3);height:auto;transform:perspective(1000px);transform-style:preserve-3d;transition:all .4s ease;width:100%}.parallax .parallax-content::before{content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%}.parallax .parallax-front{align-items:center;color:#fff;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-pack:center;height:100%;justify-content:center;left:0;position:absolute;text-align:center;text-shadow:0 0 20px rgba(48,55,66,.75);top:0;transform:translateZ(50px) scale(.95);transition:transform .4s;width:100%;z-index:1}.parallax .parallax-top-left{height:50%;left:0;outline:0;position:absolute;top:0;width:50%;z-index:100}.parallax .parallax-top-left:focus~.parallax-content,.parallax .parallax-top-left:hover~.parallax-content{transform:perspective(1000px) rotateX(3deg) rotateY(-3deg)}.parallax .parallax-top-left:focus~.parallax-content::before,.parallax .parallax-top-left:hover~.parallax-content::before{background:linear-gradient(135deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-top-left:focus~.parallax-content .parallax-front,.parallax .parallax-top-left:hover~.parallax-content .parallax-front{transform:translate3d(4.5px,4.5px,50px) scale(.95)}.parallax .parallax-top-right{height:50%;outline:0;position:absolute;right:0;top:0;width:50%;z-index:100}.parallax .parallax-top-right:focus~.parallax-content,.parallax .parallax-top-right:hover~.parallax-content{transform:perspective(1000px) rotateX(3deg) rotateY(3deg)}.parallax .parallax-top-right:focus~.parallax-content::before,.parallax .parallax-top-right:hover~.parallax-content::before{background:linear-gradient(-135deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-top-right:focus~.parallax-content .parallax-front,.parallax .parallax-top-right:hover~.parallax-content .parallax-front{transform:translate3d(-4.5px,4.5px,50px) scale(.95)}.parallax .parallax-bottom-left{bottom:0;height:50%;left:0;outline:0;position:absolute;width:50%;z-index:100}.parallax .parallax-bottom-left:focus~.parallax-content,.parallax .parallax-bottom-left:hover~.parallax-content{transform:perspective(1000px) rotateX(-3deg) rotateY(-3deg)}.parallax .parallax-bottom-left:focus~.parallax-content::before,.parallax .parallax-bottom-left:hover~.parallax-content::before{background:linear-gradient(45deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-bottom-left:focus~.parallax-content .parallax-front,.parallax .parallax-bottom-left:hover~.parallax-content .parallax-front{transform:translate3d(4.5px,-4.5px,50px) scale(.95)}.parallax .parallax-bottom-right{bottom:0;height:50%;outline:0;position:absolute;right:0;width:50%;z-index:100}.parallax .parallax-bottom-right:focus~.parallax-content,.parallax .parallax-bottom-right:hover~.parallax-content{transform:perspective(1000px) rotateX(-3deg) rotateY(3deg)}.parallax .parallax-bottom-right:focus~.parallax-content::before,.parallax .parallax-bottom-right:hover~.parallax-content::before{background:linear-gradient(-45deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-bottom-right:focus~.parallax-content .parallax-front,.parallax .parallax-bottom-right:hover~.parallax-content .parallax-front{transform:translate3d(-4.5px,-4.5px,50px) scale(.95)}.progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#eef0f3;border:0;border-radius:.1rem;color:#5755d9;height:.2rem;position:relative;width:100%}.progress::-webkit-progress-bar{background:0 0;border-radius:.1rem}.progress::-webkit-progress-value{background:#5755d9;border-radius:.1rem}.progress::-moz-progress-bar{background:#5755d9;border-radius:.1rem}.progress:indeterminate{animation:progress-indeterminate 1.5s linear infinite;background:#eef0f3 linear-gradient(to right,#5755d9 30%,#eef0f3 30%) top left/150% 150% no-repeat}.progress:indeterminate::-moz-progress-bar{background:0 0}@keyframes progress-indeterminate{0%{background-position:200% 0}100%{background-position:-200% 0}}.slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;display:block;height:1.2rem;width:100%}.slider:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2);outline:0}.slider.tooltip:not([data-tooltip])::after{content:attr(value)}.slider::-webkit-slider-thumb{-webkit-appearance:none;background:#5755d9;border:0;border-radius:50%;height:.6rem;margin-top:-.25rem;-webkit-transition:transform .2s;transition:transform .2s;width:.6rem}.slider::-moz-range-thumb{background:#5755d9;border:0;border-radius:50%;height:.6rem;-moz-transition:transform .2s;transition:transform .2s;width:.6rem}.slider::-ms-thumb{background:#5755d9;border:0;border-radius:50%;height:.6rem;-ms-transition:transform .2s;transition:transform .2s;width:.6rem}.slider:active::-webkit-slider-thumb{transform:scale(1.25)}.slider:active::-moz-range-thumb{transform:scale(1.25)}.slider:active::-ms-thumb{transform:scale(1.25)}.slider.disabled::-webkit-slider-thumb,.slider:disabled::-webkit-slider-thumb{background:#f7f8f9;transform:scale(1)}.slider.disabled::-moz-range-thumb,.slider:disabled::-moz-range-thumb{background:#f7f8f9;transform:scale(1)}.slider.disabled::-ms-thumb,.slider:disabled::-ms-thumb{background:#f7f8f9;transform:scale(1)}.slider::-webkit-slider-runnable-track{background:#eef0f3;border-radius:.1rem;height:.1rem;width:100%}.slider::-moz-range-track{background:#eef0f3;border-radius:.1rem;height:.1rem;width:100%}.slider::-ms-track{background:#eef0f3;border-radius:.1rem;height:.1rem;width:100%}.slider::-ms-fill-lower{background:#5755d9}.timeline .timeline-item{display:-ms-flexbox;display:flex;margin-bottom:1.2rem;position:relative}.timeline .timeline-item::before{background:#dadee4;content:"";height:100%;left:11px;position:absolute;top:1.2rem;width:2px}.timeline .timeline-item .timeline-left{-ms-flex:0 0 auto;flex:0 0 auto}.timeline .timeline-item .timeline-content{-ms-flex:1 1 auto;flex:1 1 auto;padding:2px 0 2px .8rem}.timeline .timeline-item .timeline-icon{align-items:center;border-radius:50%;color:#fff;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-pack:center;height:1.2rem;justify-content:center;text-align:center;width:1.2rem}.timeline .timeline-item .timeline-icon::before{border:.1rem solid #5755d9;border-radius:50%;content:"";display:block;height:.4rem;left:.4rem;position:absolute;top:.4rem;width:.4rem}.timeline .timeline-item .timeline-icon.icon-lg{background:#5755d9;line-height:1.2rem}.timeline .timeline-item .timeline-icon.icon-lg::before{content:none}.viewer-360{align-items:center;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-direction:column;flex-direction:column}.viewer-360 .viewer-slider[max="36"][value="1"]+.viewer-image{background-position-y:0}.viewer-360 .viewer-slider[max="36"][value="2"]+.viewer-image{background-position-y:2.8571428571%}.viewer-360 .viewer-slider[max="36"][value="3"]+.viewer-image{background-position-y:5.7142857143%}.viewer-360 .viewer-slider[max="36"][value="4"]+.viewer-image{background-position-y:8.5714285714%}.viewer-360 .viewer-slider[max="36"][value="5"]+.viewer-image{background-position-y:11.4285714286%}.viewer-360 .viewer-slider[max="36"][value="6"]+.viewer-image{background-position-y:14.2857142857%}.viewer-360 .viewer-slider[max="36"][value="7"]+.viewer-image{background-position-y:17.1428571429%}.viewer-360 .viewer-slider[max="36"][value="8"]+.viewer-image{background-position-y:20%}.viewer-360 .viewer-slider[max="36"][value="9"]+.viewer-image{background-position-y:22.8571428571%}.viewer-360 .viewer-slider[max="36"][value="10"]+.viewer-image{background-position-y:25.7142857143%}.viewer-360 .viewer-slider[max="36"][value="11"]+.viewer-image{background-position-y:28.5714285714%}.viewer-360 .viewer-slider[max="36"][value="12"]+.viewer-image{background-position-y:31.4285714286%}.viewer-360 .viewer-slider[max="36"][value="13"]+.viewer-image{background-position-y:34.2857142857%}.viewer-360 .viewer-slider[max="36"][value="14"]+.viewer-image{background-position-y:37.1428571429%}.viewer-360 .viewer-slider[max="36"][value="15"]+.viewer-image{background-position-y:40%}.viewer-360 .viewer-slider[max="36"][value="16"]+.viewer-image{background-position-y:42.8571428571%}.viewer-360 .viewer-slider[max="36"][value="17"]+.viewer-image{background-position-y:45.7142857143%}.viewer-360 .viewer-slider[max="36"][value="18"]+.viewer-image{background-position-y:48.5714285714%}.viewer-360 .viewer-slider[max="36"][value="19"]+.viewer-image{background-position-y:51.4285714286%}.viewer-360 .viewer-slider[max="36"][value="20"]+.viewer-image{background-position-y:54.2857142857%}.viewer-360 .viewer-slider[max="36"][value="21"]+.viewer-image{background-position-y:57.1428571429%}.viewer-360 .viewer-slider[max="36"][value="22"]+.viewer-image{background-position-y:60%}.viewer-360 .viewer-slider[max="36"][value="23"]+.viewer-image{background-position-y:62.8571428571%}.viewer-360 .viewer-slider[max="36"][value="24"]+.viewer-image{background-position-y:65.7142857143%}.viewer-360 .viewer-slider[max="36"][value="25"]+.viewer-image{background-position-y:68.5714285714%}.viewer-360 .viewer-slider[max="36"][value="26"]+.viewer-image{background-position-y:71.4285714286%}.viewer-360 .viewer-slider[max="36"][value="27"]+.viewer-image{background-position-y:74.2857142857%}.viewer-360 .viewer-slider[max="36"][value="28"]+.viewer-image{background-position-y:77.1428571429%}.viewer-360 .viewer-slider[max="36"][value="29"]+.viewer-image{background-position-y:80%}.viewer-360 .viewer-slider[max="36"][value="30"]+.viewer-image{background-position-y:82.8571428571%}.viewer-360 .viewer-slider[max="36"][value="31"]+.viewer-image{background-position-y:85.7142857143%}.viewer-360 .viewer-slider[max="36"][value="32"]+.viewer-image{background-position-y:88.5714285714%}.viewer-360 .viewer-slider[max="36"][value="33"]+.viewer-image{background-position-y:91.4285714286%}.viewer-360 .viewer-slider[max="36"][value="34"]+.viewer-image{background-position-y:94.2857142857%}.viewer-360 .viewer-slider[max="36"][value="35"]+.viewer-image{background-position-y:97.1428571429%}.viewer-360 .viewer-slider[max="36"][value="36"]+.viewer-image{background-position-y:100%}.viewer-360 .viewer-slider{cursor:ew-resize;-ms-flex-order:2;margin:1rem;order:2;width:60%}.viewer-360 .viewer-image{background-position-y:0;background-repeat:no-repeat;background-size:100%;-ms-flex-order:1;max-width:100%;order:1} \ No newline at end of file diff --git a/tools/web/src/main/resources/assets/spectre-icons.min.css b/tools/web/src/main/resources/assets/spectre-icons.min.css new file mode 100644 index 0000000000..0276f7b848 --- /dev/null +++ b/tools/web/src/main/resources/assets/spectre-icons.min.css @@ -0,0 +1 @@ +/*! Spectre.css Icons v0.5.9 | MIT License | github.com/picturepan2/spectre */.icon{box-sizing:border-box;display:inline-block;font-size:inherit;font-style:normal;height:1em;position:relative;text-indent:-9999px;vertical-align:middle;width:1em}.icon::after,.icon::before{content:"";display:block;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.icon.icon-2x{font-size:1.6rem}.icon.icon-3x{font-size:2.4rem}.icon.icon-4x{font-size:3.2rem}.accordion .icon,.btn .icon,.menu .icon,.toast .icon{vertical-align:-10%}.btn-lg .icon{vertical-align:-15%}.icon-arrow-down::before,.icon-arrow-left::before,.icon-arrow-right::before,.icon-arrow-up::before,.icon-back::before,.icon-downward::before,.icon-forward::before,.icon-upward::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.65em;width:.65em}.icon-arrow-down::before{transform:translate(-50%,-75%) rotate(225deg)}.icon-arrow-left::before{transform:translate(-25%,-50%) rotate(-45deg)}.icon-arrow-right::before{transform:translate(-75%,-50%) rotate(135deg)}.icon-arrow-up::before{transform:translate(-50%,-25%) rotate(45deg)}.icon-back::after,.icon-forward::after{background:currentColor;height:.1rem;width:.8em}.icon-downward::after,.icon-upward::after{background:currentColor;height:.8em;width:.1rem}.icon-back::after{left:55%}.icon-back::before{transform:translate(-50%,-50%) rotate(-45deg)}.icon-downward::after{top:45%}.icon-downward::before{transform:translate(-50%,-50%) rotate(-135deg)}.icon-forward::after{left:45%}.icon-forward::before{transform:translate(-50%,-50%) rotate(135deg)}.icon-upward::after{top:55%}.icon-upward::before{transform:translate(-50%,-50%) rotate(45deg)}.icon-caret::before{border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid currentColor;height:0;transform:translate(-50%,-25%);width:0}.icon-menu::before{background:currentColor;box-shadow:0 -.35em,0 .35em;height:.1rem;width:100%}.icon-apps::before{background:currentColor;box-shadow:-.35em -.35em,-.35em 0,-.35em .35em,0 -.35em,0 .35em,.35em -.35em,.35em 0,.35em .35em;height:3px;width:3px}.icon-resize-horiz::after,.icon-resize-horiz::before,.icon-resize-vert::after,.icon-resize-vert::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.45em;width:.45em}.icon-resize-horiz::before,.icon-resize-vert::before{transform:translate(-50%,-90%) rotate(45deg)}.icon-resize-horiz::after,.icon-resize-vert::after{transform:translate(-50%,-10%) rotate(225deg)}.icon-resize-horiz::before{transform:translate(-90%,-50%) rotate(-45deg)}.icon-resize-horiz::after{transform:translate(-10%,-50%) rotate(135deg)}.icon-more-horiz::before,.icon-more-vert::before{background:currentColor;border-radius:50%;box-shadow:-.4em 0,.4em 0;height:3px;width:3px}.icon-more-vert::before{box-shadow:0 -.4em,0 .4em}.icon-cross::before,.icon-minus::before,.icon-plus::before{background:currentColor;height:.1rem;width:100%}.icon-cross::after,.icon-plus::after{background:currentColor;height:100%;width:.1rem}.icon-cross::before{width:100%}.icon-cross::after{height:100%}.icon-cross::after,.icon-cross::before{transform:translate(-50%,-50%) rotate(45deg)}.icon-check::before{border:.1rem solid currentColor;border-right:0;border-top:0;height:.5em;transform:translate(-50%,-75%) rotate(-45deg);width:.9em}.icon-stop{border:.1rem solid currentColor;border-radius:50%}.icon-stop::before{background:currentColor;height:.1rem;transform:translate(-50%,-50%) rotate(45deg);width:1em}.icon-shutdown{border:.1rem solid currentColor;border-radius:50%;border-top-color:transparent}.icon-shutdown::before{background:currentColor;content:"";height:.5em;top:.1em;width:.1rem}.icon-refresh::before{border:.1rem solid currentColor;border-radius:50%;border-right-color:transparent;height:1em;width:1em}.icon-refresh::after{border:.2em solid currentColor;border-left-color:transparent;border-top-color:transparent;height:0;left:80%;top:20%;width:0}.icon-search::before{border:.1rem solid currentColor;border-radius:50%;height:.75em;left:5%;top:5%;transform:translate(0,0) rotate(45deg);width:.75em}.icon-search::after{background:currentColor;height:.1rem;left:80%;top:80%;transform:translate(-50%,-50%) rotate(45deg);width:.4em}.icon-edit::before{border:.1rem solid currentColor;height:.4em;transform:translate(-40%,-60%) rotate(-45deg);width:.85em}.icon-edit::after{border:.15em solid currentColor;border-right-color:transparent;border-top-color:transparent;height:0;left:5%;top:95%;transform:translate(0,-100%);width:0}.icon-delete::before{border:.1rem solid currentColor;border-bottom-left-radius:.1rem;border-bottom-right-radius:.1rem;border-top:0;height:.75em;top:60%;width:.75em}.icon-delete::after{background:currentColor;box-shadow:-.25em .2em,.25em .2em;height:.1rem;top:.05rem;width:.5em}.icon-share{border:.1rem solid currentColor;border-radius:.1rem;border-right:0;border-top:0}.icon-share::before{border:.1rem solid currentColor;border-left:0;border-top:0;height:.4em;left:100%;top:.25em;transform:translate(-125%,-50%) rotate(-45deg);width:.4em}.icon-share::after{border:.1rem solid currentColor;border-bottom:0;border-radius:75% 0;border-right:0;height:.5em;width:.6em}.icon-flag::before{background:currentColor;height:1em;left:15%;width:.1rem}.icon-flag::after{border:.1rem solid currentColor;border-bottom-right-radius:.1rem;border-left:0;border-top-right-radius:.1rem;height:.65em;left:60%;top:35%;width:.8em}.icon-bookmark::before{border:.1rem solid currentColor;border-bottom:0;border-top-left-radius:.1rem;border-top-right-radius:.1rem;height:.9em;width:.8em}.icon-bookmark::after{border:.1rem solid currentColor;border-bottom:0;border-left:0;border-radius:.1rem;height:.5em;transform:translate(-50%,35%) rotate(-45deg) skew(15deg,15deg);width:.5em}.icon-download,.icon-upload{border-bottom:.1rem solid currentColor}.icon-download::before,.icon-upload::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.5em;transform:translate(-50%,-60%) rotate(-135deg);width:.5em}.icon-download::after,.icon-upload::after{background:currentColor;height:.6em;top:40%;width:.1rem}.icon-upload::before{transform:translate(-50%,-60%) rotate(45deg)}.icon-upload::after{top:50%}.icon-copy::before{border:.1rem solid currentColor;border-bottom:0;border-radius:.1rem;border-right:0;height:.8em;left:40%;top:35%;width:.8em}.icon-copy::after{border:.1rem solid currentColor;border-radius:.1rem;height:.8em;left:60%;top:60%;width:.8em}.icon-time{border:.1rem solid currentColor;border-radius:50%}.icon-time::before{background:currentColor;height:.4em;transform:translate(-50%,-75%);width:.1rem}.icon-time::after{background:currentColor;height:.3em;transform:translate(-50%,-75%) rotate(90deg);transform-origin:50% 90%;width:.1rem}.icon-mail::before{border:.1rem solid currentColor;border-radius:.1rem;height:.8em;width:1em}.icon-mail::after{border:.1rem solid currentColor;border-right:0;border-top:0;height:.5em;transform:translate(-50%,-90%) rotate(-45deg) skew(10deg,10deg);width:.5em}.icon-people::before{border:.1rem solid currentColor;border-radius:50%;height:.45em;top:25%;width:.45em}.icon-people::after{border:.1rem solid currentColor;border-radius:50% 50% 0 0;height:.4em;top:75%;width:.9em}.icon-message{border:.1rem solid currentColor;border-bottom:0;border-radius:.1rem;border-right:0}.icon-message::before{border:.1rem solid currentColor;border-bottom-right-radius:.1rem;border-left:0;border-top:0;height:.8em;left:65%;top:40%;width:.7em}.icon-message::after{background:currentColor;border-radius:.1rem;height:.3em;left:10%;top:100%;transform:translate(0,-90%) rotate(45deg);width:.1rem}.icon-photo{border:.1rem solid currentColor;border-radius:.1rem}.icon-photo::before{border:.1rem solid currentColor;border-radius:50%;height:.25em;left:35%;top:35%;width:.25em}.icon-photo::after{border:.1rem solid currentColor;border-bottom:0;border-left:0;height:.5em;left:60%;transform:translate(-50%,25%) rotate(-45deg);width:.5em}.icon-link::after,.icon-link::before{border:.1rem solid currentColor;border-radius:5em 0 0 5em;border-right:0;height:.5em;width:.75em}.icon-link::before{transform:translate(-70%,-45%) rotate(-45deg)}.icon-link::after{transform:translate(-30%,-55%) rotate(135deg)}.icon-location::before{border:.1rem solid currentColor;border-radius:50% 50% 50% 0;height:.8em;transform:translate(-50%,-60%) rotate(-45deg);width:.8em}.icon-location::after{border:.1rem solid currentColor;border-radius:50%;height:.2em;transform:translate(-50%,-80%);width:.2em}.icon-emoji{border:.1rem solid currentColor;border-radius:50%}.icon-emoji::before{border-radius:50%;box-shadow:-.17em -.1em,.17em -.1em;height:.15em;width:.15em}.icon-emoji::after{border:.1rem solid currentColor;border-bottom-color:transparent;border-radius:50%;border-right-color:transparent;height:.5em;transform:translate(-50%,-40%) rotate(-135deg);width:.5em} \ No newline at end of file diff --git a/tools/web/src/main/resources/assets/spectre.min.css b/tools/web/src/main/resources/assets/spectre.min.css new file mode 100644 index 0000000000..0fe23d9c09 --- /dev/null +++ b/tools/web/src/main/resources/assets/spectre.min.css @@ -0,0 +1 @@ +/*! Spectre.css v0.5.9 | MIT License | github.com/picturepan2/spectre */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}address{font-style:normal}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:"SF Mono","Segoe UI Mono","Roboto Mono",Menlo,Courier,monospace;font-size:1em}dfn{font-style:italic}small{font-size:80%;font-weight:400}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}fieldset{border:0;margin:0;padding:0}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item;outline:0}canvas{display:inline-block}template{display:none}[hidden]{display:none}*,::after,::before{box-sizing:inherit}html{box-sizing:border-box;font-size:20px;line-height:1.5;-webkit-tap-highlight-color:transparent}body{background:#fff;color:#3b4351;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;font-size:.8rem;overflow-x:hidden;text-rendering:optimizeLegibility}a{color:#5755d9;outline:0;text-decoration:none}a:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}a.active,a:active,a:focus,a:hover{color:#302ecd;text-decoration:underline}a:visited{color:#807fe2}h1,h2,h3,h4,h5,h6{color:inherit;font-weight:500;line-height:1.2;margin-bottom:.5em;margin-top:0}.h1,.h2,.h3,.h4,.h5,.h6{font-weight:500}.h1,h1{font-size:2rem}.h2,h2{font-size:1.6rem}.h3,h3{font-size:1.4rem}.h4,h4{font-size:1.2rem}.h5,h5{font-size:1rem}.h6,h6{font-size:.8rem}p{margin:0 0 1.2rem}a,ins,u{-webkit-text-decoration-skip:ink edges;text-decoration-skip:ink edges}abbr[title]{border-bottom:.05rem dotted;cursor:help;text-decoration:none}kbd{background:#303742;border-radius:.1rem;color:#fff;font-size:.7rem;line-height:1.25;padding:.1rem .2rem}mark{background:#ffe9b3;border-bottom:.05rem solid #ffd367;border-radius:.1rem;color:#3b4351;padding:.05rem .1rem 0}blockquote{border-left:.1rem solid #dadee4;margin-left:0;padding:.4rem .8rem}blockquote p:last-child{margin-bottom:0}ol,ul{margin:.8rem 0 .8rem .8rem;padding:0}ol ol,ol ul,ul ol,ul ul{margin:.8rem 0 .8rem .8rem}ol li,ul li{margin-top:.4rem}ul{list-style:disc inside}ul ul{list-style-type:circle}ol{list-style:decimal inside}ol ol{list-style-type:lower-alpha}dl dt{font-weight:700}dl dd{margin:.4rem 0 .8rem 0}.lang-zh,.lang-zh-hans,html:lang(zh),html:lang(zh-Hans){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",sans-serif}.lang-zh-hant,html:lang(zh-Hant){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang TC","Hiragino Sans CNS","Microsoft JhengHei","Helvetica Neue",sans-serif}.lang-ja,html:lang(ja){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Hiragino Sans","Hiragino Kaku Gothic Pro","Yu Gothic",YuGothic,Meiryo,"Helvetica Neue",sans-serif}.lang-ko,html:lang(ko){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Malgun Gothic","Helvetica Neue",sans-serif}.lang-cjk ins,.lang-cjk u,:lang(ja) ins,:lang(ja) u,:lang(zh) ins,:lang(zh) u{border-bottom:.05rem solid;text-decoration:none}.lang-cjk del+del,.lang-cjk del+s,.lang-cjk ins+ins,.lang-cjk ins+u,.lang-cjk s+del,.lang-cjk s+s,.lang-cjk u+ins,.lang-cjk u+u,:lang(ja) del+del,:lang(ja) del+s,:lang(ja) ins+ins,:lang(ja) ins+u,:lang(ja) s+del,:lang(ja) s+s,:lang(ja) u+ins,:lang(ja) u+u,:lang(zh) del+del,:lang(zh) del+s,:lang(zh) ins+ins,:lang(zh) ins+u,:lang(zh) s+del,:lang(zh) s+s,:lang(zh) u+ins,:lang(zh) u+u{margin-left:.125em}.table{border-collapse:collapse;border-spacing:0;text-align:left;width:100%}.table.table-striped tbody tr:nth-of-type(odd){background:#f7f8f9}.table tbody tr.active,.table.table-striped tbody tr.active{background:#eef0f3}.table.table-hover tbody tr:hover{background:#eef0f3}.table.table-scroll{display:block;overflow-x:auto;padding-bottom:.75rem;white-space:nowrap}.table td,.table th{border-bottom:.05rem solid #dadee4;padding:.6rem .4rem}.table th{border-bottom-width:.1rem}.btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:.05rem solid #5755d9;border-radius:.1rem;color:#5755d9;cursor:pointer;display:inline-block;font-size:.8rem;height:1.8rem;line-height:1.2rem;outline:0;padding:.25rem .4rem;text-align:center;text-decoration:none;transition:background .2s,border .2s,box-shadow .2s,color .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.btn:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.btn:focus,.btn:hover{background:#f1f1fc;border-color:#4b48d6;text-decoration:none}.btn.active,.btn:active{background:#4b48d6;border-color:#3634d2;color:#fff;text-decoration:none}.btn.active.loading::after,.btn:active.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.disabled,.btn:disabled,.btn[disabled]{cursor:default;opacity:.5;pointer-events:none}.btn.btn-primary{background:#5755d9;border-color:#4b48d6;color:#fff}.btn.btn-primary:focus,.btn.btn-primary:hover{background:#4240d4;border-color:#3634d2;color:#fff}.btn.btn-primary.active,.btn.btn-primary:active{background:#3a38d2;border-color:#302ecd;color:#fff}.btn.btn-primary.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.btn-success{background:#32b643;border-color:#2faa3f;color:#fff}.btn.btn-success:focus{box-shadow:0 0 0 .1rem rgba(50,182,67,.2)}.btn.btn-success:focus,.btn.btn-success:hover{background:#30ae40;border-color:#2da23c;color:#fff}.btn.btn-success.active,.btn.btn-success:active{background:#2a9a39;border-color:#278e34;color:#fff}.btn.btn-success.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.btn-error{background:#e85600;border-color:#d95000;color:#fff}.btn.btn-error:focus{box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.btn.btn-error:focus,.btn.btn-error:hover{background:#de5200;border-color:#cf4d00;color:#fff}.btn.btn-error.active,.btn.btn-error:active{background:#c44900;border-color:#b54300;color:#fff}.btn.btn-error.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.btn-link{background:0 0;border-color:transparent;color:#5755d9}.btn.btn-link.active,.btn.btn-link:active,.btn.btn-link:focus,.btn.btn-link:hover{color:#302ecd}.btn.btn-sm{font-size:.7rem;height:1.4rem;padding:.05rem .3rem}.btn.btn-lg{font-size:.9rem;height:2rem;padding:.35rem .6rem}.btn.btn-block{display:block;width:100%}.btn.btn-action{padding-left:0;padding-right:0;width:1.8rem}.btn.btn-action.btn-sm{width:1.4rem}.btn.btn-action.btn-lg{width:2rem}.btn.btn-clear{background:0 0;border:0;color:currentColor;height:1rem;line-height:.8rem;margin-left:.2rem;margin-right:-2px;opacity:1;padding:.1rem;text-decoration:none;width:1rem}.btn.btn-clear:focus,.btn.btn-clear:hover{background:rgba(247,248,249,.5);opacity:.95}.btn.btn-clear::before{content:"\2715"}.btn-group{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.btn-group .btn{-ms-flex:1 0 auto;flex:1 0 auto}.btn-group .btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group .btn:not(:first-child):not(:last-child){border-radius:0;margin-left:-.05rem}.btn-group .btn:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-.05rem}.btn-group .btn.active,.btn-group .btn:active,.btn-group .btn:focus,.btn-group .btn:hover{z-index:1}.btn-group.btn-group-block{display:-ms-flexbox;display:flex}.btn-group.btn-group-block .btn{-ms-flex:1 0 0;flex:1 0 0}.form-group:not(:last-child){margin-bottom:.4rem}fieldset{margin-bottom:.8rem}legend{font-size:.9rem;font-weight:500;margin-bottom:.8rem}.form-label{display:block;line-height:1.2rem;padding:.3rem 0}.form-label.label-sm{font-size:.7rem;padding:.1rem 0}.form-label.label-lg{font-size:.9rem;padding:.4rem 0}.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;background-image:none;border:.05rem solid #bcc3ce;border-radius:.1rem;color:#3b4351;display:block;font-size:.8rem;height:1.8rem;line-height:1.2rem;max-width:100%;outline:0;padding:.25rem .4rem;position:relative;transition:background .2s,border .2s,box-shadow .2s,color .2s;width:100%}.form-input:focus{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-input:-ms-input-placeholder{color:#bcc3ce}.form-input::-ms-input-placeholder{color:#bcc3ce}.form-input::placeholder{color:#bcc3ce}.form-input.input-sm{font-size:.7rem;height:1.4rem;padding:.05rem .3rem}.form-input.input-lg{font-size:.9rem;height:2rem;padding:.35rem .6rem}.form-input.input-inline{display:inline-block;vertical-align:middle;width:auto}.form-input[type=file]{height:auto}textarea.form-input,textarea.form-input.input-lg,textarea.form-input.input-sm{height:auto}.form-input-hint{color:#bcc3ce;font-size:.7rem;margin-top:.2rem}.has-success .form-input-hint,.is-success+.form-input-hint{color:#32b643}.has-error .form-input-hint,.is-error+.form-input-hint{color:#e85600}.form-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:.05rem solid #bcc3ce;border-radius:.1rem;color:inherit;font-size:.8rem;height:1.8rem;line-height:1.2rem;outline:0;padding:.25rem .4rem;vertical-align:middle;width:100%}.form-select:focus{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-select::-ms-expand{display:none}.form-select.select-sm{font-size:.7rem;height:1.4rem;padding:.05rem 1.1rem .05rem .3rem}.form-select.select-lg{font-size:.9rem;height:2rem;padding:.35rem 1.4rem .35rem .6rem}.form-select[multiple],.form-select[size]{height:auto;padding:.25rem .4rem}.form-select[multiple] option,.form-select[size] option{padding:.1rem .2rem}.form-select:not([multiple]):not([size]){background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%204%205'%3E%3Cpath%20fill='%23667189'%20d='M2%200L0%202h4zm0%205L0%203h4z'/%3E%3C/svg%3E") no-repeat right .35rem center/.4rem .5rem;padding-right:1.2rem}.has-icon-left,.has-icon-right{position:relative}.has-icon-left .form-icon,.has-icon-right .form-icon{height:.8rem;margin:0 .25rem;position:absolute;top:50%;transform:translateY(-50%);width:.8rem;z-index:2}.has-icon-left .form-icon{left:.05rem}.has-icon-left .form-input{padding-left:1.3rem}.has-icon-right .form-icon{right:.05rem}.has-icon-right .form-input{padding-right:1.3rem}.form-checkbox,.form-radio,.form-switch{display:block;line-height:1.2rem;margin:.2rem 0;min-height:1.4rem;padding:.1rem .4rem .1rem 1.2rem;position:relative}.form-checkbox input,.form-radio input,.form-switch input{clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;position:absolute;width:1px}.form-checkbox input:focus+.form-icon,.form-radio input:focus+.form-icon,.form-switch input:focus+.form-icon{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-checkbox input:checked+.form-icon,.form-radio input:checked+.form-icon,.form-switch input:checked+.form-icon{background:#5755d9;border-color:#5755d9}.form-checkbox .form-icon,.form-radio .form-icon,.form-switch .form-icon{border:.05rem solid #bcc3ce;cursor:pointer;display:inline-block;position:absolute;transition:background .2s,border .2s,box-shadow .2s,color .2s}.form-checkbox.input-sm,.form-radio.input-sm,.form-switch.input-sm{font-size:.7rem;margin:0}.form-checkbox.input-lg,.form-radio.input-lg,.form-switch.input-lg{font-size:.9rem;margin:.3rem 0}.form-checkbox .form-icon,.form-radio .form-icon{background:#fff;height:.8rem;left:0;top:.3rem;width:.8rem}.form-checkbox input:active+.form-icon,.form-radio input:active+.form-icon{background:#eef0f3}.form-checkbox .form-icon{border-radius:.1rem}.form-checkbox input:checked+.form-icon::before{background-clip:padding-box;border:.1rem solid #fff;border-left-width:0;border-top-width:0;content:"";height:9px;left:50%;margin-left:-3px;margin-top:-6px;position:absolute;top:50%;transform:rotate(45deg);width:6px}.form-checkbox input:indeterminate+.form-icon{background:#5755d9;border-color:#5755d9}.form-checkbox input:indeterminate+.form-icon::before{background:#fff;content:"";height:2px;left:50%;margin-left:-5px;margin-top:-1px;position:absolute;top:50%;width:10px}.form-radio .form-icon{border-radius:50%}.form-radio input:checked+.form-icon::before{background:#fff;border-radius:50%;content:"";height:6px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:6px}.form-switch{padding-left:2rem}.form-switch .form-icon{background:#bcc3ce;background-clip:padding-box;border-radius:.45rem;height:.9rem;left:0;top:.25rem;width:1.6rem}.form-switch .form-icon::before{background:#fff;border-radius:50%;content:"";display:block;height:.8rem;left:0;position:absolute;top:0;transition:background .2s,border .2s,box-shadow .2s,color .2s,left .2s;width:.8rem}.form-switch input:checked+.form-icon::before{left:14px}.form-switch input:active+.form-icon::before{background:#f7f8f9}.input-group{display:-ms-flexbox;display:flex}.input-group .input-group-addon{background:#f7f8f9;border:.05rem solid #bcc3ce;border-radius:.1rem;line-height:1.2rem;padding:.25rem .4rem;white-space:nowrap}.input-group .input-group-addon.addon-sm{font-size:.7rem;padding:.05rem .3rem}.input-group .input-group-addon.addon-lg{font-size:.9rem;padding:.35rem .6rem}.input-group .form-input,.input-group .form-select{-ms-flex:1 1 auto;flex:1 1 auto;width:1%}.input-group .input-group-btn{z-index:1}.input-group .form-input:first-child:not(:last-child),.input-group .form-select:first-child:not(:last-child),.input-group .input-group-addon:first-child:not(:last-child),.input-group .input-group-btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.input-group .form-input:not(:first-child):not(:last-child),.input-group .form-select:not(:first-child):not(:last-child),.input-group .input-group-addon:not(:first-child):not(:last-child),.input-group .input-group-btn:not(:first-child):not(:last-child){border-radius:0;margin-left:-.05rem}.input-group .form-input:last-child:not(:first-child),.input-group .form-select:last-child:not(:first-child),.input-group .input-group-addon:last-child:not(:first-child),.input-group .input-group-btn:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-.05rem}.input-group .form-input:focus,.input-group .form-select:focus,.input-group .input-group-addon:focus,.input-group .input-group-btn:focus{z-index:2}.input-group .form-select{width:auto}.input-group.input-inline{display:-ms-inline-flexbox;display:inline-flex}.form-input.is-success,.form-select.is-success,.has-success .form-input,.has-success .form-select{background:#f9fdfa;border-color:#32b643}.form-input.is-success:focus,.form-select.is-success:focus,.has-success .form-input:focus,.has-success .form-select:focus{box-shadow:0 0 0 .1rem rgba(50,182,67,.2)}.form-input.is-error,.form-select.is-error,.has-error .form-input,.has-error .form-select{background:#fffaf7;border-color:#e85600}.form-input.is-error:focus,.form-select.is-error:focus,.has-error .form-input:focus,.has-error .form-select:focus{box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-checkbox.is-error .form-icon,.form-radio.is-error .form-icon,.form-switch.is-error .form-icon,.has-error .form-checkbox .form-icon,.has-error .form-radio .form-icon,.has-error .form-switch .form-icon{border-color:#e85600}.form-checkbox.is-error input:checked+.form-icon,.form-radio.is-error input:checked+.form-icon,.form-switch.is-error input:checked+.form-icon,.has-error .form-checkbox input:checked+.form-icon,.has-error .form-radio input:checked+.form-icon,.has-error .form-switch input:checked+.form-icon{background:#e85600;border-color:#e85600}.form-checkbox.is-error input:focus+.form-icon,.form-radio.is-error input:focus+.form-icon,.form-switch.is-error input:focus+.form-icon,.has-error .form-checkbox input:focus+.form-icon,.has-error .form-radio input:focus+.form-icon,.has-error .form-switch input:focus+.form-icon{border-color:#e85600;box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-checkbox.is-error input:indeterminate+.form-icon,.has-error .form-checkbox input:indeterminate+.form-icon{background:#e85600;border-color:#e85600}.form-input:not(:-ms-input-placeholder):invalid{border-color:#e85600}.form-input:not(:placeholder-shown):invalid{border-color:#e85600}.form-input:not(:-ms-input-placeholder):invalid:focus{background:#fffaf7;box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-input:not(:placeholder-shown):invalid:focus{background:#fffaf7;box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-input:not(:-ms-input-placeholder):invalid+.form-input-hint{color:#e85600}.form-input:not(:placeholder-shown):invalid+.form-input-hint{color:#e85600}.form-input.disabled,.form-input:disabled,.form-select.disabled,.form-select:disabled{background-color:#eef0f3;cursor:not-allowed;opacity:.5}.form-input[readonly]{background-color:#f7f8f9}input.disabled+.form-icon,input:disabled+.form-icon{background:#eef0f3;cursor:not-allowed;opacity:.5}.form-switch input.disabled+.form-icon::before,.form-switch input:disabled+.form-icon::before{background:#fff}.form-horizontal{padding:.4rem 0}.form-horizontal .form-group{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.form-inline{display:inline-block}.label{background:#eef0f3;border-radius:.1rem;color:#455060;display:inline-block;line-height:1.25;padding:.1rem .2rem}.label.label-rounded{border-radius:5rem;padding-left:.4rem;padding-right:.4rem}.label.label-primary{background:#5755d9;color:#fff}.label.label-secondary{background:#f1f1fc;color:#5755d9}.label.label-success{background:#32b643;color:#fff}.label.label-warning{background:#ffb700;color:#fff}.label.label-error{background:#e85600;color:#fff}code{background:#fcf2f2;border-radius:.1rem;color:#d73e48;font-size:85%;line-height:1.25;padding:.1rem .2rem}.code{border-radius:.1rem;color:#3b4351;position:relative}.code::before{color:#bcc3ce;content:attr(data-lang);font-size:.7rem;position:absolute;right:.4rem;top:.1rem}.code code{background:#f7f8f9;color:inherit;display:block;line-height:1.5;overflow-x:auto;padding:1rem;width:100%}.img-responsive{display:block;height:auto;max-width:100%}.img-fit-cover{object-fit:cover}.img-fit-contain{object-fit:contain}.video-responsive{display:block;overflow:hidden;padding:0;position:relative;width:100%}.video-responsive::before{content:"";display:block;padding-bottom:56.25%}.video-responsive embed,.video-responsive iframe,.video-responsive object{border:0;bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}video.video-responsive{height:auto;max-width:100%}video.video-responsive::before{content:none}.video-responsive-4-3::before{padding-bottom:75%}.video-responsive-1-1::before{padding-bottom:100%}.figure{margin:0 0 .4rem 0}.figure .figure-caption{color:#66758c;margin-top:.4rem}.container{margin-left:auto;margin-right:auto;padding-left:.4rem;padding-right:.4rem;width:100%}.container.grid-xl{max-width:1296px}.container.grid-lg{max-width:976px}.container.grid-md{max-width:856px}.container.grid-sm{max-width:616px}.container.grid-xs{max-width:496px}.show-lg,.show-md,.show-sm,.show-xl,.show-xs{display:none!important}.cols,.columns{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:-.4rem;margin-right:-.4rem}.cols.col-gapless,.columns.col-gapless{margin-left:0;margin-right:0}.cols.col-gapless>.column,.columns.col-gapless>.column{padding-left:0;padding-right:0}.cols.col-oneline,.columns.col-oneline{-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto}.column,[class~=col-]{-ms-flex:1;flex:1;max-width:100%;padding-left:.4rem;padding-right:.4rem}.column.col-1,.column.col-10,.column.col-11,.column.col-12,.column.col-2,.column.col-3,.column.col-4,.column.col-5,.column.col-6,.column.col-7,.column.col-8,.column.col-9,.column.col-auto,[class~=col-].col-1,[class~=col-].col-10,[class~=col-].col-11,[class~=col-].col-12,[class~=col-].col-2,[class~=col-].col-3,[class~=col-].col-4,[class~=col-].col-5,[class~=col-].col-6,[class~=col-].col-7,[class~=col-].col-8,[class~=col-].col-9,[class~=col-].col-auto{-ms-flex:none;flex:none}.col-12{width:100%}.col-11{width:91.66666667%}.col-10{width:83.33333333%}.col-9{width:75%}.col-8{width:66.66666667%}.col-7{width:58.33333333%}.col-6{width:50%}.col-5{width:41.66666667%}.col-4{width:33.33333333%}.col-3{width:25%}.col-2{width:16.66666667%}.col-1{width:8.33333333%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;max-width:none;width:auto}.col-mx-auto{margin-left:auto;margin-right:auto}.col-ml-auto{margin-left:auto}.col-mr-auto{margin-right:auto}@media (max-width:1280px){.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{-ms-flex:none;flex:none}.col-xl-12{width:100%}.col-xl-11{width:91.66666667%}.col-xl-10{width:83.33333333%}.col-xl-9{width:75%}.col-xl-8{width:66.66666667%}.col-xl-7{width:58.33333333%}.col-xl-6{width:50%}.col-xl-5{width:41.66666667%}.col-xl-4{width:33.33333333%}.col-xl-3{width:25%}.col-xl-2{width:16.66666667%}.col-xl-1{width:8.33333333%}.col-xl-auto{width:auto}.hide-xl{display:none!important}.show-xl{display:block!important}}@media (max-width:960px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto{-ms-flex:none;flex:none}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-auto{width:auto}.hide-lg{display:none!important}.show-lg{display:block!important}}@media (max-width:840px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto{-ms-flex:none;flex:none}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-auto{width:auto}.hide-md{display:none!important}.show-md{display:block!important}}@media (max-width:600px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto{-ms-flex:none;flex:none}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-auto{width:auto}.hide-sm{display:none!important}.show-sm{display:block!important}}@media (max-width:480px){.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-auto{-ms-flex:none;flex:none}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-auto{width:auto}.hide-xs{display:none!important}.show-xs{display:block!important}}.hero{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;padding-bottom:4rem;padding-top:4rem}.hero.hero-sm{padding-bottom:2rem;padding-top:2rem}.hero.hero-lg{padding-bottom:8rem;padding-top:8rem}.hero .hero-body{padding:.4rem}.navbar{align-items:stretch;display:-ms-flexbox;display:flex;-ms-flex-align:stretch;-ms-flex-pack:justify;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-content:space-between}.navbar .navbar-section{align-items:center;display:-ms-flexbox;display:flex;-ms-flex:1 0 0;flex:1 0 0;-ms-flex-align:center}.navbar .navbar-section:not(:first-child):last-child{-ms-flex-pack:end;justify-content:flex-end}.navbar .navbar-center{align-items:center;display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-align:center}.navbar .navbar-brand{font-size:.9rem;text-decoration:none}.accordion input:checked~.accordion-header>.icon:first-child,.accordion[open] .accordion-header>.icon:first-child{transform:rotate(90deg)}.accordion input:checked~.accordion-body,.accordion[open] .accordion-body{max-height:50rem}.accordion .accordion-header{display:block;padding:.2rem .4rem}.accordion .accordion-header .icon{transition:transform .25s}.accordion .accordion-body{margin-bottom:.4rem;max-height:0;overflow:hidden;transition:max-height .25s}summary.accordion-header::-webkit-details-marker{display:none}.avatar{background:#5755d9;border-radius:50%;color:rgba(255,255,255,.85);display:inline-block;font-size:.8rem;font-weight:300;height:1.6rem;line-height:1.25;margin:0;position:relative;vertical-align:middle;width:1.6rem}.avatar.avatar-xs{font-size:.4rem;height:.8rem;width:.8rem}.avatar.avatar-sm{font-size:.6rem;height:1.2rem;width:1.2rem}.avatar.avatar-lg{font-size:1.2rem;height:2.4rem;width:2.4rem}.avatar.avatar-xl{font-size:1.6rem;height:3.2rem;width:3.2rem}.avatar img{border-radius:50%;height:100%;position:relative;width:100%;z-index:1}.avatar .avatar-icon,.avatar .avatar-presence{background:#fff;bottom:14.64%;height:50%;padding:.1rem;position:absolute;right:14.64%;transform:translate(50%,50%);width:50%;z-index:2}.avatar .avatar-presence{background:#bcc3ce;border-radius:50%;box-shadow:0 0 0 .1rem #fff;height:.5em;width:.5em}.avatar .avatar-presence.online{background:#32b643}.avatar .avatar-presence.busy{background:#e85600}.avatar .avatar-presence.away{background:#ffb700}.avatar[data-initial]::before{color:currentColor;content:attr(data-initial);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.badge{position:relative;white-space:nowrap}.badge:not([data-badge])::after,.badge[data-badge]::after{background:#5755d9;background-clip:padding-box;border-radius:.5rem;box-shadow:0 0 0 .1rem #fff;color:#fff;content:attr(data-badge);display:inline-block;transform:translate(-.05rem,-.5rem)}.badge[data-badge]::after{font-size:.7rem;height:.9rem;line-height:1;min-width:.9rem;padding:.1rem .2rem;text-align:center;white-space:nowrap}.badge:not([data-badge])::after,.badge[data-badge=""]::after{height:6px;min-width:6px;padding:0;width:6px}.badge.btn::after{position:absolute;right:0;top:0;transform:translate(50%,-50%)}.badge.avatar::after{position:absolute;right:14.64%;top:14.64%;transform:translate(50%,-50%);z-index:100}.breadcrumb{list-style:none;margin:.2rem 0;padding:.2rem 0}.breadcrumb .breadcrumb-item{color:#66758c;display:inline-block;margin:0;padding:.2rem 0}.breadcrumb .breadcrumb-item:not(:last-child){margin-right:.2rem}.breadcrumb .breadcrumb-item:not(:last-child) a{color:#66758c}.breadcrumb .breadcrumb-item:not(:first-child)::before{color:#66758c;content:"/";padding-right:.4rem}.bar{background:#eef0f3;border-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;height:.8rem;width:100%}.bar.bar-sm{height:.2rem}.bar .bar-item{background:#5755d9;color:#fff;display:block;-ms-flex-negative:0;flex-shrink:0;font-size:.7rem;height:100%;line-height:.8rem;position:relative;text-align:center;width:0}.bar .bar-item:first-child{border-bottom-left-radius:.1rem;border-top-left-radius:.1rem}.bar .bar-item:last-child{border-bottom-right-radius:.1rem;border-top-right-radius:.1rem;-ms-flex-negative:1;flex-shrink:1}.bar-slider{height:.1rem;margin:.4rem 0;position:relative}.bar-slider .bar-item{left:0;padding:0;position:absolute}.bar-slider .bar-item:not(:last-child):first-child{background:#eef0f3;z-index:1}.bar-slider .bar-slider-btn{background:#5755d9;border:0;border-radius:50%;height:.6rem;padding:0;position:absolute;right:0;top:50%;transform:translate(50%,-50%);width:.6rem}.bar-slider .bar-slider-btn:active{box-shadow:0 0 0 .1rem #5755d9}.card{background:#fff;border:.05rem solid #dadee4;border-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card .card-body,.card .card-footer,.card .card-header{padding:.8rem;padding-bottom:0}.card .card-body:last-child,.card .card-footer:last-child,.card .card-header:last-child{padding-bottom:.8rem}.card .card-body{-ms-flex:1 1 auto;flex:1 1 auto}.card .card-image{padding-top:.8rem}.card .card-image:first-child{padding-top:0}.card .card-image:first-child img{border-top-left-radius:.1rem;border-top-right-radius:.1rem}.card .card-image:last-child img{border-bottom-left-radius:.1rem;border-bottom-right-radius:.1rem}.chip{align-items:center;background:#eef0f3;border-radius:5rem;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;font-size:90%;height:1.2rem;line-height:.8rem;margin:.1rem;max-width:320px;overflow:hidden;padding:.2rem .4rem;text-decoration:none;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.chip.active{background:#5755d9;color:#fff}.chip .avatar{margin-left:-.4rem;margin-right:.2rem}.chip .btn-clear{border-radius:50%;transform:scale(.75)}.dropdown{display:inline-block;position:relative}.dropdown .menu{animation:slide-down .15s ease 1;display:none;left:0;max-height:50vh;overflow-y:auto;position:absolute;top:100%}.dropdown.dropdown-right .menu{left:auto;right:0}.dropdown .dropdown-toggle:focus+.menu,.dropdown .menu:hover,.dropdown.active .menu{display:block}.dropdown .btn-group .dropdown-toggle:nth-last-child(2){border-bottom-right-radius:.1rem;border-top-right-radius:.1rem}.empty{background:#f7f8f9;border-radius:.1rem;color:#66758c;padding:3.2rem 1.6rem;text-align:center}.empty .empty-icon{margin-bottom:.8rem}.empty .empty-subtitle,.empty .empty-title{margin:.4rem auto}.empty .empty-action{margin-top:.8rem}.menu{background:#fff;border-radius:.1rem;box-shadow:0 .05rem .2rem rgba(48,55,66,.3);list-style:none;margin:0;min-width:180px;padding:.4rem;transform:translateY(.2rem);z-index:300}.menu.menu-nav{background:0 0;box-shadow:none}.menu .menu-item{margin-top:0;padding:0 .4rem;position:relative;text-decoration:none}.menu .menu-item>a{border-radius:.1rem;color:inherit;display:block;margin:0 -.4rem;padding:.2rem .4rem;text-decoration:none}.menu .menu-item>a:focus,.menu .menu-item>a:hover{background:#f1f1fc;color:#5755d9}.menu .menu-item>a.active,.menu .menu-item>a:active{background:#f1f1fc;color:#5755d9}.menu .menu-item .form-checkbox,.menu .menu-item .form-radio,.menu .menu-item .form-switch{margin:.1rem 0}.menu .menu-item+.menu-item{margin-top:.2rem}.menu .menu-badge{align-items:center;display:-ms-flexbox;display:flex;-ms-flex-align:center;height:100%;position:absolute;right:0;top:0}.menu .menu-badge .label{margin-right:.4rem}.modal{align-items:center;bottom:0;display:none;-ms-flex-align:center;-ms-flex-pack:center;justify-content:center;left:0;opacity:0;overflow:hidden;padding:.4rem;position:fixed;right:0;top:0}.modal.active,.modal:target{display:-ms-flexbox;display:flex;opacity:1;z-index:400}.modal.active .modal-overlay,.modal:target .modal-overlay{background:rgba(247,248,249,.75);bottom:0;cursor:default;display:block;left:0;position:absolute;right:0;top:0}.modal.active .modal-container,.modal:target .modal-container{animation:slide-down .2s ease 1;z-index:1}.modal.modal-sm .modal-container{max-width:320px;padding:0 .4rem}.modal.modal-lg .modal-overlay{background:#fff}.modal.modal-lg .modal-container{box-shadow:none;max-width:960px}.modal-container{background:#fff;border-radius:.1rem;box-shadow:0 .2rem .5rem rgba(48,55,66,.3);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:75vh;max-width:640px;padding:0 .8rem;width:100%}.modal-container.modal-fullheight{max-height:100vh}.modal-container .modal-header{color:#303742;padding:.8rem}.modal-container .modal-body{overflow-y:auto;padding:.8rem;position:relative}.modal-container .modal-footer{padding:.8rem;text-align:right}.nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;list-style:none;margin:.2rem 0}.nav .nav-item a{color:#66758c;padding:.2rem .4rem;text-decoration:none}.nav .nav-item a:focus,.nav .nav-item a:hover{color:#5755d9}.nav .nav-item.active>a{color:#505c6e;font-weight:700}.nav .nav-item.active>a:focus,.nav .nav-item.active>a:hover{color:#5755d9}.nav .nav{margin-bottom:.4rem;margin-left:.8rem}.pagination{display:-ms-flexbox;display:flex;list-style:none;margin:.2rem 0;padding:.2rem 0}.pagination .page-item{margin:.2rem .05rem}.pagination .page-item span{display:inline-block;padding:.2rem .2rem}.pagination .page-item a{border-radius:.1rem;display:inline-block;padding:.2rem .4rem;text-decoration:none}.pagination .page-item a:focus,.pagination .page-item a:hover{color:#5755d9}.pagination .page-item.disabled a{cursor:default;opacity:.5;pointer-events:none}.pagination .page-item.active a{background:#5755d9;color:#fff}.pagination .page-item.page-next,.pagination .page-item.page-prev{-ms-flex:1 0 50%;flex:1 0 50%}.pagination .page-item.page-next{text-align:right}.pagination .page-item .page-item-title{margin:0}.pagination .page-item .page-item-subtitle{margin:0;opacity:.5}.panel{border:.05rem solid #dadee4;border-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.panel .panel-footer,.panel .panel-header{-ms-flex:0 0 auto;flex:0 0 auto;padding:.8rem}.panel .panel-nav{-ms-flex:0 0 auto;flex:0 0 auto}.panel .panel-body{-ms-flex:1 1 auto;flex:1 1 auto;overflow-y:auto;padding:0 .8rem}.popover{display:inline-block;position:relative}.popover .popover-container{left:50%;opacity:0;padding:.4rem;position:absolute;top:0;transform:translate(-50%,-50%) scale(0);transition:transform .2s;width:320px;z-index:300}.popover :focus+.popover-container,.popover:hover .popover-container{display:block;opacity:1;transform:translate(-50%,-100%) scale(1)}.popover.popover-right .popover-container{left:100%;top:50%}.popover.popover-right :focus+.popover-container,.popover.popover-right:hover .popover-container{transform:translate(0,-50%) scale(1)}.popover.popover-bottom .popover-container{left:50%;top:100%}.popover.popover-bottom :focus+.popover-container,.popover.popover-bottom:hover .popover-container{transform:translate(-50%,0) scale(1)}.popover.popover-left .popover-container{left:0;top:50%}.popover.popover-left :focus+.popover-container,.popover.popover-left:hover .popover-container{transform:translate(-100%,-50%) scale(1)}.popover .card{border:0;box-shadow:0 .2rem .5rem rgba(48,55,66,.3)}.step{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;list-style:none;margin:.2rem 0;width:100%}.step .step-item{-ms-flex:1 1 0;flex:1 1 0;margin-top:0;min-height:1rem;position:relative;text-align:center}.step .step-item:not(:first-child)::before{background:#5755d9;content:"";height:2px;left:-50%;position:absolute;top:9px;width:100%}.step .step-item a{color:#5755d9;display:inline-block;padding:20px 10px 0;text-decoration:none}.step .step-item a::before{background:#5755d9;border:.1rem solid #fff;border-radius:50%;content:"";display:block;height:.6rem;left:50%;position:absolute;top:.2rem;transform:translateX(-50%);width:.6rem;z-index:1}.step .step-item.active a::before{background:#fff;border:.1rem solid #5755d9}.step .step-item.active~.step-item::before{background:#dadee4}.step .step-item.active~.step-item a{color:#bcc3ce}.step .step-item.active~.step-item a::before{background:#dadee4}.tab{align-items:center;border-bottom:.05rem solid #dadee4;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-wrap:wrap;flex-wrap:wrap;list-style:none;margin:.2rem 0 .15rem 0}.tab .tab-item{margin-top:0}.tab .tab-item a{border-bottom:.1rem solid transparent;color:inherit;display:block;margin:0 .4rem 0 0;padding:.4rem .2rem .3rem .2rem;text-decoration:none}.tab .tab-item a:focus,.tab .tab-item a:hover{color:#5755d9}.tab .tab-item a.active,.tab .tab-item.active a{border-bottom-color:#5755d9;color:#5755d9}.tab .tab-item.tab-action{-ms-flex:1 0 auto;flex:1 0 auto;text-align:right}.tab .tab-item .btn-clear{margin-top:-.2rem}.tab.tab-block .tab-item{-ms-flex:1 0 0;flex:1 0 0;text-align:center}.tab.tab-block .tab-item a{margin:0}.tab.tab-block .tab-item .badge[data-badge]::after{position:absolute;right:.1rem;top:.1rem;transform:translate(0,0)}.tab:not(.tab-block) .badge{padding-right:0}.tile{align-content:space-between;align-items:flex-start;display:-ms-flexbox;display:flex;-ms-flex-align:start;-ms-flex-line-pack:justify}.tile .tile-action,.tile .tile-icon{-ms-flex:0 0 auto;flex:0 0 auto}.tile .tile-content{-ms-flex:1 1 auto;flex:1 1 auto}.tile .tile-content:not(:first-child){padding-left:.4rem}.tile .tile-content:not(:last-child){padding-right:.4rem}.tile .tile-subtitle,.tile .tile-title{line-height:1.2rem}.tile.tile-centered{align-items:center;-ms-flex-align:center}.tile.tile-centered .tile-content{overflow:hidden}.tile.tile-centered .tile-subtitle,.tile.tile-centered .tile-title{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toast{background:rgba(48,55,66,.95);border:.05rem solid #303742;border-color:#303742;border-radius:.1rem;color:#fff;display:block;padding:.4rem;width:100%}.toast.toast-primary{background:rgba(87,85,217,.95);border-color:#5755d9}.toast.toast-success{background:rgba(50,182,67,.95);border-color:#32b643}.toast.toast-warning{background:rgba(255,183,0,.95);border-color:#ffb700}.toast.toast-error{background:rgba(232,86,0,.95);border-color:#e85600}.toast a{color:#fff;text-decoration:underline}.toast a.active,.toast a:active,.toast a:focus,.toast a:hover{opacity:.75}.toast .btn-clear{margin:.1rem}.toast p:last-child{margin-bottom:0}.tooltip{position:relative}.tooltip::after{background:rgba(48,55,66,.95);border-radius:.1rem;bottom:100%;color:#fff;content:attr(data-tooltip);display:block;font-size:.7rem;left:50%;max-width:320px;opacity:0;overflow:hidden;padding:.2rem .4rem;pointer-events:none;position:absolute;text-overflow:ellipsis;transform:translate(-50%,.4rem);transition:opacity .2s,transform .2s;white-space:pre;z-index:300}.tooltip:focus::after,.tooltip:hover::after{opacity:1;transform:translate(-50%,-.2rem)}.tooltip.disabled,.tooltip[disabled]{pointer-events:auto}.tooltip.tooltip-right::after{bottom:50%;left:100%;transform:translate(-.2rem,50%)}.tooltip.tooltip-right:focus::after,.tooltip.tooltip-right:hover::after{transform:translate(.2rem,50%)}.tooltip.tooltip-bottom::after{bottom:auto;top:100%;transform:translate(-50%,-.4rem)}.tooltip.tooltip-bottom:focus::after,.tooltip.tooltip-bottom:hover::after{transform:translate(-50%,.2rem)}.tooltip.tooltip-left::after{bottom:50%;left:auto;right:100%;transform:translate(.4rem,50%)}.tooltip.tooltip-left:focus::after,.tooltip.tooltip-left:hover::after{transform:translate(-.2rem,50%)}@keyframes loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes slide-down{0%{opacity:0;transform:translateY(-1.6rem)}100%{opacity:1;transform:translateY(0)}}.text-primary{color:#5755d9!important}a.text-primary:focus,a.text-primary:hover{color:#4240d4}a.text-primary:visited{color:#6c6ade}.text-secondary{color:#e5e5f9!important}a.text-secondary:focus,a.text-secondary:hover{color:#d1d0f4}a.text-secondary:visited{color:#fafafe}.text-gray{color:#bcc3ce!important}a.text-gray:focus,a.text-gray:hover{color:#adb6c4}a.text-gray:visited{color:#cbd0d9}.text-light{color:#fff!important}a.text-light:focus,a.text-light:hover{color:#f2f2f2}a.text-light:visited{color:#fff}.text-dark{color:#3b4351!important}a.text-dark:focus,a.text-dark:hover{color:#303742}a.text-dark:visited{color:#455060}.text-success{color:#32b643!important}a.text-success:focus,a.text-success:hover{color:#2da23c}a.text-success:visited{color:#39c94b}.text-warning{color:#ffb700!important}a.text-warning:focus,a.text-warning:hover{color:#e6a500}a.text-warning:visited{color:#ffbe1a}.text-error{color:#e85600!important}a.text-error:focus,a.text-error:hover{color:#cf4d00}a.text-error:visited{color:#ff6003}.bg-primary{background:#5755d9!important;color:#fff}.bg-secondary{background:#f1f1fc!important}.bg-dark{background:#303742!important;color:#fff}.bg-gray{background:#f7f8f9!important}.bg-success{background:#32b643!important;color:#fff}.bg-warning{background:#ffb700!important;color:#fff}.bg-error{background:#e85600!important;color:#fff}.c-hand{cursor:pointer}.c-move{cursor:move}.c-zoom-in{cursor:zoom-in}.c-zoom-out{cursor:zoom-out}.c-not-allowed{cursor:not-allowed}.c-auto{cursor:auto}.d-block{display:block}.d-inline{display:inline}.d-inline-block{display:inline-block}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.d-hide,.d-none{display:none!important}.d-visible{visibility:visible}.d-invisible{visibility:hidden}.text-hide{background:0 0;border:0;color:transparent;font-size:0;line-height:0;text-shadow:none}.text-assistive{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.divider,.divider-vert{display:block;position:relative}.divider-vert[data-content]::after,.divider[data-content]::after{background:#fff;color:#bcc3ce;content:attr(data-content);display:inline-block;font-size:.7rem;padding:0 .4rem;transform:translateY(-.65rem)}.divider{border-top:.05rem solid #f1f3f5;height:.05rem;margin:.4rem 0}.divider[data-content]{margin:.8rem 0}.divider-vert{display:block;padding:.8rem}.divider-vert::before{border-left:.05rem solid #dadee4;bottom:.4rem;content:"";display:block;left:50%;position:absolute;top:.4rem;transform:translateX(-50%)}.divider-vert[data-content]::after{left:50%;padding:.2rem 0;position:absolute;top:50%;transform:translate(-50%,-50%)}.loading{color:transparent!important;min-height:.8rem;pointer-events:none;position:relative}.loading::after{animation:loading .5s infinite linear;background:0 0;border:.1rem solid #5755d9;border-radius:50%;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:.8rem;left:50%;margin-left:-.4rem;margin-top:-.4rem;opacity:1;padding:0;position:absolute;top:50%;width:.8rem;z-index:1}.loading.loading-lg{min-height:2rem}.loading.loading-lg::after{height:1.6rem;margin-left:-.8rem;margin-top:-.8rem;width:1.6rem}.clearfix::after{clear:both;content:"";display:table}.float-left{float:left!important}.float-right{float:right!important}.p-relative{position:relative!important}.p-absolute{position:absolute!important}.p-fixed{position:fixed!important}.p-sticky{position:-webkit-sticky!important;position:sticky!important}.p-centered{display:block;float:none;margin-left:auto;margin-right:auto}.flex-centered{align-items:center;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-pack:center;justify-content:center}.m-0{margin:0!important}.mb-0{margin-bottom:0!important}.ml-0{margin-left:0!important}.mr-0{margin-right:0!important}.mt-0{margin-top:0!important}.mx-0{margin-left:0!important;margin-right:0!important}.my-0{margin-bottom:0!important;margin-top:0!important}.m-1{margin:.2rem!important}.mb-1{margin-bottom:.2rem!important}.ml-1{margin-left:.2rem!important}.mr-1{margin-right:.2rem!important}.mt-1{margin-top:.2rem!important}.mx-1{margin-left:.2rem!important;margin-right:.2rem!important}.my-1{margin-bottom:.2rem!important;margin-top:.2rem!important}.m-2{margin:.4rem!important}.mb-2{margin-bottom:.4rem!important}.ml-2{margin-left:.4rem!important}.mr-2{margin-right:.4rem!important}.mt-2{margin-top:.4rem!important}.mx-2{margin-left:.4rem!important;margin-right:.4rem!important}.my-2{margin-bottom:.4rem!important;margin-top:.4rem!important}.p-0{padding:0!important}.pb-0{padding-bottom:0!important}.pl-0{padding-left:0!important}.pr-0{padding-right:0!important}.pt-0{padding-top:0!important}.px-0{padding-left:0!important;padding-right:0!important}.py-0{padding-bottom:0!important;padding-top:0!important}.p-1{padding:.2rem!important}.pb-1{padding-bottom:.2rem!important}.pl-1{padding-left:.2rem!important}.pr-1{padding-right:.2rem!important}.pt-1{padding-top:.2rem!important}.px-1{padding-left:.2rem!important;padding-right:.2rem!important}.py-1{padding-bottom:.2rem!important;padding-top:.2rem!important}.p-2{padding:.4rem!important}.pb-2{padding-bottom:.4rem!important}.pl-2{padding-left:.4rem!important}.pr-2{padding-right:.4rem!important}.pt-2{padding-top:.4rem!important}.px-2{padding-left:.4rem!important;padding-right:.4rem!important}.py-2{padding-bottom:.4rem!important;padding-top:.4rem!important}.s-rounded{border-radius:.1rem}.s-circle{border-radius:50%}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-normal{font-weight:400}.text-bold{font-weight:700}.text-italic{font-style:italic}.text-large{font-size:1.2em}.text-small{font-size:.9em}.text-tiny{font-size:.8em}.text-muted{opacity:.8}.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-clip{overflow:hidden;text-overflow:clip;white-space:nowrap}.text-break{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;word-break:break-word;word-wrap:break-word} \ No newline at end of file diff --git a/tools/web/src/main/resources/assets/style.css b/tools/web/src/main/resources/assets/style.css new file mode 100644 index 0000000000..b9ece19779 --- /dev/null +++ b/tools/web/src/main/resources/assets/style.css @@ -0,0 +1,56 @@ +.version { + font-size: 80%; + margin: 1em; +} + +.ast { + font-family: monospace; +} + +.code { + font-family: monospace; + white-space: pre; +} + +.ast li { + line-height: 180%; +} + +.value { + background: rgb(133 88 255 / 30%); + border: 1px solid rgb(133 88 255 / 80%); + border-radius: 2px; + padding: .1ex; +} + +.type-name { + background: rgb(109 248 46 / 30%); + border: 1px solid rgb(109 248 46 / 80%); + border-radius: 2px; + padding: .1ex; +} + +.attrib-name { + background: rgb(251 78 251 / 30%); + border: 1px solid rgb(251 78 251 / 80%); + border-radius: 2px; + padding: .1ex; +} + +.range { + background: #888; + color: white; + border-radius: 2px; + padding: .1ex; + margin-left: 2em; +} + +.jmlish { + background: rgba(100, 150, 250, .3); + margin: 1em; +} + + +.accordion input:checked ~ .accordion-body, .accordion[open] .accordion-body { + overflow: scroll; +} \ No newline at end of file diff --git a/tools/xpath/build.gradle.kts b/tools/xpath/build.gradle.kts new file mode 100644 index 0000000000..0cdd8f85b9 --- /dev/null +++ b/tools/xpath/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("standard-kotlin") +} + +dependencies { +} + diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/AttribModifier.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/AttribModifier.kt new file mode 100644 index 0000000000..3a86b81200 --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/AttribModifier.kt @@ -0,0 +1,20 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.Modifier.DefaultKeyword +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.nodeTypes.NodeWithModifiers +import org.w3c.dom.Element + +/** + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +class AttribModifier : PseudoAttributeProvider { + override fun attributeForNode(node: Node, owner: Element): Collection { + if (node is NodeWithModifiers<*>) { + return DefaultKeyword.entries + .map { JPAttrPseudo(it.name, { "" + node.hasModifier(it) }, owner) } + } + return listOf() + } +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/AttribNodeWithName.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/AttribNodeWithName.kt new file mode 100644 index 0000000000..dc9e9921bd --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/AttribNodeWithName.kt @@ -0,0 +1,18 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.nodeTypes.NodeWithName +import org.w3c.dom.Element + +/** + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +class AttribNodeWithName : PseudoAttributeProvider { + override fun attributeForNode(node: Node, owner: Element): Collection { + if (node is NodeWithName<*>) { + return setOf(JPAttrPseudo("name", { node.nameAsString }, owner)) + } + return listOf() + } +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/DocumentFactories.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/DocumentFactories.kt new file mode 100644 index 0000000000..dea6cf0be8 --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/DocumentFactories.kt @@ -0,0 +1,97 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.Node +import com.github.javaparser.metamodel.PropertyMetaModel +import org.w3c.dom.* +import java.util.* + +/** + * @author Alexander Weigl + * @version 1 (30.11.22) + */ +object DocumentFactories { + val attributeProviders by lazy { + ServiceLoader.load(PseudoAttributeProvider::class.java).toList() + } + + fun isNodeProperty(mm: PropertyMetaModel): Boolean = mm.isNode || mm.isNodeList + + fun getDocument(node: CompilationUnit): Document = JPDocument(node) + + fun getElement(it: Node, parent: Element): JPElement = JPElement(it, parent) + + + fun wrap(list: List): NodeList { + return object : NodeList { + override fun item(index: Int): org.w3c.dom.Node = list[index] + + override fun getLength(): Int = list.size + } + } + + fun wrap(vararg seq: Element): NodeList = wrap(listOf(*seq)) + + fun emptyNodeMap(): NamedNodeMap { + return object : NamedNodeMap { + override fun getNamedItem(name: String): org.w3c.dom.Node? = null + + @Throws(DOMException::class) + override fun setNamedItem(arg: org.w3c.dom.Node): org.w3c.dom.Node? = null + + @Throws(DOMException::class) + override fun removeNamedItem(name: String): org.w3c.dom.Node? = null + + override fun item(index: Int): org.w3c.dom.Node? = null + + override fun getLength(): Int = 0 + + @Throws(DOMException::class) + override fun getNamedItemNS(namespaceURI: String, localName: String): org.w3c.dom.Node? = null + + @Throws(DOMException::class) + override fun setNamedItemNS(arg: org.w3c.dom.Node): org.w3c.dom.Node? = null + + @Throws(DOMException::class) + override fun removeNamedItemNS(namespaceURI: String, localName: String): org.w3c.dom.Node? = null + } + } + + fun getAttribute(jpElement: JPElement, it: PropertyMetaModel): Attr = JPAttr(jpElement, it) + + fun nodeMap(jpElement: JPElement): NamedNodeMap { + return object : NamedNodeMap { + override fun getNamedItem(name: String) = + jpElement.attributes.firstOrNull { it.name.equals(name) } + + @Throws(DOMException::class) + override fun setNamedItem(arg: org.w3c.dom.Node): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun removeNamedItem(name: String): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + override fun item(index: Int): org.w3c.dom.Node = jpElement.attributes[index] + + override fun getLength(): Int = jpElement.attributes.size + + @Throws(DOMException::class) + override fun getNamedItemNS(namespaceURI: String, localName: String): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun setNamedItemNS(arg: org.w3c.dom.Node): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun removeNamedItemNS(namespaceURI: String, localName: String): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + } + } +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPAttr.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPAttr.kt new file mode 100644 index 0000000000..e27b3b470b --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPAttr.kt @@ -0,0 +1,122 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.metamodel.PropertyMetaModel +import org.w3c.dom.* + +/** + * Wraps a class attribute into the XML world. + * + * @author Alexander Weigl + * @version 1 (30.11.22) + */ +internal class JPAttr(element: JPElement, metaModel: PropertyMetaModel) : Attr { + private val attr: PropertyMetaModel = metaModel + private val parent: JPElement = element + + override fun getName(): String = attr.name + + override fun getSpecified(): Boolean = true + + override fun getValue(): String = attr.getValue(parent.astNode).toString() + + @Throws(DOMException::class) + override fun setValue(value: String) { + throw DOMException(0.toShort(), "read-only") + } + + override fun getOwnerElement(): Element = parent + + override fun getSchemaTypeInfo(): TypeInfo? = null + + override fun isId(): Boolean = false + + override fun getNodeName(): String = name + + @Throws(DOMException::class) + override fun getNodeValue(): String = attr.getValue(parent.astNode).toString() + + @Throws(DOMException::class) + override fun setNodeValue(nodeValue: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + override fun getNodeType(): Short = 0 + + override fun getParentNode(): Node? = null + + override fun getChildNodes(): NodeList = DocumentFactories.wrap() + + override fun getFirstChild(): Node? = null + + override fun getLastChild(): Node? = null + + override fun getPreviousSibling(): Node? = null + + override fun getNextSibling(): Node? = null + + override fun getAttributes(): NamedNodeMap? = null + + override fun getOwnerDocument(): Document? = null + + @Throws(DOMException::class) + override fun insertBefore(newChild: Node, refChild: Node): Node? = null + + @Throws(DOMException::class) + override fun replaceChild(newChild: Node, oldChild: Node): Node? = null + + @Throws(DOMException::class) + override fun removeChild(oldChild: Node): Node? = null + + @Throws(DOMException::class) + override fun appendChild(newChild: Node): Node? = null + + override fun hasChildNodes(): Boolean = false + + override fun cloneNode(deep: Boolean): Node? = null + + override fun normalize() { + } + + override fun isSupported(feature: String, version: String): Boolean = false + + override fun getNamespaceURI(): String? = null + + override fun getPrefix(): String? = null + + @Throws(DOMException::class) + override fun setPrefix(prefix: String) { + } + + override fun getLocalName(): String? = null + + override fun hasAttributes(): Boolean = false + + override fun getBaseURI(): String? = null + + @Throws(DOMException::class) + override fun compareDocumentPosition(other: Node): Short = 0 + + @Throws(DOMException::class) + override fun getTextContent(): String = value + + @Throws(DOMException::class) + override fun setTextContent(textContent: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + override fun isSameNode(other: Node): Boolean = false + + override fun lookupPrefix(namespaceURI: String): String? = null + + override fun isDefaultNamespace(namespaceURI: String): Boolean = false + + override fun lookupNamespaceURI(prefix: String): String? = null + + override fun isEqualNode(arg: Node): Boolean = false + + override fun getFeature(feature: String, version: String): Any? = null + + override fun setUserData(key: String, data: Any, handler: UserDataHandler): Any? = null + + override fun getUserData(key: String): Any? = null +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPAttrPseudo.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPAttrPseudo.kt new file mode 100644 index 0000000000..909a88b4ff --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPAttrPseudo.kt @@ -0,0 +1,116 @@ +package io.github.jmltoolkit.xpath + +import org.w3c.dom.* +import java.util.function.Supplier + +/** + * @author Alexander Weigl + * @version 1 (01.12.22) + */ +class JPAttrPseudo(private val _name: String, private val supplier: Supplier, private val owner: Element) : Attr { + override fun getName(): String = _name + + override fun getSpecified(): Boolean = true + + override fun getValue(): String = supplier.get() + + @Throws(DOMException::class) + override fun setValue(value: String) { + throw IllegalStateException() + } + + override fun getOwnerElement(): Element = owner + + override fun getSchemaTypeInfo(): TypeInfo? = null + + override fun isId(): Boolean = false + + override fun getNodeName(): String = getName() + + @Throws(DOMException::class) + override fun getNodeValue(): String = value + + @Throws(DOMException::class) + override fun setNodeValue(nodeValue: String) { + throw RuntimeException() + } + + override fun getNodeType(): Short = Node.ATTRIBUTE_NODE + + override fun getParentNode(): Node = ownerElement + + override fun getChildNodes(): NodeList = DocumentFactories.wrap() + + override fun getFirstChild(): Node? = null + + override fun getLastChild(): Node? = null + + override fun getPreviousSibling(): Node? = null + + override fun getNextSibling(): Node? = null + + override fun getAttributes(): NamedNodeMap? = null + + override fun getOwnerDocument(): Document = parentNode.ownerDocument + + @Throws(DOMException::class) + override fun insertBefore(newChild: Node, refChild: Node): Node? = null + + @Throws(DOMException::class) + override fun replaceChild(newChild: Node, oldChild: Node): Node? = null + + @Throws(DOMException::class) + override fun removeChild(oldChild: Node): Node? = null + + @Throws(DOMException::class) + override fun appendChild(newChild: Node): Node? = null + + override fun hasChildNodes(): Boolean = false + + override fun cloneNode(deep: Boolean): Node? = null + + override fun normalize() { + } + + override fun isSupported(feature: String, version: String): Boolean = false + + override fun getNamespaceURI(): String? = null + + override fun getPrefix(): String? = null + + @Throws(DOMException::class) + override fun setPrefix(prefix: String) { + } + + override fun getLocalName(): String? = null + + override fun hasAttributes(): Boolean = false + + override fun getBaseURI(): String? = null + + @Throws(DOMException::class) + override fun compareDocumentPosition(other: Node): Short = 0 + + @Throws(DOMException::class) + override fun getTextContent(): String = value + + @Throws(DOMException::class) + override fun setTextContent(textContent: String) { + } + + override fun isSameNode(other: Node): Boolean = false + + override fun lookupPrefix(namespaceURI: String): String? = null + + override fun isDefaultNamespace(namespaceURI: String): Boolean = false + + override fun lookupNamespaceURI(prefix: String): String? = null + + override fun isEqualNode(arg: Node): Boolean = false + + override fun getFeature(feature: String, version: String): Any? = null + + override fun setUserData(key: String, data: Any, handler: UserDataHandler): Any? = null + + override fun getUserData(key: String): Any? = null +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPDocument.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPDocument.kt new file mode 100644 index 0000000000..37f4cbfbfd --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPDocument.kt @@ -0,0 +1,213 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.CompilationUnit +import org.w3c.dom.* + +class JPDocument(node: CompilationUnit) : Document { + private val root: JPRootElement = JPRootElement(listOf(node), this) + + override fun getDoctype(): DocumentType? = null + + override fun getImplementation(): DOMImplementation? = null + + override fun getDocumentElement(): Element = root + + @Throws(DOMException::class) + override fun createElement(tagName: String): Element { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun createDocumentFragment(): DocumentFragment? = null + + override fun createTextNode(data: String): Text? = null + + override fun createComment(data: String): Comment? = null + + @Throws(DOMException::class) + override fun createCDATASection(data: String): CDATASection { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun createProcessingInstruction(target: String, data: String): ProcessingInstruction { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun createAttribute(name: String): Attr { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun createEntityReference(name: String): EntityReference { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getElementsByTagName(tagname: String): NodeList { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun importNode(importedNode: Node, deep: Boolean): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun createElementNS(namespaceURI: String, qualifiedName: String): Element { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun createAttributeNS(namespaceURI: String, qualifiedName: String): Attr { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getElementsByTagNameNS(namespaceURI: String, localName: String): NodeList { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getElementById(elementId: String): Element? = null + + override fun getInputEncoding(): String = "utf-8" + + override fun getXmlEncoding(): String = "utf-8" + + override fun getXmlStandalone(): Boolean = true + + @Throws(DOMException::class) + override fun setXmlStandalone(xmlStandalone: Boolean) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getXmlVersion(): String = "1.0" + + @Throws(DOMException::class) + override fun setXmlVersion(xmlVersion: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getStrictErrorChecking(): Boolean = false + + override fun setStrictErrorChecking(strictErrorChecking: Boolean) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getDocumentURI(): String? = null + + override fun setDocumentURI(documentURI: String) { + } + + @Throws(DOMException::class) + override fun adoptNode(source: Node): Node? = null + + override fun getDomConfig(): DOMConfiguration? = null + + override fun normalizeDocument() { + } + + @Throws(DOMException::class) + override fun renameNode(n: Node, namespaceURI: String, qualifiedName: String): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getNodeName(): String = "#document" + + @Throws(DOMException::class) + override fun getNodeValue(): String { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun setNodeValue(nodeValue: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getNodeType(): Short = Node.DOCUMENT_TYPE_NODE + + override fun getParentNode(): Node? = null + + override fun getChildNodes(): NodeList = DocumentFactories.wrap(root) + + override fun getFirstChild(): Node = root + + override fun getLastChild(): Node = root + + override fun getPreviousSibling(): Node? = null + + override fun getNextSibling(): Node? = null + + override fun getAttributes(): NamedNodeMap? = null + + override fun getOwnerDocument(): Document = this + + @Throws(DOMException::class) + override fun insertBefore(newChild: Node, refChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun replaceChild(newChild: Node, oldChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun removeChild(oldChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun appendChild(newChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun hasChildNodes(): Boolean = root != null + + override fun cloneNode(deep: Boolean): Node? = null + + override fun normalize() { + } + + override fun isSupported(feature: String, version: String): Boolean = false + + override fun getNamespaceURI(): String? = null + + override fun getPrefix(): String? = null + + @Throws(DOMException::class) + override fun setPrefix(prefix: String) { + } + + override fun getLocalName(): String? = null + + override fun hasAttributes(): Boolean = false + + override fun getBaseURI(): String? = null + + @Throws(DOMException::class) + override fun compareDocumentPosition(other: Node): Short { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun getTextContent(): String? = null + + @Throws(DOMException::class) + override fun setTextContent(textContent: String) { + } + + override fun isSameNode(other: Node): Boolean = false + + override fun lookupPrefix(namespaceURI: String): String? = null + + override fun isDefaultNamespace(namespaceURI: String): Boolean = false + + override fun lookupNamespaceURI(prefix: String): String? = null + + override fun isEqualNode(arg: Node): Boolean = false + + override fun getFeature(feature: String, version: String): Any? = null + + override fun setUserData(key: String, data: Any, handler: UserDataHandler): Any? = null + + override fun getUserData(key: String): Any? = null +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPElement.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPElement.kt new file mode 100644 index 0000000000..487dfef19f --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPElement.kt @@ -0,0 +1,242 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.NodeList +import com.github.javaparser.metamodel.NodeMetaModel +import com.github.javaparser.metamodel.PropertyMetaModel +import org.w3c.dom.* + +/** + * @author Alexander Weigl + * @version 1 (30.11.22) + */ +class JPElement(val astNode: Node, private val parent: Element) : Element { + private val meta: NodeMetaModel = astNode.metaModel + private var posInParent: Int = 0 + + val children: List by lazy { + meta.allPropertyMetaModels + .filter(DocumentFactories::isNodeProperty) + .map { it.getValue(this.astNode) } + .flatMap { + when (it) { + is NodeList<*> -> it.map { n -> DocumentFactories.getElement(n, this) } + is Node -> listOf(DocumentFactories.getElement(it, this)) + else -> listOf() + } + } + .map { it } + .also { + for (i in children.indices) { + children[i].posInParent = i + } + } + } + + val attributes: List by lazy { + val attr = meta.allPropertyMetaModels + .filter { !DocumentFactories.isNodeProperty(it) } + .map { DocumentFactories.getAttribute(this, it) } + .toMutableList() + + for (provider in DocumentFactories.attributeProviders) { + val seq = provider.attributeForNode(astNode, this) + attr.addAll(seq) + } + attr + } + + override fun getTagName(): String = meta.typeName + + override fun getAttribute(name: String): String { + val prop = getProperty(name) + return prop.getValue(astNode).toString() + } + + fun getProperty(name: String): PropertyMetaModel { + return meta.allPropertyMetaModels.stream() + .filter { it: PropertyMetaModel -> it.name == name } + .findFirst().orElse(null) + } + + @Throws(DOMException::class) + override fun setAttribute(name: String, value: String) { + throw IllegalStateException() + } + + @Throws(DOMException::class) + override fun removeAttribute(name: String) { + throw IllegalStateException() + } + + override fun getAttributeNode(name: String) = attributes.asSequence() + .filter { it: Attr -> it.name == name } + .firstOrNull() + + @Throws(DOMException::class) + override fun setAttributeNode(newAttr: Attr): Attr? = null + + @Throws(DOMException::class) + override fun removeAttributeNode(oldAttr: Attr): Attr? = null + + override fun getElementsByTagName(name: String): org.w3c.dom.NodeList { + throw IllegalStateException() + } + + @Throws(DOMException::class) + override fun getAttributeNS(namespaceURI: String, localName: String): String { + throw IllegalStateException() + } + + @Throws(DOMException::class) + override fun setAttributeNS(namespaceURI: String, qualifiedName: String, value: String) { + throw IllegalStateException() + } + + @Throws(DOMException::class) + override fun removeAttributeNS(namespaceURI: String, localName: String) { + throw IllegalStateException() + } + + @Throws(DOMException::class) + override fun getAttributeNodeNS(namespaceURI: String, localName: String): Attr { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun setAttributeNodeNS(newAttr: Attr): Attr { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun getElementsByTagNameNS(namespaceURI: String, localName: String): org.w3c.dom.NodeList { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + override fun hasAttribute(name: String): Boolean = !meta.allPropertyMetaModels.isEmpty() + + @Throws(DOMException::class) + override fun hasAttributeNS(namespaceURI: String, localName: String): Boolean { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + override fun getSchemaTypeInfo(): TypeInfo? = null + + @Throws(DOMException::class) + override fun setIdAttribute(name: String, isId: Boolean) { + } + + @Throws(DOMException::class) + override fun setIdAttributeNS(namespaceURI: String, localName: String, isId: Boolean) { + } + + @Throws(DOMException::class) + override fun setIdAttributeNode(idAttr: Attr, isId: Boolean) { + } + + override fun getNodeName(): String = tagName + + @Throws(DOMException::class) + override fun getNodeValue(): String = "" + + @Throws(DOMException::class) + override fun setNodeValue(nodeValue: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + override fun getNodeType(): Short = org.w3c.dom.Node.ELEMENT_NODE + + override fun getParentNode(): org.w3c.dom.Node = parent + + override fun getChildNodes(): org.w3c.dom.NodeList = DocumentFactories.wrap(children) + + override fun getFirstChild() = children.firstOrNull() + override fun getLastChild() = children.lastOrNull() + + override fun getPreviousSibling(): org.w3c.dom.Node? { + if (posInParent != 0) { + return parent.childNodes.item(posInParent - 1) + } + return null + } + + override fun getNextSibling(): org.w3c.dom.Node? { + if (posInParent + 1 < parent.childNodes.length) { + return parent.childNodes.item(posInParent + 1) + } + return null + } + + override fun getAttributes(): NamedNodeMap = DocumentFactories.nodeMap(this) + + override fun getOwnerDocument(): Document? = parent.ownerDocument + + @Throws(DOMException::class) + override fun insertBefore(newChild: org.w3c.dom.Node, refChild: org.w3c.dom.Node): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun replaceChild(newChild: org.w3c.dom.Node, oldChild: org.w3c.dom.Node): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun removeChild(oldChild: org.w3c.dom.Node): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + @Throws(DOMException::class) + override fun appendChild(newChild: org.w3c.dom.Node): org.w3c.dom.Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "") + } + + override fun hasChildNodes(): Boolean = children.isNotEmpty() + + override fun cloneNode(deep: Boolean): org.w3c.dom.Node? = null + + override fun normalize() { + } + + override fun isSupported(feature: String, version: String): Boolean = false + + override fun getNamespaceURI(): String? = null + + override fun getPrefix(): String? = null + + @Throws(DOMException::class) + override fun setPrefix(prefix: String) { + } + + override fun getLocalName(): String? = null + + override fun hasAttributes(): Boolean = false + + override fun getBaseURI(): String? = null + + @Throws(DOMException::class) + override fun compareDocumentPosition(other: org.w3c.dom.Node): Short = 0 + + @Throws(DOMException::class) + override fun getTextContent(): String? = null + + @Throws(DOMException::class) + override fun setTextContent(textContent: String) { + } + + override fun isSameNode(other: org.w3c.dom.Node): Boolean = false + + override fun lookupPrefix(namespaceURI: String): String? = null + + override fun isDefaultNamespace(namespaceURI: String): Boolean = false + + override fun lookupNamespaceURI(prefix: String): String? = null + + override fun isEqualNode(arg: org.w3c.dom.Node): Boolean = false + + override fun getFeature(feature: String, version: String): Any? = null + + override fun setUserData(key: String, data: Any, handler: UserDataHandler): Any? = null + + override fun getUserData(key: String): Any? = null +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPRootElement.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPRootElement.kt new file mode 100644 index 0000000000..5552a4d552 --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/JPRootElement.kt @@ -0,0 +1,193 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.CompilationUnit +import org.w3c.dom.* + + +class JPRootElement(private val nodes: List, private val document: JPDocument) : Element { + private val elements: List by lazy { + nodes.map { DocumentFactories.getElement(it, this) } + } + + override fun getTagName(): String = "project" + + override fun getAttribute(name: String): String = "" + + @Throws(DOMException::class) + override fun setAttribute(name: String, value: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun removeAttribute(name: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getAttributeNode(name: String): Attr? = null + + @Throws(DOMException::class) + override fun setAttributeNode(newAttr: Attr): Attr { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun removeAttributeNode(oldAttr: Attr): Attr { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getElementsByTagName(name: String): NodeList { + throw IllegalStateException() + } + + @Throws(DOMException::class) + override fun getAttributeNS(namespaceURI: String, localName: String): String = "" + + @Throws(DOMException::class) + override fun setAttributeNS(namespaceURI: String, qualifiedName: String, value: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun removeAttributeNS(namespaceURI: String, localName: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun getAttributeNodeNS(namespaceURI: String, localName: String): Attr? = null + + @Throws(DOMException::class) + override fun setAttributeNodeNS(newAttr: Attr): Attr { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun getElementsByTagNameNS(namespaceURI: String, localName: String): NodeList { + throw IllegalStateException() + } + + override fun hasAttribute(name: String): Boolean = false + + @Throws(DOMException::class) + override fun hasAttributeNS(namespaceURI: String, localName: String): Boolean = false + + override fun getSchemaTypeInfo(): TypeInfo? = null + + @Throws(DOMException::class) + override fun setIdAttribute(name: String, isId: Boolean) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun setIdAttributeNS(namespaceURI: String, localName: String, isId: Boolean) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun setIdAttributeNode(idAttr: Attr, isId: Boolean) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getNodeName(): String = tagName + + @Throws(DOMException::class) + override fun getNodeValue(): String { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun setNodeValue(nodeValue: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getNodeType(): Short = Node.ELEMENT_NODE + + override fun getParentNode(): Node = document + + override fun getChildNodes(): NodeList = DocumentFactories.wrap(elements) + + override fun getFirstChild(): Node = elements.first() + + override fun getLastChild(): Node = elements.last() + + override fun getPreviousSibling(): Node? = null + + override fun getNextSibling(): Node? = null + + override fun getAttributes(): NamedNodeMap = DocumentFactories.emptyNodeMap() + + override fun getOwnerDocument(): Document = document + + @Throws(DOMException::class) + override fun insertBefore(newChild: Node, refChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun replaceChild(newChild: Node, oldChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun removeChild(oldChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + @Throws(DOMException::class) + override fun appendChild(newChild: Node): Node { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun hasChildNodes(): Boolean = elements.isNotEmpty() + + override fun cloneNode(deep: Boolean): Node? = null + + override fun normalize() { + } + + override fun isSupported(feature: String, version: String): Boolean = false + + override fun getNamespaceURI(): String? = null + + override fun getPrefix(): String? = null + + @Throws(DOMException::class) + override fun setPrefix(prefix: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun getLocalName(): String? = null + + override fun hasAttributes(): Boolean = false + + override fun getBaseURI(): String? = null + + @Throws(DOMException::class) + override fun compareDocumentPosition(other: Node): Short = 0 + + @Throws(DOMException::class) + override fun getTextContent(): String = "" + + @Throws(DOMException::class) + override fun setTextContent(textContent: String) { + throw DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported") + } + + override fun isSameNode(other: Node): Boolean { + return other is JPRootElement && + this.document === other.document + } + + override fun lookupPrefix(namespaceURI: String): String = "" + + override fun isDefaultNamespace(namespaceURI: String): Boolean = false + + override fun lookupNamespaceURI(prefix: String): String? = null + + override fun isEqualNode(arg: Node): Boolean = false + + override fun getFeature(feature: String, version: String): Any? = null + + override fun setUserData(key: String, data: Any, handler: UserDataHandler): Any? = null + + override fun getUserData(key: String): Any? = null +} \ No newline at end of file diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/PseudoAttributeHelper.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/PseudoAttributeHelper.kt new file mode 100644 index 0000000000..4495142fdf --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/PseudoAttributeHelper.kt @@ -0,0 +1,21 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.Node +import org.w3c.dom.Element + +/** + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +abstract class PseudoAttributeHelper protected constructor(private val clazz: Class) : + PseudoAttributeProvider { + @Suppress("UNCHECKED_CAST") + override fun attributeForNode(node: Node, owner: Element): Collection { + if (clazz == node.javaClass) { + return attributes(node as T, owner) + } + return listOf() + } + + protected abstract fun attributes(node: T, owner: Element?): Collection +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/PseudoAttributeProvider.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/PseudoAttributeProvider.kt new file mode 100644 index 0000000000..55fbdaf042 --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/PseudoAttributeProvider.kt @@ -0,0 +1,12 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.Node +import org.w3c.dom.Element + +/** + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +interface PseudoAttributeProvider { + fun attributeForNode(node: Node, owner: Element): Collection +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/XPathFacade.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/XPathFacade.kt new file mode 100644 index 0000000000..930138d440 --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/XPathFacade.kt @@ -0,0 +1,44 @@ +package io.github.jmltoolkit.xpath + +import com.github.javaparser.ast.CompilationUnit +import org.w3c.dom.Document +import org.w3c.dom.NodeList +import java.io.StringWriter +import javax.xml.transform.OutputKeys +import javax.xml.transform.Source +import javax.xml.transform.TransformerException +import javax.xml.transform.TransformerFactory +import javax.xml.transform.dom.DOMSource +import javax.xml.transform.stream.StreamResult +import javax.xml.xpath.XPathConstants +import javax.xml.xpath.XPathExpressionException +import javax.xml.xpath.XPathFactory + +/** + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +object XPathFacade { + @Throws(TransformerException::class) + fun printXml(n: CompilationUnit): String { + val xmlDocument: Document = DocumentFactories.getDocument(n) + val transformerFactory = TransformerFactory.newInstance() + val transformer = transformerFactory.newTransformer() + transformer.setOutputProperty(OutputKeys.INDENT, "yes") + val source: Source = DOMSource(xmlDocument.documentElement) + val sw = StringWriter() + val result = StreamResult(sw) + transformer.transform(source, result) + return sw.buffer.toString() + } + + @Throws(XPathExpressionException::class) + fun query(n: CompilationUnit, query: String?) { + val xmlDocument: Document = DocumentFactories.getDocument(n) + val xPath = XPathFactory.newInstance().newXPath() + val res = xPath.compile(query).evaluate(xmlDocument, XPathConstants.NODESET) as NodeList + for (i in 0 until res.length) { + println((res.item(i) as JPElement).astNode) + } + } +} diff --git a/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/package-info.kt b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/package-info.kt new file mode 100644 index 0000000000..0a606ceb6c --- /dev/null +++ b/tools/xpath/src/main/kotlin/io/github/jmltoolkit/xpath/package-info.kt @@ -0,0 +1,16 @@ +/** + * XPath query on the AST. + * + * + * This package provides the possibility to apply an XPath query on AST nodes. It wraps the existing classes + * into XML documents and elements of type `org.w3c.dom`. This allows you to also use them in nearly + * every system that expect a DOM, e.g., you can print AST as an XML document or xquery. + * + * + * This DOM is immutable. + * + * @author Alexander Weigl + * @version 1 (11.02.23) + */ +package io.github.jmltoolkit.xpath + diff --git a/tools/xpath/src/main/resources/META-INF/services/io.github.jmltoolkit.xpath.PseudoAttributeProvider b/tools/xpath/src/main/resources/META-INF/services/io.github.jmltoolkit.xpath.PseudoAttributeProvider new file mode 100644 index 0000000000..edbc52c1f9 --- /dev/null +++ b/tools/xpath/src/main/resources/META-INF/services/io.github.jmltoolkit.xpath.PseudoAttributeProvider @@ -0,0 +1,2 @@ +io.github.jmltoolkit.xpath.AttribNodeWithName +io.github.jmltoolkit.xpath.AttribModifier \ No newline at end of file

    * This class was generated automatically by javacc, do not edit. @@ -70,7 +69,8 @@ private JavaParser() { private static boolean _doNotConsiderAnnotationsAsNodeStartForCodeAttribution = false; - public static boolean getDoNotConsiderAnnotationsAsNodeStartForCodeAttribution() { + public static boolean getDoNotConsiderAnnotationsAsNodeStartForCodeAttribution() + { return _doNotConsiderAnnotationsAsNodeStartForCodeAttribution; } @@ -78,27 +78,32 @@ public static void setDoNotConsiderAnnotationsAsNodeStartForCodeAttribution(bool _doNotConsiderAnnotationsAsNodeStartForCodeAttribution = doNotConsiderAnnotationsAsNodeStartForCodeAttribution; } - public static boolean getDoNotAssignCommentsPreceedingEmptyLines() { + public static boolean getDoNotAssignCommentsPreceedingEmptyLines() + { return _doNotAssignCommentsPreceedingEmptyLines; } - public static void setDoNotAssignCommentsPreceedingEmptyLines(boolean doNotAssignCommentsPreceedingEmptyLines) { + public static void setDoNotAssignCommentsPreceedingEmptyLines(boolean doNotAssignCommentsPreceedingEmptyLines) + { _doNotAssignCommentsPreceedingEmptyLines = doNotAssignCommentsPreceedingEmptyLines; } public static CompilationUnit parse(final InputStream in, final String encoding) { - return parse(in, encoding, true); + return parse(in,encoding,true); } /** * Parses the Java code contained in the {@link InputStream} and returns a * {@link CompilationUnit} that represents it. * - * @param in {@link InputStream} containing Java source code - * @param encoding encoding of the source code + * @param in + * {@link InputStream} containing Java source code + * @param encoding + * encoding of the source code * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ public static CompilationUnit parse(final InputStream in, final String encoding, boolean considerComments) { @@ -106,11 +111,11 @@ public static CompilationUnit parse(final InputStream in, String code = SourcesHelper.streamToString(in, encoding); InputStream in1 = SourcesHelper.stringToStream(code, encoding); CompilationUnit cu = new ASTParser(in1, encoding).CompilationUnit(); - if (considerComments) { - insertComments(cu, code); + if (considerComments){ + insertComments(cu,code); } return cu; - } catch (IOException ioe) { + } catch (IOException ioe){ throw new ParseException(ioe.getMessage()); } } @@ -119,27 +124,33 @@ public static CompilationUnit parse(final InputStream in, * Parses the Java code contained in the {@link InputStream} and returns a * {@link CompilationUnit} that represents it. * - * @param in {@link InputStream} containing Java source code + * @param in + * {@link InputStream} containing Java source code * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ - public static CompilationUnit parse(final InputStream in) { - return parse(in, null, true); + public static CompilationUnit parse(final InputStream in) + { + return parse(in, null,true); } public static CompilationUnit parse(final File file, final String encoding) throws ParseException, IOException { - return parse(file, encoding, true); + return parse(file,encoding,true); } /** * Parses the Java code contained in a {@link File} and returns a * {@link CompilationUnit} that represents it. * - * @param file {@link File} containing Java source code - * @param encoding encoding of the source code + * @param file + * {@link File} containing Java source code + * @param encoding + * encoding of the source code * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors * @throws IOException */ public static CompilationUnit parse(final File file, final String encoding, boolean considerComments) @@ -156,26 +167,29 @@ public static CompilationUnit parse(final File file, final String encoding, bool * Parses the Java code contained in a {@link File} and returns a * {@link CompilationUnit} that represents it. * - * @param file {@link File} containing Java source code + * @param file + * {@link File} containing Java source code * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors * @throws IOException */ public static CompilationUnit parse(final File file) throws ParseException, IOException { - return parse(file, null, true); + return parse(file, null,true); } - public static CompilationUnit parse(final Reader reader, boolean considerComments) { + public static CompilationUnit parse(final Reader reader, boolean considerComments) + { try { String code = SourcesHelper.readerToString(reader); Reader reader1 = SourcesHelper.stringToReader(code); CompilationUnit cu = new ASTParser(reader1).CompilationUnit(); - if (considerComments) { - insertComments(cu, code); + if (considerComments){ + insertComments(cu,code); } return cu; - } catch (IOException ioe) { + } catch (IOException ioe){ throw new ParseException(ioe.getMessage()); } } @@ -184,11 +198,14 @@ public static CompilationUnit parse(final Reader reader, boolean considerComment * Parses the Java block contained in a {@link String} and returns a * {@link BlockStmt} that represents it. * - * @param blockStatement {@link String} containing Java block code + * @param blockStatement + * {@link String} containing Java block code * @return BlockStmt representing the Java block - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ - public static BlockStmt parseBlock(final String blockStatement) { + public static BlockStmt parseBlock(final String blockStatement) + { StringReader sr = new StringReader(blockStatement); BlockStmt result = new ASTParser(sr).Block(); sr.close(); @@ -199,9 +216,11 @@ public static BlockStmt parseBlock(final String blockStatement) { * Parses the Java statement contained in a {@link String} and returns a * {@link Statement} that represents it. * - * @param statement {@link String} containing Java statement code + * @param statement + * {@link String} containing Java statement code * @return Statement representing the Java statement - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ public static Statement parseStatement(final String statement) { StringReader sr = new StringReader(statement); @@ -214,9 +233,11 @@ public static Statement parseStatement(final String statement) { * Parses the Java import contained in a {@link String} and returns a * {@link ImportDeclaration} that represents it. * - * @param importDeclaration {@link String} containing Java import code + * @param importDeclaration + * {@link String} containing Java import code * @return ImportDeclaration representing the Java import declaration - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ public static ImportDeclaration parseImport(final String importDeclaration) { StringReader sr = new StringReader(importDeclaration); @@ -229,9 +250,11 @@ public static ImportDeclaration parseImport(final String importDeclaration) { * Parses the Java expression contained in a {@link String} and returns a * {@link Expression} that represents it. * - * @param expression {@link String} containing Java expression + * @param expression + * {@link String} containing Java expression * @return Expression representing the Java expression - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ public static Expression parseExpression(final String expression) { StringReader sr = new StringReader(expression); @@ -244,9 +267,11 @@ public static Expression parseExpression(final String expression) { * Parses the Java annotation contained in a {@link String} and returns a * {@link AnnotationExpr} that represents it. * - * @param annotation {@link String} containing Java annotation + * @param annotation + * {@link String} containing Java annotation * @return AnnotationExpr representing the Java annotation - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ public static AnnotationExpr parseAnnotation(final String annotation) { StringReader sr = new StringReader(annotation); @@ -259,9 +284,11 @@ public static AnnotationExpr parseAnnotation(final String annotation) { * Parses the Java body declaration(e.g fields or methods) contained in a * {@link String} and returns a {@link BodyDeclaration} that represents it. * - * @param body {@link String} containing Java body declaration + * @param body + * {@link String} containing Java body declaration * @return BodyDeclaration representing the Java annotation - * @throws ParseException if the source code has parser errors + * @throws ParseException + * if the source code has parser errors */ public static BodyDeclaration parseBodyDeclaration(final String body) { StringReader sr = new StringReader(body); @@ -274,8 +301,8 @@ public static BodyDeclaration parseBodyDeclaration(final String body) { * Comments are attributed to the thing the comment and are removed from * allComments. */ - private static void insertCommentsInCu(CompilationUnit cu, CommentsCollection commentsCollection) { - if (commentsCollection.size() == 0) return; + private static void insertCommentsInCu(CompilationUnit cu, CommentsCollection commentsCollection){ + if (commentsCollection.size()==0) return; // I should sort all the direct children and the comments, if a comment is the first thing then it // a comment to the CompilationUnit @@ -287,18 +314,20 @@ private static void insertCommentsInCu(CompilationUnit cu, CommentsCollection co List children = cu.getChildrenNodes(); PositionUtils.sortByBeginPosition(children); - if (cu.getPackage() != null && (children.size() == 0 || PositionUtils.areInOrder(comments.get(0), children.get(0)))) { + if (cu.getPackage()!=null && (children.size()==0 || PositionUtils.areInOrder(comments.get(0), children.get(0)))){ cu.setComment(comments.get(0)); comments.remove(0); } - insertCommentsInNode(cu, comments); + insertCommentsInNode(cu,comments); } - private static boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineComment) { + private static boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineComment) + { // The node start and end at the same line as the comment, // let's give to it the comment - if (node.getBeginLine() == lineComment.getBeginLine() && !node.hasComment()) { + if (node.getBeginLine()==lineComment.getBeginLine() && !node.hasComment()) + { node.setComment(lineComment); return true; } else { @@ -309,8 +338,10 @@ private static boolean attributeLineCommentToNodeOrChild(Node node, LineComment PositionUtils.sortByBeginPosition(children); Collections.reverse(children); - for (Node child : children) { - if (attributeLineCommentToNodeOrChild(child, lineComment)) { + for (Node child : children) + { + if (attributeLineCommentToNodeOrChild(child, lineComment)) + { return true; } } @@ -323,8 +354,8 @@ private static boolean attributeLineCommentToNodeOrChild(Node node, LineComment * This method try to attributes the nodes received to child of the node. * It returns the node that were not attributed. */ - private static void insertCommentsInNode(Node node, List commentsToAttribute) { - if (commentsToAttribute.size() == 0) return; + private static void insertCommentsInNode(Node node, List commentsToAttribute){ + if (commentsToAttribute.size()==0) return; // the comments can: // 1) Inside one of the child, then it is the child that have to associate them @@ -334,25 +365,30 @@ private static void insertCommentsInNode(Node node, List commentsToAttr List children = node.getChildrenNodes(); PositionUtils.sortByBeginPosition(children); - for (Node child : children) { + for (Node child : children){ List commentsInsideChild = new LinkedList(); - for (Comment c : commentsToAttribute) { - if (PositionUtils.nodeContains(child, c, _doNotConsiderAnnotationsAsNodeStartForCodeAttribution)) { + for (Comment c : commentsToAttribute){ + if (PositionUtils.nodeContains(child, c, _doNotConsiderAnnotationsAsNodeStartForCodeAttribution)){ commentsInsideChild.add(c); } } commentsToAttribute.removeAll(commentsInsideChild); - insertCommentsInNode(child, commentsInsideChild); + insertCommentsInNode(child,commentsInsideChild); } // I can attribute in line comments to elements preceeding them, if there // is something contained in their line List attributedComments = new LinkedList(); - for (Comment comment : commentsToAttribute) { - if (comment.isLineComment()) { - for (Node child : children) { - if (child.getEndLine() == comment.getBeginLine()) { - if (attributeLineCommentToNodeOrChild(child, comment.asLineComment())) { + for (Comment comment : commentsToAttribute) + { + if (comment.isLineComment()) + { + for (Node child : children) + { + if (child.getEndLine()==comment.getBeginLine()) + { + if (attributeLineCommentToNodeOrChild(child, comment.asLineComment())) + { attributedComments.add(comment); } } @@ -368,14 +404,15 @@ private static void insertCommentsInNode(Node node, List commentsToAttr childrenAndComments.addAll(commentsToAttribute); PositionUtils.sortByBeginPosition(childrenAndComments, _doNotConsiderAnnotationsAsNodeStartForCodeAttribution); - for (Node thing : childrenAndComments) { - if (thing instanceof Comment) { - previousComment = (Comment) thing; - if (!previousComment.isOrphan()) { + for (Node thing : childrenAndComments){ + if (thing instanceof Comment){ + previousComment = (Comment)thing; + if (!previousComment.isOrphan()) + { previousComment = null; } } else { - if (previousComment != null && !thing.hasComment()) { + if (previousComment != null && !thing.hasComment()){ if (!_doNotAssignCommentsPreceedingEmptyLines || !thereAreLinesBetween(previousComment, thing)) { thing.setComment(previousComment); attributedComments.add(previousComment); @@ -388,26 +425,28 @@ private static void insertCommentsInNode(Node node, List commentsToAttr commentsToAttribute.removeAll(attributedComments); // all the remaining are orphan nodes - for (Comment c : commentsToAttribute) { + for (Comment c : commentsToAttribute){ if (c.isOrphan()) { node.addOrphanComment(c); } } } - private static boolean thereAreLinesBetween(Node a, Node b) { - if (!PositionUtils.areInOrder(a, b)) { + private static boolean thereAreLinesBetween(Node a, Node b) + { + if (!PositionUtils.areInOrder(a, b)) + { return thereAreLinesBetween(b, a); } int endOfA = a.getEndLine(); - return b.getBeginLine() > (a.getEndLine() + 1); + return b.getBeginLine()>(a.getEndLine()+1); } private static void insertComments(CompilationUnit cu, String code) throws IOException { CommentsParser commentsParser = new CommentsParser(); CommentsCollection allComments = commentsParser.parse(code); - insertCommentsInCu(cu, allComments); + insertCommentsInCu(cu,allComments); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/Position.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/Position.java index 8970bb0831..522411c270 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/Position.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/Position.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser; import com.github.javaparser.ast.Node; @@ -27,27 +27,27 @@ public class Position { private int line; private int column; - public static final Position ABSOLUTE_START = new Position(Node.ABSOLUTE_BEGIN_LINE, -1); - public static final Position ABSOLUTE_END = new Position(Node.ABSOLUTE_END_LINE, -1); + public static final Position ABSOLUTE_START = new Position(Node.ABSOLUTE_BEGIN_LINE,-1); + public static final Position ABSOLUTE_END = new Position(Node.ABSOLUTE_END_LINE,-1); - public static Position beginOf(Node node) { - return new Position(node.getBeginLine(), node.getBeginColumn()); + public static Position beginOf(Node node){ + return new Position(node.getBeginLine(),node.getBeginColumn()); } - public static Position endOf(Node node) { - return new Position(node.getEndLine(), node.getEndColumn()); + public static Position endOf(Node node){ + return new Position(node.getEndLine(),node.getEndColumn()); } - public Position(int line, int column) { + public Position(int line, int column){ this.line = line; this.column = column; } - public int getLine() { + public int getLine(){ return this.line; } - public int getColumn() { + public int getColumn(){ return this.column; } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/PositionUtils.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/PositionUtils.java index 5be830908a..41df817107 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/PositionUtils.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/PositionUtils.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser; import com.github.javaparser.ast.Node; @@ -42,11 +42,11 @@ private PositionUtils() { // prevent instantiation } - public static void sortByBeginPosition(List nodes) { + public static void sortByBeginPosition(List nodes){ sortByBeginPosition(nodes, false); } - public static void sortByBeginPosition(List nodes, final boolean ignoringAnnotations) { + public static void sortByBeginPosition(List nodes, final boolean ignoringAnnotations){ Collections.sort(nodes, new Comparator() { @Override public int compare(Node o1, Node o2) { @@ -55,11 +55,11 @@ public int compare(Node o1, Node o2) { }); } - public static boolean areInOrder(Node a, Node b) { + public static boolean areInOrder(Node a, Node b){ return areInOrder(a, b, false); } - public static boolean areInOrder(Node a, Node b, boolean ignoringAnnotations) { + public static boolean areInOrder(Node a, Node b, boolean ignoringAnnotations){ return compare(a, b, ignoringAnnotations) <= 0; } @@ -73,7 +73,7 @@ private static int compare(Node a, Node b, boolean ignoringAnnotations) { } } - int signLine = signum(a.getBeginLine() - b.getBeginLine()); + int signLine = signum( a.getBeginLine() - b.getBeginLine() ); if (signLine == 0) { return signum(a.getBeginColumn() - b.getBeginColumn()); } else { @@ -82,14 +82,14 @@ private static int compare(Node a, Node b, boolean ignoringAnnotations) { } public static AnnotationExpr getLastAnnotation(Node node) { - if (node instanceof AnnotableNode) { + if (node instanceof AnnotableNode){ List annotations = new LinkedList(); annotations.addAll(((AnnotableNode) node).getAnnotations()); - if (annotations.size() == 0) { + if (annotations.size()==0){ return null; } sortByBeginPosition(annotations); - return annotations.get(annotations.size() - 1); + return annotations.get(annotations.size()-1); } else { return null; } @@ -114,28 +114,27 @@ private static Node beginNodeWithoutConsideringAnnotations(Node node) { } else if (node instanceof ClassOrInterfaceDeclaration) { ClassOrInterfaceDeclaration casted = (ClassOrInterfaceDeclaration) node; return casted.getNameExpr(); - } else { + } else { return node; } } - public static boolean nodeContains(Node container, Node contained, boolean ignoringAnnotations) { - if (!ignoringAnnotations || PositionUtils.getLastAnnotation(container) == null) { + public static boolean nodeContains(Node container, Node contained, boolean ignoringAnnotations){ + if (!ignoringAnnotations || PositionUtils.getLastAnnotation(container)==null){ return container.contains(contained); } - if (!container.contains(contained)) { + if (!container.contains(contained)){ return false; } // if the node is contained, but it comes immediately after the annotations, // let's not consider it contained - if (container instanceof AnnotableNode) { + if (container instanceof AnnotableNode){ int bl = beginLineWithoutConsideringAnnotation(container); int bc = beginColumnWithoutConsideringAnnotation(container); - if (bl > contained.getBeginLine()) return false; - if (bl == contained.getBeginLine() && bc > contained.getBeginColumn()) return false; - if (container.getEndLine() < contained.getEndLine()) return false; - if (container.getEndLine() == contained.getEndLine() && container.getEndColumn() < contained.getEndColumn()) - return false; + if (bl>contained.getBeginLine()) return false; + if (bl==contained.getBeginLine() && bc>contained.getBeginColumn()) return false; + if (container.getEndLine() - * * @author Julio Vilmar Gesser */ public final class CompilationUnit extends Node { @@ -88,9 +87,9 @@ public void accept(VoidVisitor v, A arg) { * Including javadocs, line comments and block comments of all types, * inner-classes and other members.
    * If there is no comment, null is returned. - * + * * @return list with all comments of this compilation unit or - * null + * null * @see JavadocComment * @see com.github.javaparser.ast.comments.LineComment * @see com.github.javaparser.ast.comments.BlockComment @@ -102,7 +101,7 @@ public List getComments() { /** * Retrieves the list of imports declared in this compilation unit or * null if there is no import. - * + * * @return the list of imports or null if there is no import */ public List getImports() { @@ -113,7 +112,7 @@ public List getImports() { * Retrieves the package declaration of this compilation unit.
    * If this compilation unit has no package declaration (default package), * null is returned. - * + * * @return the package declaration or null */ public PackageDeclaration getPackage() { @@ -123,7 +122,7 @@ public PackageDeclaration getPackage() { /** * Return the list of types declared in this compilation unit.
    * If there is no types declared, null is returned. - * + * * @return the list of types or null null if there is no type * @see AnnotationDeclaration * @see ClassOrInterfaceDeclaration @@ -136,8 +135,9 @@ public List getTypes() { /** * Sets the list of comments of this compilation unit. - * - * @param comments the list of comments + * + * @param comments + * the list of comments */ public void setComments(List comments) { throw new RuntimeException("Not implemented!"); @@ -146,32 +146,35 @@ public void setComments(List comments) { /** * Sets the list of imports of this compilation unit. The list is initially * null. - * - * @param imports the list of imports + * + * @param imports + * the list of imports */ public void setImports(List imports) { this.imports = imports; - setAsParentNodeOf(this.imports); + setAsParentNodeOf(this.imports); } /** * Sets or clear the package declarations of this compilation unit. - * - * @param pakage the pakage declaration to set or null to default - * package + * + * @param pakage + * the pakage declaration to set or null to default + * package */ public void setPackage(PackageDeclaration pakage) { this.pakage = pakage; - setAsParentNodeOf(this.pakage); + setAsParentNodeOf(this.pakage); } /** * Sets the list of types declared in this compilation unit. - * - * @param types the lis of types + * + * @param types + * the lis of types */ public void setTypes(List types) { this.types = types; - setAsParentNodeOf(this.types); + setAsParentNodeOf(this.types); } } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/DocumentableNode.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/DocumentableNode.java index 74f70c5e41..0038831b8b 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/DocumentableNode.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/DocumentableNode.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; import com.github.javaparser.ast.comments.JavadocComment; @@ -29,6 +29,5 @@ public interface DocumentableNode { public JavadocComment getJavaDoc(); - public void setJavaDoc(JavadocComment javadocComment); } diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/ImportDeclaration.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/ImportDeclaration.java index 0d9da3d5b1..da249e20b4 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/ImportDeclaration.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/ImportDeclaration.java @@ -3,12 +3,12 @@ * Copyright (C) 2011, 2013-2015 The JavaParser Team. * * This file is part of JavaParser. - * + * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * b) the terms of the Apache License + * b) the terms of the Apache License * * You should have received a copy of both licenses in LICENCE.LGPL and * LICENCE.APACHE. Please refer to those files for details. @@ -18,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ - + package com.github.javaparser.ast; import com.github.javaparser.ast.expr.NameExpr; @@ -36,7 +36,6 @@ * ImportDeclaration ::= "import" ( "static" )? }{@link NameExpr}{@code ( "." "*" )? ";" * } * - * * @author Julio Vilmar Gesser */ public final class ImportDeclaration extends Node { @@ -75,7 +74,7 @@ public
    void accept(VoidVisitor v, A arg) { /** * Retrieves the name of the import. - * + * * @return the name of the import */ public NameExpr getName() { @@ -84,9 +83,9 @@ public NameExpr getName() { /** * Return if the import ends with "*". - * + * * @return true if the import ends with "*", false - * otherwise + * otherwise */ public boolean isAsterisk() { return asterisk; @@ -94,9 +93,9 @@ public boolean isAsterisk() { /** * Return if the import is static. - * + * * @return true if the import is static, false - * otherwise + * otherwise */ public boolean isStatic() { return static_; @@ -104,8 +103,9 @@ public boolean isStatic() { /** * Sets if this import is asterisk. - * - * @param asterisk true if this import is asterisk + * + * @param asterisk + * true if this import is asterisk */ public void setAsterisk(boolean asterisk) { this.asterisk = asterisk; @@ -113,8 +113,9 @@ public void setAsterisk(boolean asterisk) { /** * Sets the name this import. - * - * @param name the name to set + * + * @param name + * the name to set */ public void setName(NameExpr name) { this.name = name; @@ -123,8 +124,9 @@ public void setName(NameExpr name) { /** * Sets if this import is static. - * - * @param static_ true if this import is static + * + * @param static_ + * true if this import is static */ public void setStatic(boolean static_) { this.static_ = static_; diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/NamedNode.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/NamedNode.java index 873016a0b3..7885d71d2c 100644 --- a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/NamedNode.java +++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_src/proper_source/com/github/javaparser/ast/NamedNode.java @@ -23,10 +23,10 @@ /** * A node having a name. - *