diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000000..46bffe8d687 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# file such that Spoon is considered as sponsorable by Github + +# https://opencollective.com/spoon-java +open_collective: spoon-java diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 542c11fe316..9fe9778af12 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -59,20 +59,12 @@ body: placeholder: X.Y.Z validations: required: true - - type: dropdown + - type: input id: jvm-version attributes: label: JVM Version description: Which JVM version are you running Spoon with? Note that Spoon is built for Java 11+, and we cannot maintain support for older versions. - options: - - "11" - - "12" - - "13" - - "14" - - "15" - - "16" - - "17" - - "18" + placeholder: You can run 'java -version' to get this information. validations: required: true - type: textarea diff --git a/.github/workflows/jreleaser.yml b/.github/workflows/jreleaser.yml new file mode 100644 index 00000000000..3195f901045 --- /dev/null +++ b/.github/workflows/jreleaser.yml @@ -0,0 +1,130 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Next release version' + required: true + default: 'patch' + type: choice + options: + - major + - minor + - patch + +jobs: + + build: + runs-on: ubuntu-latest + steps: +# Setups the environment + - name: Checkout + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + with: + fetch-depth: 0 + token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} + - name: Set git user + run: | + git config --global user.name "GitHub Actions Bot" + git config --global user.email "<>" + - name: Set up JDK 11 + uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3 + with: + java-version: '11' + distribution: 'temurin' + cache: maven + + - name: install go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + - name: install semversion + run: go install github.com/ffurrer2/semver/cmd/semver@latest +# Get current version from pom and remove snapshot if present. + - name: Get current version from pom and remove snapshot if present. + run: echo "CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//')" >> $GITHUB_ENV + - name: Get version with snapshot + run: echo "CURRENT_VERSION_WITH_SNAPSHOT=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV +# Calculate release version: +# - if `version` is patch, we just increment drop the `-SNAPSHOT` suffix +# (e.g. 10.0.1-SNAPSHOT -> 10.0.1) +# - if `version` is minor or major, we increment the minor or major version and +# set the patch version to `0` (e.g. 10.0.1-SNAPSHOT -> 11.0.0 or 10.1.0) +# +# As we are using a snapshot version, the first call to `semver next` slices +# off only the `-SNAPSHOT` suffix. We therefore run `semver next` on the +# version *without* the `-SNAPSHOT` prefix for major and minor bumps. +# +# After release, we run `semver next` once again and append the `-SNAPSHOT` +# suffix. This results in our patch version from above becoming +# `10.0.2-SNAPSHOT`. The major/minor just get the patch set to `1` and +# `-SNAPSHOT` appended. + - name: Set next version for patch + if: ${{ github.event.inputs.version == 'patch' }} + run: echo "NEXT_VERSION=$(semver next ${{ github.event.inputs.version }} $CURRENT_VERSION_WITH_SNAPSHOT)" >> $GITHUB_ENV + - name: Set next version for major/minor + if: ${{ github.event.inputs.version == 'major' || github.event.inputs.version == 'minor' }} + run: echo "NEXT_VERSION=$(semver next ${{ github.event.inputs.version }} $CURRENT_VERSION)" >> $GITHUB_ENV + - name: set branchname to next version + run: echo "BRANCH_NAME=release/$NEXT_VERSION" >> $GITHUB_ENV + - name: Set release version + run: | + mvn -f spoon-pom --no-transfer-progress --batch-mode versions:set -DnewVersion=$NEXT_VERSION -DprocessAllModules + mvn --no-transfer-progress --batch-mode versions:set -DnewVersion=$NEXT_VERSION -DprocessAllModules + mvn -f spoon-javadoc --no-transfer-progress --batch-mode versions:set -DnewVersion=$NEXT_VERSION -DprocessAllModules + - name: Commit & Push changes + run: | + git checkout -b ${{env.BRANCH_NAME}} + git commit -am "release: Releasing version ${{ env.NEXT_VERSION }}" + git push --set-upstream origin ${{ env.BRANCH_NAME }} + + + +# Now we can run the release + - name: Stage release + run: mvn -f spoon-pom --no-transfer-progress --batch-mode -Pjreleaser clean deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + - name: Print next version + run: mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//' + - name: Run JReleaser + uses: jreleaser/release-action@0b198089c53ad2aef0d2bff6b5e6061ead2bbb90 # v2 + with: + setup-java: false + version: 1.4.0 + arguments: full-release + env: + JRELEASER_PROJECT_VERSION: ${{ env.NEXT_VERSION }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} + JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD }} +# Time to set the next version: The next version of any Release is a snapshot version of the next patch version + - name : Set next version (patch of release version) with -SNAPSHOT suffix + run: | + echo "NEXT_RELEASE_VERSION=$(semver next patch $NEXT_VERSION)-SNAPSHOT" >> $GITHUB_ENV + echo "NEXT_RELEASE_VERSION_WITHOUT_SNAPSHOT=$(semver next patch $NEXT_VERSION)" >> $GITHUB_ENV + - name: Set release version + run: | + mvn -f spoon-pom --no-transfer-progress --batch-mode versions:set -DnewVersion=$NEXT_RELEASE_VERSION -DprocessAllModules + mvn --no-transfer-progress --batch-mode versions:set -DnewVersion=$NEXT_RELEASE_VERSION -DprocessAllModules + mvn -f spoon-javadoc --no-transfer-progress --batch-mode versions:set -DnewVersion=$NEXT_RELEASE_VERSION -DprocessAllModules +# Commit and push changes + - name: Commit & Push changes + run: | + git commit -am "release: Setting SNAPSHOT version $NEXT_RELEASE_VERSION" + git push --set-upstream origin ${{ env.BRANCH_NAME }} + - name: Merge Fast Forward + run: | + git checkout master + git merge --ff-only ${{ env.BRANCH_NAME }} + git push origin master + +# Log failure: + - name: JReleaser release output + if: always() + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: jreleaser-release + path: | + out/jreleaser/trace.log + out/jreleaser/output.properties diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml index eef442622a6..31f51279b6e 100644 --- a/.github/workflows/qodana.yml +++ b/.github/workflows/qodana.yml @@ -14,13 +14,29 @@ jobs: runs-on: ubuntu-latest name: code-quality qodana steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@7afb26c0c2f325c0d5c21ea1f617c79c7f899337 # v2022.3.4 + uses: JetBrains/qodana-action@54d3fc653c515607d6b1599201a383e9e07649b1 # v2023.1.5 with: args: --source-directory,./src/main/java , --fail-threshold, 0 - - uses: github/codeql-action/upload-sarif@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2 + post-pr-comment: "false" + - uses: github/codeql-action/upload-sarif@46ed16ded91731b2df79a2893d3aea8e9f03b5c4 # v2 + with: + sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json + code-quality-spoon-javadoc: + runs-on: ubuntu-latest + name: code-quality spoon-javadoc qodana + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + fetch-depth: 0 + - name: 'Qodana Scan (spoon-javadoc)' + uses: JetBrains/qodana-action@54d3fc653c515607d6b1599201a383e9e07649b1 # v2023.1.5 + with: + args: --source-directory,./spoon-javadoc/src/main/java , --fail-threshold, 0 + post-pr-comment: "false" + - uses: github/codeql-action/upload-sarif@46ed16ded91731b2df79a2893d3aea8e9f03b5c4 # v2 with: sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json diff --git a/.github/workflows/sbom.yml b/.github/workflows/sbom.yml index 20496f8f3ec..b39cf239d35 100644 --- a/.github/workflows/sbom.yml +++ b/.github/workflows/sbom.yml @@ -22,10 +22,10 @@ jobs: SSH_AUTH_SOCK: /tmp/ssh_agent.sock name: Generate and store SBOM steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 - - uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0 + - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: 17 distribution: ${{ env.JAVA_DISTRIBUTION }} diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml new file mode 100644 index 00000000000..54906db2057 --- /dev/null +++ b/.github/workflows/scorecards.yml @@ -0,0 +1,76 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '20 7 * * 2' + push: + branches: ["master"] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + contents: read + actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1 + with: + egress-policy: audit + + - name: "Checkout code" + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecards on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@46ed16ded91731b2df79a2893d3aea8e9f03b5c4 # v2.20.3 + with: + sarif_file: results.sarif diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index de66e723334..d25f4df49a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,36 +17,28 @@ on: env: JAVA_DISTRIBUTION: temurin + MAVEN_OPTS: >- + -Dmaven.resolver.transport=native + -Daether.connector.connectTimeout=300000 + -Daether.connector.requestTimeout=300000 jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: - java: [11, 17, 19, 20-ea] - os: [ubuntu-latest, windows-latest] - exclude: - - os: windows-latest - java: 17 - - os: windows-latest - java: 19 - - os: windows-latest - java: 20-ea - - - - env: - MAVEN_OPTS: -Djava.src.version=${{ matrix.java }} -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false + java: [17, 21-ea] + os: [ubuntu-latest] name: Tests with Java ${{ matrix.java }} on ${{ matrix.os }} steps: - name: Disable Git's autocrlf run: git config --global core.autocrlf false - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: oracle-actions/setup-java@2c4df2930e35870536667f383d87f1246fbe613f # v1 with: + website: jdk.java.net java-version: ${{ matrix.java }} - distribution: ${{ env.JAVA_DISTRIBUTION }} - name: Get date for cache # see https://github.com/actions/cache README id: get-date @@ -63,24 +55,22 @@ jobs: run: mv chore/logback.xml src/test/resources/ - name: Build run: | - mvn -B test-compile + mvn -f spoon-pom -B test-compile - name: Fetch final dependencies # this is a hack to download the final test dependencies required to actually run the tests - run: timeout 20 mvn -B test || echo "Done fetching dependencies" + run: timeout 20 mvn -f spoon-pom -B test || echo "Done fetching dependencies" shell: bash - name: Test - run: - mvn test + run: + mvn -f spoon-pom test - name: print run tests run: cat testResults.spoon coverage: runs-on: ubuntu-latest - env: - MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false name: Test with coverage steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: 17 distribution: ${{ env.JAVA_DISTRIBUTION }} @@ -100,30 +90,27 @@ jobs: run: mv chore/logback.xml src/test/resources/ - name: Build run: | - mvn -B test-compile + mvn -f spoon-pom -B test-compile - name: Test with coverage - run: mvn -Pcoveralls test jacoco:report coveralls:report -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER --fail-never + run: mvn -f spoon-pom -Pcoveralls test jacoco:report coveralls:report -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER --fail-never env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.number }} extra: runs-on: ubuntu-latest - env: - MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false name: Extra checks steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 - - uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0 + - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: 11 distribution: ${{ env.JAVA_DISTRIBUTION }} - - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 + - uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1 with: python-version: 3.11 - - name: Get date for cache # see https://github.com/actions/cache README id: get-date run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT @@ -134,25 +121,116 @@ jobs: path: ~/.m2/repository key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-maven- - - name: Use silent log config run: mv chore/logback.xml src/test/resources/ - - name: Run extra checks - run: ./chore/ci-extra.sh + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + fetch-depth: 0 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y python3-pip + pip3 install --user CommonMark==0.9.1 requests pygithub + + - name: Verify and Site Maven goals + run: mvn verify license:check site -DskipTests -DadditionalJOption=-Xdoclint:syntax,-missing -Dscan + - name: Install spoon-pom + working-directory: spoon-pom + run: mvn install -DskipTests + + - name: Checkstyle in src/tests + run: mvn -q checkstyle:checkstyle -Pcheckstyle-test + + - name: Check documentation links + run: python3 ./chore/check-links-in-doc.py + + - name: Analyze dependencies through DepClean in spoon-core + run: mvn -q depclean:depclean + + - name: Spoon-decompiler + working-directory: spoon-decompiler + run: | + mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon + mvn -q versions:update-parent -DallowSnapshots=true + git diff + mvn -q test + mvn -q checkstyle:checkstyle license:check + mvn -q depclean:depclean + + - name: Spoon-control-flow + working-directory: spoon-control-flow + run: | + mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon + mvn -q versions:update-parent -DallowSnapshots=true + git diff + mvn -q test + mvn -q checkstyle:checkstyle license:check + # spoon dataflow + - name: Cache downloaded file + uses: actions/cache@v2 + with: + path: spoon-dataflow/z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip + key: ${{ runner.os }}-z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip + restore-keys: | + ${{ runner.os }}-z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip + - name: Spoon-dataflow + working-directory: spoon-dataflow + run: | + wget https://projects.ow2.org/download/spoon/WebHome/z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip + unzip z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip + export LD_LIBRARY_PATH=./z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04/bin + ./gradlew build + - name: Spoon-visualisation + working-directory: spoon-visualisation + run: | + mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon + mvn -q versions:update-parent -DallowSnapshots=true + git diff + mvn -q test + mvn -q depclean:depclean + + - name: Spoon-smpl + working-directory: spoon-smpl + run: | + mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon + mvn -q versions:update-parent -DallowSnapshots=true + git diff + mvn -q -Djava.src.version=11 test + mvn -q checkstyle:checkstyle license:check + mvn -q depclean:depclean + - name: Trigger extra tasks + if: github.repository == 'INRIA/spoon' && github.event_name == 'pull_request' + run: | + curl https://raw.githubusercontent.com/SpoonLabs/spoon-ci-external/master/spoon-pull-request.sh | bash - name: Run Javadoc quality check run: ./chore/check-javadoc-regressions.py COMPARE_WITH_MASTER reproducible-builds: runs-on: ubuntu-latest - env: - MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false name: reproducible-builds steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 - - uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0 + - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: 17 distribution: ${{ env.JAVA_DISTRIBUTION }} - name: Check status run: chore/check-reproducible-builds.sh + maven-central-requirements: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - name: Set up JDK 11 + uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3 + with: + java-version: '11' + distribution: 'temurin' + # the pom checker needs maven 3.9.0 + - name: Set up Maven + uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5 + with: + maven-version: 3.9.0 + # we dont enforce that the version must be non snapshot as this is not possible for SNAPSHOT versions in our workflow. + - name: Check maven pom quality + run: mvn -f spoon-pom org.kordamp.maven:pomchecker-maven-plugin:1.9.0:check-maven-central -D"checker.release=false" diff --git a/.gitignore b/.gitignore index 8d151e03f7b..98143478428 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,7 @@ gradle-app.setting ## Gradle Enterprise ID File ## .mvn/.gradle-enterprise/gradle-enterprise-workspace-id +# Jreleaser files +out/ +# Mvn release plugin creates this during version update +pom.xml.versionsBackup diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1674c4f867d..925c141ae11 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Current integrators: - Email: nicolas.harrand@gmail.com - Martin Monperrus [@monperrus](https://github.com/monperrus/) - Email: martin.monperrus@gnieh.org - - GPG fingerprint: [074F73B36D8DD649B132BAC18035014A2B7BFA92](https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x074F73B36D8DD649B132BAC18035014A2B7BFA92) + - GPG fingerprint: [AF7B251DA8126C30896FAFF77D398AD45AEEEC93](https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xAF7B251DA8126C30896FAFF77D398AD45AEEEC93) - Martin Wittlinger [@MartinWitt](https://github.com/MartinWitt) - Email: wittlinger.martin@gmail.com - Hannes Greule [@SirYwell](https://github.com/SirYwell) @@ -70,7 +70,7 @@ Guidelines for feature pull-requests: Other kinds of pull-requests: 1. Pull requests with passing test cases only are welcome, they specify previously unspecified behavior and are prefixed by "test:". -1. Pull requests with failing test cases only are welcome, they reproduce bugs and are very useful for maintainers to fix them. You can prevent failing the CI with adding the annotation `@GitHubIssue(issueNumber = , fixed = false)`. If you fix a test case with such an annotation mark the test case as fixed with `@GitHubIssue(issueNumber = , fixed = true)`. +2. Pull requests with failing test cases only are welcome, they reproduce bugs and are very useful for maintainers to fix them. You can prevent failing the CI with adding the annotation `@GitHubIssue(issueNumber = , fixed = false)`. If you fix a test case with such an annotation mark the test case as fixed with `@GitHubIssue(issueNumber = , fixed = true)`. 1. "Chore" pull-requests modify the CI setup. 1. If there is no activity on an issue or on a pull request for 3 months it's closed. diff --git a/LICENSE-short.txt b/LICENSE-short.txt index 4f2dfec4ecb..2e678bf0abd 100644 --- a/LICENSE-short.txt +++ b/LICENSE-short.txt @@ -1,5 +1,5 @@ SPDX-License-Identifier: (MIT OR CECILL-C) -Copyright (C) 2006-2019 INRIA and contributors +Copyright (C) 2006-2023 INRIA and contributors -Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. \ No newline at end of file +Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. diff --git a/README.md b/README.md index bf093bc45c4..2702069be67 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Maven Central](https://img.shields.io/maven-central/v/fr.inria.gforge.spoon/spoon-core.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22fr.inria.gforge.spoon%22%20AND%20a%3A%22spoon-core%22) [![GHA tests Workflow Status](https://github.com/INRIA/spoon/actions/workflows/tests.yml/badge.svg)](https://github.com/INRIA/spoon/actions/workflows/tests.yml) -[![Coverage Status](https://coveralls.io/repos/INRIA/spoon/badge.png)](https://coveralls.io/r/INRIA/spoon) +[![Coverage Status](https://coveralls.io/repos/INRIA/spoon/badge.svg)](https://coveralls.io/r/INRIA/spoon) [![Maintainability Rating](https://sonarqube.ow2.org/api/project_badges/measure?project=fr.inria.gforge.spoon%3Aspoon-core&metric=sqale_rating)](https://sonarqube.ow2.org/dashboard?id=fr.inria.gforge.spoon%3Aspoon-core) [![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-success?labelColor=1e5b96)](https://github.com/jvm-repo-rebuild/reproducible-central#fr.inria.gforge.spoon:spoon-core) @@ -156,6 +156,11 @@ Maven: Spoon is Free and Open Source, double-licensed under the ([CeCILL-C license](https://cecill.info/licences.en.html) - French equivalent to LGPL) and the MIT license. +## JProfiler + +Spoon is developed with the help of JProfiler, a Java profiler by ej-technologies GmbH. JProfiler supports the development of Spoon by providing its full-featured Java Profiler for free. We thank ej-technologies GmbH for this support. + +[![JProfiler](https://www.ej-technologies.com/images/product_banners/jprofiler_large.png)](https://www.ej-technologies.com/products/jprofiler/overview.html) ## Github Contributors This list is generated by `chore/generate-contributor-list.py`. If you're not listed or you'd like to have your full name, please post to https://github.com/INRIA/spoon/issues/3909. diff --git a/chore/check-reproducible-builds.sh b/chore/check-reproducible-builds.sh index 3392f899d25..5da16c50ca7 100755 --- a/chore/check-reproducible-builds.sh +++ b/chore/check-reproducible-builds.sh @@ -4,11 +4,11 @@ set -e build() { - mvn clean package -DskipDepClean -DskipTests -Dmaven.javadoc.skip > /dev/null + mvn -f spoon-pom clean package -DskipDepClean -DskipTests -Dmaven.javadoc.skip > /dev/null } compare_files() { - sudo docker run --rm -t -w $(pwd) -v $(pwd):$(pwd):ro \ + sudo docker run --rm -t -w "$(pwd)" -v "$(pwd):$(pwd):ro" \ registry.salsa.debian.org/reproducible-builds/diffoscope "$1" "$2" } @@ -19,6 +19,7 @@ build # Save artifacts mkdir -p saved_artifacts cp target/spoon-core-*.jar saved_artifacts +cp spoon-javadoc/target/spoon-javadoc*.jar saved_artifacts # Build again, will overwrite target jars build @@ -33,7 +34,10 @@ CORE_EXIT="$?" compare_files target/spoon-core-*dependencies.jar saved_artifacts/spoon-core-*dependencies.jar DEPS_EXIT="$?" -if [[ "$CORE_EXIT" == 0 && "$DEPS_EXIT" == 0 ]]; then +compare_files spoon-javadoc/target/spoon-javadoc*.jar saved_artifacts/spoon-javadoc*.jar +JAVADOC_EXIT="$?" + +if [[ "$CORE_EXIT" == 0 && "$DEPS_EXIT" == 0 && "$JAVADOC_EXIT" == 0 ]]; then echo -e "\033[1;32mThe jars were reproducible!\033[0m" exit 0 fi @@ -48,6 +52,9 @@ fi if [[ "$CORE_EXIT" != 0 ]]; then echo -e " \033[31mspoon-core-VERSION.jar was not reproducible!\033[0m" fi +if [[ "$JAVADOC_EXIT" != 0 ]]; then + echo -e " \033[31mspoon-javadoc-VERSION.jar was not reproducible!\033[0m" +fi exit 1 diff --git a/chore/ci-extra.sh b/chore/ci-extra.sh deleted file mode 100755 index 9f13fc3a1ed..00000000000 --- a/chore/ci-extra.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -# This script intends to be run in continuous integration. -# it runs verify and site maven goals -# and to check documentation links -# -# It also run test, verify, checkstyle, and depclean goals on spoon-decompiler - -# fails if anything fails -set -e - -pip install --user CommonMark==0.9.1 requests pygithub - -mvn -version - -# verify includes checkstyle, , outputing the errors in the log of CI -# javadoc check is included in goal "site" -# it's better to have the doclint here because the pom.xml config of javadoc is a nightmare -mvn verify license:check site install -DskipTests -DadditionalJOption=-Xdoclint:syntax,-missing -Dscan - -# checkstyle in src/tests -mvn -q checkstyle:checkstyle -Pcheckstyle-test - -python ./chore/check-links-in-doc.py - -# Analyze the usage of dependencies through DepClean in spoon-core. -# The build fails if DepClean detects at least one unused direct dependency. -mvn -q depclean:depclean - -################################################################## -# Spoon-decompiler -################################################################## -cd spoon-decompiler - -# always depends on the latest snapshot, just installed with "mvn install" above -mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon -git diff - -mvn -q test -mvn -q checkstyle:checkstyle license:check -mvn -q depclean:depclean - -################################################################## -# Spoon-control-flow -################################################################## -cd ../spoon-control-flow - -# always depends on the latest snapshot, just installed with "mvn install" above -mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon -git diff - -mvn -q test -mvn -q checkstyle:checkstyle license:check - -################################################################## -# Spoon-dataflow -################################################################## -cd ../spoon-dataflow - -# download and install z3 lib -# the github URL is rate limited, and this results in flaky CI -# wget https://github.com/Z3Prover/z3/releases/download/z3-4.8.4/z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip -# so we have a copy on OW2 -wget https://projects.ow2.org/download/spoon/WebHome/z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip - -unzip z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip -export LD_LIBRARY_PATH=./z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04/bin - -# build and run tests -./gradlew build - - -################################################################## -# Spoon-visualisation -################################################################## -cd ../spoon-visualisation - -# always depends on the latest snapshot, just installed with "mvn install" above -mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon -git diff - -mvn -q -Djava.src.version=11 test -mvn -q depclean:depclean - -################################################################## -# Spoon-smpl -################################################################## -cd ../spoon-smpl - -# always depends on the latest snapshot, just installed with "mvn install" above -mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon -git diff - -mvn -q -Djava.src.version=11 test -mvn -q checkstyle:checkstyle license:check -mvn -q depclean:depclean - -################################################################## -## Trigerring extra tasks that we don't want to commit to master -## (For experimental CI features, short lived tasks, etc) - -if [[ "$GITHUB_REPOSITORY" == "INRIA/spoon" ]] && [[ "$GITHUB_EVENT_NAME" == "pull_request" ]] -then - echo "downloading extra CI PR script from SpoonLabs/spoon-ci-external" - curl https://raw.githubusercontent.com/SpoonLabs/spoon-ci-external/master/spoon-pull-request.sh | bash -fi diff --git a/doc/_includes/head.html b/doc/_includes/head.html index 86d429f969d..45cb99b5663 100644 --- a/doc/_includes/head.html +++ b/doc/_includes/head.html @@ -14,7 +14,7 @@ - + diff --git a/doc/images/spoon_javadoc_ansi_print.png b/doc/images/spoon_javadoc_ansi_print.png new file mode 100644 index 00000000000..45f2a5d2d91 Binary files /dev/null and b/doc/images/spoon_javadoc_ansi_print.png differ diff --git a/doc/jenkins/Dockerfile b/doc/jenkins/Dockerfile index 79c9ca53a33..d45ba6d81f3 100644 --- a/doc/jenkins/Dockerfile +++ b/doc/jenkins/Dockerfile @@ -1,4 +1,4 @@ -FROM stackbrew/ubuntu:16.04 +FROM stackbrew/ubuntu:16.04@sha256:cd39646de5628c8188396c506fdc76dd94c7652a82439cc4318cfc05cc93fbb7 MAINTAINER Gerard Paligot "gerard.paligot@inria.fr" RUN apt-get update && apt-get clean diff --git a/doc/spoon_javadoc.md b/doc/spoon_javadoc.md new file mode 100644 index 00000000000..a7274d74684 --- /dev/null +++ b/doc/spoon_javadoc.md @@ -0,0 +1,163 @@ +--- +title: Javadoc parsing +tags: [javadoc, javadoc-parsing] +keywords: javadoc, javadoc-parsing, comments, spoon +--- + +The spoon-javadoc submodule provides a parser for javadoc comments, producing a +structured syntax tree representing the comment. Each tag is parsed and +tokenized according to the rules in the javadoc specification. Additionally, +references in e.g. `@link` or `@see` tags are resolved to `CtReference`s, +allowing you to easily analyze them. + +A visitor infrastructure is also provided, which eases analyzing comments or +converting them into your own format. + +### Installation + +On a Unix-like system, the following set of commands should be sufficient for +getting spoon-javadoc up and running from scratch. + +``` +$ git clone https://github.com/INRIA/spoon.git +$ cd spoon/spoon-pom +$ mvn install +``` + +### Basic usage + +To get started you get the raw javadoc string (including `/**` and `*/`) and +pass it to a newly created `JavadocParser`. +You then call `parse` and get back a list of elements, corresponding to text, +inline tags or block tags. +Using a `JavadocVisitor` you can then visit each of them and drill down a bit. + +In the following example, javadoc is parsed and then printed out again -- but +this time with some ANSI color highlighting applied. Note that references are +pretty-printed according to `CtReference#toString()`. + +
+ +Expand me for the code + +```java +void example() { + String javadoc = "/**\n" + + " * Hello world, this is a description.\n" + + " * How are you doing? I am just fine :)\n" + + " * This is an inline link {@link String} and one with a {@link String label}\n" + + " * and a {@link String#CASE_INSENSITIVE_ORDER field} and {@link String#replace(char, char) with a space}.\n" + + " * {@link java.lang.annotation.Target @Target} chained to @Target.\n" + + " *

\n" + + " * We can also write very HTML {@code code}.\n" + + " * And an index: {@index \"Hello world\" With a phrase} or {@index without Without a phrase}.\n" + + " * {@snippet lang = java id = \"example me\" foo = 'bar':\n" + + " * public void HelloWorld(){ //@start region = \"foo\"\n" + + " * System.out.println(\"Hello World!\"); // @highlight substring=\"println\"\n" + + " * int a = 10; // @start foo=bar :\n" + + " * int a = 10; // @end\n" + + " * } // @end region=foo\n" + + " *}\n" + + " *

{@index \"Module Resolution\"}

\n" + + " *\n" + + " * @param args some argument\n" + + " * @author a poor {@literal man}\n" + + " * hello world\n" + + " * @see String#contains(CharSequence) with a label\n" + + " * @see String#replace(char, char)\n" + + " */\n"; + + List elements = new JavadocParser( + // Raw comment string including "/*" and "**/" + // You can get this using CtComment#getRawContent from a spoon element. + javadoc, + // The reference element so resolving of links works correctly. + // Javadoc comments can use "#foo" to refer to fields/methods + // in the current class. + new Launcher().getFactory().Type().OBJECT.getTypeDeclaration() + ).parse(); + + for (JavadocElement element : elements) { + System.out.print(element.accept(new ExampleVisitor())); + } +} + +private static class ExampleVisitor implements JavadocVisitor { + + @Override + public String defaultValue() { + throw new RuntimeException("Visit method not implemented"); + } + + @Override + public String visitInlineTag(JavadocInlineTag tag) { + String result = "{@\033[36m" + tag.getTagType().getName() + "\033[0m"; + for (JavadocElement element : tag.getElements()) { + result += " " + element.accept(this); + } + result += "}"; + return result; + } + + @Override + public String visitBlockTag(JavadocBlockTag tag) { + String result = "@\033[36m" + tag.getTagType().getName() + "\033[0m "; + for (JavadocElement element : tag.getElements()) { + result += element.accept(this); + } + result += "\n"; + return result; + } + + @Override + public String visitText(JavadocText text) { + return text.getText(); + } + + @Override + public String visitReference(JavadocReference reference) { + return "\033[31m" + reference.getReference() + "\033[0m"; + } + + @Override + public String visitSnippet(JavadocSnippetTag snippet) { + String result = "{@\033[36m" + snippet.getTagType().getName() + "\033[0m "; + result += snippet.getAttributes() + .entrySet() + .stream() + .sorted(Map.Entry.comparingByKey()) + .map(entry -> entry.getKey() + "='" + entry.getValue() + "'") + .collect(Collectors.joining(" ")); + + result += " : "; + for (JavadocElement element : snippet.getElements()) { + result += element.accept(this); + } + + result += "}\n"; + return result; + } +} +``` + +
+
+This will print a version with a bit more colours: +![ANSI colored javadoc]({{ "/images/spoon_javadoc_ansi_print.png" | prepend: site.baseurl }}) + +### Snippets +Spoon-javadoc provides the `JavadocSnippetBody` class to help parse javadoc +snippets: +```java +JavadocSnippetBody body = JavadocSnippetBody.fromString( + "class Foo { // @start region=\"foo\"\n" + + " int p0 = 0; // @start region=\"bar\"\n" + + " int p1 = 1;\n" + + " int p2 = 2; // @end\n" + + " int p3 = 3; // @end\n" + + "}\n" +); +body.getLines(); // returns all lines of the original snippet +body.getRegions(); // returns all start/highlight/link regions +body.getActiveRegionsAtLine(0); // returns all regions active in the given line +``` diff --git a/doc/type_adaption.md b/doc/type_adaption.md index 07047e4b82e..a9b93db6a6a 100644 --- a/doc/type_adaption.md +++ b/doc/type_adaption.md @@ -116,6 +116,43 @@ we need to go from any other node in the tree. #### Finding no hierarchy If we can not find any hierarchy we currently return the input type unchanged. +#### Adapting generics of enclosing classes +Java allows classes to use generics of their enclosing class, e.g. +```java +public class Outer { + public class Inner { + public void bar(A a, B b) {} + } +} +``` +If you now additionally introduce a dual inheritance relationship +```java +public class OuterSub extends Outer { + public class InnerSub extends Outer.Inner { + public void bar(A1 a, B1 b) {} + } +} +``` +Adapting the method from `Outer.Inner#bar` to `OuterSub.InnerSub#bar` involves +building the hierarchy from `InnerSub` to `Outer.Inner` and then adapting `A1` +and `B1`. +While this hierarchy can be used to resolve `B` to `B1`, it will not be helpful +for adapting `A` to `A1`: This generic type is passed down through a completely +different inheritance chain. + +To solve this, we check whether a type parameter is declared by the class +containing the type reference. +For example, when translating `A1` we notice that even though the usage is in +`InnerSub#bar`, the declaration of the type parameter was in `OuterSub`. +Therefore, we adjust the end of our hierarchy to `Outer` instead of `Inner` and +the start to the innermost enclosing class inheriting from that, which is +`OuterSub` in our example. +Notice that there could be *multiple* matching enclosing classes, but we +have no way to decide which one to use, and just arbitrarily resolve the +ambiguity by picking the first one. + +After this adjustment of the start and end types, the rest of the translation +continues normally. ## Adapting a method to a subclass Closely related to type adaption (but not exactly the same!) is translating diff --git a/jreleaser.yml b/jreleaser.yml new file mode 100644 index 00000000000..94f0cd823f2 --- /dev/null +++ b/jreleaser.yml @@ -0,0 +1,49 @@ +project: + name: spoon + description: Spoon is an open-source library to analyze, rewrite, transform, transpile Java source code. + longDescription: Spoon is an open-source library to analyze, rewrite, transform, transpile Java source code. + It parses source files to build a well-designed AST with powerful analysis and transformation API. + It supports modern Java versions up to Java 20. + authors: + - slarse + - monperrus + - nharrand + - martinwitt + - sirywell + - I-Al-Istannen + license: (MIT OR CECILL-C) + links: + homepage: https://spoon.gforge.inria.fr/ + java: + groupId: fr.inria.gforge + version: "11" + inceptionYear: "2015" + +release: + github: + owner: INRIA + changelog: + formatted: ALWAYS + preset: conventional-commits + format: '- {{commitShortHash}} {{commitTitle}}' + contributors: + format: '- {{contributorName}} ({{contributorUsernameAsLink}})' + hide: + contributors: + - '[bot]' + - 'GitHub' +signing: + active: ALWAYS + armored: true +deploy: + maven: + nexus2: + maven-central: + active: ALWAYS + # Spoon is hosted on the legacy sonatype instance, see + # https://central.sonatype.org/publish/publish-guide/#releasing-to-central + url: https://oss.sonatype.org/service/local + closeRepository: true + releaseRepository: true + stagingRepositories: + - target/staging-deploy diff --git a/pom.xml b/pom.xml index 89bcef70670..037511afe40 100644 --- a/pom.xml +++ b/pom.xml @@ -12,31 +12,17 @@ fr.inria.gforge.spoon spoon-pom - 1.0 + 10.4.1-SNAPSHOT spoon-pom spoon-core jar - 10.3.0-SNAPSHOT + 10.4.1-SNAPSHOT Spoon Core Spoon is a tool for meta-programming, analysis and transformation of Java programs. http://spoon.gforge.inria.fr/ - - - CeCILL-C - French equivalent to LGPL - https://cecill.info/licences/Licence_CeCILL-C_V1-en.txt - repo - - - MIT - https://opensource.org/licenses/MIT - repo - - - **/support/gui/* @@ -48,7 +34,7 @@ org.eclipse.jdt org.eclipse.jdt.core - 3.32.0 + 3.33.0 org.eclipse.platform @@ -82,12 +68,13 @@ commons-io commons-io - 2.11.0 + 2.13.0 + org.apache.maven maven-model - 3.8.8 + 3.6.0 org.apache.commons @@ -104,25 +91,25 @@ com.fasterxml.jackson.core jackson-databind - 2.14.2 + 2.15.2 org.apache.commons commons-compress - 1.22 + 1.23.0 com.google.guava guava - 31.1-jre + 32.1.1-jre test ch.qos.logback logback-classic - 1.4.5 + 1.4.8 test @@ -168,7 +155,7 @@ org.kohsuke.metainf-services metainf-services - 1.9 + 1.11 true test @@ -178,7 +165,6 @@ org.jacoco jacoco-maven-plugin - 0.8.8 @@ -268,7 +254,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.1 + 3.3.0 true true diff --git a/qodana.yaml b/qodana.yaml index e858314af16..d0043b7e59c 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,7 +1,6 @@ profile: name: qodana.recommended version: "1.0" -linter: jetbrains/qodana-jvm-community:2022.3-eap include: - name: Anonymous2MethodRef - name: AssignmentToCatchBlockParameter diff --git a/renovate.json b/renovate.json index 171f903404d..44b9d3aabf2 100644 --- a/renovate.json +++ b/renovate.json @@ -1,12 +1,18 @@ { - "extends": [ - "config:base", - "helpers:pinGitHubActionDigests" - ], - "packageRules": [ - { - "packageNames": ["org.mockito:mockito-core"], - "schedule": ["on monday"] - } - ] + "extends":[ + "config:base", + "helpers:pinGitHubActionDigests" + ], + "packageRules":[ + { + "matchUpdateTypes":[ + "minor", + "patch", + "pin", + "digest", + "pinDigest" + ], + "automerge":true + } + ] } diff --git a/spoon-control-flow/pom.xml b/spoon-control-flow/pom.xml index a681898400c..f84f2524cd7 100644 --- a/spoon-control-flow/pom.xml +++ b/spoon-control-flow/pom.xml @@ -27,7 +27,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.1 + 3.3.0 true ../checkstyle.xml @@ -75,7 +75,7 @@ fr.inria.gforge.spoon spoon-core - 10.2.0 + 10.3.0 diff --git a/spoon-dataflow/build.gradle b/spoon-dataflow/build.gradle index 67aa4323347..81550ea98c4 100644 --- a/spoon-dataflow/build.gradle +++ b/spoon-dataflow/build.gradle @@ -5,8 +5,8 @@ plugins { // always depends on the latest snapshot of Spoon // https://github.com/patrikerdes/gradle-use-latest-versions-plugin id 'se.patrikerdes.use-latest-versions' version '0.2.18' - id 'com.github.ben-manes.versions' version '0.46.0' - id "com.github.johnrengelman.shadow" version "7.1.2" + id 'com.github.ben-manes.versions' version '0.47.0' + id "com.github.johnrengelman.shadow" version "8.1.1" } group 'fr.inria.gforge.spoon' @@ -23,7 +23,7 @@ dependencies { implementation group: 'fr.inria.gforge.spoon', name: 'spoon-core', version: '+' implementation group: 'commons-cli', name: 'commons-cli', version: '1.5.0' implementation group: 'com.microsoft', name: 'z3', version: '4.8.4' - testImplementation("org.junit.jupiter:junit-jupiter:5.9.2") + testImplementation("org.junit.jupiter:junit-jupiter:5.9.3") } application { diff --git a/spoon-dataflow/gradle/wrapper/gradle-wrapper.jar b/spoon-dataflow/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa75..033e24c4cdf 100644 Binary files a/spoon-dataflow/gradle/wrapper/gradle-wrapper.jar and b/spoon-dataflow/gradle/wrapper/gradle-wrapper.jar differ diff --git a/spoon-dataflow/gradle/wrapper/gradle-wrapper.properties b/spoon-dataflow/gradle/wrapper/gradle-wrapper.properties index 508322917bd..62f495dfed6 100644 --- a/spoon-dataflow/gradle/wrapper/gradle-wrapper.properties +++ b/spoon-dataflow/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/spoon-dataflow/gradlew b/spoon-dataflow/gradlew index 65dcd68d65c..fcb6fca147c 100755 --- a/spoon-dataflow/gradlew +++ b/spoon-dataflow/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# 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"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + 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. @@ -144,7 +144,7 @@ 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=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then 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 $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/spoon-decompiler/pom.xml b/spoon-decompiler/pom.xml index 3bc931c2a99..4f7aefeda32 100644 --- a/spoon-decompiler/pom.xml +++ b/spoon-decompiler/pom.xml @@ -28,7 +28,7 @@ fr.inria.gforge.spoon spoon-core - 10.2.0 + 10.3.0 @@ -82,7 +82,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.1 + 3.3.0 true ../checkstyle.xml diff --git a/spoon-javadoc/pom.xml b/spoon-javadoc/pom.xml new file mode 100644 index 00000000000..8bf51bba194 --- /dev/null +++ b/spoon-javadoc/pom.xml @@ -0,0 +1,78 @@ + + + + spoon-pom + fr.inria.gforge.spoon + 10.4.1-SNAPSHOT + ../spoon-pom + + 4.0.0 + + spoon-javadoc + jar + 10.4.1-SNAPSHOT + Spoon Javadoc + A javadoc parser for the java source code analysis tool spoon. + http://spoon.gforge.inria.fr/ + + + + org.jacoco + jacoco-maven-plugin + + + + prepare-agent + + + + report + prepare-package + + report + + + + check-coverage + + check + + + + + CLASS + + + LINE + COVEREDRATIO + 0.1 + + + + + + + + + + + + + + fr.inria.gforge.spoon + spoon-core + ${version} + provided + + + + org.assertj + assertj-core + 3.24.2 + test + + + + diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/JavadocTagCategory.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/JavadocTagCategory.java new file mode 100644 index 00000000000..dc68fbbb9fd --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/JavadocTagCategory.java @@ -0,0 +1,17 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api; + +/** + * The category (block or inline) a javadoc tag belongs to. A tag might be able to be used as + * both (e.g. {@code @return}. + */ +public enum JavadocTagCategory { + INLINE, + BLOCK, +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/JavadocTagType.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/JavadocTagType.java new file mode 100644 index 00000000000..e8191e55e1f --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/JavadocTagType.java @@ -0,0 +1,65 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api; + +import java.util.Collection; +import java.util.List; + +/** + * The type of a javadoc tag (e.g. {@code @link} or {@code @author}). + *

+ * The standard tags are provided by {@link StandardJavadocTagType}, but non-standard tags are often found in real + * code. + */ +public interface JavadocTagType { + + /** + * @return an immutable collection of applicable categories + */ + Collection categories(); + + /** + * @return true if this tag can be used as an inline tag. This is not exclusive with {@link #isBlock()}. + */ + default boolean isInline() { + return categories().contains(JavadocTagCategory.INLINE); + } + + /** + * @return true if this tag can be used as a block tag. This is not exclusive with {@link #isInline()}. + */ + default boolean isBlock() { + return categories().contains(JavadocTagCategory.BLOCK); + } + + /** + * @return the name of the tag (e.g. "return") + */ + String getName(); + + /** + * Creates a new tag type with a non-standard name. + * + * @param name the name of the tag + * @param categories the categories it belongs to + * @return the crated tag type + */ + static JavadocTagType unknown(String name, JavadocTagCategory... categories) { + return new JavadocTagType() { + @Override + public Collection categories() { + return List.of(categories); + } + + @Override + public String getName() { + return name; + } + }; + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/StandardJavadocTagType.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/StandardJavadocTagType.java new file mode 100644 index 00000000000..61e9c0f22d1 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/StandardJavadocTagType.java @@ -0,0 +1,79 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api; + +import static spoon.javadoc.api.JavadocTagCategory.BLOCK; +import static spoon.javadoc.api.JavadocTagCategory.INLINE; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Optional; +import java.util.Set; + +/** + * Contains all standard javadoc tag types. + */ +public enum StandardJavadocTagType implements JavadocTagType { + AUTHOR("author", BLOCK), + CODE("code", INLINE), + DEPRECATED("deprecated", BLOCK), + DOC_ROOT("docRoot", INLINE), + EXCEPTION("exception", BLOCK), + HIDDEN("hidden", BLOCK), + INDEX("index", INLINE), + INHERIT_DOC("inheritDoc", INLINE), + LINK("link", INLINE), + LINKPLAIN("linkplain", INLINE), + LITERAL("literal", INLINE), + PARAM("param", BLOCK), + PROVIDES("provides", BLOCK), + RETURN("return", INLINE, BLOCK), + SEE("see", BLOCK), + SERIAL("serial", BLOCK), + SERIAL_DATA("serialData", BLOCK), + SERIAL_FIELD("serialField", BLOCK), + SINCE("since", BLOCK), + SNIPPET("snippet", INLINE), + SUMMARY("summary", INLINE), + SYSTEM_PROPERTY("systemProperty", INLINE), + THROWS("throws", BLOCK), + USES("uses", BLOCK), + VALUE("value", INLINE), + VERSION("version", BLOCK); + + private final String name; + private final Set categories; + + StandardJavadocTagType(String name, JavadocTagCategory... categories) { + this.name = name; + this.categories = Set.of(categories); + } + + @Override + public Collection categories() { + return categories; + } + + @Override + public String getName() { + return name; + } + + /** + * Tries to parse a tag type from its string representation (see {@link #getName()}). + * + * @param name the name to parse + * @return the matching standard tag, if any + */ + public static Optional fromString(String name) { + return Arrays.stream(values()) + .filter(it -> it.getName().equalsIgnoreCase(name)) + .map(it -> (JavadocTagType) it) + .findFirst(); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocBlockTag.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocBlockTag.java new file mode 100644 index 00000000000..01560d83165 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocBlockTag.java @@ -0,0 +1,96 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import spoon.javadoc.api.JavadocTagType; + +/** + * A javadoc block tag (like {@code @author} or {@code @see}. + */ +public class JavadocBlockTag implements JavadocElement { + + private final JavadocTagType tagType; + private final List elements; + + /** + * @param elements the arguments and content + * @param tagType the type of the tag + */ + public JavadocBlockTag(List elements, JavadocTagType tagType) { + this.tagType = tagType; + this.elements = elements; + } + + /** + * {@return the tag type (e.g. {@code @version}} + */ + public JavadocTagType getTagType() { + return tagType; + } + + /** + * {@return an unmodifiable view of the content of the tag. Potential arguments are the first element(s), content is + * the rest.} + */ + public List getElements() { + return Collections.unmodifiableList(elements); + } + + /** + * Returns the (first) argument of this block tag, if it is of the given type. + * + * @param type the type you expect the argument to be + * @param the type of the argument + * @return the argument, if it exists and is of the given type + */ + public Optional getArgument(Class type) { + if (getElements().isEmpty()) { + return Optional.empty(); + } + JavadocElement element = getElements().get(0); + if (type.isInstance(element)) { + return Optional.of(type.cast(element)); + } + return Optional.empty(); + } + + @Override + public T accept(JavadocVisitor visitor) { + return visitor.visitBlockTag(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JavadocBlockTag that = (JavadocBlockTag) o; + return Objects.equals(tagType, that.tagType) && Objects.equals(elements, + that.elements); + } + + @Override + public int hashCode() { + return Objects.hash(tagType, elements); + } + + @Override + public String toString() { + return "JavadocBlockTag{" + + "tagType=" + tagType.getName() + + ", elements=" + elements + + '}'; + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocCommentView.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocCommentView.java new file mode 100644 index 00000000000..1c095ab6690 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocCommentView.java @@ -0,0 +1,48 @@ +package spoon.javadoc.api.elements; + +import java.util.List; +import java.util.stream.Collectors; +import spoon.javadoc.api.JavadocTagType; + +/** + * A slightly more expressive view of a {@code List}. + */ +public class JavadocCommentView { + + private final List elements; + + public JavadocCommentView(List elements) { + this.elements = List.copyOf(elements); + } + + public List getElements() { + return elements; + } + + public List getBlockTags() { + return elements.stream() + .filter(it -> it instanceof JavadocBlockTag) + .map(it -> (JavadocBlockTag) it) + .collect(Collectors.toList()); + } + + public List getBlockTag(JavadocTagType type) { + return getBlockTags().stream() + .filter(it -> type.equals(it.getTagType())) + .collect(Collectors.toList()); + } + + public List getBlockTagArguments( + JavadocTagType type, Class expectedArgumentClass + ) { + return getBlockTag(type).stream() + .flatMap(it -> it.getArgument(expectedArgumentClass).stream()) + .collect(Collectors.toList()); + } + + public List getBody() { + return elements.stream() + .filter(it -> !(it instanceof JavadocBlockTag)) + .collect(Collectors.toList()); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocElement.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocElement.java new file mode 100644 index 00000000000..2664e180f5f --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocElement.java @@ -0,0 +1,23 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements; + +/** + * A semantic part of a javadoc comment. + */ +public interface JavadocElement { + + /** + * Accepts a javadoc visitor by calling the appropriate visit method. + * + * @param visitor the visitor to accept + * @param the return type of the visitor + * @return the value returned by the visitor + */ + T accept(JavadocVisitor visitor); +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocInlineTag.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocInlineTag.java new file mode 100644 index 00000000000..f988f700ad1 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocInlineTag.java @@ -0,0 +1,94 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import spoon.javadoc.api.JavadocTagType; + +/** + * A javadoc inline tag (e.g. {@code @literal} or {@code @link}). + */ +public class JavadocInlineTag implements JavadocElement { + + private final List elements; + private final JavadocTagType tagType; + + /** + * @param elements the arguments of the tag + * @param tagType the type of the tag + */ + public JavadocInlineTag(List elements, JavadocTagType tagType) { + this.elements = elements; + this.tagType = tagType; + } + + /** + * @return the type of the tag + */ + public JavadocTagType getTagType() { + return tagType; + } + + /** + * @return the arguments of the tag + */ + public List getElements() { + return elements; + } + + /** + * Returns the (first) argument of this block tag, if it is of the given type. + * + * @param type the type you expect the argument to be + * @param the type of the argument + * @return the argument, if it exists and is of the given type + */ + public Optional getArgument(Class type) { + if (getElements().isEmpty()) { + return Optional.empty(); + } + JavadocElement element = getElements().get(0); + if (type.isInstance(element)) { + return Optional.of(type.cast(element)); + } + return Optional.empty(); + } + + @Override + public T accept(JavadocVisitor visitor) { + return visitor.visitInlineTag(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JavadocInlineTag that = (JavadocInlineTag) o; + return Objects.equals(elements, that.elements) && Objects.equals(tagType, + that.tagType); + } + + @Override + public int hashCode() { + return Objects.hash(elements, tagType); + } + + @Override + public String toString() { + return "JavadocInlineTag{" + + "elements=" + elements + + ", tagType=" + tagType.getName() + + '}'; + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocReference.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocReference.java new file mode 100644 index 00000000000..858244a57ce --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocReference.java @@ -0,0 +1,64 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements; + +import java.util.Objects; +import spoon.reflect.reference.CtReference; + +/** + * A reference to a java element inside a javadoc comment. + *

+ * This is typically a {@code {@link Element}} inline tag or a {@code {@see Element}} block tag. + */ +public class JavadocReference implements JavadocElement { + + private final CtReference reference; + + /** + * @param reference the underlying reference + */ + public JavadocReference(CtReference reference) { + this.reference = reference; + } + + /** + * @return the reference to the java element + */ + public CtReference getReference() { + return reference; + } + + @Override + public T accept(JavadocVisitor visitor) { + return visitor.visitReference(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JavadocReference that = (JavadocReference) o; + return Objects.equals(reference, that.reference); + } + + @Override + public int hashCode() { + return Objects.hash(reference); + } + + @Override + public String toString() { + return "JavadocReference{" + + ", reference=" + reference + + '}'; + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocText.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocText.java new file mode 100644 index 00000000000..eb16ac43547 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocText.java @@ -0,0 +1,61 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements; + +import java.util.Objects; + +/** + * Normal text appearing in a javadoc comment. + */ +public class JavadocText implements JavadocElement { + + private final String text; + + /** + * @param text the represented text + */ + public JavadocText(String text) { + this.text = text; + } + + /** + * @return the represented text + */ + public String getText() { + return text; + } + + @Override + public T accept(JavadocVisitor visitor) { + return visitor.visitText(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JavadocText that = (JavadocText) o; + return Objects.equals(text, that.text); + } + + @Override + public int hashCode() { + return Objects.hash(text); + } + + @Override + public String toString() { + return "JavadocText{" + + "text='" + text + '\'' + + '}'; + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocVisitor.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocVisitor.java new file mode 100644 index 00000000000..3b944dedb40 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/JavadocVisitor.java @@ -0,0 +1,75 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements; + +import spoon.javadoc.api.elements.snippets.JavadocSnippetTag; + +/** + * A visitor for javadoc elements. + * + * @param the return type of the visit methods + */ +public interface JavadocVisitor { + + /** + * @return the default value to return if a visit method is not overwritten + */ + T defaultValue(); + + /** + * @param tag the inline tag to visit + * @return a return value + * @implNote the default implementation visits all arguments + */ + default T visitInlineTag(JavadocInlineTag tag) { + for (JavadocElement element : tag.getElements()) { + element.accept(this); + } + return defaultValue(); + } + + /** + * @param tag the block tag to visit + * @return a return value + * @implNote the default implementation visits all elements + */ + default T visitBlockTag(JavadocBlockTag tag) { + for (JavadocElement element : tag.getElements()) { + element.accept(this); + } + return defaultValue(); + } + + /** + * @param snippet the snippet tag to visit + * @return a return value + * @implNote the default implementation visits all elements + */ + default T visitSnippet(JavadocSnippetTag snippet) { + for (JavadocElement element : snippet.getElements()) { + element.accept(this); + } + return defaultValue(); + } + + /** + * @param text the javadoc text to visit + * @return a return value + */ + default T visitText(JavadocText text) { + return defaultValue(); + } + + /** + * @param reference the javadoc reference to visit + * @return a return value + */ + default T visitReference(JavadocReference reference) { + return defaultValue(); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetBody.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetBody.java new file mode 100644 index 00000000000..1e5d8d33a06 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetBody.java @@ -0,0 +1,69 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements.snippets; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import spoon.javadoc.api.parsing.SnippetFileParser; + +/** + * A representation of a {@code @snippet} tag body (or a file referenced by it). + *

+ * Snippet bodies consist of normal code with a list of (potentially overlapping) regions. This class contains lines, + * regions, and is able to answer "what regions apply here" queries. + */ +public class JavadocSnippetBody { + + private final Set regions; + private final List lines; + + private JavadocSnippetBody(List lines, Set regions) { + this.regions = regions; + this.lines = lines; + } + + /** + * @param line the line to check + * @return all markup regions that overlap with the given line + */ + public Collection getActiveRegionsAtLine(int line) { + return regions.stream() + .filter(it -> line >= it.getStartLine() && line <= it.getEndLine()) + .collect(Collectors.toList()); + } + + /** + * @return all lines of this snippet body + */ + public List getLines() { + return Collections.unmodifiableList(lines); + } + + /** + * @return all markup regions in this snippet + */ + public Set getMarkupRegions() { + return Collections.unmodifiableSet(regions); + } + + /** + * Parses the given text as a snippet body. + * + * @param text the text to parse + * @return the parsed snippet body + */ + public static JavadocSnippetBody fromString(String text) { + List lines = text.lines().collect(Collectors.toList()); + Set tags = new SnippetFileParser(lines).parse(); + + return new JavadocSnippetBody(lines, tags); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetMarkupRegion.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetMarkupRegion.java new file mode 100644 index 00000000000..e1d22ef595c --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetMarkupRegion.java @@ -0,0 +1,106 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements.snippets; + +import java.util.Collections; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +public class JavadocSnippetMarkupRegion { + + private final int startLine; + private final int endLine; + private final Map attributes; + private final JavadocSnippetRegionType type; + + /** + * Creates a new snippet markup region representing some markup tag. + * + * @param startLine the starting line (inclusive) + * @param endLine the end line (inclusive) + * @param attributes the attributes of the region + * @param type the type of the region + */ + public JavadocSnippetMarkupRegion( + int startLine, + int endLine, + Map attributes, + JavadocSnippetRegionType type + ) { + this.startLine = startLine; + this.endLine = endLine; + this.attributes = attributes; + this.type = type; + } + + /** + * @return the name of this region + * @implNote this implementation is equivalent to {@code Optional.ofNullable(attributes.get("region"))} + */ + public Optional getName() { + return Optional.ofNullable(attributes.get("region")); + } + + /** + * @return the line this region starts on (inclusive) + */ + public int getStartLine() { + return startLine; + } + + /** + * @return the line this region ends on (inclusive) + */ + public int getEndLine() { + return endLine; + } + + /** + * @return an unmodifiable map with the region's attributes + */ + public Map getAttributes() { + return Collections.unmodifiableMap(attributes); + } + + /** + * @return the type of the region + */ + public JavadocSnippetRegionType getType() { + return type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JavadocSnippetMarkupRegion that = (JavadocSnippetMarkupRegion) o; + return startLine == that.startLine && endLine == that.endLine && Objects.equals( + attributes, that.attributes) && type == that.type; + } + + @Override + public int hashCode() { + return Objects.hash(startLine, endLine, attributes, type); + } + + @Override + public String toString() { + return "SnippetMarkupRegion{" + + "name='" + getName() + '\'' + + ", startLine=" + startLine + + ", endLine=" + endLine + + ", attributes=" + attributes + + ", type=" + type + + '}'; + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetRegionType.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetRegionType.java new file mode 100644 index 00000000000..3afa5316263 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetRegionType.java @@ -0,0 +1,47 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements.snippets; + +import java.util.Optional; + +/** + * The type of a javadoc snippet markup region. + */ +public enum JavadocSnippetRegionType { + HIGHLIGHT("highlight"), + LINK("link"), + REPLACE("replace"), + START("start"); + + private final String asString; + + JavadocSnippetRegionType(String asString) { + this.asString = asString; + } + + @Override + public String toString() { + return asString; + } + + /** + * Parses the snippet region type from a case-insensitive string. + * + * @param input the tag name + * @return the matching region type, if any + */ + public static Optional fromString(String input) { + for (JavadocSnippetRegionType type : values()) { + if (type.asString.equalsIgnoreCase(input)) { + return Optional.of(type); + } + } + + return Optional.empty(); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetTag.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetTag.java new file mode 100644 index 00000000000..4f299a73476 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/elements/snippets/JavadocSnippetTag.java @@ -0,0 +1,72 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.elements.snippets; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import spoon.javadoc.api.StandardJavadocTagType; +import spoon.javadoc.api.elements.JavadocInlineTag; +import spoon.javadoc.api.elements.JavadocText; +import spoon.javadoc.api.elements.JavadocVisitor; + +/** + * An {@code @snippet} inline tag. + *

+ * You want to use + * {@link spoon.javadoc.api.elements.snippets.JavadocSnippetBody JavadocSnippetBody} instead of directly using this + * classs. + */ +@Internal +public class SnippetFileParser { + + private final List lines; + private final Deque openRegions; + + /** + * @param lines the lines of the snippet body + */ + public SnippetFileParser(List lines) { + this.lines = lines; + this.openRegions = new ArrayDeque<>(); + } + + /** + * Parses the body to a list of markup regions. + * + * @return the parsed markup regions + */ + public Set parse() { + Set regions = new HashSet<>(); + boolean closeOnNext = false; + + for (int lineNumber = 0; lineNumber < lines.size(); lineNumber++) { + if (closeOnNext && !openRegions.isEmpty()) { + endClosestRegion(lineNumber).ifPresent(regions::add); + closeOnNext = false; + } + + StringReader line = new StringReader(lines.get(lineNumber)); + line.readWhile(it -> it != '@'); + if (!line.peek("@")) { + continue; + } + line.read("@"); + String tag = line.readWhile(it -> !Character.isWhitespace(it)); + + if (tag.equalsIgnoreCase("end")) { + endRegion(line, lineNumber).ifPresent(regions::add); + continue; + } + + Optional regionType = JavadocSnippetRegionType.fromString( + tag.strip().toLowerCase(Locale.ROOT) + ); + if (regionType.isEmpty()) { + continue; + } + + Map attributes = InlineTagParser.parseSnippetAttributes( + new StringReader(line.readRemaining()) + ); + boolean forNextLine = line.getUnderlying().stripTrailing().endsWith(":"); + boolean shouldClose = + !attributes.containsKey("region") && regionType.get() != JavadocSnippetRegionType.START; + closeOnNext = forNextLine && shouldClose; + + int startLine = forNextLine ? lineNumber + 1 : lineNumber; + openRegions.push(new OpenRegion(startLine, attributes, regionType.get())); + + // A one-line region + if (shouldClose && !closeOnNext) { + endRegion(line, lineNumber).ifPresent(regions::add); + } + } + + for (int i = 0, end = openRegions.size(); i < end; i++) { + endClosestRegion(lines.size()).ifPresent(regions::add); + } + + return regions; + } + + private Optional endRegion(StringReader reader, int line) { + reader.readWhile(it -> Character.isWhitespace(it) && it != '\n'); + if (openRegions.isEmpty()) { + return Optional.empty(); + } + + if (reader.peek("\n") || !reader.canRead()) { + return endClosestRegion(line); + } + + Map attributes = InlineTagParser.parseSnippetAttributes( + new StringReader(reader.readWhile(it -> it != '\n')) + ); + String regionName = attributes.get("region"); + + return openRegions.stream() + .filter(it -> it.name.equals(regionName)) + .findFirst() + .stream() + .peek(openRegions::remove) + .findFirst() + .map(it -> it.close(line)); + } + + private Optional endClosestRegion(int endLine) { + // end without argument + OpenRegion openRegion = openRegions.pop(); + return Optional.of(openRegion.close(endLine)); + } + + private static class OpenRegion { + + private final int startLine; + private final String name; + private final Map attributes; + private final JavadocSnippetRegionType type; + + private OpenRegion( + int startLine, Map attributes, JavadocSnippetRegionType type + ) { + this.startLine = startLine; + this.name = attributes.getOrDefault("region", ""); + this.attributes = attributes; + this.type = type; + } + + public JavadocSnippetMarkupRegion close(int endLine) { + return new JavadocSnippetMarkupRegion(startLine, endLine, attributes, type); + } + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/StringReader.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/StringReader.java new file mode 100644 index 00000000000..f3ff4b69640 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/StringReader.java @@ -0,0 +1,158 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.parsing; + +import java.util.function.IntPredicate; + +/** + * A string reader to help with building hand-written parsers. + */ +class StringReader { + + private final String underlying; + private int position; + + StringReader(String underlying) { + this(underlying, 0); + } + + StringReader(String underlying, int position) { + this.underlying = underlying; + this.position = position; + } + + public String readWhile(IntPredicate predicate) { + int start = position; + while (canRead() && predicate.test(peek())) { + position++; + } + + return underlying.substring(start, position); + } + + /** + * Reads text (which may contain balanced braces) enclosed by braces ({@literal {}}). + * + * @return the text excluding the braces + */ + public String readBalancedBraced() { + if (peek() != '{') { + throw new RuntimeException(":( no brace at start"); + } + int start = position + 1; + int depth = 0; + do { + if (peek() == '{') { + depth++; + } else if (peek() == '}') { + depth--; + } + position++; + + if (depth == 0) { + break; + } + } while (canRead()); + + return underlying.substring(start, position - 1); + } + + public boolean matches(String needle) { + return peek(needle.length()).equals(needle); + } + + public int peek() { + return underlying.codePointAt(position); + } + + public String peek(int chars) { + if (!canRead(chars)) { + return ""; + } + return underlying.substring(position, position + chars); + } + + public boolean peek(String needle) { + return peek(needle.length()).equals(needle); + } + + public String read(int amount) { + int start = position; + position = Math.min(underlying.length(), position + amount); + return underlying.substring(start, position); + } + + public boolean canRead() { + return canRead(1); + } + + public boolean canRead(int amount) { + return position + amount - 1 < underlying.length(); + } + + public StringReader fork() { + return new StringReader(underlying, position); + } + + public void read(String needle) { + if (!matches(needle)) { + throw new RuntimeException("Expected: " + needle); + } + position += needle.length(); + } + + public int remaining() { + return underlying.length() - position; + } + + public String readRemaining() { + return read(remaining()); + } + + public String readLine() { + String text = readWhile(it -> it != '\n'); + read("\n"); + + return text; + } + + /** + * Reads text enclosed by single or double quotes. + * + * @return the text excluding the quotes + */ + public String readPotentiallyQuoted() { + if (peek() != '"' && peek() != '\'') { + return readWhile(it -> !Character.isWhitespace(it)); + } + + int quoteEndChar = peek(); + read(Character.toString(quoteEndChar)); + String text = readWhile(it -> it != quoteEndChar); + read(Character.toString(quoteEndChar)); + + return text; + } + + public String getUnderlying() { + return underlying; + } + + public int getPosition() { + return position; + } + + public int getLastLinebreakPosition() { + for (int i = position - 1; i >= 0; i--) { + if (underlying.charAt(i) == '\n') { + return i; + } + } + return -1; + } +} diff --git a/spoon-javadoc/src/test/java/spoon/javadoc/api/TestHelper.java b/spoon-javadoc/src/test/java/spoon/javadoc/api/TestHelper.java new file mode 100644 index 00000000000..e1443dc29fa --- /dev/null +++ b/spoon-javadoc/src/test/java/spoon/javadoc/api/TestHelper.java @@ -0,0 +1,58 @@ +package spoon.javadoc.api; + +import java.lang.invoke.MethodHandles; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import spoon.Launcher; +import spoon.javadoc.api.elements.snippets.JavadocSnippetMarkupRegion; +import spoon.javadoc.api.elements.snippets.JavadocSnippetRegionType; +import spoon.reflect.declaration.CtMethod; +import spoon.reflect.declaration.CtType; +import spoon.reflect.factory.Factory; + +public class TestHelper { + + public static CtType parseType(Class clazz) { + Launcher launcher = new Launcher(); + launcher.getEnvironment().setCommentEnabled(true); + launcher.getEnvironment().setComplianceLevel(11); + launcher.addInputResource("src/test/java/" + clazz.getName().replace(".", "/") + ".java"); + return launcher.buildModel().getAllTypes().iterator().next(); + } + + public static Object invokeMethod(CtMethod method) { + if (!method.isStatic()) { + throw new IllegalArgumentException("Spoon method must be static"); + } + Class actualClass = method.getDeclaringType().getActualClass(); + Method actualMethod = Arrays.stream(actualClass.getDeclaredMethods()) + .filter(it -> it.getName().equals(method.getSimpleName())) + .findAny() + .orElseThrow(); + + try { + List parameters = new ArrayList<>(); + for (Class parameterType : actualMethod.getParameterTypes()) { + if (parameterType == Factory.class) { + parameters.add(method.getFactory()); + } else { + parameters.add((Object) MethodHandles.zero(parameterType).invoke()); + } + } + + actualMethod.setAccessible(true); + return actualMethod.invoke(null, parameters.toArray()); + } catch (Throwable e) { + throw new RuntimeException("Failed to invoke method", e); + } + } + + public static JavadocSnippetMarkupRegion region( + int startLine, int endLine, Map attributes, JavadocSnippetRegionType type + ) { + return new JavadocSnippetMarkupRegion(startLine, endLine, attributes, type); + } +} diff --git a/spoon-javadoc/src/test/java/spoon/javadoc/api/elements/snippets/JavadocSnippetBodyTest.java b/spoon-javadoc/src/test/java/spoon/javadoc/api/elements/snippets/JavadocSnippetBodyTest.java new file mode 100644 index 00000000000..4a92d142046 --- /dev/null +++ b/spoon-javadoc/src/test/java/spoon/javadoc/api/elements/snippets/JavadocSnippetBodyTest.java @@ -0,0 +1,35 @@ +package spoon.javadoc.api.elements.snippets; + +import static org.assertj.core.api.Assertions.assertThat; +import static spoon.javadoc.api.TestHelper.region; +import static spoon.javadoc.api.elements.snippets.JavadocSnippetRegionType.START; + +import java.util.Map; +import org.junit.jupiter.api.Test; + +class JavadocSnippetBodyTest { + + @Test + void testOverlap() { + JavadocSnippetBody body = JavadocSnippetBody.fromString( + "class Foo { // @start region=\"foo\"\n" + + " int p0 = 0; // @start region=\"bar\"\n" + + " int p1 = 1;\n" + + " int p2 = 2; // @end\n" + + " int p3 = 3; // @end\n" + + "}\n" + ); + assertThat(body.getLines()).hasSize(6); + + var first = region(0, 4, Map.of("region", "foo"), START); + var second = region(1, 3, Map.of("region", "bar"), START); + + assertThat(body.getActiveRegionsAtLine(0)).containsExactly(first); + assertThat(body.getActiveRegionsAtLine(1)).containsExactlyInAnyOrder(first, second); + assertThat(body.getActiveRegionsAtLine(2)).containsExactlyInAnyOrder(first, second); + assertThat(body.getActiveRegionsAtLine(3)).containsExactlyInAnyOrder(first, second); + assertThat(body.getActiveRegionsAtLine(4)).containsExactlyInAnyOrder(first); + assertThat(body.getActiveRegionsAtLine(5)).containsExactlyInAnyOrder(); + } + +} diff --git a/spoon-javadoc/src/test/java/spoon/javadoc/api/parsing/JavadocParserTest.java b/spoon-javadoc/src/test/java/spoon/javadoc/api/parsing/JavadocParserTest.java new file mode 100644 index 00000000000..4966fb74ad2 --- /dev/null +++ b/spoon-javadoc/src/test/java/spoon/javadoc/api/parsing/JavadocParserTest.java @@ -0,0 +1,458 @@ +package spoon.javadoc.api.parsing; + +import static org.assertj.core.api.Assertions.assertThat; +import static spoon.javadoc.api.StandardJavadocTagType.AUTHOR; +import static spoon.javadoc.api.StandardJavadocTagType.CODE; +import static spoon.javadoc.api.StandardJavadocTagType.DEPRECATED; +import static spoon.javadoc.api.StandardJavadocTagType.DOC_ROOT; +import static spoon.javadoc.api.StandardJavadocTagType.EXCEPTION; +import static spoon.javadoc.api.StandardJavadocTagType.HIDDEN; +import static spoon.javadoc.api.StandardJavadocTagType.INDEX; +import static spoon.javadoc.api.StandardJavadocTagType.INHERIT_DOC; +import static spoon.javadoc.api.StandardJavadocTagType.LINK; +import static spoon.javadoc.api.StandardJavadocTagType.LINKPLAIN; +import static spoon.javadoc.api.StandardJavadocTagType.LITERAL; +import static spoon.javadoc.api.StandardJavadocTagType.PARAM; +import static spoon.javadoc.api.StandardJavadocTagType.PROVIDES; +import static spoon.javadoc.api.StandardJavadocTagType.RETURN; +import static spoon.javadoc.api.StandardJavadocTagType.SEE; +import static spoon.javadoc.api.StandardJavadocTagType.SERIAL; +import static spoon.javadoc.api.StandardJavadocTagType.SERIAL_DATA; +import static spoon.javadoc.api.StandardJavadocTagType.SERIAL_FIELD; +import static spoon.javadoc.api.StandardJavadocTagType.SINCE; +import static spoon.javadoc.api.StandardJavadocTagType.SUMMARY; +import static spoon.javadoc.api.StandardJavadocTagType.SYSTEM_PROPERTY; +import static spoon.javadoc.api.StandardJavadocTagType.THROWS; +import static spoon.javadoc.api.StandardJavadocTagType.USES; +import static spoon.javadoc.api.StandardJavadocTagType.VALUE; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Stream; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.TestFactory; +import spoon.javadoc.api.JavadocTagType; +import spoon.javadoc.api.TestHelper; +import spoon.javadoc.api.elements.JavadocBlockTag; +import spoon.javadoc.api.elements.JavadocElement; +import spoon.javadoc.api.elements.JavadocInlineTag; +import spoon.javadoc.api.elements.JavadocReference; +import spoon.javadoc.api.elements.JavadocText; +import spoon.javadoc.api.elements.snippets.JavadocSnippetTag; +import spoon.reflect.declaration.CtMethod; +import spoon.reflect.declaration.CtParameter; +import spoon.reflect.declaration.CtType; +import spoon.reflect.factory.Factory; +import spoon.reflect.reference.CtTypeReference; + +class JavadocParserTest { + + public static final String I_AM_A_VAR = "WOE IS ME"; + + @TestFactory + Stream testFactoryForSamples() { + return TestHelper.parseType(getClass()) + .getMethods() + .stream() + .filter(it -> it.getSimpleName().startsWith("sample")) + .map(JavadocParserTest::buildDynamicTest); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + private static DynamicTest buildDynamicTest(CtMethod method) { + return DynamicTest.dynamicTest( + method.getSimpleName(), + () -> assertThat(JavadocParser.forElement(method)) + .containsExactlyElementsOf((Iterable) TestHelper.invokeMethod(method)) + ); + } + + // @formatter:off + /** + * This is a small comment. And now a second sentence. + * This part can also contain {@literal inline tags}, or html. + * + * @since 1.0 + * @return The expected AST + * + * This return tag has a linebreak... + */ + // @formatter:on + private static List sampleWithoutReferences() { + return List.of( + text( + "This is a small comment. And now a second sentence.\nThis part can also contain " + ), + inline(LITERAL, text("inline tags")), + text(", or html.\n\n"), + block(SINCE, text("1.0")), + block(RETURN, text("The expected AST\n\nThis return tag has a linebreak...")) + ); + } + + // @formatter:off + /** + * Some people use {@code to write code}. Sometimes, you also find an {@code {@docRoot}}, normally used to set image + * urls: {@docRoot}/foo.html. + * + * Javadoc can also build an + * {@index index Something that serves to guide, point out, or otherwise facilitate reference, especially.} for you. + * These indices can also span {@index "multiple words" more than a single word}. + * + * {@summary This is a cool summary. Not sure people use this tag. It is mostly ignored here, as it is not at the + * beginning}. + * + * Your JVM vendor can be found in {@systemProperty java.vendor}. + * + * Literals, like {@literal {@literal}} can be wrapped in literal tags. + */ + // @formatter:on + private static List sampleManyInlineTags() { + return List.of( + text("Some people use "), + inline(CODE, text("to write code")), + text(". Sometimes, you also find an "), + inline(CODE, text("{@docRoot}")), + text(", normally used to set image\nurls: "), + inline(DOC_ROOT), + text("/foo.html.\n\nJavadoc can also build an\n"), + + inline( + INDEX, + text("index"), + text( + "Something that serves to guide, point out, or otherwise " + + "facilitate reference, especially." + ) + ), + text(" for you.\nThese indices can also span "), + inline(INDEX, text("multiple words"), text("more than a single word")), + text(".\n\n"), + + inline( + SUMMARY, + text( + "This is a cool summary. Not sure people use this tag. " + + "It is mostly ignored here, as it is not at the\nbeginning") + ), + text(".\n\nYour JVM vendor can be found in "), + + inline(SYSTEM_PROPERTY, text("java.vendor")), + text(".\n\nLiterals, like "), + inline(LITERAL, text("{@literal}")), + text(" can be wrapped in literal tags.") + ); + } + + // @formatter:off + /** + * {@inheritDoc} Please inherit the description. + * + * {@return hello, I am an inline return tag!} + */ + // @formatter:on + private static List sampleReturnInline() { + return List.of( + inline(INHERIT_DOC), + text(" Please inherit the description.\n\n"), + inline(RETURN, text("hello, I am an inline return tag!")) + ); + } + + // @formatter:off + /** + * @param aParam A parameter! + * @return some value + * @author I was authored by me + * @hidden + * @serialData Nothing is serialized + * @since The day I wrote this + * @deprecated No worries, you can always use me + */ + // @formatter:on + private static List sampleBlockTags(int aParam) { + return List.of( + block(PARAM, text("aParam"), text("A parameter!")), + block(RETURN, text("some value")), + block(AUTHOR, text("I was authored by me")), + block(HIDDEN), + block(SERIAL_DATA, text("Nothing is serialized")), + block(SINCE, text("The day I wrote this")), + block(DEPRECATED, text("No worries, you can always use me")) + ); + } + + // @formatter:off + /** + * This method makes no use of {@link String}, {@link String#contains(CharSequence)}, + * {@link String#CASE_INSENSITIVE_ORDER}, or {@link java.time}. + * + * To make things nicer, we can {@link String label}, {@link String#substring(int, int) label}, + * {@link String#CASE_INSENSITIVE_ORDER label} {@link java.lang.invoke them} all. + * + * Additionally, {@linkplain String this works} {@linkplain String#substring(int) with} + * {@linkplain String#CASE_INSENSITIVE_ORDER plain} {@linkplain java.lang links} too. + * + * People can also embed values: {@value #I_AM_A_VAR}. + */ + // @formatter:on + private static List sampleReferencedInlineTags(Factory factory) { + return List.of( + text("This method makes no use of "), + inline(LINK, ref(factory, String.class)), + text(", "), + inline(LINK, ref(factory, String.class, "contains", CharSequence.class)), + text(",\n"), + inline(LINK, refField(factory, String.class, "CASE_INSENSITIVE_ORDER")), + text(", or "), + inline(LINK, refPackage(factory, "java.time")), + + text(".\n\nTo make things nicer, we can "), + inline(LINK, ref(factory, String.class), text("label")), + text(", "), + inline(LINK, ref(factory, String.class, "substring", int.class, int.class), text("label")), + text(",\n"), + inline(LINK, refField(factory, String.class, "CASE_INSENSITIVE_ORDER"), text("label")), + text(" "), + inline(LINK, refPackage(factory, "java.lang.invoke"), text("them")), + text(" all.\n\nAdditionally, "), + + inline(LINKPLAIN, ref(factory, String.class), text("this works")), + text(" "), + inline(LINKPLAIN, ref(factory, String.class, "substring", int.class), text("with")), + text("\n"), + inline(LINKPLAIN, refField(factory, String.class, "CASE_INSENSITIVE_ORDER"), text("plain")), + text(" "), + inline(LINKPLAIN, refPackage(factory, "java.lang"), text("links")), + text(" too.\n\nPeople can also embed values: "), + + inline(VALUE, refField(factory, JavadocParserTest.class, "I_AM_A_VAR")), + text(".") + ); + } + + // @formatter:off + /** + * @exception RuntimeException If something happens + * @throws IllegalArgumentException If something else happens + * @see Character#codePointAt(char[], int) for more information + * @see "somewhere else" + * @see label me + * @see spoon.javadoc + * @see java.base/ + * @see java.base + * @see java.base/java.lang.String + */ + // @formatter:on + private static List sampleReferencedBlockTags(Factory factory) { + return List.of( + block(EXCEPTION, ref(factory, RuntimeException.class), text("If something happens")), + block( + THROWS, + ref(factory, IllegalArgumentException.class), + text("If something else happens") + ), + block( + SEE, + ref(factory, Character.class, "codePointAt", char[].class, int.class), + text("for more information") + ), + block(SEE, text("somewhere else")), + block(SEE, text("label me")), + block(SEE, refPackage(factory, "spoon.javadoc")), + block(SEE, refModule(factory, "java.base")), + // This is wrong, but we currently live with it. + block(SEE, refPackage(factory, "java.base")), + block(SEE, ref(factory, String.class)) + ); + } + + // @formatter:off + /** + *
+    class Foo {
+      int foo = 0;
+    }
+	 * 
+ */ + // @formatter:on + private static List sampleNoLeadingAsterisks() { + return List.of( + text("
\n    class Foo {\n      int foo = 0;\n    }\n
") + ); + } + + // @formatter:off + /** + * @param a type param + */ + // @formatter:on + private static List sampleTypeParam() { + return List.of( + block(PARAM, text(""), text("a type param")) + ); + } + + // @formatter:off + /** + * @provides foo.bar.Baz hello world + * @uses foo.bar.Foo hello there + */ + // @formatter:on + private static List sampleModuleStuff() { + return List.of( + block(PROVIDES, text("foo.bar.Baz"), text("hello world")), + block(USES, text("foo.bar.Foo"), text("hello there")) + ); + } + + // @formatter:off + /** + * @provides foo.bar.Baz hello world + * @uses foo.bar.Foo hello there + * @serialData some data + * @serial include + * @serial exclude + * @serial Some docs + * @serialField name type some description + */ + // @formatter:on + private static List sampleSerializableStuff() { + return List.of( + block(PROVIDES, text("foo.bar.Baz"), text("hello world")), + block(USES, text("foo.bar.Foo"), text("hello there")), + block(SERIAL_DATA, text("some data")), + block(SERIAL, text("include")), + block(SERIAL, text("exclude")), + block(SERIAL, text("Some docs")), + block(SERIAL_FIELD, text("name"), text("type"), text("some description")) + ); + } + + // @formatter:off + /** + * {@snippet id = "bar" lang = "java": + * class Foo {} + *} + */ + // @formatter:on + private static List sampleSnippet() { + return List.of( + new JavadocSnippetTag(text("\n class Foo {}\n"), Map.of("id", "bar", "lang", "java")) + ); + } + + // @formatter:off + /** + * {@link #I_AM_A_VAR} + * {@link JavadocParserTest#I_AM_A_VAR} + * {@link spoon.javadoc.api.parsing.JavadocParserTest#I_AM_A_VAR} + * {@link #text(String)} + * {@link #text} + * {@link JavadocParserTest#text( String)} + * {@link JavadocParserTest#text} + * {@link spoon.javadoc.api.parsing.JavadocParserTest#text(String)} + * {@link spoon.javadoc.api.parsing.JavadocParserTest#text} + */ + // @formatter:on + private static List sampleLinkFormats(Factory factory) { + return List.of( + inline(LINK, refField(factory, JavadocParserTest.class, "I_AM_A_VAR")), + text("\n"), + inline(LINK, refField(factory, JavadocParserTest.class, "I_AM_A_VAR")), + text("\n"), + inline(LINK, refField(factory, JavadocParserTest.class, "I_AM_A_VAR")), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)) + ); + } + + // @formatter:off + /** + * {@link #text()} + * {@link #text(int)} + * {@link #text(String} + * {@link #text(} + */ + // @formatter:on + private static List sampleBrokenLinks(Factory factory) { + return List.of( + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)), + text("\n"), + inline(LINK, ref(factory, JavadocParserTest.class, "text", String.class)) + ); + } + + private static JavadocText text(String text) { + return new JavadocText(text); + } + + private static JavadocBlockTag block(JavadocTagType type, JavadocElement... elements) { + return new JavadocBlockTag(Arrays.asList(elements), type); + } + + private static JavadocInlineTag inline(JavadocTagType type, JavadocElement... elements) { + return new JavadocInlineTag(Arrays.asList(elements), type); + } + + private static JavadocReference ref(Factory factory, Class clazz) { + return new JavadocReference(factory.createCtTypeReference(clazz)); + } + + private static JavadocReference ref( + Factory factory, Class clazz, String name, Class... params + ) { + CtType ctClass = factory.Type().get(clazz); + for (CtMethod candidate : ctClass.getMethodsByName(name)) { + if (parametersMatch(candidate, params)) { + return new JavadocReference(candidate.getReference()); + } + } + + throw new RuntimeException( + "Not found: " + clazz + "#" + name + "(" + Arrays.toString(params) + ")" + ); + } + + private static JavadocReference refField(Factory factory, Class clazz, String name) { + CtType ctClass = factory.Type().get(clazz); + return new JavadocReference(ctClass.getField(name).getReference()); + } + + private static JavadocReference refPackage(Factory factory, String name) { + return new JavadocReference(factory.Package().createReference(name)); + } + + private static JavadocReference refModule(Factory factory, String name) { + return new JavadocReference(factory.Core().createModuleReference().setSimpleName(name)); + } + + private static boolean parametersMatch(CtMethod method, Class[] expected) { + List> parameters = method.getParameters(); + if (parameters.size() != expected.length) { + return false; + } + for (int i = 0; i < parameters.size(); i++) { + CtTypeReference candidateType = parameters.get(i).getType(); + if (candidateType.getActualClass() != expected[i]) { + return false; + } + } + return true; + } +} diff --git a/spoon-javadoc/src/test/java/spoon/javadoc/api/parsing/SnippetFileParserTest.java b/spoon-javadoc/src/test/java/spoon/javadoc/api/parsing/SnippetFileParserTest.java new file mode 100644 index 00000000000..05acef87cf7 --- /dev/null +++ b/spoon-javadoc/src/test/java/spoon/javadoc/api/parsing/SnippetFileParserTest.java @@ -0,0 +1,63 @@ +package spoon.javadoc.api.parsing; + +import static org.assertj.core.api.Assertions.assertThat; +import static spoon.javadoc.api.elements.snippets.JavadocSnippetRegionType.HIGHLIGHT; +import static spoon.javadoc.api.elements.snippets.JavadocSnippetRegionType.LINK; +import static spoon.javadoc.api.elements.snippets.JavadocSnippetRegionType.START; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.junit.jupiter.api.Test; +import spoon.javadoc.api.TestHelper; +import spoon.javadoc.api.elements.snippets.JavadocSnippetMarkupRegion; + +class SnippetFileParserTest { + + @Test + void testGeneralParsing() { + Set regions = new SnippetFileParser(List.of( + "class Foo { // @highlight", + " int p1 = 0; //@highlight substring=\"p1\" type=\"italic\"", + " int p2 = 0; //@highlight substring=\"p3\" type=\"italic\" region=\"foo\" :", + " int p3 = 0;", + " static { // @end region=\"foo\"", + " System.out.println(\"hey\"); // @link substring=\"System.out\" target=\"System#out\"", + " }", + " int p4 = 0; // @start region=\"baz\"", + " int p5 = 0; // @end", + "}" + )).parse(); + List expected = List.of( + TestHelper.region(0, 0, Map.of(), HIGHLIGHT), + TestHelper.region(1, 1, Map.of("substring", "p1", "type", "italic"), HIGHLIGHT), + TestHelper.region( + 3, 4, Map.of("substring", "p3", "type", "italic", "region", "foo"), + HIGHLIGHT + ), + TestHelper.region(5, 5, Map.of("substring", "System.out", "target", "System#out"), LINK), + TestHelper.region(7, 8, Map.of("region", "baz"), START) + ); + + assertThat(regions).containsExactlyInAnyOrderElementsOf(expected); + } + + @Test + void testOverlap() { + Set regions = new SnippetFileParser(List.of( + "class Foo { // @start region=\"foo\"", + " int p0 = 0; // @start region=\"bar\"", + " int p1 = 1;", + " int p2 = 2; // @end", + " int p3 = 3; // @end", + "}" + )).parse(); + List expected = List.of( + TestHelper.region(0, 4, Map.of("region", "foo"), START), + TestHelper.region(1, 3, Map.of("region", "bar"), START) + ); + + assertThat(regions).containsExactlyInAnyOrderElementsOf(expected); + } + +} diff --git a/spoon-pom/pom.xml b/spoon-pom/pom.xml index b8125dc72ef..88bcee6e1ad 100644 --- a/spoon-pom/pom.xml +++ b/spoon-pom/pom.xml @@ -13,17 +13,22 @@ fr.inria.gforge.spoon spoon-pom pom - 1.0 + 10.4.1-SNAPSHOT Spoon POM Common Maven config for Spoon modules http://spoon.gforge.inria.fr/ 2007 + + ../spoon-javadoc + .. + + 11 target/velocity.log UTF-8 - 1 + 1688669240 @@ -32,31 +37,31 @@ org.mockito mockito-core - 5.2.0 + 5.4.0 test org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.9.3 test org.junit.jupiter junit-jupiter-params - 5.9.2 + 5.9.3 test org.junit.platform junit-platform-launcher - 1.9.2 + 1.9.3 test org.mockito mockito-junit-jupiter - 5.2.0 + 5.4.0 test @@ -142,7 +147,7 @@ org.kohsuke.metainf-services metainf-services - 1.9 + 1.11 @@ -152,27 +157,6 @@ org.apache.maven.plugins maven-deploy-plugin - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://oss.sonatype.org/ - true - - - - org.apache.maven.wagon - wagon-ssh - 3.5.3 - - - - - org.apache.maven.plugins maven-dependency-plugin @@ -232,11 +216,11 @@ maven-assembly-plugin - 3.5.0 + 3.6.0 maven-clean-plugin - 3.2.0 + 3.3.1 maven-compiler-plugin @@ -244,15 +228,15 @@ maven-dependency-plugin - 3.5.0 + 3.6.0 maven-deploy-plugin - 3.1.0 + 3.1.1 maven-install-plugin - 3.1.0 + 3.1.1 maven-javadoc-plugin @@ -260,15 +244,15 @@ maven-project-info-reports-plugin - 3.4.2 + 3.4.5 maven-release-plugin - 3.0.0-M7 + 3.0.1 maven-resources-plugin - 3.3.0 + 3.3.1 maven-site-plugin @@ -276,47 +260,13 @@ maven-surefire-plugin - 3.0.0-M9 + 3.1.2 - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.maven.plugins - - - maven-dependency-plugin - - - [2.8,) - - - - copy-dependencies - - - - - - - - - - - com.mycila license-maven-plugin - 4.1 + 4.2 @@ -342,6 +292,11 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.10 + @@ -408,10 +363,28 @@ release + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.wagon + wagon-ssh + 3.5.3 + + + org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-sources @@ -442,7 +415,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts @@ -453,12 +426,105 @@ + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.1 + + + + + + jreleaser + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.1 + + + org.jacoco + jacoco-maven-plugin + 0.8.10 + + true + + + + + CeCILL-C + French equivalent to LGPL + https://cecill.info/licences/Licence_CeCILL-C_V1-en.txt + repo + + + MIT + https://opensource.org/licenses/MIT + repo + + + + + + slarse + Simon Larsén + + + monperrus + Martin Monperrus + + + nharrand + Nicolas Harrand + + + martinwitt + Martin Wittlinger + + + sirywell + Hannes Greule + + + I-Al-Istannen + I-Al-Istannen + diff --git a/spoon-smpl/pom.xml b/spoon-smpl/pom.xml index 649d88541fd..5b1ca25ae8e 100644 --- a/spoon-smpl/pom.xml +++ b/spoon-smpl/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.1 + 3.3.0 true ../checkstyle.xml @@ -83,7 +83,7 @@ fr.inria.gforge.spoon spoon-core - 10.2.0 + 10.3.0 fr.inria.gforge.spoon diff --git a/spoon-smpl/src/test/java/spoon/smpl/C4JShouldVibrateTest.java b/spoon-smpl/src/test/java/spoon/smpl/C4JShouldVibrateTest.java index b8ef6f1638a..8663d0dcac9 100644 --- a/spoon-smpl/src/test/java/spoon/smpl/C4JShouldVibrateTest.java +++ b/spoon-smpl/src/test/java/spoon/smpl/C4JShouldVibrateTest.java @@ -63,7 +63,7 @@ public static void initializeContext() { /* 22 */ "...\n" + /* 23 */ "}\n"; - ctx = new ZippedCodeBaseTestContext(smpl, "src/test/resources/C4JShouldVibrate.zip", false); + ctx = new ZippedCodeBaseTestContext(smpl, "src/test/resources/C4JShouldVibrate.zip", true); } @Test diff --git a/spoon-visualisation/pom.xml b/spoon-visualisation/pom.xml index 27ad13a7c28..a49c735f6f3 100644 --- a/spoon-visualisation/pom.xml +++ b/spoon-visualisation/pom.xml @@ -39,7 +39,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.5.0 + 3.6.0 main deps @@ -129,7 +129,7 @@ fr.inria.gforge.spoon spoon-core - 10.2.0 + 10.3.0 * @@ -184,13 +184,13 @@ org.jetbrains annotations - 24.0.0 + 24.0.1 compile org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.9.3 test diff --git a/src/main/java/spoon/ContractVerifier.java b/src/main/java/spoon/ContractVerifier.java index bed17b882bd..df5d049a955 100644 --- a/src/main/java/spoon/ContractVerifier.java +++ b/src/main/java/spoon/ContractVerifier.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/FluentLauncher.java b/src/main/java/spoon/FluentLauncher.java index f6b05faa2cb..a3f2a07788b 100644 --- a/src/main/java/spoon/FluentLauncher.java +++ b/src/main/java/spoon/FluentLauncher.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/IncrementalLauncher.java b/src/main/java/spoon/IncrementalLauncher.java index 98750e1db0d..c2e00cf70c6 100644 --- a/src/main/java/spoon/IncrementalLauncher.java +++ b/src/main/java/spoon/IncrementalLauncher.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/JLSViolation.java b/src/main/java/spoon/JLSViolation.java index bb1d8c09c9c..0c550a4c568 100644 --- a/src/main/java/spoon/JLSViolation.java +++ b/src/main/java/spoon/JLSViolation.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/Launcher.java b/src/main/java/spoon/Launcher.java index 9587fb365db..e4ba92d00c7 100644 --- a/src/main/java/spoon/Launcher.java +++ b/src/main/java/spoon/Launcher.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; @@ -813,13 +813,13 @@ public void prettyprint() { for (File dirInputSource : modelBuilder.getInputSources()) { if (dirInputSource.isDirectory()) { final Path dirInputSourceAsPath = dirInputSource.toPath(); - final Collection resources = FileUtils.listFiles(dirInputSource, RESOURCES_FILE_FILTER, ALL_DIR_FILTER); - for (Object resource : resources) { - final Path resourcePath = ((File) resource).toPath(); + final Collection resources = FileUtils.listFiles(dirInputSource, RESOURCES_FILE_FILTER, ALL_DIR_FILTER); + for (File resource : resources) { + final Path resourcePath = resource.toPath(); final Path relativePath = dirInputSourceAsPath.relativize(resourcePath); final Path targetPath = outputPath.resolve(relativePath).getParent(); try { - FileUtils.copyFileToDirectory((File) resource, targetPath.toFile()); + FileUtils.copyFileToDirectory(resource, targetPath.toFile()); } catch (IOException e) { throw new SpoonException(e); } diff --git a/src/main/java/spoon/LovecraftException.java b/src/main/java/spoon/LovecraftException.java index d72f8e3aa8c..b4cb057b30e 100644 --- a/src/main/java/spoon/LovecraftException.java +++ b/src/main/java/spoon/LovecraftException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/MavenLauncher.java b/src/main/java/spoon/MavenLauncher.java index d829bf6a713..0748b133673 100644 --- a/src/main/java/spoon/MavenLauncher.java +++ b/src/main/java/spoon/MavenLauncher.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/NoClasspathWorkaround.java b/src/main/java/spoon/NoClasspathWorkaround.java index a860e010288..fe879c67801 100644 --- a/src/main/java/spoon/NoClasspathWorkaround.java +++ b/src/main/java/spoon/NoClasspathWorkaround.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/OutputType.java b/src/main/java/spoon/OutputType.java index d5bac2d9fcb..ede4e7bb98a 100644 --- a/src/main/java/spoon/OutputType.java +++ b/src/main/java/spoon/OutputType.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/SpoonAPI.java b/src/main/java/spoon/SpoonAPI.java index cb91e29c407..b2f1d6d7969 100644 --- a/src/main/java/spoon/SpoonAPI.java +++ b/src/main/java/spoon/SpoonAPI.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/SpoonException.java b/src/main/java/spoon/SpoonException.java index 191c49ebd78..90baf60bc72 100644 --- a/src/main/java/spoon/SpoonException.java +++ b/src/main/java/spoon/SpoonException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/SpoonModelBuilder.java b/src/main/java/spoon/SpoonModelBuilder.java index 358ecef9756..5e66c50e24d 100644 --- a/src/main/java/spoon/SpoonModelBuilder.java +++ b/src/main/java/spoon/SpoonModelBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon; diff --git a/src/main/java/spoon/compiler/Environment.java b/src/main/java/spoon/compiler/Environment.java index 2f65279899d..a952502156b 100644 --- a/src/main/java/spoon/compiler/Environment.java +++ b/src/main/java/spoon/compiler/Environment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler; diff --git a/src/main/java/spoon/compiler/InvalidClassPathException.java b/src/main/java/spoon/compiler/InvalidClassPathException.java index 88a9dd2d2af..67258cb5265 100644 --- a/src/main/java/spoon/compiler/InvalidClassPathException.java +++ b/src/main/java/spoon/compiler/InvalidClassPathException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler; diff --git a/src/main/java/spoon/compiler/ModelBuildingException.java b/src/main/java/spoon/compiler/ModelBuildingException.java index e8759bbf416..913c79f7f69 100644 --- a/src/main/java/spoon/compiler/ModelBuildingException.java +++ b/src/main/java/spoon/compiler/ModelBuildingException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler; diff --git a/src/main/java/spoon/compiler/SpoonFile.java b/src/main/java/spoon/compiler/SpoonFile.java index 681e4ff229a..adf2db13066 100644 --- a/src/main/java/spoon/compiler/SpoonFile.java +++ b/src/main/java/spoon/compiler/SpoonFile.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler; diff --git a/src/main/java/spoon/compiler/SpoonFolder.java b/src/main/java/spoon/compiler/SpoonFolder.java index c2f3a5e4ea9..bea2f954986 100644 --- a/src/main/java/spoon/compiler/SpoonFolder.java +++ b/src/main/java/spoon/compiler/SpoonFolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler; diff --git a/src/main/java/spoon/compiler/SpoonResource.java b/src/main/java/spoon/compiler/SpoonResource.java index d32c1d82a77..e37881a6850 100644 --- a/src/main/java/spoon/compiler/SpoonResource.java +++ b/src/main/java/spoon/compiler/SpoonResource.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler; diff --git a/src/main/java/spoon/compiler/SpoonResourceHelper.java b/src/main/java/spoon/compiler/SpoonResourceHelper.java index e0932da6065..8d0de1eb342 100644 --- a/src/main/java/spoon/compiler/SpoonResourceHelper.java +++ b/src/main/java/spoon/compiler/SpoonResourceHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler; diff --git a/src/main/java/spoon/compiler/builder/AdvancedOptions.java b/src/main/java/spoon/compiler/builder/AdvancedOptions.java index d466d3a604a..c43dd91db4f 100644 --- a/src/main/java/spoon/compiler/builder/AdvancedOptions.java +++ b/src/main/java/spoon/compiler/builder/AdvancedOptions.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/AnnotationProcessingOptions.java b/src/main/java/spoon/compiler/builder/AnnotationProcessingOptions.java index a47b21ae876..67dc4dd1162 100644 --- a/src/main/java/spoon/compiler/builder/AnnotationProcessingOptions.java +++ b/src/main/java/spoon/compiler/builder/AnnotationProcessingOptions.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/ClasspathOptions.java b/src/main/java/spoon/compiler/builder/ClasspathOptions.java index ffcad9beec4..605e4663441 100644 --- a/src/main/java/spoon/compiler/builder/ClasspathOptions.java +++ b/src/main/java/spoon/compiler/builder/ClasspathOptions.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/ComplianceOptions.java b/src/main/java/spoon/compiler/builder/ComplianceOptions.java index f314d2154c3..7c8e037640d 100644 --- a/src/main/java/spoon/compiler/builder/ComplianceOptions.java +++ b/src/main/java/spoon/compiler/builder/ComplianceOptions.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/EncodingProvider.java b/src/main/java/spoon/compiler/builder/EncodingProvider.java index e840ce90b76..c4de3864cc2 100644 --- a/src/main/java/spoon/compiler/builder/EncodingProvider.java +++ b/src/main/java/spoon/compiler/builder/EncodingProvider.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/JDTBuilder.java b/src/main/java/spoon/compiler/builder/JDTBuilder.java index 0d04de89426..979b6900899 100644 --- a/src/main/java/spoon/compiler/builder/JDTBuilder.java +++ b/src/main/java/spoon/compiler/builder/JDTBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/JDTBuilderImpl.java b/src/main/java/spoon/compiler/builder/JDTBuilderImpl.java index 1be2ed0dd28..88ba1555503 100644 --- a/src/main/java/spoon/compiler/builder/JDTBuilderImpl.java +++ b/src/main/java/spoon/compiler/builder/JDTBuilderImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/Options.java b/src/main/java/spoon/compiler/builder/Options.java index 2f528cf828b..09007e6cbc0 100644 --- a/src/main/java/spoon/compiler/builder/Options.java +++ b/src/main/java/spoon/compiler/builder/Options.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/builder/SourceOptions.java b/src/main/java/spoon/compiler/builder/SourceOptions.java index e6df4af144b..620b5fba518 100644 --- a/src/main/java/spoon/compiler/builder/SourceOptions.java +++ b/src/main/java/spoon/compiler/builder/SourceOptions.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.compiler.builder; diff --git a/src/main/java/spoon/compiler/package-info.java b/src/main/java/spoon/compiler/package-info.java index 34204d99298..d2590cfc4ab 100644 --- a/src/main/java/spoon/compiler/package-info.java +++ b/src/main/java/spoon/compiler/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines interfaces for Java file compilation with Spoon.

diff --git a/src/main/java/spoon/experimental/CtUnresolvedImport.java b/src/main/java/spoon/experimental/CtUnresolvedImport.java index 40d7dc450f6..9494237cc0c 100644 --- a/src/main/java/spoon/experimental/CtUnresolvedImport.java +++ b/src/main/java/spoon/experimental/CtUnresolvedImport.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.experimental; diff --git a/src/main/java/spoon/experimental/NoClasspathWorkaround.java b/src/main/java/spoon/experimental/NoClasspathWorkaround.java index 0b9bd504cc8..f181fea350c 100644 --- a/src/main/java/spoon/experimental/NoClasspathWorkaround.java +++ b/src/main/java/spoon/experimental/NoClasspathWorkaround.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.experimental; diff --git a/src/main/java/spoon/experimental/SpoonifierVisitor.java b/src/main/java/spoon/experimental/SpoonifierVisitor.java index 50007a14af7..989ae052a23 100644 --- a/src/main/java/spoon/experimental/SpoonifierVisitor.java +++ b/src/main/java/spoon/experimental/SpoonifierVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.experimental; diff --git a/src/main/java/spoon/experimental/package-info.java b/src/main/java/spoon/experimental/package-info.java index 66ace2227a9..465cd86bfa0 100644 --- a/src/main/java/spoon/experimental/package-info.java +++ b/src/main/java/spoon/experimental/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * this is unstable code, subject to potential complete redesign, not only in snapshots but also in releases. you can use this code but you'll probably be impacted upon future changes. diff --git a/src/main/java/spoon/javadoc/internal/Javadoc.java b/src/main/java/spoon/javadoc/internal/Javadoc.java index 022489cee5e..dac54a782c3 100644 --- a/src/main/java/spoon/javadoc/internal/Javadoc.java +++ b/src/main/java/spoon/javadoc/internal/Javadoc.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * This file originally comes from JavaParser and is distributed under the terms of diff --git a/src/main/java/spoon/javadoc/internal/JavadocBlockTag.java b/src/main/java/spoon/javadoc/internal/JavadocBlockTag.java index 0c9945356e5..e784fc8b60b 100644 --- a/src/main/java/spoon/javadoc/internal/JavadocBlockTag.java +++ b/src/main/java/spoon/javadoc/internal/JavadocBlockTag.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * This file originally comes from JavaParser and is distributed under the terms of diff --git a/src/main/java/spoon/javadoc/internal/JavadocDescription.java b/src/main/java/spoon/javadoc/internal/JavadocDescription.java index e16922559b8..fbddf795587 100644 --- a/src/main/java/spoon/javadoc/internal/JavadocDescription.java +++ b/src/main/java/spoon/javadoc/internal/JavadocDescription.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * This file originally comes from JavaParser and is distributed under the terms of diff --git a/src/main/java/spoon/javadoc/internal/JavadocDescriptionElement.java b/src/main/java/spoon/javadoc/internal/JavadocDescriptionElement.java index 8e92ca64449..743a1d96daa 100644 --- a/src/main/java/spoon/javadoc/internal/JavadocDescriptionElement.java +++ b/src/main/java/spoon/javadoc/internal/JavadocDescriptionElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * This file originally comes from JavaParser and is distributed under the terms of diff --git a/src/main/java/spoon/javadoc/internal/JavadocInlineTag.java b/src/main/java/spoon/javadoc/internal/JavadocInlineTag.java index 32b26760ffb..e11dde27623 100644 --- a/src/main/java/spoon/javadoc/internal/JavadocInlineTag.java +++ b/src/main/java/spoon/javadoc/internal/JavadocInlineTag.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * This file originally comes from JavaParser and is distributed under the terms of diff --git a/src/main/java/spoon/javadoc/internal/JavadocSnippet.java b/src/main/java/spoon/javadoc/internal/JavadocSnippet.java index 10a97305db0..f82fd374671 100644 --- a/src/main/java/spoon/javadoc/internal/JavadocSnippet.java +++ b/src/main/java/spoon/javadoc/internal/JavadocSnippet.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * This file originally comes from JavaParser and is distributed under the terms of diff --git a/src/main/java/spoon/legacy/NameFilter.java b/src/main/java/spoon/legacy/NameFilter.java index 5f0529c7b12..174edb12591 100644 --- a/src/main/java/spoon/legacy/NameFilter.java +++ b/src/main/java/spoon/legacy/NameFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.legacy; diff --git a/src/main/java/spoon/legacy/package-info.java b/src/main/java/spoon/legacy/package-info.java index a87b5a26c15..18519f9829a 100644 --- a/src/main/java/spoon/legacy/package-info.java +++ b/src/main/java/spoon/legacy/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package contains legacy code of Spoon. This code is kept for sake of maximum compatibility but no support is provided anymore.

diff --git a/src/main/java/spoon/metamodel/ConceptKind.java b/src/main/java/spoon/metamodel/ConceptKind.java index 81d302e0ad0..4474f9a7f1d 100644 --- a/src/main/java/spoon/metamodel/ConceptKind.java +++ b/src/main/java/spoon/metamodel/ConceptKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.metamodel; diff --git a/src/main/java/spoon/metamodel/MMMethod.java b/src/main/java/spoon/metamodel/MMMethod.java index 90a62723ccf..7ee4610ec64 100644 --- a/src/main/java/spoon/metamodel/MMMethod.java +++ b/src/main/java/spoon/metamodel/MMMethod.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.metamodel; diff --git a/src/main/java/spoon/metamodel/MMMethodKind.java b/src/main/java/spoon/metamodel/MMMethodKind.java index 7512c4641e0..51632e7a267 100644 --- a/src/main/java/spoon/metamodel/MMMethodKind.java +++ b/src/main/java/spoon/metamodel/MMMethodKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.metamodel; diff --git a/src/main/java/spoon/metamodel/Metamodel.java b/src/main/java/spoon/metamodel/Metamodel.java index f46640b5f43..e23f3ee6acc 100644 --- a/src/main/java/spoon/metamodel/Metamodel.java +++ b/src/main/java/spoon/metamodel/Metamodel.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.metamodel; diff --git a/src/main/java/spoon/metamodel/MetamodelConcept.java b/src/main/java/spoon/metamodel/MetamodelConcept.java index 2d72bc256dc..41a17565d5c 100644 --- a/src/main/java/spoon/metamodel/MetamodelConcept.java +++ b/src/main/java/spoon/metamodel/MetamodelConcept.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.metamodel; diff --git a/src/main/java/spoon/metamodel/MetamodelProperty.java b/src/main/java/spoon/metamodel/MetamodelProperty.java index 90a62af59db..76e83da330a 100644 --- a/src/main/java/spoon/metamodel/MetamodelProperty.java +++ b/src/main/java/spoon/metamodel/MetamodelProperty.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.metamodel; diff --git a/src/main/java/spoon/metamodel/package-info.java b/src/main/java/spoon/metamodel/package-info.java index 126b09603cf..e7f5a483827 100644 --- a/src/main/java/spoon/metamodel/package-info.java +++ b/src/main/java/spoon/metamodel/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * Ready to go meta? diff --git a/src/main/java/spoon/package-info.java b/src/main/java/spoon/package-info.java index 02e196bf2a5..b3168bceb54 100644 --- a/src/main/java/spoon/package-info.java +++ b/src/main/java/spoon/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This root package provides the default integrated launchers for Spoon program processing.

diff --git a/src/main/java/spoon/pattern/ConflictResolutionMode.java b/src/main/java/spoon/pattern/ConflictResolutionMode.java index aa10a36c262..2156e213544 100644 --- a/src/main/java/spoon/pattern/ConflictResolutionMode.java +++ b/src/main/java/spoon/pattern/ConflictResolutionMode.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/Generator.java b/src/main/java/spoon/pattern/Generator.java index 0f28779cade..1fb113670b3 100644 --- a/src/main/java/spoon/pattern/Generator.java +++ b/src/main/java/spoon/pattern/Generator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/InlinedStatementConfigurator.java b/src/main/java/spoon/pattern/InlinedStatementConfigurator.java index 95363d62410..2d4545246e8 100644 --- a/src/main/java/spoon/pattern/InlinedStatementConfigurator.java +++ b/src/main/java/spoon/pattern/InlinedStatementConfigurator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/Match.java b/src/main/java/spoon/pattern/Match.java index 574d4029873..42792402ee8 100644 --- a/src/main/java/spoon/pattern/Match.java +++ b/src/main/java/spoon/pattern/Match.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/Pattern.java b/src/main/java/spoon/pattern/Pattern.java index b92ab696309..cb4aade463c 100644 --- a/src/main/java/spoon/pattern/Pattern.java +++ b/src/main/java/spoon/pattern/Pattern.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/PatternBuilder.java b/src/main/java/spoon/pattern/PatternBuilder.java index c89c3203963..31454334bd0 100644 --- a/src/main/java/spoon/pattern/PatternBuilder.java +++ b/src/main/java/spoon/pattern/PatternBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/PatternBuilderHelper.java b/src/main/java/spoon/pattern/PatternBuilderHelper.java index bb182c55c8a..dab20ee335f 100644 --- a/src/main/java/spoon/pattern/PatternBuilderHelper.java +++ b/src/main/java/spoon/pattern/PatternBuilderHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/PatternParameterConfigurator.java b/src/main/java/spoon/pattern/PatternParameterConfigurator.java index bc4d96427ab..acc4496ef4e 100644 --- a/src/main/java/spoon/pattern/PatternParameterConfigurator.java +++ b/src/main/java/spoon/pattern/PatternParameterConfigurator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/Quantifier.java b/src/main/java/spoon/pattern/Quantifier.java index b4990a3f1eb..680f6a96889 100644 --- a/src/main/java/spoon/pattern/Quantifier.java +++ b/src/main/java/spoon/pattern/Quantifier.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern; diff --git a/src/main/java/spoon/pattern/internal/DefaultGenerator.java b/src/main/java/spoon/pattern/internal/DefaultGenerator.java index 67ba61d74be..668e3ef14b5 100644 --- a/src/main/java/spoon/pattern/internal/DefaultGenerator.java +++ b/src/main/java/spoon/pattern/internal/DefaultGenerator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal; diff --git a/src/main/java/spoon/pattern/internal/PatternPrinter.java b/src/main/java/spoon/pattern/internal/PatternPrinter.java index 5be028c31df..ddb898467fc 100644 --- a/src/main/java/spoon/pattern/internal/PatternPrinter.java +++ b/src/main/java/spoon/pattern/internal/PatternPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal; diff --git a/src/main/java/spoon/pattern/internal/ResultHolder.java b/src/main/java/spoon/pattern/internal/ResultHolder.java index 235aec75a78..29d34046e92 100644 --- a/src/main/java/spoon/pattern/internal/ResultHolder.java +++ b/src/main/java/spoon/pattern/internal/ResultHolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal; diff --git a/src/main/java/spoon/pattern/internal/SubstitutionRequestProvider.java b/src/main/java/spoon/pattern/internal/SubstitutionRequestProvider.java index 16819d0e32e..426f82c9d96 100644 --- a/src/main/java/spoon/pattern/internal/SubstitutionRequestProvider.java +++ b/src/main/java/spoon/pattern/internal/SubstitutionRequestProvider.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal; diff --git a/src/main/java/spoon/pattern/internal/ValueConvertor.java b/src/main/java/spoon/pattern/internal/ValueConvertor.java index 4e2add65267..cd7b5c40ecb 100644 --- a/src/main/java/spoon/pattern/internal/ValueConvertor.java +++ b/src/main/java/spoon/pattern/internal/ValueConvertor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal; diff --git a/src/main/java/spoon/pattern/internal/ValueConvertorImpl.java b/src/main/java/spoon/pattern/internal/ValueConvertorImpl.java index 604ba3dfd59..7982d6a4847 100644 --- a/src/main/java/spoon/pattern/internal/ValueConvertorImpl.java +++ b/src/main/java/spoon/pattern/internal/ValueConvertorImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal; diff --git a/src/main/java/spoon/pattern/internal/matcher/ChainOfMatchersImpl.java b/src/main/java/spoon/pattern/internal/matcher/ChainOfMatchersImpl.java index dedc16ab5ca..fd4f8b11101 100644 --- a/src/main/java/spoon/pattern/internal/matcher/ChainOfMatchersImpl.java +++ b/src/main/java/spoon/pattern/internal/matcher/ChainOfMatchersImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.matcher; diff --git a/src/main/java/spoon/pattern/internal/matcher/Matchers.java b/src/main/java/spoon/pattern/internal/matcher/Matchers.java index ccce1ba7256..912db36b435 100644 --- a/src/main/java/spoon/pattern/internal/matcher/Matchers.java +++ b/src/main/java/spoon/pattern/internal/matcher/Matchers.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.matcher; diff --git a/src/main/java/spoon/pattern/internal/matcher/MatchingScanner.java b/src/main/java/spoon/pattern/internal/matcher/MatchingScanner.java index 109623c8fe0..e8d02363bbe 100644 --- a/src/main/java/spoon/pattern/internal/matcher/MatchingScanner.java +++ b/src/main/java/spoon/pattern/internal/matcher/MatchingScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.matcher; diff --git a/src/main/java/spoon/pattern/internal/matcher/TobeMatched.java b/src/main/java/spoon/pattern/internal/matcher/TobeMatched.java index 3f3316a88f3..e6b7c52ca9a 100644 --- a/src/main/java/spoon/pattern/internal/matcher/TobeMatched.java +++ b/src/main/java/spoon/pattern/internal/matcher/TobeMatched.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.matcher; diff --git a/src/main/java/spoon/pattern/internal/parameter/AbstractParameterInfo.java b/src/main/java/spoon/pattern/internal/parameter/AbstractParameterInfo.java index ca51a7ca265..6aa5b2430e5 100644 --- a/src/main/java/spoon/pattern/internal/parameter/AbstractParameterInfo.java +++ b/src/main/java/spoon/pattern/internal/parameter/AbstractParameterInfo.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/pattern/internal/parameter/ComputedParameterInfo.java b/src/main/java/spoon/pattern/internal/parameter/ComputedParameterInfo.java index 88788bdbc8f..996b87b3cea 100644 --- a/src/main/java/spoon/pattern/internal/parameter/ComputedParameterInfo.java +++ b/src/main/java/spoon/pattern/internal/parameter/ComputedParameterInfo.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/pattern/internal/parameter/ListParameterInfo.java b/src/main/java/spoon/pattern/internal/parameter/ListParameterInfo.java index a0de55f9beb..8c3629f9e8a 100644 --- a/src/main/java/spoon/pattern/internal/parameter/ListParameterInfo.java +++ b/src/main/java/spoon/pattern/internal/parameter/ListParameterInfo.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/pattern/internal/parameter/MapParameterInfo.java b/src/main/java/spoon/pattern/internal/parameter/MapParameterInfo.java index 219886e1c4b..b291b16da94 100644 --- a/src/main/java/spoon/pattern/internal/parameter/MapParameterInfo.java +++ b/src/main/java/spoon/pattern/internal/parameter/MapParameterInfo.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/pattern/internal/parameter/ParameterComputer.java b/src/main/java/spoon/pattern/internal/parameter/ParameterComputer.java index 4a0117f704b..d4ac56c22bb 100644 --- a/src/main/java/spoon/pattern/internal/parameter/ParameterComputer.java +++ b/src/main/java/spoon/pattern/internal/parameter/ParameterComputer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/pattern/internal/parameter/ParameterInfo.java b/src/main/java/spoon/pattern/internal/parameter/ParameterInfo.java index 347574181ff..525ed3c15d2 100644 --- a/src/main/java/spoon/pattern/internal/parameter/ParameterInfo.java +++ b/src/main/java/spoon/pattern/internal/parameter/ParameterInfo.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/pattern/internal/parameter/SetParameterInfo.java b/src/main/java/spoon/pattern/internal/parameter/SetParameterInfo.java index 7aaaf229238..219add07644 100644 --- a/src/main/java/spoon/pattern/internal/parameter/SetParameterInfo.java +++ b/src/main/java/spoon/pattern/internal/parameter/SetParameterInfo.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/pattern/internal/parameter/SimpleNameOfTypeReferenceParameterComputer.java b/src/main/java/spoon/pattern/internal/parameter/SimpleNameOfTypeReferenceParameterComputer.java index e89beb85bfb..e117e44d1a1 100644 --- a/src/main/java/spoon/pattern/internal/parameter/SimpleNameOfTypeReferenceParameterComputer.java +++ b/src/main/java/spoon/pattern/internal/parameter/SimpleNameOfTypeReferenceParameterComputer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.pattern.internal.parameter; diff --git a/src/main/java/spoon/processing/AbstractAnnotationProcessor.java b/src/main/java/spoon/processing/AbstractAnnotationProcessor.java index a9aa7031bc3..f127e595f6c 100644 --- a/src/main/java/spoon/processing/AbstractAnnotationProcessor.java +++ b/src/main/java/spoon/processing/AbstractAnnotationProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/AbstractManualProcessor.java b/src/main/java/spoon/processing/AbstractManualProcessor.java index 60854384b57..53814bbda5f 100644 --- a/src/main/java/spoon/processing/AbstractManualProcessor.java +++ b/src/main/java/spoon/processing/AbstractManualProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/AbstractParallelProcessor.java b/src/main/java/spoon/processing/AbstractParallelProcessor.java index 36b1c177af5..560f240fd4b 100644 --- a/src/main/java/spoon/processing/AbstractParallelProcessor.java +++ b/src/main/java/spoon/processing/AbstractParallelProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/AbstractProcessor.java b/src/main/java/spoon/processing/AbstractProcessor.java index b2f9274e5c8..e8fa4d7d52b 100644 --- a/src/main/java/spoon/processing/AbstractProcessor.java +++ b/src/main/java/spoon/processing/AbstractProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/AnnotationProcessor.java b/src/main/java/spoon/processing/AnnotationProcessor.java index a00dd233042..5b24882f9db 100644 --- a/src/main/java/spoon/processing/AnnotationProcessor.java +++ b/src/main/java/spoon/processing/AnnotationProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/FactoryAccessor.java b/src/main/java/spoon/processing/FactoryAccessor.java index 69336f2d26c..f46717ce637 100644 --- a/src/main/java/spoon/processing/FactoryAccessor.java +++ b/src/main/java/spoon/processing/FactoryAccessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/FileGenerator.java b/src/main/java/spoon/processing/FileGenerator.java index 9f848946a9f..c453034e15c 100644 --- a/src/main/java/spoon/processing/FileGenerator.java +++ b/src/main/java/spoon/processing/FileGenerator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/ProcessInterruption.java b/src/main/java/spoon/processing/ProcessInterruption.java index bc81eae8bf6..b295f5cb3b8 100644 --- a/src/main/java/spoon/processing/ProcessInterruption.java +++ b/src/main/java/spoon/processing/ProcessInterruption.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/ProcessingManager.java b/src/main/java/spoon/processing/ProcessingManager.java index 97bbcd4be59..eb0ec23ab47 100644 --- a/src/main/java/spoon/processing/ProcessingManager.java +++ b/src/main/java/spoon/processing/ProcessingManager.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/Processor.java b/src/main/java/spoon/processing/Processor.java index c821c6d972e..f217bfb957d 100644 --- a/src/main/java/spoon/processing/Processor.java +++ b/src/main/java/spoon/processing/Processor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/ProcessorProperties.java b/src/main/java/spoon/processing/ProcessorProperties.java index ded878b6d99..95c910e9428 100644 --- a/src/main/java/spoon/processing/ProcessorProperties.java +++ b/src/main/java/spoon/processing/ProcessorProperties.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/ProcessorPropertiesImpl.java b/src/main/java/spoon/processing/ProcessorPropertiesImpl.java index 0ffcd3353f1..3f5030702f9 100644 --- a/src/main/java/spoon/processing/ProcessorPropertiesImpl.java +++ b/src/main/java/spoon/processing/ProcessorPropertiesImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/Property.java b/src/main/java/spoon/processing/Property.java index 220ec5805b7..f46b54c5c09 100644 --- a/src/main/java/spoon/processing/Property.java +++ b/src/main/java/spoon/processing/Property.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/SpoonTagger.java b/src/main/java/spoon/processing/SpoonTagger.java index b30ce3ab3bd..233c9381b30 100644 --- a/src/main/java/spoon/processing/SpoonTagger.java +++ b/src/main/java/spoon/processing/SpoonTagger.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/TraversalStrategy.java b/src/main/java/spoon/processing/TraversalStrategy.java index 76c2aea13ce..f351006c5ce 100644 --- a/src/main/java/spoon/processing/TraversalStrategy.java +++ b/src/main/java/spoon/processing/TraversalStrategy.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.processing; diff --git a/src/main/java/spoon/processing/package-info.java b/src/main/java/spoon/processing/package-info.java index 647f8385236..05fabddfcfc 100644 --- a/src/main/java/spoon/processing/package-info.java +++ b/src/main/java/spoon/processing/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package contains the core API for code processing.

diff --git a/src/main/java/spoon/refactoring/AbstractRenameRefactoring.java b/src/main/java/spoon/refactoring/AbstractRenameRefactoring.java index 92f2a21a12e..f65c70ba3fb 100644 --- a/src/main/java/spoon/refactoring/AbstractRenameRefactoring.java +++ b/src/main/java/spoon/refactoring/AbstractRenameRefactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/CtDeprecatedRefactoring.java b/src/main/java/spoon/refactoring/CtDeprecatedRefactoring.java index 66e3475864a..a8a5366bfef 100644 --- a/src/main/java/spoon/refactoring/CtDeprecatedRefactoring.java +++ b/src/main/java/spoon/refactoring/CtDeprecatedRefactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/CtParameterRemoveRefactoring.java b/src/main/java/spoon/refactoring/CtParameterRemoveRefactoring.java index 9baada630b0..7837c1d5aed 100644 --- a/src/main/java/spoon/refactoring/CtParameterRemoveRefactoring.java +++ b/src/main/java/spoon/refactoring/CtParameterRemoveRefactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/CtRefactoring.java b/src/main/java/spoon/refactoring/CtRefactoring.java index 82d11a2661f..777eb431b2b 100644 --- a/src/main/java/spoon/refactoring/CtRefactoring.java +++ b/src/main/java/spoon/refactoring/CtRefactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/CtRenameGenericVariableRefactoring.java b/src/main/java/spoon/refactoring/CtRenameGenericVariableRefactoring.java index e3655eca2cb..d0b4566841c 100644 --- a/src/main/java/spoon/refactoring/CtRenameGenericVariableRefactoring.java +++ b/src/main/java/spoon/refactoring/CtRenameGenericVariableRefactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/CtRenameLocalVariableRefactoring.java b/src/main/java/spoon/refactoring/CtRenameLocalVariableRefactoring.java index a6ff973d136..5c13d6d519d 100644 --- a/src/main/java/spoon/refactoring/CtRenameLocalVariableRefactoring.java +++ b/src/main/java/spoon/refactoring/CtRenameLocalVariableRefactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/CtRenameRefactoring.java b/src/main/java/spoon/refactoring/CtRenameRefactoring.java index 79c96a93941..ada2fe4e835 100644 --- a/src/main/java/spoon/refactoring/CtRenameRefactoring.java +++ b/src/main/java/spoon/refactoring/CtRenameRefactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/MethodCallState.java b/src/main/java/spoon/refactoring/MethodCallState.java index 27b1e6c2fa3..d7871b07762 100644 --- a/src/main/java/spoon/refactoring/MethodCallState.java +++ b/src/main/java/spoon/refactoring/MethodCallState.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/MethodInvocationSearch.java b/src/main/java/spoon/refactoring/MethodInvocationSearch.java index b9d40d0013a..f7eb40f53a0 100644 --- a/src/main/java/spoon/refactoring/MethodInvocationSearch.java +++ b/src/main/java/spoon/refactoring/MethodInvocationSearch.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/Refactoring.java b/src/main/java/spoon/refactoring/Refactoring.java index c6ede21338c..1f0bc3b32fd 100644 --- a/src/main/java/spoon/refactoring/Refactoring.java +++ b/src/main/java/spoon/refactoring/Refactoring.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/refactoring/RefactoringException.java b/src/main/java/spoon/refactoring/RefactoringException.java index 755b830d2c9..803481cee9e 100644 --- a/src/main/java/spoon/refactoring/RefactoringException.java +++ b/src/main/java/spoon/refactoring/RefactoringException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.refactoring; diff --git a/src/main/java/spoon/reflect/CtModel.java b/src/main/java/spoon/reflect/CtModel.java index 7deb473e5e2..317d06d034e 100644 --- a/src/main/java/spoon/reflect/CtModel.java +++ b/src/main/java/spoon/reflect/CtModel.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect; diff --git a/src/main/java/spoon/reflect/CtModelImpl.java b/src/main/java/spoon/reflect/CtModelImpl.java index cf1ca981cc3..fa24c7432bd 100644 --- a/src/main/java/spoon/reflect/CtModelImpl.java +++ b/src/main/java/spoon/reflect/CtModelImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect; diff --git a/src/main/java/spoon/reflect/ModelElementContainerDefaultCapacities.java b/src/main/java/spoon/reflect/ModelElementContainerDefaultCapacities.java index 30dd3e521ad..9204f637d55 100644 --- a/src/main/java/spoon/reflect/ModelElementContainerDefaultCapacities.java +++ b/src/main/java/spoon/reflect/ModelElementContainerDefaultCapacities.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect; diff --git a/src/main/java/spoon/reflect/ModelStreamer.java b/src/main/java/spoon/reflect/ModelStreamer.java index cbd672223d8..e220c291062 100644 --- a/src/main/java/spoon/reflect/ModelStreamer.java +++ b/src/main/java/spoon/reflect/ModelStreamer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect; diff --git a/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java b/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java index a0ea4687dfa..312f716ef97 100644 --- a/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java +++ b/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.annotations; diff --git a/src/main/java/spoon/reflect/annotations/PropertyGetter.java b/src/main/java/spoon/reflect/annotations/PropertyGetter.java index 733f1733367..797e1d587b4 100644 --- a/src/main/java/spoon/reflect/annotations/PropertyGetter.java +++ b/src/main/java/spoon/reflect/annotations/PropertyGetter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.annotations; diff --git a/src/main/java/spoon/reflect/annotations/PropertySetter.java b/src/main/java/spoon/reflect/annotations/PropertySetter.java index 686602f8e48..7745dab3423 100644 --- a/src/main/java/spoon/reflect/annotations/PropertySetter.java +++ b/src/main/java/spoon/reflect/annotations/PropertySetter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.annotations; diff --git a/src/main/java/spoon/reflect/code/BinaryOperatorKind.java b/src/main/java/spoon/reflect/code/BinaryOperatorKind.java index 27a9d768cda..46ed9891e49 100644 --- a/src/main/java/spoon/reflect/code/BinaryOperatorKind.java +++ b/src/main/java/spoon/reflect/code/BinaryOperatorKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CaseKind.java b/src/main/java/spoon/reflect/code/CaseKind.java index 1f4d664f0e6..7dfa427d4e9 100644 --- a/src/main/java/spoon/reflect/code/CaseKind.java +++ b/src/main/java/spoon/reflect/code/CaseKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtAbstractInvocation.java b/src/main/java/spoon/reflect/code/CtAbstractInvocation.java index e7e856ff933..a2d39dc8d2c 100644 --- a/src/main/java/spoon/reflect/code/CtAbstractInvocation.java +++ b/src/main/java/spoon/reflect/code/CtAbstractInvocation.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtAbstractSwitch.java b/src/main/java/spoon/reflect/code/CtAbstractSwitch.java index d2a3daa1911..84a91877e01 100644 --- a/src/main/java/spoon/reflect/code/CtAbstractSwitch.java +++ b/src/main/java/spoon/reflect/code/CtAbstractSwitch.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtAnnotationFieldAccess.java b/src/main/java/spoon/reflect/code/CtAnnotationFieldAccess.java index ad028a48e7d..ff8570c867a 100644 --- a/src/main/java/spoon/reflect/code/CtAnnotationFieldAccess.java +++ b/src/main/java/spoon/reflect/code/CtAnnotationFieldAccess.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtArrayAccess.java b/src/main/java/spoon/reflect/code/CtArrayAccess.java index 64f5770df2d..02144ae7136 100644 --- a/src/main/java/spoon/reflect/code/CtArrayAccess.java +++ b/src/main/java/spoon/reflect/code/CtArrayAccess.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtArrayRead.java b/src/main/java/spoon/reflect/code/CtArrayRead.java index 8c0b48bff83..fa4f1fd1d5c 100644 --- a/src/main/java/spoon/reflect/code/CtArrayRead.java +++ b/src/main/java/spoon/reflect/code/CtArrayRead.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtArrayWrite.java b/src/main/java/spoon/reflect/code/CtArrayWrite.java index 35bee0e475f..3d6b74634c0 100644 --- a/src/main/java/spoon/reflect/code/CtArrayWrite.java +++ b/src/main/java/spoon/reflect/code/CtArrayWrite.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtAssert.java b/src/main/java/spoon/reflect/code/CtAssert.java index b49ccb6f15c..5ec2f77cab5 100644 --- a/src/main/java/spoon/reflect/code/CtAssert.java +++ b/src/main/java/spoon/reflect/code/CtAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtAssignment.java b/src/main/java/spoon/reflect/code/CtAssignment.java index 9c4201d6cf3..d0622509404 100644 --- a/src/main/java/spoon/reflect/code/CtAssignment.java +++ b/src/main/java/spoon/reflect/code/CtAssignment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtBinaryOperator.java b/src/main/java/spoon/reflect/code/CtBinaryOperator.java index cc074c84b1e..b731116acd4 100644 --- a/src/main/java/spoon/reflect/code/CtBinaryOperator.java +++ b/src/main/java/spoon/reflect/code/CtBinaryOperator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtBlock.java b/src/main/java/spoon/reflect/code/CtBlock.java index ca1c5191f49..14233097829 100644 --- a/src/main/java/spoon/reflect/code/CtBlock.java +++ b/src/main/java/spoon/reflect/code/CtBlock.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtBodyHolder.java b/src/main/java/spoon/reflect/code/CtBodyHolder.java index f81a2a4e18d..0c8694943b9 100644 --- a/src/main/java/spoon/reflect/code/CtBodyHolder.java +++ b/src/main/java/spoon/reflect/code/CtBodyHolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtBreak.java b/src/main/java/spoon/reflect/code/CtBreak.java index 1ee29947c34..0490da48aee 100644 --- a/src/main/java/spoon/reflect/code/CtBreak.java +++ b/src/main/java/spoon/reflect/code/CtBreak.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtCFlowBreak.java b/src/main/java/spoon/reflect/code/CtCFlowBreak.java index 737a786d4cb..0bca9910511 100644 --- a/src/main/java/spoon/reflect/code/CtCFlowBreak.java +++ b/src/main/java/spoon/reflect/code/CtCFlowBreak.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtCase.java b/src/main/java/spoon/reflect/code/CtCase.java index 9ce11e23a0d..c88e19d39c7 100644 --- a/src/main/java/spoon/reflect/code/CtCase.java +++ b/src/main/java/spoon/reflect/code/CtCase.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtCatch.java b/src/main/java/spoon/reflect/code/CtCatch.java index 8eccbd8e2e9..9b730ec25f9 100644 --- a/src/main/java/spoon/reflect/code/CtCatch.java +++ b/src/main/java/spoon/reflect/code/CtCatch.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtCatchVariable.java b/src/main/java/spoon/reflect/code/CtCatchVariable.java index 25241537ee2..e29c512f803 100644 --- a/src/main/java/spoon/reflect/code/CtCatchVariable.java +++ b/src/main/java/spoon/reflect/code/CtCatchVariable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtCodeElement.java b/src/main/java/spoon/reflect/code/CtCodeElement.java index 93642c3c3f3..617359c8de3 100644 --- a/src/main/java/spoon/reflect/code/CtCodeElement.java +++ b/src/main/java/spoon/reflect/code/CtCodeElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtCodeSnippetExpression.java b/src/main/java/spoon/reflect/code/CtCodeSnippetExpression.java index 16759b314d5..e51fe204d7b 100644 --- a/src/main/java/spoon/reflect/code/CtCodeSnippetExpression.java +++ b/src/main/java/spoon/reflect/code/CtCodeSnippetExpression.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtCodeSnippetStatement.java b/src/main/java/spoon/reflect/code/CtCodeSnippetStatement.java index 018f3b5948a..845e893b52b 100644 --- a/src/main/java/spoon/reflect/code/CtCodeSnippetStatement.java +++ b/src/main/java/spoon/reflect/code/CtCodeSnippetStatement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtComment.java b/src/main/java/spoon/reflect/code/CtComment.java index a8d526659b3..69f276e67c0 100644 --- a/src/main/java/spoon/reflect/code/CtComment.java +++ b/src/main/java/spoon/reflect/code/CtComment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtConditional.java b/src/main/java/spoon/reflect/code/CtConditional.java index 07335f1c9a2..c1f48653562 100644 --- a/src/main/java/spoon/reflect/code/CtConditional.java +++ b/src/main/java/spoon/reflect/code/CtConditional.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtConstructorCall.java b/src/main/java/spoon/reflect/code/CtConstructorCall.java index bba313c351a..d747e7f7797 100644 --- a/src/main/java/spoon/reflect/code/CtConstructorCall.java +++ b/src/main/java/spoon/reflect/code/CtConstructorCall.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtContinue.java b/src/main/java/spoon/reflect/code/CtContinue.java index d1a8c371839..e5bde221166 100644 --- a/src/main/java/spoon/reflect/code/CtContinue.java +++ b/src/main/java/spoon/reflect/code/CtContinue.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtDo.java b/src/main/java/spoon/reflect/code/CtDo.java index 5ab5845b465..fbf0704aa27 100644 --- a/src/main/java/spoon/reflect/code/CtDo.java +++ b/src/main/java/spoon/reflect/code/CtDo.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtExecutableReferenceExpression.java b/src/main/java/spoon/reflect/code/CtExecutableReferenceExpression.java index 1e3d63b8f32..8336ae1d921 100644 --- a/src/main/java/spoon/reflect/code/CtExecutableReferenceExpression.java +++ b/src/main/java/spoon/reflect/code/CtExecutableReferenceExpression.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtExpression.java b/src/main/java/spoon/reflect/code/CtExpression.java index 2b5c6ee5b7e..2a5e7a148dd 100644 --- a/src/main/java/spoon/reflect/code/CtExpression.java +++ b/src/main/java/spoon/reflect/code/CtExpression.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtFieldAccess.java b/src/main/java/spoon/reflect/code/CtFieldAccess.java index 1c71cf55221..767e1e88994 100644 --- a/src/main/java/spoon/reflect/code/CtFieldAccess.java +++ b/src/main/java/spoon/reflect/code/CtFieldAccess.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtFieldRead.java b/src/main/java/spoon/reflect/code/CtFieldRead.java index a4693e551d0..3336cc0d113 100644 --- a/src/main/java/spoon/reflect/code/CtFieldRead.java +++ b/src/main/java/spoon/reflect/code/CtFieldRead.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtFieldWrite.java b/src/main/java/spoon/reflect/code/CtFieldWrite.java index 5a5b749c723..a55915b4e84 100644 --- a/src/main/java/spoon/reflect/code/CtFieldWrite.java +++ b/src/main/java/spoon/reflect/code/CtFieldWrite.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtFor.java b/src/main/java/spoon/reflect/code/CtFor.java index 473fdab4d05..106d55d7a72 100644 --- a/src/main/java/spoon/reflect/code/CtFor.java +++ b/src/main/java/spoon/reflect/code/CtFor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtForEach.java b/src/main/java/spoon/reflect/code/CtForEach.java index 7fca523b700..71e6790db84 100644 --- a/src/main/java/spoon/reflect/code/CtForEach.java +++ b/src/main/java/spoon/reflect/code/CtForEach.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtIf.java b/src/main/java/spoon/reflect/code/CtIf.java index a6458613bd9..efd6bb8d513 100644 --- a/src/main/java/spoon/reflect/code/CtIf.java +++ b/src/main/java/spoon/reflect/code/CtIf.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtInvocation.java b/src/main/java/spoon/reflect/code/CtInvocation.java index 5388998553a..f9bcc3376b3 100644 --- a/src/main/java/spoon/reflect/code/CtInvocation.java +++ b/src/main/java/spoon/reflect/code/CtInvocation.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtJavaDoc.java b/src/main/java/spoon/reflect/code/CtJavaDoc.java index dff532c8e7a..9e48d5bacbe 100644 --- a/src/main/java/spoon/reflect/code/CtJavaDoc.java +++ b/src/main/java/spoon/reflect/code/CtJavaDoc.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtJavaDocTag.java b/src/main/java/spoon/reflect/code/CtJavaDocTag.java index 19cb80ba10d..13eea9facea 100644 --- a/src/main/java/spoon/reflect/code/CtJavaDocTag.java +++ b/src/main/java/spoon/reflect/code/CtJavaDocTag.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtLabelledFlowBreak.java b/src/main/java/spoon/reflect/code/CtLabelledFlowBreak.java index 56fca177eb2..7be9f845bdf 100644 --- a/src/main/java/spoon/reflect/code/CtLabelledFlowBreak.java +++ b/src/main/java/spoon/reflect/code/CtLabelledFlowBreak.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtLambda.java b/src/main/java/spoon/reflect/code/CtLambda.java index ee460c8d1a1..8dc57de15a5 100644 --- a/src/main/java/spoon/reflect/code/CtLambda.java +++ b/src/main/java/spoon/reflect/code/CtLambda.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtLiteral.java b/src/main/java/spoon/reflect/code/CtLiteral.java index 3758e7162f9..78a7c8f127a 100644 --- a/src/main/java/spoon/reflect/code/CtLiteral.java +++ b/src/main/java/spoon/reflect/code/CtLiteral.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtLocalVariable.java b/src/main/java/spoon/reflect/code/CtLocalVariable.java index ee51727d441..72feb853003 100644 --- a/src/main/java/spoon/reflect/code/CtLocalVariable.java +++ b/src/main/java/spoon/reflect/code/CtLocalVariable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtLoop.java b/src/main/java/spoon/reflect/code/CtLoop.java index 53353fd4d60..e8fd96b254d 100644 --- a/src/main/java/spoon/reflect/code/CtLoop.java +++ b/src/main/java/spoon/reflect/code/CtLoop.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtNewArray.java b/src/main/java/spoon/reflect/code/CtNewArray.java index c6b5f3c4129..b7a5fa605bc 100644 --- a/src/main/java/spoon/reflect/code/CtNewArray.java +++ b/src/main/java/spoon/reflect/code/CtNewArray.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtNewClass.java b/src/main/java/spoon/reflect/code/CtNewClass.java index 85a15a98b92..fc09af8868c 100644 --- a/src/main/java/spoon/reflect/code/CtNewClass.java +++ b/src/main/java/spoon/reflect/code/CtNewClass.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtOperatorAssignment.java b/src/main/java/spoon/reflect/code/CtOperatorAssignment.java index d955aebb8a1..201d8f36aa8 100644 --- a/src/main/java/spoon/reflect/code/CtOperatorAssignment.java +++ b/src/main/java/spoon/reflect/code/CtOperatorAssignment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtPattern.java b/src/main/java/spoon/reflect/code/CtPattern.java index cf57205d70e..3ff9e00b4b9 100644 --- a/src/main/java/spoon/reflect/code/CtPattern.java +++ b/src/main/java/spoon/reflect/code/CtPattern.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtRHSReceiver.java b/src/main/java/spoon/reflect/code/CtRHSReceiver.java index 5c349721f52..0811a6e5cd8 100644 --- a/src/main/java/spoon/reflect/code/CtRHSReceiver.java +++ b/src/main/java/spoon/reflect/code/CtRHSReceiver.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtResource.java b/src/main/java/spoon/reflect/code/CtResource.java index 2fe8c954d8d..29e7fdc508b 100644 --- a/src/main/java/spoon/reflect/code/CtResource.java +++ b/src/main/java/spoon/reflect/code/CtResource.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtReturn.java b/src/main/java/spoon/reflect/code/CtReturn.java index c1eb918ae42..09ec941037d 100644 --- a/src/main/java/spoon/reflect/code/CtReturn.java +++ b/src/main/java/spoon/reflect/code/CtReturn.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtStatement.java b/src/main/java/spoon/reflect/code/CtStatement.java index 9e094e9fea1..12e4073a453 100644 --- a/src/main/java/spoon/reflect/code/CtStatement.java +++ b/src/main/java/spoon/reflect/code/CtStatement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtStatementList.java b/src/main/java/spoon/reflect/code/CtStatementList.java index 7a2a97671aa..21999a14046 100644 --- a/src/main/java/spoon/reflect/code/CtStatementList.java +++ b/src/main/java/spoon/reflect/code/CtStatementList.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtSuperAccess.java b/src/main/java/spoon/reflect/code/CtSuperAccess.java index 88b21f40946..6c489e5858d 100644 --- a/src/main/java/spoon/reflect/code/CtSuperAccess.java +++ b/src/main/java/spoon/reflect/code/CtSuperAccess.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtSwitch.java b/src/main/java/spoon/reflect/code/CtSwitch.java index 699a04f8e98..9afa0eda05b 100644 --- a/src/main/java/spoon/reflect/code/CtSwitch.java +++ b/src/main/java/spoon/reflect/code/CtSwitch.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtSwitchExpression.java b/src/main/java/spoon/reflect/code/CtSwitchExpression.java index 39f510c5fc5..005c4ab34d8 100644 --- a/src/main/java/spoon/reflect/code/CtSwitchExpression.java +++ b/src/main/java/spoon/reflect/code/CtSwitchExpression.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtSynchronized.java b/src/main/java/spoon/reflect/code/CtSynchronized.java index 52924016fba..e23d74c83d4 100644 --- a/src/main/java/spoon/reflect/code/CtSynchronized.java +++ b/src/main/java/spoon/reflect/code/CtSynchronized.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtTargetedExpression.java b/src/main/java/spoon/reflect/code/CtTargetedExpression.java index 757b7c3b966..27523899615 100644 --- a/src/main/java/spoon/reflect/code/CtTargetedExpression.java +++ b/src/main/java/spoon/reflect/code/CtTargetedExpression.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtTextBlock.java b/src/main/java/spoon/reflect/code/CtTextBlock.java index f05becde35d..d36fb68262b 100644 --- a/src/main/java/spoon/reflect/code/CtTextBlock.java +++ b/src/main/java/spoon/reflect/code/CtTextBlock.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtThisAccess.java b/src/main/java/spoon/reflect/code/CtThisAccess.java index 76e1b93f1cf..6a523a0d479 100644 --- a/src/main/java/spoon/reflect/code/CtThisAccess.java +++ b/src/main/java/spoon/reflect/code/CtThisAccess.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtThrow.java b/src/main/java/spoon/reflect/code/CtThrow.java index 58dd158d4a0..2aa12cecc5a 100644 --- a/src/main/java/spoon/reflect/code/CtThrow.java +++ b/src/main/java/spoon/reflect/code/CtThrow.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtTry.java b/src/main/java/spoon/reflect/code/CtTry.java index ac108559d16..b359e2f550d 100644 --- a/src/main/java/spoon/reflect/code/CtTry.java +++ b/src/main/java/spoon/reflect/code/CtTry.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtTryWithResource.java b/src/main/java/spoon/reflect/code/CtTryWithResource.java index 40d576ecb4d..1e1e833e4c4 100644 --- a/src/main/java/spoon/reflect/code/CtTryWithResource.java +++ b/src/main/java/spoon/reflect/code/CtTryWithResource.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtTypeAccess.java b/src/main/java/spoon/reflect/code/CtTypeAccess.java index 57ddc82650d..410071bc6d0 100644 --- a/src/main/java/spoon/reflect/code/CtTypeAccess.java +++ b/src/main/java/spoon/reflect/code/CtTypeAccess.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtTypePattern.java b/src/main/java/spoon/reflect/code/CtTypePattern.java index 077570110f8..400cbab2dbf 100644 --- a/src/main/java/spoon/reflect/code/CtTypePattern.java +++ b/src/main/java/spoon/reflect/code/CtTypePattern.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtUnaryOperator.java b/src/main/java/spoon/reflect/code/CtUnaryOperator.java index ed916217160..f9a2e18c14e 100644 --- a/src/main/java/spoon/reflect/code/CtUnaryOperator.java +++ b/src/main/java/spoon/reflect/code/CtUnaryOperator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtVariableAccess.java b/src/main/java/spoon/reflect/code/CtVariableAccess.java index c5d2d8036dd..7b46568706b 100644 --- a/src/main/java/spoon/reflect/code/CtVariableAccess.java +++ b/src/main/java/spoon/reflect/code/CtVariableAccess.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtVariableRead.java b/src/main/java/spoon/reflect/code/CtVariableRead.java index d356ac33edc..7d097c0d149 100644 --- a/src/main/java/spoon/reflect/code/CtVariableRead.java +++ b/src/main/java/spoon/reflect/code/CtVariableRead.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtVariableWrite.java b/src/main/java/spoon/reflect/code/CtVariableWrite.java index 29cbc66a372..2e700ec6ab5 100644 --- a/src/main/java/spoon/reflect/code/CtVariableWrite.java +++ b/src/main/java/spoon/reflect/code/CtVariableWrite.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtWhile.java b/src/main/java/spoon/reflect/code/CtWhile.java index 33fa3ebc075..1ca1cc90a0d 100644 --- a/src/main/java/spoon/reflect/code/CtWhile.java +++ b/src/main/java/spoon/reflect/code/CtWhile.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/CtYieldStatement.java b/src/main/java/spoon/reflect/code/CtYieldStatement.java index f3d1346a958..7d3b82214de 100644 --- a/src/main/java/spoon/reflect/code/CtYieldStatement.java +++ b/src/main/java/spoon/reflect/code/CtYieldStatement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/LiteralBase.java b/src/main/java/spoon/reflect/code/LiteralBase.java index 84d9e1ab0d6..546e13cf397 100644 --- a/src/main/java/spoon/reflect/code/LiteralBase.java +++ b/src/main/java/spoon/reflect/code/LiteralBase.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/UnaryOperatorKind.java b/src/main/java/spoon/reflect/code/UnaryOperatorKind.java index b41c1c216f1..7acda66aea7 100644 --- a/src/main/java/spoon/reflect/code/UnaryOperatorKind.java +++ b/src/main/java/spoon/reflect/code/UnaryOperatorKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.code; diff --git a/src/main/java/spoon/reflect/code/package-info.java b/src/main/java/spoon/reflect/code/package-info.java index 6ed201c9d8d..4b51ab6ced2 100644 --- a/src/main/java/spoon/reflect/code/package-info.java +++ b/src/main/java/spoon/reflect/code/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package contains the meta-model part that models the executable code (methods and constructors' bodies, field initializers). diff --git a/src/main/java/spoon/reflect/cu/SourcePosition.java b/src/main/java/spoon/reflect/cu/SourcePosition.java index a79eb9ae19d..89646c481ba 100644 --- a/src/main/java/spoon/reflect/cu/SourcePosition.java +++ b/src/main/java/spoon/reflect/cu/SourcePosition.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.cu; diff --git a/src/main/java/spoon/reflect/cu/SourcePositionHolder.java b/src/main/java/spoon/reflect/cu/SourcePositionHolder.java index 4ee7a76e5e1..8cc36ab0cb1 100644 --- a/src/main/java/spoon/reflect/cu/SourcePositionHolder.java +++ b/src/main/java/spoon/reflect/cu/SourcePositionHolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.cu; diff --git a/src/main/java/spoon/reflect/cu/package-info.java b/src/main/java/spoon/reflect/cu/package-info.java index c59020830e6..d87410b934f 100644 --- a/src/main/java/spoon/reflect/cu/package-info.java +++ b/src/main/java/spoon/reflect/cu/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines compilation units that hold the source code and some classes around them (in most cases, these features should be ignored by the programmers).

diff --git a/src/main/java/spoon/reflect/cu/position/BodyHolderSourcePosition.java b/src/main/java/spoon/reflect/cu/position/BodyHolderSourcePosition.java index 08cb62b2266..b259fddd387 100644 --- a/src/main/java/spoon/reflect/cu/position/BodyHolderSourcePosition.java +++ b/src/main/java/spoon/reflect/cu/position/BodyHolderSourcePosition.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.cu.position; diff --git a/src/main/java/spoon/reflect/cu/position/CompoundSourcePosition.java b/src/main/java/spoon/reflect/cu/position/CompoundSourcePosition.java index f16725d72cd..eec3db42afb 100644 --- a/src/main/java/spoon/reflect/cu/position/CompoundSourcePosition.java +++ b/src/main/java/spoon/reflect/cu/position/CompoundSourcePosition.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.cu.position; diff --git a/src/main/java/spoon/reflect/cu/position/DeclarationSourcePosition.java b/src/main/java/spoon/reflect/cu/position/DeclarationSourcePosition.java index 5e4040cd4fb..bca0fae535d 100644 --- a/src/main/java/spoon/reflect/cu/position/DeclarationSourcePosition.java +++ b/src/main/java/spoon/reflect/cu/position/DeclarationSourcePosition.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.cu.position; diff --git a/src/main/java/spoon/reflect/cu/position/NoSourcePosition.java b/src/main/java/spoon/reflect/cu/position/NoSourcePosition.java index 5845db78272..cd3fc027d87 100644 --- a/src/main/java/spoon/reflect/cu/position/NoSourcePosition.java +++ b/src/main/java/spoon/reflect/cu/position/NoSourcePosition.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.cu.position; diff --git a/src/main/java/spoon/reflect/declaration/CtAnnotatedElementType.java b/src/main/java/spoon/reflect/declaration/CtAnnotatedElementType.java index 5f2a835caa9..5c669cf3978 100644 --- a/src/main/java/spoon/reflect/declaration/CtAnnotatedElementType.java +++ b/src/main/java/spoon/reflect/declaration/CtAnnotatedElementType.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtAnnotation.java b/src/main/java/spoon/reflect/declaration/CtAnnotation.java index 9ebde5690b7..a44d767bf62 100644 --- a/src/main/java/spoon/reflect/declaration/CtAnnotation.java +++ b/src/main/java/spoon/reflect/declaration/CtAnnotation.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtAnnotationMethod.java b/src/main/java/spoon/reflect/declaration/CtAnnotationMethod.java index 68a2280a193..14d46ee015f 100644 --- a/src/main/java/spoon/reflect/declaration/CtAnnotationMethod.java +++ b/src/main/java/spoon/reflect/declaration/CtAnnotationMethod.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtAnnotationType.java b/src/main/java/spoon/reflect/declaration/CtAnnotationType.java index 2da31da9a66..110b6227546 100644 --- a/src/main/java/spoon/reflect/declaration/CtAnnotationType.java +++ b/src/main/java/spoon/reflect/declaration/CtAnnotationType.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtAnonymousExecutable.java b/src/main/java/spoon/reflect/declaration/CtAnonymousExecutable.java index d8395d3aaf5..8cea3e9d789 100644 --- a/src/main/java/spoon/reflect/declaration/CtAnonymousExecutable.java +++ b/src/main/java/spoon/reflect/declaration/CtAnonymousExecutable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtClass.java b/src/main/java/spoon/reflect/declaration/CtClass.java index 02d4948031b..531dc6dca1b 100644 --- a/src/main/java/spoon/reflect/declaration/CtClass.java +++ b/src/main/java/spoon/reflect/declaration/CtClass.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java b/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java index 6b7cf16e0b6..18ee70eb405 100644 --- a/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java +++ b/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtCompilationUnit.java b/src/main/java/spoon/reflect/declaration/CtCompilationUnit.java index 0b6b465910e..606d827e1e3 100644 --- a/src/main/java/spoon/reflect/declaration/CtCompilationUnit.java +++ b/src/main/java/spoon/reflect/declaration/CtCompilationUnit.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtConstructor.java b/src/main/java/spoon/reflect/declaration/CtConstructor.java index 686276e9eb3..ee79386b105 100644 --- a/src/main/java/spoon/reflect/declaration/CtConstructor.java +++ b/src/main/java/spoon/reflect/declaration/CtConstructor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtElement.java b/src/main/java/spoon/reflect/declaration/CtElement.java index 85097f22d62..b72f6c527c7 100644 --- a/src/main/java/spoon/reflect/declaration/CtElement.java +++ b/src/main/java/spoon/reflect/declaration/CtElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtEnum.java b/src/main/java/spoon/reflect/declaration/CtEnum.java index a977307af30..fe6dc822367 100644 --- a/src/main/java/spoon/reflect/declaration/CtEnum.java +++ b/src/main/java/spoon/reflect/declaration/CtEnum.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtEnumValue.java b/src/main/java/spoon/reflect/declaration/CtEnumValue.java index 13041738350..0637623fb17 100644 --- a/src/main/java/spoon/reflect/declaration/CtEnumValue.java +++ b/src/main/java/spoon/reflect/declaration/CtEnumValue.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtExecutable.java b/src/main/java/spoon/reflect/declaration/CtExecutable.java index ac601521be3..61550a6dbad 100644 --- a/src/main/java/spoon/reflect/declaration/CtExecutable.java +++ b/src/main/java/spoon/reflect/declaration/CtExecutable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtField.java b/src/main/java/spoon/reflect/declaration/CtField.java index cc2bfedc3ce..2d2767f630e 100644 --- a/src/main/java/spoon/reflect/declaration/CtField.java +++ b/src/main/java/spoon/reflect/declaration/CtField.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtFormalTypeDeclarer.java b/src/main/java/spoon/reflect/declaration/CtFormalTypeDeclarer.java index ac3e30e19f9..62c4fdcfcd6 100644 --- a/src/main/java/spoon/reflect/declaration/CtFormalTypeDeclarer.java +++ b/src/main/java/spoon/reflect/declaration/CtFormalTypeDeclarer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtImport.java b/src/main/java/spoon/reflect/declaration/CtImport.java index c7e25f47a6b..8c69c1ca534 100644 --- a/src/main/java/spoon/reflect/declaration/CtImport.java +++ b/src/main/java/spoon/reflect/declaration/CtImport.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtImportKind.java b/src/main/java/spoon/reflect/declaration/CtImportKind.java index ee0144adb6d..024dde2f413 100644 --- a/src/main/java/spoon/reflect/declaration/CtImportKind.java +++ b/src/main/java/spoon/reflect/declaration/CtImportKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtInterface.java b/src/main/java/spoon/reflect/declaration/CtInterface.java index ac3d58d6990..afd9f5b70bd 100644 --- a/src/main/java/spoon/reflect/declaration/CtInterface.java +++ b/src/main/java/spoon/reflect/declaration/CtInterface.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtMethod.java b/src/main/java/spoon/reflect/declaration/CtMethod.java index 5b962dbcd3a..bf3453d2892 100644 --- a/src/main/java/spoon/reflect/declaration/CtMethod.java +++ b/src/main/java/spoon/reflect/declaration/CtMethod.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtModifiable.java b/src/main/java/spoon/reflect/declaration/CtModifiable.java index 573d08b4684..f5198c991e2 100644 --- a/src/main/java/spoon/reflect/declaration/CtModifiable.java +++ b/src/main/java/spoon/reflect/declaration/CtModifiable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtModule.java b/src/main/java/spoon/reflect/declaration/CtModule.java index 9891298e57f..6ce8fcecbe3 100644 --- a/src/main/java/spoon/reflect/declaration/CtModule.java +++ b/src/main/java/spoon/reflect/declaration/CtModule.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtModuleDirective.java b/src/main/java/spoon/reflect/declaration/CtModuleDirective.java index 9a9645d2678..e434e4cacf1 100644 --- a/src/main/java/spoon/reflect/declaration/CtModuleDirective.java +++ b/src/main/java/spoon/reflect/declaration/CtModuleDirective.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtModuleRequirement.java b/src/main/java/spoon/reflect/declaration/CtModuleRequirement.java index d837819ce27..93aa7dac0b1 100644 --- a/src/main/java/spoon/reflect/declaration/CtModuleRequirement.java +++ b/src/main/java/spoon/reflect/declaration/CtModuleRequirement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtMultiTypedElement.java b/src/main/java/spoon/reflect/declaration/CtMultiTypedElement.java index 16fed7f27e2..2d7b03c7d90 100644 --- a/src/main/java/spoon/reflect/declaration/CtMultiTypedElement.java +++ b/src/main/java/spoon/reflect/declaration/CtMultiTypedElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtNamedElement.java b/src/main/java/spoon/reflect/declaration/CtNamedElement.java index b40447fa797..930d81c7296 100644 --- a/src/main/java/spoon/reflect/declaration/CtNamedElement.java +++ b/src/main/java/spoon/reflect/declaration/CtNamedElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtPackage.java b/src/main/java/spoon/reflect/declaration/CtPackage.java index 38549048189..e8ad46b3729 100644 --- a/src/main/java/spoon/reflect/declaration/CtPackage.java +++ b/src/main/java/spoon/reflect/declaration/CtPackage.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtPackageDeclaration.java b/src/main/java/spoon/reflect/declaration/CtPackageDeclaration.java index 8cd3be78eaf..d22c135c191 100644 --- a/src/main/java/spoon/reflect/declaration/CtPackageDeclaration.java +++ b/src/main/java/spoon/reflect/declaration/CtPackageDeclaration.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtPackageExport.java b/src/main/java/spoon/reflect/declaration/CtPackageExport.java index 0004d5843b8..2d849bdf1f1 100644 --- a/src/main/java/spoon/reflect/declaration/CtPackageExport.java +++ b/src/main/java/spoon/reflect/declaration/CtPackageExport.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtParameter.java b/src/main/java/spoon/reflect/declaration/CtParameter.java index 18eec312986..7a08fbba41f 100644 --- a/src/main/java/spoon/reflect/declaration/CtParameter.java +++ b/src/main/java/spoon/reflect/declaration/CtParameter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtProvidedService.java b/src/main/java/spoon/reflect/declaration/CtProvidedService.java index ce586766732..6c6314f0c14 100644 --- a/src/main/java/spoon/reflect/declaration/CtProvidedService.java +++ b/src/main/java/spoon/reflect/declaration/CtProvidedService.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtRecord.java b/src/main/java/spoon/reflect/declaration/CtRecord.java index 2921f0575b0..5377f437e61 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecord.java +++ b/src/main/java/spoon/reflect/declaration/CtRecord.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java index 065d5c54d7c..e8065dfe18f 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java +++ b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; /** @@ -19,14 +19,22 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElement, CtShadowable { /** - * Converts the component to an implicit method. - * @return the method + * Converts the component to an implicit method. The returned method is a view and has no parent. + * This means that any modification on the returned method will not be reflected on the component. + * Also this element is not part of the model. A record already has the methods corresponding to its components. + * Use {@link CtRecord#getMethods()} to get the getter methods of a record. + * + * @return the method corresponding to the component (a getter) as a view. */ CtMethod toMethod(); /** - * Converts the component to an implicit field. - * @return the field + * Converts the component to an implicit field.The returned field is a view and has no parent. + * This means that any modification on the returned field will not be reflected on the component. + * Also this element is not part of the model. A record already has the field corresponding to its components. + * Use {@link CtRecord#getFields()} to get the fields of a record. + * + * @return the field corresponding to the component as a view. */ CtField toField(); diff --git a/src/main/java/spoon/reflect/declaration/CtSealable.java b/src/main/java/spoon/reflect/declaration/CtSealable.java index 091b116b712..ef0a203e0f6 100644 --- a/src/main/java/spoon/reflect/declaration/CtSealable.java +++ b/src/main/java/spoon/reflect/declaration/CtSealable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtShadowable.java b/src/main/java/spoon/reflect/declaration/CtShadowable.java index 46e9687135a..fbce477bcee 100644 --- a/src/main/java/spoon/reflect/declaration/CtShadowable.java +++ b/src/main/java/spoon/reflect/declaration/CtShadowable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtType.java b/src/main/java/spoon/reflect/declaration/CtType.java index c8d0f55d049..cf8466b52b5 100644 --- a/src/main/java/spoon/reflect/declaration/CtType.java +++ b/src/main/java/spoon/reflect/declaration/CtType.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtTypeInformation.java b/src/main/java/spoon/reflect/declaration/CtTypeInformation.java index e68d99476c6..cd559580e92 100644 --- a/src/main/java/spoon/reflect/declaration/CtTypeInformation.java +++ b/src/main/java/spoon/reflect/declaration/CtTypeInformation.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtTypeMember.java b/src/main/java/spoon/reflect/declaration/CtTypeMember.java index 1a0a9d62723..386815d2c75 100644 --- a/src/main/java/spoon/reflect/declaration/CtTypeMember.java +++ b/src/main/java/spoon/reflect/declaration/CtTypeMember.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtTypeParameter.java b/src/main/java/spoon/reflect/declaration/CtTypeParameter.java index c8a782918db..f34cb171b36 100644 --- a/src/main/java/spoon/reflect/declaration/CtTypeParameter.java +++ b/src/main/java/spoon/reflect/declaration/CtTypeParameter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtTypedElement.java b/src/main/java/spoon/reflect/declaration/CtTypedElement.java index 793453ad190..85ce2297d8e 100644 --- a/src/main/java/spoon/reflect/declaration/CtTypedElement.java +++ b/src/main/java/spoon/reflect/declaration/CtTypedElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtUsedService.java b/src/main/java/spoon/reflect/declaration/CtUsedService.java index d42041a84d2..fc21b319075 100644 --- a/src/main/java/spoon/reflect/declaration/CtUsedService.java +++ b/src/main/java/spoon/reflect/declaration/CtUsedService.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/CtVariable.java b/src/main/java/spoon/reflect/declaration/CtVariable.java index 689fc559314..da05871e312 100644 --- a/src/main/java/spoon/reflect/declaration/CtVariable.java +++ b/src/main/java/spoon/reflect/declaration/CtVariable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/ModifierKind.java b/src/main/java/spoon/reflect/declaration/ModifierKind.java index b75ee78d217..3ae853f3630 100644 --- a/src/main/java/spoon/reflect/declaration/ModifierKind.java +++ b/src/main/java/spoon/reflect/declaration/ModifierKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/ParentNotInitializedException.java b/src/main/java/spoon/reflect/declaration/ParentNotInitializedException.java index fe8d9350069..922d9885dd7 100644 --- a/src/main/java/spoon/reflect/declaration/ParentNotInitializedException.java +++ b/src/main/java/spoon/reflect/declaration/ParentNotInitializedException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.declaration; diff --git a/src/main/java/spoon/reflect/declaration/package-info.java b/src/main/java/spoon/reflect/declaration/package-info.java index a3610a471ca..d7389782bd9 100644 --- a/src/main/java/spoon/reflect/declaration/package-info.java +++ b/src/main/java/spoon/reflect/declaration/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package contains the meta-model part that models the declarations (program's structures such as classes, fields, etc). diff --git a/src/main/java/spoon/reflect/eval/PartialEvaluator.java b/src/main/java/spoon/reflect/eval/PartialEvaluator.java index 1f927d3ec67..f1805131435 100644 --- a/src/main/java/spoon/reflect/eval/PartialEvaluator.java +++ b/src/main/java/spoon/reflect/eval/PartialEvaluator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.eval; diff --git a/src/main/java/spoon/reflect/eval/package-info.java b/src/main/java/spoon/reflect/eval/package-info.java index cabfc30fbc9..5f33436425c 100644 --- a/src/main/java/spoon/reflect/eval/package-info.java +++ b/src/main/java/spoon/reflect/eval/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines some evaluators for the Spoon meta-model.

diff --git a/src/main/java/spoon/reflect/factory/AnnotationFactory.java b/src/main/java/spoon/reflect/factory/AnnotationFactory.java index c9c83d30140..738b556bbe8 100644 --- a/src/main/java/spoon/reflect/factory/AnnotationFactory.java +++ b/src/main/java/spoon/reflect/factory/AnnotationFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/ClassFactory.java b/src/main/java/spoon/reflect/factory/ClassFactory.java index 225daf168b0..20cfa531e36 100644 --- a/src/main/java/spoon/reflect/factory/ClassFactory.java +++ b/src/main/java/spoon/reflect/factory/ClassFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/CodeFactory.java b/src/main/java/spoon/reflect/factory/CodeFactory.java index 3b736373f48..c7c74972e4f 100644 --- a/src/main/java/spoon/reflect/factory/CodeFactory.java +++ b/src/main/java/spoon/reflect/factory/CodeFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/CompilationUnitFactory.java b/src/main/java/spoon/reflect/factory/CompilationUnitFactory.java index b162f8ca714..8ecc8b603b8 100644 --- a/src/main/java/spoon/reflect/factory/CompilationUnitFactory.java +++ b/src/main/java/spoon/reflect/factory/CompilationUnitFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/ConstructorFactory.java b/src/main/java/spoon/reflect/factory/ConstructorFactory.java index 95c60d00c5b..5dd7d86dd02 100644 --- a/src/main/java/spoon/reflect/factory/ConstructorFactory.java +++ b/src/main/java/spoon/reflect/factory/ConstructorFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/CoreFactory.java b/src/main/java/spoon/reflect/factory/CoreFactory.java index 73314babddb..06a28f95680 100644 --- a/src/main/java/spoon/reflect/factory/CoreFactory.java +++ b/src/main/java/spoon/reflect/factory/CoreFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/EnumFactory.java b/src/main/java/spoon/reflect/factory/EnumFactory.java index e886ad02e59..69657f1363d 100644 --- a/src/main/java/spoon/reflect/factory/EnumFactory.java +++ b/src/main/java/spoon/reflect/factory/EnumFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/EvalFactory.java b/src/main/java/spoon/reflect/factory/EvalFactory.java index 0da722a05cb..b39dfe185a7 100644 --- a/src/main/java/spoon/reflect/factory/EvalFactory.java +++ b/src/main/java/spoon/reflect/factory/EvalFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/ExecutableFactory.java b/src/main/java/spoon/reflect/factory/ExecutableFactory.java index 73d7b216651..1a245198696 100644 --- a/src/main/java/spoon/reflect/factory/ExecutableFactory.java +++ b/src/main/java/spoon/reflect/factory/ExecutableFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/Factory.java b/src/main/java/spoon/reflect/factory/Factory.java index 3d9cafca2dc..2b987dd5f82 100644 --- a/src/main/java/spoon/reflect/factory/Factory.java +++ b/src/main/java/spoon/reflect/factory/Factory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/FactoryImpl.java b/src/main/java/spoon/reflect/factory/FactoryImpl.java index b363ab04d62..d68071732ee 100644 --- a/src/main/java/spoon/reflect/factory/FactoryImpl.java +++ b/src/main/java/spoon/reflect/factory/FactoryImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/FieldFactory.java b/src/main/java/spoon/reflect/factory/FieldFactory.java index decdf74d899..66d004ee946 100644 --- a/src/main/java/spoon/reflect/factory/FieldFactory.java +++ b/src/main/java/spoon/reflect/factory/FieldFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/InterfaceFactory.java b/src/main/java/spoon/reflect/factory/InterfaceFactory.java index 10da375b798..7cd5965d023 100644 --- a/src/main/java/spoon/reflect/factory/InterfaceFactory.java +++ b/src/main/java/spoon/reflect/factory/InterfaceFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/MethodFactory.java b/src/main/java/spoon/reflect/factory/MethodFactory.java index cb23698be9f..1455497a354 100644 --- a/src/main/java/spoon/reflect/factory/MethodFactory.java +++ b/src/main/java/spoon/reflect/factory/MethodFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/ModuleFactory.java b/src/main/java/spoon/reflect/factory/ModuleFactory.java index dadb41b6862..11ab6b1e17d 100644 --- a/src/main/java/spoon/reflect/factory/ModuleFactory.java +++ b/src/main/java/spoon/reflect/factory/ModuleFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/PackageFactory.java b/src/main/java/spoon/reflect/factory/PackageFactory.java index 4437418e32c..2d4720387f1 100644 --- a/src/main/java/spoon/reflect/factory/PackageFactory.java +++ b/src/main/java/spoon/reflect/factory/PackageFactory.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ @@ -12,7 +12,6 @@ import spoon.reflect.declaration.CtModule; import spoon.reflect.declaration.CtPackage; import spoon.reflect.declaration.CtPackageDeclaration; -import spoon.reflect.declaration.CtType; import spoon.reflect.reference.CtPackageReference; import java.util.ArrayList; diff --git a/src/main/java/spoon/reflect/factory/QueryFactory.java b/src/main/java/spoon/reflect/factory/QueryFactory.java index 0634ecd0fa7..10147d05643 100644 --- a/src/main/java/spoon/reflect/factory/QueryFactory.java +++ b/src/main/java/spoon/reflect/factory/QueryFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/SubFactory.java b/src/main/java/spoon/reflect/factory/SubFactory.java index 6a02ca4ccb1..b0708b4161e 100644 --- a/src/main/java/spoon/reflect/factory/SubFactory.java +++ b/src/main/java/spoon/reflect/factory/SubFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; diff --git a/src/main/java/spoon/reflect/factory/TypeFactory.java b/src/main/java/spoon/reflect/factory/TypeFactory.java index 2743b2a9d73..74fb28a1c3a 100644 --- a/src/main/java/spoon/reflect/factory/TypeFactory.java +++ b/src/main/java/spoon/reflect/factory/TypeFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.factory; @@ -93,7 +93,9 @@ public class TypeFactory extends SubFactory { public final CtTypeReference ENUM = createReference(Enum.class); public final CtTypeReference OMITTED_TYPE_ARG_TYPE = createReference(CtTypeReference.OMITTED_TYPE_ARG_NAME); - private final Map, CtType> shadowCache = new ConcurrentHashMap<>(); + // This map MUST provide a useful computeIfAbsent method in the face of concurrency. + // Therefore, we declare it as a ConcurrentHashMap directly. + private final ConcurrentHashMap, CtType> shadowCache = new ConcurrentHashMap<>(); private final ConcurrentHashMap>> typeRefCache = new ConcurrentHashMap<>(); /** @@ -608,37 +610,35 @@ private void addNestedType(List> list, CtType t) { public CtType get(Class cl) { final CtType aType = get(cl.getName()); if (aType == null) { - final CtType shadowClass = (CtType) this.shadowCache.get(cl); - if (shadowClass == null) { - CtType newShadowClass; - try { - newShadowClass = new JavaReflectionTreeBuilder(getShadowFactory()).scan((Class) cl); - } catch (Throwable e) { - Launcher.LOGGER.warn("cannot create shadow class: {}", cl.getName(), e); - - newShadowClass = getShadowFactory().Core().createClass(); - newShadowClass.setSimpleName(cl.getSimpleName()); - newShadowClass.setShadow(true); - getShadowFactory().Package().getOrCreate(cl.getPackage().getName()).addType(newShadowClass); - } - newShadowClass.setFactory(factory); - newShadowClass.accept(new CtScanner() { - @Override - public void scan(CtElement element) { - if (element != null) { - element.setFactory(factory); - } - } - }); - this.shadowCache.put(cl, newShadowClass); - return newShadowClass; - } else { - return shadowClass; - } + return (CtType) this.shadowCache.computeIfAbsent(cl, this::buildNewShadowClass); } return aType; } + private CtType buildNewShadowClass(Class cl) { + CtType newShadowClass; + try { + newShadowClass = new JavaReflectionTreeBuilder(getShadowFactory()).scan(cl); + } catch (Throwable e) { + Launcher.LOGGER.warn("cannot create shadow class: {}", cl.getName(), e); + + newShadowClass = getShadowFactory().Core().createClass(); + newShadowClass.setSimpleName(cl.getSimpleName()); + newShadowClass.setShadow(true); + getShadowFactory().Package().getOrCreate(cl.getPackage().getName()).addType(newShadowClass); + } + newShadowClass.setFactory(factory); + newShadowClass.accept(new CtScanner() { + @Override + public void scan(CtElement element) { + if (element != null) { + element.setFactory(factory); + } + } + }); + return newShadowClass; + } + private transient Factory shadowFactory; private Factory getShadowFactory() { if (shadowFactory == null) { diff --git a/src/main/java/spoon/reflect/factory/package-info.java b/src/main/java/spoon/reflect/factory/package-info.java index e7b5d0e9470..5bdbc5a0158 100644 --- a/src/main/java/spoon/reflect/factory/package-info.java +++ b/src/main/java/spoon/reflect/factory/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines all the sub-factories for the Spoon meta-model. diff --git a/src/main/java/spoon/reflect/meta/ContainerKind.java b/src/main/java/spoon/reflect/meta/ContainerKind.java index 8d314fa0d52..6918d50b56d 100644 --- a/src/main/java/spoon/reflect/meta/ContainerKind.java +++ b/src/main/java/spoon/reflect/meta/ContainerKind.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta; diff --git a/src/main/java/spoon/reflect/meta/RoleHandler.java b/src/main/java/spoon/reflect/meta/RoleHandler.java index 164969d70e4..77d8245930e 100644 --- a/src/main/java/spoon/reflect/meta/RoleHandler.java +++ b/src/main/java/spoon/reflect/meta/RoleHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta; diff --git a/src/main/java/spoon/reflect/meta/impl/AbstractRoleHandler.java b/src/main/java/spoon/reflect/meta/impl/AbstractRoleHandler.java index a6ab45359eb..7af9a1f3fe0 100644 --- a/src/main/java/spoon/reflect/meta/impl/AbstractRoleHandler.java +++ b/src/main/java/spoon/reflect/meta/impl/AbstractRoleHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta.impl; diff --git a/src/main/java/spoon/reflect/meta/impl/ListHandler.java b/src/main/java/spoon/reflect/meta/impl/ListHandler.java index 9523c547bcd..de0ac21643d 100644 --- a/src/main/java/spoon/reflect/meta/impl/ListHandler.java +++ b/src/main/java/spoon/reflect/meta/impl/ListHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta.impl; diff --git a/src/main/java/spoon/reflect/meta/impl/MapHandler.java b/src/main/java/spoon/reflect/meta/impl/MapHandler.java index 2d52ecdb62a..8a7f2c93064 100644 --- a/src/main/java/spoon/reflect/meta/impl/MapHandler.java +++ b/src/main/java/spoon/reflect/meta/impl/MapHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta.impl; diff --git a/src/main/java/spoon/reflect/meta/impl/ModelRoleHandlers.java b/src/main/java/spoon/reflect/meta/impl/ModelRoleHandlers.java index 43f92cefd05..935427e1252 100644 --- a/src/main/java/spoon/reflect/meta/impl/ModelRoleHandlers.java +++ b/src/main/java/spoon/reflect/meta/impl/ModelRoleHandlers.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta.impl; import java.lang.annotation.Annotation; diff --git a/src/main/java/spoon/reflect/meta/impl/RoleHandlerHelper.java b/src/main/java/spoon/reflect/meta/impl/RoleHandlerHelper.java index dec6d9aa6a4..d12d1cbf453 100644 --- a/src/main/java/spoon/reflect/meta/impl/RoleHandlerHelper.java +++ b/src/main/java/spoon/reflect/meta/impl/RoleHandlerHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta.impl; diff --git a/src/main/java/spoon/reflect/meta/impl/SetHandler.java b/src/main/java/spoon/reflect/meta/impl/SetHandler.java index da5d1ca7445..ca2a667fad8 100644 --- a/src/main/java/spoon/reflect/meta/impl/SetHandler.java +++ b/src/main/java/spoon/reflect/meta/impl/SetHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta.impl; diff --git a/src/main/java/spoon/reflect/meta/impl/SingleHandler.java b/src/main/java/spoon/reflect/meta/impl/SingleHandler.java index e151806da73..d61504a69d3 100644 --- a/src/main/java/spoon/reflect/meta/impl/SingleHandler.java +++ b/src/main/java/spoon/reflect/meta/impl/SingleHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.meta.impl; diff --git a/src/main/java/spoon/reflect/package-info.java b/src/main/java/spoon/reflect/package-info.java index a4121a5df73..4aad334bf37 100644 --- a/src/main/java/spoon/reflect/package-info.java +++ b/src/main/java/spoon/reflect/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines the Spoon's compile-time meta-model of Java programs. diff --git a/src/main/java/spoon/reflect/path/CtElementPathBuilder.java b/src/main/java/spoon/reflect/path/CtElementPathBuilder.java index ddbacb06081..5c39afe4e4e 100644 --- a/src/main/java/spoon/reflect/path/CtElementPathBuilder.java +++ b/src/main/java/spoon/reflect/path/CtElementPathBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path; diff --git a/src/main/java/spoon/reflect/path/CtPath.java b/src/main/java/spoon/reflect/path/CtPath.java index e50a5d95530..57e023ab4e2 100644 --- a/src/main/java/spoon/reflect/path/CtPath.java +++ b/src/main/java/spoon/reflect/path/CtPath.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path; diff --git a/src/main/java/spoon/reflect/path/CtPathBuilder.java b/src/main/java/spoon/reflect/path/CtPathBuilder.java index 29f49b2cdbe..d2e0a76c4d6 100644 --- a/src/main/java/spoon/reflect/path/CtPathBuilder.java +++ b/src/main/java/spoon/reflect/path/CtPathBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path; diff --git a/src/main/java/spoon/reflect/path/CtPathException.java b/src/main/java/spoon/reflect/path/CtPathException.java index d906ed8500f..b25269f76f4 100644 --- a/src/main/java/spoon/reflect/path/CtPathException.java +++ b/src/main/java/spoon/reflect/path/CtPathException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path; diff --git a/src/main/java/spoon/reflect/path/CtPathStringBuilder.java b/src/main/java/spoon/reflect/path/CtPathStringBuilder.java index 7082db76d81..8645360ee37 100644 --- a/src/main/java/spoon/reflect/path/CtPathStringBuilder.java +++ b/src/main/java/spoon/reflect/path/CtPathStringBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path; diff --git a/src/main/java/spoon/reflect/path/CtRole.java b/src/main/java/spoon/reflect/path/CtRole.java index 2b0f8d710ef..61a4028faed 100644 --- a/src/main/java/spoon/reflect/path/CtRole.java +++ b/src/main/java/spoon/reflect/path/CtRole.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path; diff --git a/src/main/java/spoon/reflect/path/impl/AbstractPathElement.java b/src/main/java/spoon/reflect/path/impl/AbstractPathElement.java index bf3918daf60..9232f08f011 100644 --- a/src/main/java/spoon/reflect/path/impl/AbstractPathElement.java +++ b/src/main/java/spoon/reflect/path/impl/AbstractPathElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path.impl; diff --git a/src/main/java/spoon/reflect/path/impl/CtNamedPathElement.java b/src/main/java/spoon/reflect/path/impl/CtNamedPathElement.java index 98e24b97700..39d47d35fe5 100644 --- a/src/main/java/spoon/reflect/path/impl/CtNamedPathElement.java +++ b/src/main/java/spoon/reflect/path/impl/CtNamedPathElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path.impl; diff --git a/src/main/java/spoon/reflect/path/impl/CtPathElement.java b/src/main/java/spoon/reflect/path/impl/CtPathElement.java index 9761d5707eb..50b4ebf6582 100644 --- a/src/main/java/spoon/reflect/path/impl/CtPathElement.java +++ b/src/main/java/spoon/reflect/path/impl/CtPathElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path.impl; diff --git a/src/main/java/spoon/reflect/path/impl/CtPathImpl.java b/src/main/java/spoon/reflect/path/impl/CtPathImpl.java index a178f68c433..ab065d1ff0b 100644 --- a/src/main/java/spoon/reflect/path/impl/CtPathImpl.java +++ b/src/main/java/spoon/reflect/path/impl/CtPathImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path.impl; diff --git a/src/main/java/spoon/reflect/path/impl/CtRolePathElement.java b/src/main/java/spoon/reflect/path/impl/CtRolePathElement.java index e116adac0dc..ab7c146a10a 100644 --- a/src/main/java/spoon/reflect/path/impl/CtRolePathElement.java +++ b/src/main/java/spoon/reflect/path/impl/CtRolePathElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path.impl; diff --git a/src/main/java/spoon/reflect/path/impl/CtTypedNameElement.java b/src/main/java/spoon/reflect/path/impl/CtTypedNameElement.java index d9602ae90be..1e48334800c 100644 --- a/src/main/java/spoon/reflect/path/impl/CtTypedNameElement.java +++ b/src/main/java/spoon/reflect/path/impl/CtTypedNameElement.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.path.impl; diff --git a/src/main/java/spoon/reflect/reference/CtActualTypeContainer.java b/src/main/java/spoon/reflect/reference/CtActualTypeContainer.java index 51582029c5d..1df34afbeaf 100644 --- a/src/main/java/spoon/reflect/reference/CtActualTypeContainer.java +++ b/src/main/java/spoon/reflect/reference/CtActualTypeContainer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtArrayTypeReference.java b/src/main/java/spoon/reflect/reference/CtArrayTypeReference.java index 437017eb3aa..c803accc606 100644 --- a/src/main/java/spoon/reflect/reference/CtArrayTypeReference.java +++ b/src/main/java/spoon/reflect/reference/CtArrayTypeReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtCatchVariableReference.java b/src/main/java/spoon/reflect/reference/CtCatchVariableReference.java index 8a69622e8f6..3a072bfa397 100644 --- a/src/main/java/spoon/reflect/reference/CtCatchVariableReference.java +++ b/src/main/java/spoon/reflect/reference/CtCatchVariableReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtExecutableReference.java b/src/main/java/spoon/reflect/reference/CtExecutableReference.java index 5088b06c40e..6eaed52c466 100644 --- a/src/main/java/spoon/reflect/reference/CtExecutableReference.java +++ b/src/main/java/spoon/reflect/reference/CtExecutableReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtFieldReference.java b/src/main/java/spoon/reflect/reference/CtFieldReference.java index d8686b007d5..a85074d2262 100644 --- a/src/main/java/spoon/reflect/reference/CtFieldReference.java +++ b/src/main/java/spoon/reflect/reference/CtFieldReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtIntersectionTypeReference.java b/src/main/java/spoon/reflect/reference/CtIntersectionTypeReference.java index 8eb490b375c..10c167be377 100644 --- a/src/main/java/spoon/reflect/reference/CtIntersectionTypeReference.java +++ b/src/main/java/spoon/reflect/reference/CtIntersectionTypeReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtLocalVariableReference.java b/src/main/java/spoon/reflect/reference/CtLocalVariableReference.java index c662753aae2..78e39384763 100644 --- a/src/main/java/spoon/reflect/reference/CtLocalVariableReference.java +++ b/src/main/java/spoon/reflect/reference/CtLocalVariableReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtModuleReference.java b/src/main/java/spoon/reflect/reference/CtModuleReference.java index 433bd0329f5..cdc98a7e824 100644 --- a/src/main/java/spoon/reflect/reference/CtModuleReference.java +++ b/src/main/java/spoon/reflect/reference/CtModuleReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtPackageReference.java b/src/main/java/spoon/reflect/reference/CtPackageReference.java index 7234ea655e0..95fc7495521 100644 --- a/src/main/java/spoon/reflect/reference/CtPackageReference.java +++ b/src/main/java/spoon/reflect/reference/CtPackageReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtParameterReference.java b/src/main/java/spoon/reflect/reference/CtParameterReference.java index 65d00b1d8f2..d998ba8f580 100644 --- a/src/main/java/spoon/reflect/reference/CtParameterReference.java +++ b/src/main/java/spoon/reflect/reference/CtParameterReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtReference.java b/src/main/java/spoon/reflect/reference/CtReference.java index f86d1fad326..4b128a6f426 100644 --- a/src/main/java/spoon/reflect/reference/CtReference.java +++ b/src/main/java/spoon/reflect/reference/CtReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtTypeMemberWildcardImportReference.java b/src/main/java/spoon/reflect/reference/CtTypeMemberWildcardImportReference.java index b29544c9b98..1f35ca2e834 100644 --- a/src/main/java/spoon/reflect/reference/CtTypeMemberWildcardImportReference.java +++ b/src/main/java/spoon/reflect/reference/CtTypeMemberWildcardImportReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtTypeParameterReference.java b/src/main/java/spoon/reflect/reference/CtTypeParameterReference.java index 6366033f12d..3b2c72d48a5 100644 --- a/src/main/java/spoon/reflect/reference/CtTypeParameterReference.java +++ b/src/main/java/spoon/reflect/reference/CtTypeParameterReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtTypeReference.java b/src/main/java/spoon/reflect/reference/CtTypeReference.java index 116e4ed7f59..bb3d73f29f7 100644 --- a/src/main/java/spoon/reflect/reference/CtTypeReference.java +++ b/src/main/java/spoon/reflect/reference/CtTypeReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtUnboundVariableReference.java b/src/main/java/spoon/reflect/reference/CtUnboundVariableReference.java index e2ee369df61..7ee747ea7b1 100644 --- a/src/main/java/spoon/reflect/reference/CtUnboundVariableReference.java +++ b/src/main/java/spoon/reflect/reference/CtUnboundVariableReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtVariableReference.java b/src/main/java/spoon/reflect/reference/CtVariableReference.java index 8f1cd1559a4..c8250d8946b 100644 --- a/src/main/java/spoon/reflect/reference/CtVariableReference.java +++ b/src/main/java/spoon/reflect/reference/CtVariableReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/CtWildcardReference.java b/src/main/java/spoon/reflect/reference/CtWildcardReference.java index fdb500e2a84..8b8d2a8a5ae 100644 --- a/src/main/java/spoon/reflect/reference/CtWildcardReference.java +++ b/src/main/java/spoon/reflect/reference/CtWildcardReference.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.reference; diff --git a/src/main/java/spoon/reflect/reference/package-info.java b/src/main/java/spoon/reflect/reference/package-info.java index 0da70fa8945..1a35bef6dab 100644 --- a/src/main/java/spoon/reflect/reference/package-info.java +++ b/src/main/java/spoon/reflect/reference/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines the references to program elements for the meta-model.

diff --git a/src/main/java/spoon/reflect/visitor/AccessibleVariablesFinder.java b/src/main/java/spoon/reflect/visitor/AccessibleVariablesFinder.java index 0648681fc53..33d07826e63 100644 --- a/src/main/java/spoon/reflect/visitor/AccessibleVariablesFinder.java +++ b/src/main/java/spoon/reflect/visitor/AccessibleVariablesFinder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/AstParentConsistencyChecker.java b/src/main/java/spoon/reflect/visitor/AstParentConsistencyChecker.java index dffadc4ea75..6188a04d727 100644 --- a/src/main/java/spoon/reflect/visitor/AstParentConsistencyChecker.java +++ b/src/main/java/spoon/reflect/visitor/AstParentConsistencyChecker.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CacheBasedConflictFinder.java b/src/main/java/spoon/reflect/visitor/CacheBasedConflictFinder.java index 01f5714d18c..2916769881b 100644 --- a/src/main/java/spoon/reflect/visitor/CacheBasedConflictFinder.java +++ b/src/main/java/spoon/reflect/visitor/CacheBasedConflictFinder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/Child.java b/src/main/java/spoon/reflect/visitor/Child.java index 4b1075f6504..5721f4a6ae5 100644 --- a/src/main/java/spoon/reflect/visitor/Child.java +++ b/src/main/java/spoon/reflect/visitor/Child.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CommentHelper.java b/src/main/java/spoon/reflect/visitor/CommentHelper.java index a9f65cce8d2..d88f6d7a924 100644 --- a/src/main/java/spoon/reflect/visitor/CommentHelper.java +++ b/src/main/java/spoon/reflect/visitor/CommentHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtAbstractBiScanner.java b/src/main/java/spoon/reflect/visitor/CtAbstractBiScanner.java index 2151fb0c3ff..f479902e317 100644 --- a/src/main/java/spoon/reflect/visitor/CtAbstractBiScanner.java +++ b/src/main/java/spoon/reflect/visitor/CtAbstractBiScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtAbstractImportVisitor.java b/src/main/java/spoon/reflect/visitor/CtAbstractImportVisitor.java index ed4c59cf4e8..15dfa4559a0 100644 --- a/src/main/java/spoon/reflect/visitor/CtAbstractImportVisitor.java +++ b/src/main/java/spoon/reflect/visitor/CtAbstractImportVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtAbstractVisitor.java b/src/main/java/spoon/reflect/visitor/CtAbstractVisitor.java index f264928ef78..d3ee98551d7 100644 --- a/src/main/java/spoon/reflect/visitor/CtAbstractVisitor.java +++ b/src/main/java/spoon/reflect/visitor/CtAbstractVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtBFSIterator.java b/src/main/java/spoon/reflect/visitor/CtBFSIterator.java index f51c3533117..0f997c9e95e 100644 --- a/src/main/java/spoon/reflect/visitor/CtBFSIterator.java +++ b/src/main/java/spoon/reflect/visitor/CtBFSIterator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtBiScannerDefault.java b/src/main/java/spoon/reflect/visitor/CtBiScannerDefault.java index 47a75466b8d..e92f980377a 100644 --- a/src/main/java/spoon/reflect/visitor/CtBiScannerDefault.java +++ b/src/main/java/spoon/reflect/visitor/CtBiScannerDefault.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; /** diff --git a/src/main/java/spoon/reflect/visitor/CtDequeScanner.java b/src/main/java/spoon/reflect/visitor/CtDequeScanner.java index 8a3e32de573..e3c8b397f97 100644 --- a/src/main/java/spoon/reflect/visitor/CtDequeScanner.java +++ b/src/main/java/spoon/reflect/visitor/CtDequeScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtImportVisitor.java b/src/main/java/spoon/reflect/visitor/CtImportVisitor.java index 77aeb306a79..00f23f009cd 100644 --- a/src/main/java/spoon/reflect/visitor/CtImportVisitor.java +++ b/src/main/java/spoon/reflect/visitor/CtImportVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtInheritanceScanner.java b/src/main/java/spoon/reflect/visitor/CtInheritanceScanner.java index 825d9f3553b..1f649de0f47 100644 --- a/src/main/java/spoon/reflect/visitor/CtInheritanceScanner.java +++ b/src/main/java/spoon/reflect/visitor/CtInheritanceScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtIterator.java b/src/main/java/spoon/reflect/visitor/CtIterator.java index 55d76aa7a74..f31af2c0f9a 100644 --- a/src/main/java/spoon/reflect/visitor/CtIterator.java +++ b/src/main/java/spoon/reflect/visitor/CtIterator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtScanner.java b/src/main/java/spoon/reflect/visitor/CtScanner.java index a7f960fcfb5..5725a6a8d04 100644 --- a/src/main/java/spoon/reflect/visitor/CtScanner.java +++ b/src/main/java/spoon/reflect/visitor/CtScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtVisitable.java b/src/main/java/spoon/reflect/visitor/CtVisitable.java index dd59f30d7c0..287aa3e8d93 100644 --- a/src/main/java/spoon/reflect/visitor/CtVisitable.java +++ b/src/main/java/spoon/reflect/visitor/CtVisitable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/CtVisitor.java b/src/main/java/spoon/reflect/visitor/CtVisitor.java index 2365723793b..383ca6b21dd 100644 --- a/src/main/java/spoon/reflect/visitor/CtVisitor.java +++ b/src/main/java/spoon/reflect/visitor/CtVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/DefaultImportComparator.java b/src/main/java/spoon/reflect/visitor/DefaultImportComparator.java index 163efc07d67..16f1e246bc9 100644 --- a/src/main/java/spoon/reflect/visitor/DefaultImportComparator.java +++ b/src/main/java/spoon/reflect/visitor/DefaultImportComparator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java b/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java index ede37c5002c..0cd0048eb3e 100644 --- a/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java +++ b/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/DefaultTokenWriter.java b/src/main/java/spoon/reflect/visitor/DefaultTokenWriter.java index bafd6fa2e91..1c221d368ce 100644 --- a/src/main/java/spoon/reflect/visitor/DefaultTokenWriter.java +++ b/src/main/java/spoon/reflect/visitor/DefaultTokenWriter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/EarlyTerminatingScanner.java b/src/main/java/spoon/reflect/visitor/EarlyTerminatingScanner.java index 54eeaf90164..fa9f9baebfc 100644 --- a/src/main/java/spoon/reflect/visitor/EarlyTerminatingScanner.java +++ b/src/main/java/spoon/reflect/visitor/EarlyTerminatingScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ElementPrinterHelper.java b/src/main/java/spoon/reflect/visitor/ElementPrinterHelper.java index 6ae8cf14e69..a7ea652182d 100644 --- a/src/main/java/spoon/reflect/visitor/ElementPrinterHelper.java +++ b/src/main/java/spoon/reflect/visitor/ElementPrinterHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/Filter.java b/src/main/java/spoon/reflect/visitor/Filter.java index 928fa1f45a4..513536a7be0 100644 --- a/src/main/java/spoon/reflect/visitor/Filter.java +++ b/src/main/java/spoon/reflect/visitor/Filter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ForceFullyQualifiedProcessor.java b/src/main/java/spoon/reflect/visitor/ForceFullyQualifiedProcessor.java index d16199b5faf..1cb703dc01e 100644 --- a/src/main/java/spoon/reflect/visitor/ForceFullyQualifiedProcessor.java +++ b/src/main/java/spoon/reflect/visitor/ForceFullyQualifiedProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ForceImportProcessor.java b/src/main/java/spoon/reflect/visitor/ForceImportProcessor.java index 3fba16d8697..6341a88c295 100644 --- a/src/main/java/spoon/reflect/visitor/ForceImportProcessor.java +++ b/src/main/java/spoon/reflect/visitor/ForceImportProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ImportAnalyzer.java b/src/main/java/spoon/reflect/visitor/ImportAnalyzer.java index a71a6541288..9aa2dddd087 100644 --- a/src/main/java/spoon/reflect/visitor/ImportAnalyzer.java +++ b/src/main/java/spoon/reflect/visitor/ImportAnalyzer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ImportCleaner.java b/src/main/java/spoon/reflect/visitor/ImportCleaner.java index b79b1db2bdb..83106f249ac 100644 --- a/src/main/java/spoon/reflect/visitor/ImportCleaner.java +++ b/src/main/java/spoon/reflect/visitor/ImportCleaner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ImportConflictDetector.java b/src/main/java/spoon/reflect/visitor/ImportConflictDetector.java index badeb209005..bcfd41ec18a 100644 --- a/src/main/java/spoon/reflect/visitor/ImportConflictDetector.java +++ b/src/main/java/spoon/reflect/visitor/ImportConflictDetector.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ImportScanner.java b/src/main/java/spoon/reflect/visitor/ImportScanner.java index 79dc75cb446..5c77aea0636 100644 --- a/src/main/java/spoon/reflect/visitor/ImportScanner.java +++ b/src/main/java/spoon/reflect/visitor/ImportScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ImportScannerImpl.java b/src/main/java/spoon/reflect/visitor/ImportScannerImpl.java index b90c7ab6331..c4c026cae8e 100644 --- a/src/main/java/spoon/reflect/visitor/ImportScannerImpl.java +++ b/src/main/java/spoon/reflect/visitor/ImportScannerImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/JavaIdentifiers.java b/src/main/java/spoon/reflect/visitor/JavaIdentifiers.java index d8f38a96d8a..645fc2e2860 100644 --- a/src/main/java/spoon/reflect/visitor/JavaIdentifiers.java +++ b/src/main/java/spoon/reflect/visitor/JavaIdentifiers.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/LexicalScope.java b/src/main/java/spoon/reflect/visitor/LexicalScope.java index 7e689ecbb3c..6a5dccc6646 100644 --- a/src/main/java/spoon/reflect/visitor/LexicalScope.java +++ b/src/main/java/spoon/reflect/visitor/LexicalScope.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/LexicalScopeScanner.java b/src/main/java/spoon/reflect/visitor/LexicalScopeScanner.java index a7b089ed709..0872a006c89 100644 --- a/src/main/java/spoon/reflect/visitor/LexicalScopeScanner.java +++ b/src/main/java/spoon/reflect/visitor/LexicalScopeScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/ListPrinter.java b/src/main/java/spoon/reflect/visitor/ListPrinter.java index a3c76869440..d65496b70cd 100644 --- a/src/main/java/spoon/reflect/visitor/ListPrinter.java +++ b/src/main/java/spoon/reflect/visitor/ListPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/LiteralHelper.java b/src/main/java/spoon/reflect/visitor/LiteralHelper.java index 74dbf844752..616e361cec6 100644 --- a/src/main/java/spoon/reflect/visitor/LiteralHelper.java +++ b/src/main/java/spoon/reflect/visitor/LiteralHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; @@ -99,7 +99,7 @@ public static String getLiteralToken(CtLiteral literal) { } StringBuilder sb = new StringBuilder(10); sb.append('\''); - appendCharLiteral(sb, (Character) literal.getValue(), mayContainsSpecialCharacter); + appendCharLiteral(sb, (Character) literal.getValue(), mayContainsSpecialCharacter, false); sb.append('\''); return sb.toString(); } else if (literal.getValue() instanceof String) { @@ -120,7 +120,7 @@ public static String getLiteralToken(CtLiteral literal) { } } - static void appendCharLiteral(StringBuilder sb, Character c, boolean mayContainsSpecialCharacter) { + static void appendCharLiteral(StringBuilder sb, Character c, boolean mayContainsSpecialCharacter, boolean isInsideString) { if (!mayContainsSpecialCharacter) { sb.append(c); } else { @@ -144,7 +144,11 @@ static void appendCharLiteral(StringBuilder sb, Character c, boolean mayContains sb.append("\\\""); //$NON-NLS-1$ break; case '\'': - sb.append("\\'"); //$NON-NLS-1$ + if (isInsideString) { + sb.append("'"); //$NON-NLS-1$ + } else { + sb.append("\\'"); //$NON-NLS-1$ + } break; case '\\': // take care not to display the escape as a potential // real char @@ -159,12 +163,11 @@ static void appendCharLiteral(StringBuilder sb, Character c, boolean mayContains static String getStringLiteral(String value, boolean mayContainsSpecialCharacter) { if (!mayContainsSpecialCharacter) { return value; - } else { - StringBuilder sb = new StringBuilder(value.length() * 2); - for (int i = 0; i < value.length(); i++) { - appendCharLiteral(sb, value.charAt(i), mayContainsSpecialCharacter); - } - return sb.toString(); } + StringBuilder sb = new StringBuilder(value.length() * 2); + for (int i = 0; i < value.length(); i++) { + appendCharLiteral(sb, value.charAt(i), true, true); + } + return sb.toString(); } } diff --git a/src/main/java/spoon/reflect/visitor/ModelConsistencyChecker.java b/src/main/java/spoon/reflect/visitor/ModelConsistencyChecker.java index fa7cb10b81a..7415990af0d 100644 --- a/src/main/java/spoon/reflect/visitor/ModelConsistencyChecker.java +++ b/src/main/java/spoon/reflect/visitor/ModelConsistencyChecker.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/NameScopeImpl.java b/src/main/java/spoon/reflect/visitor/NameScopeImpl.java index 1c1be257af8..8613b8fa2a5 100644 --- a/src/main/java/spoon/reflect/visitor/NameScopeImpl.java +++ b/src/main/java/spoon/reflect/visitor/NameScopeImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/OperatorHelper.java b/src/main/java/spoon/reflect/visitor/OperatorHelper.java index 29f568f3349..b27d015ff6b 100644 --- a/src/main/java/spoon/reflect/visitor/OperatorHelper.java +++ b/src/main/java/spoon/reflect/visitor/OperatorHelper.java @@ -1,20 +1,29 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; import spoon.SpoonException; import spoon.reflect.code.BinaryOperatorKind; +import spoon.reflect.code.CtExpression; +import spoon.reflect.code.CtVariableRead; import spoon.reflect.code.UnaryOperatorKind; +import spoon.reflect.factory.TypeFactory; +import spoon.reflect.reference.CtTypeReference; +import spoon.support.Internal; + +import java.util.Optional; +import java.util.Set; /** * Computes source code representation of the operator */ -class OperatorHelper { +@Internal +public final class OperatorHelper { public enum OperatorAssociativity { LEFT, RIGHT, NONE @@ -23,14 +32,28 @@ public enum OperatorAssociativity { private OperatorHelper() { } + /** + * Checks if the operator is a prefix operator. + * @param o the operator + * @return true if it is a prefix operator, false otherwise + */ public static boolean isPrefixOperator(UnaryOperatorKind o) { return !isSufixOperator(o); } + + /** + * Checks if the operator is a suffix operator. + * @param o the operator + * @return true if it is a suffix operator, false otherwise + */ public static boolean isSufixOperator(UnaryOperatorKind o) { return o.name().startsWith("POST"); } /** + * Gets the representation of the operator in the source code. For example, POS will return "+". + * + * @param o the operator * @return java source code representation of a pre or post unary operator. */ public static String getOperatorText(UnaryOperatorKind o) { @@ -57,6 +80,9 @@ public static String getOperatorText(UnaryOperatorKind o) { } /** + * Gets the representation of the operator in the source code. For example, OR will return "||". + * + * @param o the operator * @return java source code representation of a binary operator. */ public static String getOperatorText(BinaryOperatorKind o) { @@ -219,4 +245,304 @@ public static OperatorAssociativity getOperatorAssociativity(UnaryOperatorKind o return OperatorAssociativity.RIGHT; } } + + private static final Set> WHOLE_NUMBERS = Set.of( + byte.class, + short.class, + int.class, + long.class + ); + + private static final Set> NUMBERS_PROMOTED_TO_INT = Set.of( + byte.class, + short.class, + char.class + ); + + private static boolean isIntegralType(CtTypeReference ctTypeReference) { + return ctTypeReference.isPrimitive() + // see https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.2.1 + && (WHOLE_NUMBERS.contains(ctTypeReference.getActualClass()) || ctTypeReference.getActualClass().equals(char.class)); + } + + private static boolean isNumericType(CtTypeReference ctTypeReference) { + return ctTypeReference.isPrimitive() && !ctTypeReference.getActualClass().equals(boolean.class); + } + + /** + * When using an unary-operator on an operand, the operand type might be changed before the operator is applied. + * For example, the result of {@code ~((short) 1)} will be of type {@code int} and not {@code short}. + * + * @param operand the operand to apply the operator on + * @return the type after applying the operator or {@link Optional#empty()} if promotion does not apply + */ + private static Optional> unaryNumericPromotion(CtExpression operand) { + // if the operand is of type Byte, Short, Character, Integer, Long, Float, or Double it is subject + // to unboxing (§5.1.8) + CtTypeReference operandType = operand.getType().unbox(); + // check if unary numeric promotion applies + if (!isNumericType(operandType)) { + return Optional.empty(); + } + + // if the operand is of type byte, short, or char, it is promoted to a value of type int by a widening + // primitive conversion (§5.1.2). + if (NUMBERS_PROMOTED_TO_INT.contains(operandType.getActualClass())) { + return Optional.of(operandType.getFactory().Type().INTEGER_PRIMITIVE); + } + + // otherwise, the operand is not converted at all. + return Optional.of(operandType); + } + + private static Optional> binaryNumericPromotion( + CtExpression left, + CtExpression right + ) { + // If any operand is of a reference type, it is subjected to unboxing conversion (§5.1.8). + CtTypeReference leftType = left.getType().unbox(); + CtTypeReference rightType = right.getType().unbox(); + TypeFactory typeFactory = leftType.getFactory().Type(); + + // each of which must denote a value that is convertible to a numeric type + if (!isNumericType(leftType) || !isNumericType(rightType)) { + return Optional.empty(); + } + + CtTypeReference doubleType = typeFactory.DOUBLE_PRIMITIVE; + // If either operand is of type double, the other is converted to double. + if (leftType.equals(doubleType) || rightType.equals(doubleType)) { + return Optional.of(doubleType); + } + + // Otherwise, if either operand is of type float, the other is converted to float. + CtTypeReference floatType = typeFactory.FLOAT_PRIMITIVE; + if (leftType.equals(floatType) || rightType.equals(floatType)) { + return Optional.of(floatType); + } + + // Otherwise, if either operand is of type long, the other is converted to long. + CtTypeReference longType = typeFactory.LONG_PRIMITIVE; + if (leftType.equals(longType) || rightType.equals(longType)) { + return Optional.of(longType); + } + + // Otherwise, both operands are converted to type int. + return Optional.of(typeFactory.INTEGER_PRIMITIVE); + } + + /** + * Get the promoted type of the binary operator, as defined by the Java Language Specification. + *

+ * Before an operator is applied, the type of the operands might be changed. + * This is called promotion. + * For example {@code 1 + 1.0} has an int and a double as operands. + * The left operand is promoted to a double, so that the left and right operand have the same type. + * + * @param operator the operator + * @param left the left operand, {@link CtExpression#getFactory()} must not return {@code null}. + * @param right the right operand + * @return the promoted type or {@link Optional#empty()} if promotion does not apply or the operation is invalid. + * Not every operator is defined for every combination of operands. + * For example {@code 1 << 1.0} is invalid. + * In this case, {@link Optional#empty()} is returned. + * @throws UnsupportedOperationException if the operator is {@link BinaryOperatorKind#INSTANCEOF} or an unknown operator. + * @see JLS 5.6.2 + */ + public static Optional> getPromotedType( + BinaryOperatorKind operator, + CtExpression left, + CtExpression right + ) { + TypeFactory typeFactory = left.getFactory().Type(); + switch (operator) { + // logical operators + case AND: + case OR: { + CtTypeReference booleanType = typeFactory.BOOLEAN_PRIMITIVE; + if (!left.getType().equals(booleanType) || !right.getType().equals(booleanType)) { + return Optional.empty(); + } + + return Optional.of(booleanType); + } + // shift operators are special: + case SL: + case SR: + case USR: { + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.19 + // on each operand unary numeric promotion is performed + CtTypeReference promotedLeft = unaryNumericPromotion(left).orElse(null); + CtTypeReference promotedRight = unaryNumericPromotion(right).orElse(null); + + if (promotedLeft == null || promotedRight == null) { + return Optional.empty(); + } + + // after promotion, both operands have to be an integral type: + if (!isIntegralType(promotedLeft) || !isIntegralType(promotedRight)) { + return Optional.empty(); + } + + // The type of the shift expression is the promoted type of the left-hand operand. + return Optional.of(promotedLeft); + } + case INSTANCEOF: + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.20.2 + // Not implemented, because it is not necessary for the current use case. + throw new UnsupportedOperationException("instanceof is not yet implemented"); + // on the following operators binary numeric promotion is performed: + case EQ: + case NE: { + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.21 + CtTypeReference leftType = left.getType().unbox(); + CtTypeReference rightType = right.getType().unbox(); + + // The equality operators may be used to compare two operands that are convertible (§5.1.8) + // to numeric type, or two operands of type boolean or Boolean, or two operands that are each + // of either reference type or the null type. All other cases result in a compile-time error. + CtTypeReference booleanType = typeFactory.BOOLEAN_PRIMITIVE; + return binaryNumericPromotion(left, right).or(() -> { + // check if both operands are of type boolean or Boolean + // if so they will be promoted to the primitive type boolean + if (leftType.equals(rightType) && leftType.equals(booleanType)) { + return Optional.of(booleanType); + } + + // if both operands are of a reference type + if (!leftType.isPrimitive() && !rightType.isPrimitive()) { + // It is a compile-time error if it is impossible to convert the type of + // either operand to the type of the other by a casting conversion (§5.5). + // The run-time values of the two operands would necessarily be unequal + // (ignoring the case where both values are null). + CtTypeReference nullType = typeFactory.NULL_TYPE; + if (leftType.equals(nullType)) { + return Optional.of(rightType); + } + + if (rightType.equals(nullType)) { + return Optional.of(leftType); + } + + if (leftType.isSubtypeOf(rightType)) { + return Optional.of(rightType); + } + + if (rightType.isSubtypeOf(leftType)) { + return Optional.of(rightType); + } + + return Optional.empty(); + } + + return Optional.empty(); + }); + } + case LT: + case LE: + case GT: + case GE: + case MUL: + case DIV: + case MOD: + case MINUS: + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.20 + return binaryNumericPromotion(left, right); + case PLUS: + return binaryNumericPromotion(left, right).or(() -> { + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.18.1 + // + // If the type of either operand of a + operator is String, then the operation is + // string concatenation. + CtTypeReference stringType = typeFactory.STRING; + if (left.getType().equals(stringType) || right.getType().equals(stringType)) { + return Optional.of(stringType); + } + + return Optional.empty(); + }); + case BITAND: + case BITXOR: + case BITOR: { + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.22 + CtTypeReference leftType = left.getType().unbox(); + CtTypeReference rightType = right.getType().unbox(); + + Set> floatingPointNumbers = Set.of( + typeFactory.FLOAT_PRIMITIVE, + typeFactory.DOUBLE_PRIMITIVE + ); + if (floatingPointNumbers.contains(leftType) || floatingPointNumbers.contains(rightType)) { + return Optional.empty(); + } + + if (leftType.equals(rightType) && leftType.equals(typeFactory.BOOLEAN_PRIMITIVE)) { + return Optional.of(leftType); + } + + return binaryNumericPromotion(left, right); + } + default: + throw new UnsupportedOperationException("Unknown operator: " + operator); + } + } + + /** + * Gets the promoted type of the unary operator, as defined by the Java Language Specification. + *

+ * Before an operator is applied, the type of the operand might be changed. + * This is called promotion. + * For example {@code -((short) 1)} has an operand of type short. + * The operand is promoted to an int, before the operator is applied. + * + * @param operator the operator + * @param operand the operand, {@link CtExpression#getFactory()} must not return {@code null}. + * @return the promoted type or {@link Optional#empty()} if promotion does not apply or the operation is invalid. + * Not every operator is defined for every combination of operands. + * For example {@code !1} is invalid. + * In this case, {@link Optional#empty()} is returned. + * @throws UnsupportedOperationException if the operator is an unknown operator. + * @see JLS 5.6.1 + */ + public static Optional> getPromotedType( + UnaryOperatorKind operator, + CtExpression operand + ) { + TypeFactory typeFactory = operand.getFactory().Type(); + CtTypeReference operandType = operand.getType(); + switch (operator) { + case COMPL: + if (isIntegralType(operandType.unbox())) { + return unaryNumericPromotion(operand); + } + + return Optional.empty(); + case POS: + case NEG: + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.15.3 + return unaryNumericPromotion(operand); + case NOT: + if (operand.getType().unbox().equals(typeFactory.BOOLEAN_PRIMITIVE)) { + return Optional.of(typeFactory.BOOLEAN_PRIMITIVE); + } + + return Optional.empty(); + case PREINC: + case PREDEC: + case POSTINC: + case POSTDEC: + // See: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.15.2 + // (documentation is very similar for all four operators) + + // The type of the operand must be a variable that is convertible to a numeric type. + if (!(operand instanceof CtVariableRead) || !isNumericType(operandType.unbox())) { + return Optional.empty(); + } + + // The type of the expression is the type of the variable. + return Optional.of(operandType); + default: + throw new UnsupportedOperationException("Unknown operator: " + operator); + } + } } diff --git a/src/main/java/spoon/reflect/visitor/Parent.java b/src/main/java/spoon/reflect/visitor/Parent.java index 844968331e8..e3570ec341a 100644 --- a/src/main/java/spoon/reflect/visitor/Parent.java +++ b/src/main/java/spoon/reflect/visitor/Parent.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/PrettyPrinter.java b/src/main/java/spoon/reflect/visitor/PrettyPrinter.java index 21a3cfd011a..b4324c9490b 100644 --- a/src/main/java/spoon/reflect/visitor/PrettyPrinter.java +++ b/src/main/java/spoon/reflect/visitor/PrettyPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/PrinterHelper.java b/src/main/java/spoon/reflect/visitor/PrinterHelper.java index 3f358fea2c2..44140034d74 100644 --- a/src/main/java/spoon/reflect/visitor/PrinterHelper.java +++ b/src/main/java/spoon/reflect/visitor/PrinterHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/PrintingContext.java b/src/main/java/spoon/reflect/visitor/PrintingContext.java index 9668bc5e3a1..0307c9b1c84 100644 --- a/src/main/java/spoon/reflect/visitor/PrintingContext.java +++ b/src/main/java/spoon/reflect/visitor/PrintingContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/Query.java b/src/main/java/spoon/reflect/visitor/Query.java index 8e6e75ba042..0ce2601242c 100644 --- a/src/main/java/spoon/reflect/visitor/Query.java +++ b/src/main/java/spoon/reflect/visitor/Query.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/Root.java b/src/main/java/spoon/reflect/visitor/Root.java index 5c68d6d0168..c3d1c0fd895 100644 --- a/src/main/java/spoon/reflect/visitor/Root.java +++ b/src/main/java/spoon/reflect/visitor/Root.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/RoundBracketAnalyzer.java b/src/main/java/spoon/reflect/visitor/RoundBracketAnalyzer.java index 571b4220e17..7ec44595f1f 100644 --- a/src/main/java/spoon/reflect/visitor/RoundBracketAnalyzer.java +++ b/src/main/java/spoon/reflect/visitor/RoundBracketAnalyzer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/TokenWriter.java b/src/main/java/spoon/reflect/visitor/TokenWriter.java index c88276428d3..e198bab0fd0 100644 --- a/src/main/java/spoon/reflect/visitor/TokenWriter.java +++ b/src/main/java/spoon/reflect/visitor/TokenWriter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/TypeNameScope.java b/src/main/java/spoon/reflect/visitor/TypeNameScope.java index 4ad4882a1f3..72974ef14ab 100644 --- a/src/main/java/spoon/reflect/visitor/TypeNameScope.java +++ b/src/main/java/spoon/reflect/visitor/TypeNameScope.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtConsumableFunction.java b/src/main/java/spoon/reflect/visitor/chain/CtConsumableFunction.java index 4164687102d..8b74bbd19bc 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtConsumableFunction.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtConsumableFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtConsumer.java b/src/main/java/spoon/reflect/visitor/chain/CtConsumer.java index 074e68cfa36..42a62e1e56d 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtConsumer.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtConsumer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtFunction.java b/src/main/java/spoon/reflect/visitor/chain/CtFunction.java index 0ef5d9769c6..777ada01405 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtFunction.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtQuery.java b/src/main/java/spoon/reflect/visitor/chain/CtQuery.java index fd892f77797..75a3af27332 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtQuery.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtQuery.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtQueryAware.java b/src/main/java/spoon/reflect/visitor/chain/CtQueryAware.java index 1e6d0206f4a..7ba7ae063d2 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtQueryAware.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtQueryAware.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtQueryImpl.java b/src/main/java/spoon/reflect/visitor/chain/CtQueryImpl.java index fe98c265af6..a7fd868a39c 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtQueryImpl.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtQueryImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtQueryable.java b/src/main/java/spoon/reflect/visitor/chain/CtQueryable.java index 6ef65737e3e..0c5f9c0b72e 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtQueryable.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtQueryable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/CtScannerListener.java b/src/main/java/spoon/reflect/visitor/chain/CtScannerListener.java index 7b184b64e40..f698eec5c7c 100644 --- a/src/main/java/spoon/reflect/visitor/chain/CtScannerListener.java +++ b/src/main/java/spoon/reflect/visitor/chain/CtScannerListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/QueryFailurePolicy.java b/src/main/java/spoon/reflect/visitor/chain/QueryFailurePolicy.java index 9918d88c2e3..81aa9d30a18 100644 --- a/src/main/java/spoon/reflect/visitor/chain/QueryFailurePolicy.java +++ b/src/main/java/spoon/reflect/visitor/chain/QueryFailurePolicy.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/chain/ScanningMode.java b/src/main/java/spoon/reflect/visitor/chain/ScanningMode.java index 19ae353ec8e..8508bae2c81 100644 --- a/src/main/java/spoon/reflect/visitor/chain/ScanningMode.java +++ b/src/main/java/spoon/reflect/visitor/chain/ScanningMode.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.chain; diff --git a/src/main/java/spoon/reflect/visitor/filter/AbstractFilter.java b/src/main/java/spoon/reflect/visitor/filter/AbstractFilter.java index fed1d2111b3..d99030d5c68 100644 --- a/src/main/java/spoon/reflect/visitor/filter/AbstractFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/AbstractFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/AbstractReferenceFilter.java b/src/main/java/spoon/reflect/visitor/filter/AbstractReferenceFilter.java index 78ed59bfe14..eb7534e9788 100644 --- a/src/main/java/spoon/reflect/visitor/filter/AbstractReferenceFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/AbstractReferenceFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/AllMethodsSameSignatureFunction.java b/src/main/java/spoon/reflect/visitor/filter/AllMethodsSameSignatureFunction.java index 4b8112f3285..9aeadd29966 100644 --- a/src/main/java/spoon/reflect/visitor/filter/AllMethodsSameSignatureFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/AllMethodsSameSignatureFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/AllTypeMembersFunction.java b/src/main/java/spoon/reflect/visitor/filter/AllTypeMembersFunction.java index 7ee32fbff31..b0d8bb3381a 100644 --- a/src/main/java/spoon/reflect/visitor/filter/AllTypeMembersFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/AllTypeMembersFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/AnnotationFilter.java b/src/main/java/spoon/reflect/visitor/filter/AnnotationFilter.java index 47c421be110..53118d9b935 100644 --- a/src/main/java/spoon/reflect/visitor/filter/AnnotationFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/AnnotationFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/CatchVariableReferenceFunction.java b/src/main/java/spoon/reflect/visitor/filter/CatchVariableReferenceFunction.java index ab0436a261b..af6b7bd2f9f 100644 --- a/src/main/java/spoon/reflect/visitor/filter/CatchVariableReferenceFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/CatchVariableReferenceFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/CatchVariableScopeFunction.java b/src/main/java/spoon/reflect/visitor/filter/CatchVariableScopeFunction.java index bb307b87cbe..cac689bef0b 100644 --- a/src/main/java/spoon/reflect/visitor/filter/CatchVariableScopeFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/CatchVariableScopeFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/CompositeFilter.java b/src/main/java/spoon/reflect/visitor/filter/CompositeFilter.java index e5c46659e41..9adf18ad62e 100644 --- a/src/main/java/spoon/reflect/visitor/filter/CompositeFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/CompositeFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/CtScannerFunction.java b/src/main/java/spoon/reflect/visitor/filter/CtScannerFunction.java index ac31c3436f3..be5aae72e6e 100644 --- a/src/main/java/spoon/reflect/visitor/filter/CtScannerFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/CtScannerFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/DirectReferenceFilter.java b/src/main/java/spoon/reflect/visitor/filter/DirectReferenceFilter.java index ab7c222774b..057967a683e 100644 --- a/src/main/java/spoon/reflect/visitor/filter/DirectReferenceFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/DirectReferenceFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/ExecutableReferenceFilter.java b/src/main/java/spoon/reflect/visitor/filter/ExecutableReferenceFilter.java index ed509fc1375..ed415fa6c07 100644 --- a/src/main/java/spoon/reflect/visitor/filter/ExecutableReferenceFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/ExecutableReferenceFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/FieldAccessFilter.java b/src/main/java/spoon/reflect/visitor/filter/FieldAccessFilter.java index 88a9d015e5b..7493bf6746a 100644 --- a/src/main/java/spoon/reflect/visitor/filter/FieldAccessFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/FieldAccessFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/FieldReferenceFunction.java b/src/main/java/spoon/reflect/visitor/filter/FieldReferenceFunction.java index cdad6375434..5561ef3ebc1 100644 --- a/src/main/java/spoon/reflect/visitor/filter/FieldReferenceFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/FieldReferenceFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/FieldScopeFunction.java b/src/main/java/spoon/reflect/visitor/filter/FieldScopeFunction.java index 6bdfe07ccb5..f687651c5d0 100644 --- a/src/main/java/spoon/reflect/visitor/filter/FieldScopeFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/FieldScopeFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/FilteringOperator.java b/src/main/java/spoon/reflect/visitor/filter/FilteringOperator.java index f7ec6aacd35..b02393a81c5 100644 --- a/src/main/java/spoon/reflect/visitor/filter/FilteringOperator.java +++ b/src/main/java/spoon/reflect/visitor/filter/FilteringOperator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/InvocationFilter.java b/src/main/java/spoon/reflect/visitor/filter/InvocationFilter.java index 8216751a2e7..3b4b846f0d2 100644 --- a/src/main/java/spoon/reflect/visitor/filter/InvocationFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/InvocationFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/LambdaFilter.java b/src/main/java/spoon/reflect/visitor/filter/LambdaFilter.java index 0e7b9e36ab2..be46a7a78f2 100644 --- a/src/main/java/spoon/reflect/visitor/filter/LambdaFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/LambdaFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/LineFilter.java b/src/main/java/spoon/reflect/visitor/filter/LineFilter.java index 99e844baa25..8f1ef48a859 100644 --- a/src/main/java/spoon/reflect/visitor/filter/LineFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/LineFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/LocalVariableReferenceFunction.java b/src/main/java/spoon/reflect/visitor/filter/LocalVariableReferenceFunction.java index 763cb04e98d..93af539afa6 100644 --- a/src/main/java/spoon/reflect/visitor/filter/LocalVariableReferenceFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/LocalVariableReferenceFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/LocalVariableScopeFunction.java b/src/main/java/spoon/reflect/visitor/filter/LocalVariableScopeFunction.java index 7e599be7182..62414d2d799 100644 --- a/src/main/java/spoon/reflect/visitor/filter/LocalVariableScopeFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/LocalVariableScopeFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/NamedElementFilter.java b/src/main/java/spoon/reflect/visitor/filter/NamedElementFilter.java index ea1e7c99ac1..3433ea103db 100644 --- a/src/main/java/spoon/reflect/visitor/filter/NamedElementFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/NamedElementFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodFilter.java b/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodFilter.java index 0073991f480..30b76ccc7ad 100644 --- a/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodQuery.java b/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodQuery.java index 275dd2f7772..e9733565525 100644 --- a/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodQuery.java +++ b/src/main/java/spoon/reflect/visitor/filter/OverriddenMethodQuery.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/OverridingMethodFilter.java b/src/main/java/spoon/reflect/visitor/filter/OverridingMethodFilter.java index 6b45b25a2b2..0eae549ee8b 100644 --- a/src/main/java/spoon/reflect/visitor/filter/OverridingMethodFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/OverridingMethodFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/ParameterReferenceFunction.java b/src/main/java/spoon/reflect/visitor/filter/ParameterReferenceFunction.java index 36fd511f9e4..1ae520a0003 100644 --- a/src/main/java/spoon/reflect/visitor/filter/ParameterReferenceFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/ParameterReferenceFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/ParameterScopeFunction.java b/src/main/java/spoon/reflect/visitor/filter/ParameterScopeFunction.java index 1f36b59c247..d8d4d06ec60 100644 --- a/src/main/java/spoon/reflect/visitor/filter/ParameterScopeFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/ParameterScopeFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/ParentFunction.java b/src/main/java/spoon/reflect/visitor/filter/ParentFunction.java index 0150c867764..c435dd4285e 100644 --- a/src/main/java/spoon/reflect/visitor/filter/ParentFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/ParentFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/PotentialVariableDeclarationFunction.java b/src/main/java/spoon/reflect/visitor/filter/PotentialVariableDeclarationFunction.java index 3a4abcfc1a6..c03fef1ac48 100644 --- a/src/main/java/spoon/reflect/visitor/filter/PotentialVariableDeclarationFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/PotentialVariableDeclarationFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/ReferenceTypeFilter.java b/src/main/java/spoon/reflect/visitor/filter/ReferenceTypeFilter.java index 8c9cad8bb2d..c08a356f68e 100644 --- a/src/main/java/spoon/reflect/visitor/filter/ReferenceTypeFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/ReferenceTypeFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/RegexFilter.java b/src/main/java/spoon/reflect/visitor/filter/RegexFilter.java index bec676fd720..2bfbba9d328 100644 --- a/src/main/java/spoon/reflect/visitor/filter/RegexFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/RegexFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/ReturnOrThrowFilter.java b/src/main/java/spoon/reflect/visitor/filter/ReturnOrThrowFilter.java index 1ea5c64ccd4..122a4219ccb 100644 --- a/src/main/java/spoon/reflect/visitor/filter/ReturnOrThrowFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/ReturnOrThrowFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/SameFilter.java b/src/main/java/spoon/reflect/visitor/filter/SameFilter.java index 0627098ec03..94685bca20d 100644 --- a/src/main/java/spoon/reflect/visitor/filter/SameFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/SameFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/SiblingsFunction.java b/src/main/java/spoon/reflect/visitor/filter/SiblingsFunction.java index 78d58200b69..491837821ca 100644 --- a/src/main/java/spoon/reflect/visitor/filter/SiblingsFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/SiblingsFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/SubInheritanceHierarchyFunction.java b/src/main/java/spoon/reflect/visitor/filter/SubInheritanceHierarchyFunction.java index 95806015d82..a680b222deb 100644 --- a/src/main/java/spoon/reflect/visitor/filter/SubInheritanceHierarchyFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/SubInheritanceHierarchyFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/SubtypeFilter.java b/src/main/java/spoon/reflect/visitor/filter/SubtypeFilter.java index 6a07d11ec3f..a1260469345 100644 --- a/src/main/java/spoon/reflect/visitor/filter/SubtypeFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/SubtypeFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/SuperInheritanceHierarchyFunction.java b/src/main/java/spoon/reflect/visitor/filter/SuperInheritanceHierarchyFunction.java index d790104c72b..9b787a63f6b 100644 --- a/src/main/java/spoon/reflect/visitor/filter/SuperInheritanceHierarchyFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/SuperInheritanceHierarchyFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/TypeFilter.java b/src/main/java/spoon/reflect/visitor/filter/TypeFilter.java index 36c74566756..63d7c99d494 100644 --- a/src/main/java/spoon/reflect/visitor/filter/TypeFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/TypeFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/VariableAccessFilter.java b/src/main/java/spoon/reflect/visitor/filter/VariableAccessFilter.java index cf14864f2a2..4d0142dcf0f 100644 --- a/src/main/java/spoon/reflect/visitor/filter/VariableAccessFilter.java +++ b/src/main/java/spoon/reflect/visitor/filter/VariableAccessFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/VariableReferenceFunction.java b/src/main/java/spoon/reflect/visitor/filter/VariableReferenceFunction.java index be38e86f4b2..b09264a007d 100644 --- a/src/main/java/spoon/reflect/visitor/filter/VariableReferenceFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/VariableReferenceFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/VariableScopeFunction.java b/src/main/java/spoon/reflect/visitor/filter/VariableScopeFunction.java index 6871192b9dd..17d5d938afd 100644 --- a/src/main/java/spoon/reflect/visitor/filter/VariableScopeFunction.java +++ b/src/main/java/spoon/reflect/visitor/filter/VariableScopeFunction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.filter; diff --git a/src/main/java/spoon/reflect/visitor/filter/package-info.java b/src/main/java/spoon/reflect/visitor/filter/package-info.java index 7aa133419a0..740f6df1e05 100644 --- a/src/main/java/spoon/reflect/visitor/filter/package-info.java +++ b/src/main/java/spoon/reflect/visitor/filter/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package contains a set of useful filters when querying the model.

diff --git a/src/main/java/spoon/reflect/visitor/package-info.java b/src/main/java/spoon/reflect/visitor/package-info.java index 1e8f73ba002..42d9e179674 100644 --- a/src/main/java/spoon/reflect/visitor/package-info.java +++ b/src/main/java/spoon/reflect/visitor/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines visitor, scanner, and scanner-based query API for Java programs reified in the meta-model.

diff --git a/src/main/java/spoon/reflect/visitor/printer/CommentOffset.java b/src/main/java/spoon/reflect/visitor/printer/CommentOffset.java index dad8e878ee4..ffe6df66e5c 100644 --- a/src/main/java/spoon/reflect/visitor/printer/CommentOffset.java +++ b/src/main/java/spoon/reflect/visitor/printer/CommentOffset.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.reflect.visitor.printer; diff --git a/src/main/java/spoon/support/CompressionType.java b/src/main/java/spoon/support/CompressionType.java index 48a4455fad4..187a996be62 100644 --- a/src/main/java/spoon/support/CompressionType.java +++ b/src/main/java/spoon/support/CompressionType.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/DefaultCoreFactory.java b/src/main/java/spoon/support/DefaultCoreFactory.java index 476d08e30f7..9f97d017335 100644 --- a/src/main/java/spoon/support/DefaultCoreFactory.java +++ b/src/main/java/spoon/support/DefaultCoreFactory.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/DefaultOutputDestinationHandler.java b/src/main/java/spoon/support/DefaultOutputDestinationHandler.java index 03d3aa248d7..e60dc3b29b7 100644 --- a/src/main/java/spoon/support/DefaultOutputDestinationHandler.java +++ b/src/main/java/spoon/support/DefaultOutputDestinationHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/DerivedProperty.java b/src/main/java/spoon/support/DerivedProperty.java index 2d49a93a7d0..9688ecdbc36 100644 --- a/src/main/java/spoon/support/DerivedProperty.java +++ b/src/main/java/spoon/support/DerivedProperty.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/Experimental.java b/src/main/java/spoon/support/Experimental.java index 5e681734829..2f881f6c352 100644 --- a/src/main/java/spoon/support/Experimental.java +++ b/src/main/java/spoon/support/Experimental.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/Internal.java b/src/main/java/spoon/support/Internal.java index bb37b4b89f5..fb5664c509b 100644 --- a/src/main/java/spoon/support/Internal.java +++ b/src/main/java/spoon/support/Internal.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/JavaOutputProcessor.java b/src/main/java/spoon/support/JavaOutputProcessor.java index d0035c6f6e4..bf9a5a766de 100644 --- a/src/main/java/spoon/support/JavaOutputProcessor.java +++ b/src/main/java/spoon/support/JavaOutputProcessor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/Level.java b/src/main/java/spoon/support/Level.java index 80137d7cfea..27548b15a29 100644 --- a/src/main/java/spoon/support/Level.java +++ b/src/main/java/spoon/support/Level.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/OutputDestinationHandler.java b/src/main/java/spoon/support/OutputDestinationHandler.java index 773f30511b4..de31e77613f 100644 --- a/src/main/java/spoon/support/OutputDestinationHandler.java +++ b/src/main/java/spoon/support/OutputDestinationHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/QueueProcessingManager.java b/src/main/java/spoon/support/QueueProcessingManager.java index 7afe2598c81..0847bf0c6bc 100644 --- a/src/main/java/spoon/support/QueueProcessingManager.java +++ b/src/main/java/spoon/support/QueueProcessingManager.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/RuntimeProcessingManager.java b/src/main/java/spoon/support/RuntimeProcessingManager.java index ece6dc80eeb..9ab0c986291 100644 --- a/src/main/java/spoon/support/RuntimeProcessingManager.java +++ b/src/main/java/spoon/support/RuntimeProcessingManager.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/SerializationModelStreamer.java b/src/main/java/spoon/support/SerializationModelStreamer.java index 90cdb88d7e0..d79249caaec 100644 --- a/src/main/java/spoon/support/SerializationModelStreamer.java +++ b/src/main/java/spoon/support/SerializationModelStreamer.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/SpoonClassNotFoundException.java b/src/main/java/spoon/support/SpoonClassNotFoundException.java index 3f175ac8eb9..803345e89d4 100644 --- a/src/main/java/spoon/support/SpoonClassNotFoundException.java +++ b/src/main/java/spoon/support/SpoonClassNotFoundException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/StandardEnvironment.java b/src/main/java/spoon/support/StandardEnvironment.java index fec94930e7d..b088b4fa297 100644 --- a/src/main/java/spoon/support/StandardEnvironment.java +++ b/src/main/java/spoon/support/StandardEnvironment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; @@ -430,25 +430,20 @@ public void setInputClassLoader(ClassLoader aClassLoader) { final URL[] urls = ((URLClassLoader) aClassLoader).getURLs(); if (urls != null && urls.length > 0) { // Check that the URLs are only file URLs - boolean onlyFileURLs = true; for (URL url : urls) { if (!"file".equals(url.getProtocol())) { - onlyFileURLs = false; + throw new SpoonException("Spoon does not support a URLClassLoader containing other resources than local file."); } } - if (onlyFileURLs) { - List classpath = new ArrayList<>(); - for (URL url : urls) { - try { - classpath.add(Path.of(url.toURI()).toAbsolutePath().toString()); - } catch (URISyntaxException | FileSystemNotFoundException | IllegalArgumentException ignored) { - classpath.add(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8)); - } + List classpath = new ArrayList<>(); + for (URL url : urls) { + try { + classpath.add(Path.of(url.toURI()).toAbsolutePath().toString()); + } catch (URISyntaxException | FileSystemNotFoundException | IllegalArgumentException ignored) { + classpath.add(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8)); } - setSourceClasspath(classpath.toArray(new String[0])); - } else { - throw new SpoonException("Spoon does not support a URLClassLoader containing other resources than local file."); } + setSourceClasspath(classpath.toArray(new String[0])); } } this.classloader = aClassLoader; diff --git a/src/main/java/spoon/support/UnsettableProperty.java b/src/main/java/spoon/support/UnsettableProperty.java index 6651e654279..94e77fddd92 100644 --- a/src/main/java/spoon/support/UnsettableProperty.java +++ b/src/main/java/spoon/support/UnsettableProperty.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support; diff --git a/src/main/java/spoon/support/adaption/AdaptionVisitor.java b/src/main/java/spoon/support/adaption/AdaptionVisitor.java index 0bf602593c3..2824500db90 100644 --- a/src/main/java/spoon/support/adaption/AdaptionVisitor.java +++ b/src/main/java/spoon/support/adaption/AdaptionVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.adaption; diff --git a/src/main/java/spoon/support/adaption/DeclarationNode.java b/src/main/java/spoon/support/adaption/DeclarationNode.java index 40bfa7c4a3a..12d53843a7f 100644 --- a/src/main/java/spoon/support/adaption/DeclarationNode.java +++ b/src/main/java/spoon/support/adaption/DeclarationNode.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.adaption; @@ -69,12 +69,10 @@ public Optional> resolveTypeParameter(CtTypeParameterReferenc // We try to find a glue node below us to delegate to. Glue nodes do the mapping so we can just // pass it on unchanged. - Optional glueNode = children.stream() - .filter(it -> it.isInducedBy(this.inducedBy)) - .findFirst(); - - if (glueNode.isPresent()) { - return glueNode.get().resolveTypeParameter(reference); + if (!children.isEmpty()) { + // We pick a random child. Well-typed programs will converge to the same solution, no matter + // which path we pick. + return children.iterator().next().resolveTypeParameter(reference); } // If we have no glue node, we need to actually resolve the type parameter as we reached the diff --git a/src/main/java/spoon/support/adaption/GlueNode.java b/src/main/java/spoon/support/adaption/GlueNode.java index 0337af10bd2..b30deb6fb5d 100644 --- a/src/main/java/spoon/support/adaption/GlueNode.java +++ b/src/main/java/spoon/support/adaption/GlueNode.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.adaption; diff --git a/src/main/java/spoon/support/adaption/NodePrintHelper.java b/src/main/java/spoon/support/adaption/NodePrintHelper.java index 27cce7c7e56..6e15fdbd750 100644 --- a/src/main/java/spoon/support/adaption/NodePrintHelper.java +++ b/src/main/java/spoon/support/adaption/NodePrintHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.adaption; diff --git a/src/main/java/spoon/support/adaption/TypeAdaptor.java b/src/main/java/spoon/support/adaption/TypeAdaptor.java index 11c83254301..911d4a29d06 100644 --- a/src/main/java/spoon/support/adaption/TypeAdaptor.java +++ b/src/main/java/spoon/support/adaption/TypeAdaptor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.adaption; @@ -559,11 +559,17 @@ private Optional> getDeclaringMethodOrConstructor(CtTypeReferenc return Optional.of((CtExecutable) parent); } + @SuppressWarnings("AssignmentToMethodParameter") private DeclarationNode buildHierarchyFrom(CtTypeReference startReference, CtType startType, CtTypeReference end) { CtType endType = findDeclaringType(end); Map, DeclarationNode> declarationNodes = new HashMap<>(); + if (needToMoveStartTypeToEnclosingClass(end, endType)) { + startType = moveStartTypeToEnclosingClass(hierarchyStart, endType.getReference()); + startReference = startType.getReference(); + } + DeclarationNode root = buildDeclarationHierarchyFrom( startType.getReference(), endType, @@ -583,6 +589,31 @@ private DeclarationNode buildHierarchyFrom(CtTypeReference startReference, Ct .orElse(null); } + private boolean needToMoveStartTypeToEnclosingClass(CtTypeReference end, CtType endType) { + if (!(end instanceof CtTypeParameterReference)) { + return false; + } + // Declaring type is not the same as the inner type (i.e. the type parameter was declared on an + // enclosing type) + CtType parentType = end.getParent(CtType.class); + parentType = resolveTypeParameterToDeclarer(parentType); + + return !parentType.getQualifiedName().equals(endType.getQualifiedName()); + } + + private CtType moveStartTypeToEnclosingClass(CtType start, CtTypeReference endRef) { + CtType current = start; + while (current != null) { + if (isSubtype(current, endRef)) { + return current; + } + current = current.getDeclaringType(); + } + throw new SpoonException( + "Did not find a suitable enclosing type to start parameter type adaption from" + ); + } + /** * This method attempts to find a suitable end type for building our hierarchy. *
@@ -598,20 +629,33 @@ private DeclarationNode buildHierarchyFrom(CtTypeReference startReference, Ct */ private CtType findDeclaringType(CtTypeReference reference) { CtType type = null; - if (reference.isParentInitialized()) { + // Prefer declaration to parent. This will be different if the type parameter is declared on an + // enclosing class. + if (reference instanceof CtTypeParameterReference) { + type = reference.getTypeDeclaration(); + } + if (type == null && reference.isParentInitialized()) { type = reference.getParent(CtType.class); } if (type == null) { type = reference.getTypeDeclaration(); } - if (type instanceof CtTypeParameter) { - CtFormalTypeDeclarer declarer = ((CtTypeParameter) type).getTypeParameterDeclarer(); + + return resolveTypeParameterToDeclarer(type); + } + + private static CtType resolveTypeParameterToDeclarer(CtType parentType) { + if (parentType instanceof CtTypeParameter) { + CtFormalTypeDeclarer declarer = ((CtTypeParameter) parentType).getTypeParameterDeclarer(); if (declarer instanceof CtType) { return (CtType) declarer; + } else { + return declarer.getDeclaringType(); } - return declarer.getDeclaringType(); } - return type; + // Could not resolve type parameter declarer (no class path mode?). + // Type adaption results will not be accurate, this is just a wild (and probably wrong) guess. + return parentType; } private DeclarationNode buildDeclarationHierarchyFrom( diff --git a/src/main/java/spoon/support/comparator/CtLineElementComparator.java b/src/main/java/spoon/support/comparator/CtLineElementComparator.java index 89c3b8e873d..3b129daadf7 100644 --- a/src/main/java/spoon/support/comparator/CtLineElementComparator.java +++ b/src/main/java/spoon/support/comparator/CtLineElementComparator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.comparator; diff --git a/src/main/java/spoon/support/comparator/DeepRepresentationComparator.java b/src/main/java/spoon/support/comparator/DeepRepresentationComparator.java index 73ec1f9a0e1..4f25d2052bb 100644 --- a/src/main/java/spoon/support/comparator/DeepRepresentationComparator.java +++ b/src/main/java/spoon/support/comparator/DeepRepresentationComparator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.comparator; diff --git a/src/main/java/spoon/support/comparator/FixedOrderBasedOnFileNameCompilationUnitComparator.java b/src/main/java/spoon/support/comparator/FixedOrderBasedOnFileNameCompilationUnitComparator.java index e1c9539ad27..5355c191726 100644 --- a/src/main/java/spoon/support/comparator/FixedOrderBasedOnFileNameCompilationUnitComparator.java +++ b/src/main/java/spoon/support/comparator/FixedOrderBasedOnFileNameCompilationUnitComparator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.comparator; diff --git a/src/main/java/spoon/support/comparator/QualifiedNameComparator.java b/src/main/java/spoon/support/comparator/QualifiedNameComparator.java index bccfe1cfeef..ca6618dab35 100644 --- a/src/main/java/spoon/support/comparator/QualifiedNameComparator.java +++ b/src/main/java/spoon/support/comparator/QualifiedNameComparator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.comparator; diff --git a/src/main/java/spoon/support/comparator/SignatureComparator.java b/src/main/java/spoon/support/comparator/SignatureComparator.java index 9929d4f4990..a76384c7c6c 100644 --- a/src/main/java/spoon/support/comparator/SignatureComparator.java +++ b/src/main/java/spoon/support/comparator/SignatureComparator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.comparator; diff --git a/src/main/java/spoon/support/compiler/FileSystemFile.java b/src/main/java/spoon/support/compiler/FileSystemFile.java index bf6adab5b98..a94c683a7be 100644 --- a/src/main/java/spoon/support/compiler/FileSystemFile.java +++ b/src/main/java/spoon/support/compiler/FileSystemFile.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/FileSystemFolder.java b/src/main/java/spoon/support/compiler/FileSystemFolder.java index dad7aad12f4..114c73b6ad6 100644 --- a/src/main/java/spoon/support/compiler/FileSystemFolder.java +++ b/src/main/java/spoon/support/compiler/FileSystemFolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/FilteringFolder.java b/src/main/java/spoon/support/compiler/FilteringFolder.java index cbbe66577f9..17cb731bcb4 100644 --- a/src/main/java/spoon/support/compiler/FilteringFolder.java +++ b/src/main/java/spoon/support/compiler/FilteringFolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/ProgressLogger.java b/src/main/java/spoon/support/compiler/ProgressLogger.java index 580ee2ca211..9251954ed29 100644 --- a/src/main/java/spoon/support/compiler/ProgressLogger.java +++ b/src/main/java/spoon/support/compiler/ProgressLogger.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/SnippetCompilationError.java b/src/main/java/spoon/support/compiler/SnippetCompilationError.java index bd69d87f325..fea7c38fd5b 100644 --- a/src/main/java/spoon/support/compiler/SnippetCompilationError.java +++ b/src/main/java/spoon/support/compiler/SnippetCompilationError.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/SnippetCompilationHelper.java b/src/main/java/spoon/support/compiler/SnippetCompilationHelper.java index eea20b65bf0..7846b7f6706 100644 --- a/src/main/java/spoon/support/compiler/SnippetCompilationHelper.java +++ b/src/main/java/spoon/support/compiler/SnippetCompilationHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/SpoonPom.java b/src/main/java/spoon/support/compiler/SpoonPom.java index 4d8d7c4a9a6..38e8ade9036 100644 --- a/src/main/java/spoon/support/compiler/SpoonPom.java +++ b/src/main/java/spoon/support/compiler/SpoonPom.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; @@ -310,7 +310,7 @@ public List getClasspathTmpFiles(String fileName) { } // Pattern corresponding to maven properties ${propertyName} - private static Pattern mavenProperty = Pattern.compile("\\$\\{.*\\}"); + private static final Pattern MAVEN_PROPERTY = Pattern.compile("\\$\\{.*?}"); /** * Extract the variable from a string @@ -318,7 +318,7 @@ public List getClasspathTmpFiles(String fileName) { private String extractVariable(String value) { String val = value; if (value != null && value.contains("$")) { - Matcher matcher = mavenProperty.matcher(value); + Matcher matcher = MAVEN_PROPERTY.matcher(value); while (matcher.find()) { String var = matcher.group(); val = val.replace(var, getProperty(var.substring(2, var.length() - 1))); @@ -353,6 +353,8 @@ private String getProperty(String key) { } } else if ("project.basedir".equals(key) || "pom.basedir".equals(key) || "basedir".equals(key)) { return pomFile.getParent(); + } else if ("file.separator".equals(key)) { + return File.separator; } String value = extractVariable(model.getProperties().getProperty(key)); if (value == null) { diff --git a/src/main/java/spoon/support/compiler/SpoonProgress.java b/src/main/java/spoon/support/compiler/SpoonProgress.java index 1e8fe870587..70cb4b5ce65 100644 --- a/src/main/java/spoon/support/compiler/SpoonProgress.java +++ b/src/main/java/spoon/support/compiler/SpoonProgress.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/VirtualFile.java b/src/main/java/spoon/support/compiler/VirtualFile.java index 2a52185ef03..aaa19488eac 100644 --- a/src/main/java/spoon/support/compiler/VirtualFile.java +++ b/src/main/java/spoon/support/compiler/VirtualFile.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/VirtualFolder.java b/src/main/java/spoon/support/compiler/VirtualFolder.java index 1b5e8b5e659..d326bc7108f 100644 --- a/src/main/java/spoon/support/compiler/VirtualFolder.java +++ b/src/main/java/spoon/support/compiler/VirtualFolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/ZipFile.java b/src/main/java/spoon/support/compiler/ZipFile.java index 10bb82411ef..4857cd32800 100644 --- a/src/main/java/spoon/support/compiler/ZipFile.java +++ b/src/main/java/spoon/support/compiler/ZipFile.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/ZipFolder.java b/src/main/java/spoon/support/compiler/ZipFolder.java index e743e7b951c..cd4fd03f64d 100644 --- a/src/main/java/spoon/support/compiler/ZipFolder.java +++ b/src/main/java/spoon/support/compiler/ZipFolder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler; diff --git a/src/main/java/spoon/support/compiler/jdt/ASTPair.java b/src/main/java/spoon/support/compiler/jdt/ASTPair.java index dc237ed10da..7953d088c0c 100644 --- a/src/main/java/spoon/support/compiler/jdt/ASTPair.java +++ b/src/main/java/spoon/support/compiler/jdt/ASTPair.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/CompilationUnitFilter.java b/src/main/java/spoon/support/compiler/jdt/CompilationUnitFilter.java index b9f82989ba0..6f0c090dfc5 100644 --- a/src/main/java/spoon/support/compiler/jdt/CompilationUnitFilter.java +++ b/src/main/java/spoon/support/compiler/jdt/CompilationUnitFilter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/CompilationUnitWrapper.java b/src/main/java/spoon/support/compiler/jdt/CompilationUnitWrapper.java index fbffaf5fc6a..61107b7a0d8 100644 --- a/src/main/java/spoon/support/compiler/jdt/CompilationUnitWrapper.java +++ b/src/main/java/spoon/support/compiler/jdt/CompilationUnitWrapper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java b/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java index 492799fab7f..16f4956addd 100644 --- a/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java +++ b/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; @@ -75,7 +75,7 @@ public static class CastInfo { /** * Stack of all parents elements */ - Deque stack = new ArrayDeque<>(); + private final Deque stack = new ArrayDeque<>(); private final JDTTreeBuilder jdtTreeBuilder; @@ -130,6 +130,37 @@ void exit(ASTNode node) { } } + /** + * @return all {@link ASTPair}s currently on the stack + */ + Iterable getAllContexts() { + return stack; + } + + /** + * @return {@code true} if there are any elements on the stack + */ + boolean hasCurrentContext() { + return !stack.isEmpty(); + } + + /** + * + * @return the {@link CtElement} on the top of the stack + * @throws NullPointerException if the stack is empty + */ + CtElement getCurrentElement() { + return stack.peek().element; + } + + /** + * @return the {@link ASTNode} on the top of the stack + * @throws NullPointerException if the stack is empty + */ + ASTNode getCurrentNode() { + return stack.peek().node; + } + CtElement getContextElementOnLevel(int level) { for (ASTPair pair : stack) { if (level == 0) { @@ -168,7 +199,7 @@ CtLocalVariable getLocalVariableDeclaration(final String name) { // note: this happens when using the new try(vardelc) structure this.jdtTreeBuilder.getLogger().error( format("Could not find declaration for local variable %s at %s", - name, stack.peek().element.getPosition())); + name, getCurrentElement().getPosition())); } return localVariable; } @@ -183,7 +214,7 @@ CtCatchVariable getCatchVariableDeclaration(final String name) { // note: this happens when using the new try(vardelc) structure this.jdtTreeBuilder.getLogger().error( format("Could not find declaration for catch variable %s at %s", - name, stack.peek().element.getPosition())); + name, getCurrentElement().getPosition())); } return catchVariable; } @@ -195,7 +226,7 @@ CtVariable getVariableDeclaration(final String name) { // note: this can happen when identifier is not a variable name but e.g. a Type name. this.jdtTreeBuilder.getLogger().debug( format("Could not find declaration for variable %s at %s.", - name, stack.peek().element.getPosition())); + name, getCurrentElement().getPosition())); } return variable; } @@ -257,7 +288,11 @@ private > U getVariableDeclaration( if (name.equals(new String(fieldBinding.readableName()))) { final String qualifiedNameOfParent = getNormalQualifiedName(referenceBinding); - final CtType parentOfField = referenceBinding.isClass() + CtType parentOfField = typeFactory.get(qualifiedNameOfParent); + if (parentOfField != null) { + return (U) parentOfField.getField(name); + } + parentOfField = referenceBinding.isClass() ? classFactory.create(qualifiedNameOfParent) : interfaceFactory.create(qualifiedNameOfParent); diff --git a/src/main/java/spoon/support/compiler/jdt/FactoryCompilerConfig.java b/src/main/java/spoon/support/compiler/jdt/FactoryCompilerConfig.java index 277258bbb7c..da2ac8ae071 100644 --- a/src/main/java/spoon/support/compiler/jdt/FactoryCompilerConfig.java +++ b/src/main/java/spoon/support/compiler/jdt/FactoryCompilerConfig.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/FileCompilerConfig.java b/src/main/java/spoon/support/compiler/jdt/FileCompilerConfig.java index e1afb9f8604..711cd0852a1 100644 --- a/src/main/java/spoon/support/compiler/jdt/FileCompilerConfig.java +++ b/src/main/java/spoon/support/compiler/jdt/FileCompilerConfig.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/JDTBasedSpoonCompiler.java b/src/main/java/spoon/support/compiler/jdt/JDTBasedSpoonCompiler.java index 6b3f6593875..aab4e04e0b0 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTBasedSpoonCompiler.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTBasedSpoonCompiler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/JDTBatchCompiler.java b/src/main/java/spoon/support/compiler/jdt/JDTBatchCompiler.java index b5081c15bb3..f8e7695598a 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTBatchCompiler.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTBatchCompiler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/JDTCommentBuilder.java b/src/main/java/spoon/support/compiler/jdt/JDTCommentBuilder.java index c06e6be0368..3a5c0834b10 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTCommentBuilder.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTCommentBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/JDTConstants.java b/src/main/java/spoon/support/compiler/jdt/JDTConstants.java index cdc20050fde..182ba7f704e 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTConstants.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTConstants.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/JDTImportBuilder.java b/src/main/java/spoon/support/compiler/jdt/JDTImportBuilder.java index ef797891a86..ac0e4c8d99b 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTImportBuilder.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTImportBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.Set; @@ -83,28 +84,35 @@ void build() { } } } else { + // A static import can be either a static field, a static method or a static type + // It is possible that this method will add duplicate imports + // Logically, if `foo` is a static method and `foo` is also a static field, then both should be + // imported with `import static example.Foo.foo;` repeated twice. int lastDot = importName.lastIndexOf('.'); String className = importName.substring(0, lastDot); - String methodOrFieldName = importName.substring(lastDot + 1); + String methodOrFieldOrTypeName = importName.substring(lastDot + 1); - CtType klass = this.getOrLoadClass(className); + CtType klass = this.getOrLoadClass(className); if (klass != null) { - if ("*".equals(methodOrFieldName)) { + if (Objects.equals(methodOrFieldOrTypeName, "*")) { this.imports.add(createImportWithPosition(factory.Type().createTypeMemberWildcardImportReference(klass.getReference()), importRef)); } else { - CtNamedElement methodOrField = null; + CtNamedElement methodOrFieldOrType; - methodOrField = klass.getField(methodOrFieldName); + methodOrFieldOrType = klass.getField(methodOrFieldOrTypeName); + if (methodOrFieldOrType != null) { + this.imports.add(createImportWithPosition(methodOrFieldOrType.getReference(), importRef)); + } - if (methodOrField == null) { - List methods = klass.getMethodsByName(methodOrFieldName); - if (methods.size() > 0) { - methodOrField = methods.get(0); - } + List> methods = klass.getMethodsByName(methodOrFieldOrTypeName); + if (methods.size() > 0) { + methodOrFieldOrType = methods.get(0); + this.imports.add(createImportWithPosition(methodOrFieldOrType.getReference(), importRef)); } - if (methodOrField != null) { - this.imports.add(createImportWithPosition(methodOrField.getReference(), importRef)); + methodOrFieldOrType = klass.getNestedType(methodOrFieldOrTypeName); + if (methodOrFieldOrType != null) { + this.imports.add(createImportWithPosition(methodOrFieldOrType.getReference(), importRef)); } } } else { diff --git a/src/main/java/spoon/support/compiler/jdt/JDTSnippetCompiler.java b/src/main/java/spoon/support/compiler/jdt/JDTSnippetCompiler.java index 59bb2c8265e..c62b0493489 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTSnippetCompiler.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTSnippetCompiler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilder.java b/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilder.java index 8c580712a2e..2278a1e1be4 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilder.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; @@ -449,8 +449,7 @@ public void endVisit(IntLiteral intLiteral, BlockScope scope) { @Override public void endVisit(LabeledStatement labeledStatement, BlockScope scope) { - ASTPair pair = context.stack.peek(); - CtBlock block = (CtBlock) pair.element; + CtBlock block = (CtBlock) context.getCurrentElement(); if (block.getStatements().size() == 1) { CtStatement childStmt = block.getStatement(0); if (childStmt.getLabel() == null) { @@ -610,7 +609,7 @@ public void endVisit(QualifiedAllocationExpression qualifiedAllocationExpression @Override public void endVisit(QualifiedNameReference qualifiedNameReference, BlockScope scope) { - if (context.stack.peek().node == qualifiedNameReference) { + if (context.getCurrentNode() == qualifiedNameReference) { context.exit(qualifiedNameReference); } } @@ -650,7 +649,7 @@ public void endVisit(SingleMemberAnnotation annotation, BlockScope scope) { @Override public void endVisit(SingleNameReference singleNameReference, BlockScope scope) { - if (context.stack.peek().node == singleNameReference) { + if (context.getCurrentNode() == singleNameReference) { context.exit(singleNameReference); } } @@ -706,16 +705,16 @@ public void endVisit(ThisReference thisReference, BlockScope scope) { @Override public void endVisit(SwitchStatement switchStatement, BlockScope scope) { - if (context.stack.peek().node instanceof CaseStatement) { - context.exit(context.stack.peek().node); + if (context.getCurrentNode() instanceof CaseStatement) { + context.exit(context.getCurrentNode()); } context.exit(switchStatement); } @Override public void endVisit(SwitchExpression switchExpression, BlockScope scope) { - if (context.stack.peek().node instanceof CaseStatement) { - context.exit(context.stack.peek().node); + if (context.getCurrentNode() instanceof CaseStatement) { + context.exit(context.getCurrentNode()); } context.exit(switchExpression); } @@ -757,14 +756,14 @@ public void endVisit(TypeDeclaration localTypeDeclaration, BlockScope scope) { @Override public void endVisit(TypeDeclaration memberTypeDeclaration, ClassScope scope) { - while (!context.stack.isEmpty() && context.stack.peek().node == memberTypeDeclaration) { + while (context.hasCurrentContext() && context.getCurrentNode() == memberTypeDeclaration) { context.exit(memberTypeDeclaration); } } @Override public void endVisit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) { - while (!context.stack.isEmpty() && context.stack.peek().node == typeDeclaration) { + while (context.hasCurrentContext() && context.getCurrentNode() == typeDeclaration) { context.exit(typeDeclaration); } } @@ -879,11 +878,10 @@ public void endVisit(LambdaExpression lambdaExpression, BlockScope blockScope) { public boolean visit(AllocationExpression allocationExpression, BlockScope scope) { CtConstructorCall constructorCall = factory.Core().createConstructorCall(); constructorCall.setExecutable(references.getExecutableReference(allocationExpression)); - ASTPair first = this.context.stack.getFirst(); // in case of enum values the constructor call is often implicit - if (first.element instanceof CtEnumValue) { - if (allocationExpression.sourceEnd == first.node.sourceEnd) { + if (context.getCurrentElement() instanceof CtEnumValue) { + if (allocationExpression.sourceEnd == context.getCurrentNode().sourceEnd) { constructorCall.setImplicit(true); } } @@ -937,7 +935,7 @@ public boolean visit(AnnotationMethodDeclaration annotationMethodDeclaration, Cl @Override public boolean visit(Argument argument, BlockScope scope) { - if (this.getContextBuilder().stack.peekFirst().element instanceof CtTry) { + if (context.getCurrentElement() instanceof CtTry) { context.enter(factory.Core().createCatch(), argument); return true; } @@ -1525,11 +1523,11 @@ public boolean visit(QualifiedNameReference qualifiedNameRef, BlockScope scope) context.enter(factory.Code().createTypeAccessWithoutCloningReference(typeRef), qualifiedNameRef); return true; } else if (qualifiedNameRef.binding instanceof ProblemBinding) { - if (context.stack.peek().element instanceof CtInvocation) { + if (helper.isProblemNameRefProbablyTypeRef(qualifiedNameRef)) { context.enter(helper.createTypeAccessNoClasspath(qualifiedNameRef), qualifiedNameRef); - return true; + } else { + context.enter(helper.createFieldAccessNoClasspath(qualifiedNameRef), qualifiedNameRef); } - context.enter(helper.createFieldAccessNoClasspath(qualifiedNameRef), qualifiedNameRef); return true; } else { context.enter( @@ -1547,14 +1545,14 @@ public boolean visit(QualifiedTypeReference qualifiedTypeReference, BlockScope s if (skipTypeInAnnotation) { return true; } - if (context.stack.peekFirst().node instanceof UnionTypeReference) { + if (context.getCurrentNode() instanceof UnionTypeReference) { CtTypeReference reference = references.getTypeReference(qualifiedTypeReference.resolvedType); if (reference == null) { reference = getFactory().createReference(qualifiedTypeReference.toString()); } context.enter(reference, qualifiedTypeReference); return true; - } else if (context.stack.peekFirst().element instanceof CtCatch) { + } else if (context.getCurrentElement() instanceof CtCatch) { context.enter(helper.createCatchVariable(qualifiedTypeReference, scope), qualifiedTypeReference); return true; } @@ -1586,7 +1584,7 @@ public boolean visit(SingleNameReference singleNameReference, BlockScope scope) } else if (singleNameReference.binding instanceof TypeBinding) { context.enter(factory.Code().createTypeAccessWithoutCloningReference(references.getTypeReference((TypeBinding) singleNameReference.binding).setSimplyQualified(true)), singleNameReference); } else if (singleNameReference.binding instanceof ProblemBinding) { - if (context.stack.peek().element instanceof CtInvocation && Character.isUpperCase(CharOperation.charToString(singleNameReference.token).charAt(0))) { + if (context.getCurrentElement() instanceof CtInvocation && Character.isUpperCase(CharOperation.charToString(singleNameReference.token).charAt(0))) { context.enter(helper.createTypeAccessNoClasspath(singleNameReference), singleNameReference); } else { context.enter(helper.createFieldAccessNoClasspath(singleNameReference), singleNameReference); @@ -1640,7 +1638,7 @@ public void endVisit(UnionTypeReference unionTypeReference, ClassScope scope) { @Override public boolean visit(UnionTypeReference unionTypeReference, BlockScope scope) { - if (!(context.stack.peekFirst().node instanceof Argument)) { + if (!(context.getCurrentNode() instanceof Argument)) { throw new SpoonException("UnionType is only supported for CtCatch."); } context.enter(helper.createCatchVariable(unionTypeReference, scope), unionTypeReference); @@ -1657,7 +1655,7 @@ public boolean visit(SingleTypeReference singleTypeReference, BlockScope scope) if (skipTypeInAnnotation) { return true; } - if (context.stack.peekFirst().node instanceof UnionTypeReference) { + if (context.getCurrentNode() instanceof UnionTypeReference) { CtTypeReference typeReference; if (singleTypeReference.resolvedType == null) { @@ -1671,10 +1669,10 @@ public boolean visit(SingleTypeReference singleTypeReference, BlockScope scope) context.enter(typeReference, singleTypeReference); typeReference.setSimplyQualified(true); return true; - } else if (context.stack.peekFirst().element instanceof CtCatch) { + } else if (context.getCurrentElement() instanceof CtCatch) { context.enter(helper.createCatchVariable(singleTypeReference, scope), singleTypeReference); return true; - } else if (context.stack.getFirst().element instanceof CtExecutableReferenceExpression) { + } else if (context.getCurrentElement() instanceof CtExecutableReferenceExpression) { context.enter(references.getTypeParameterReference(singleTypeReference.resolvedType, singleTypeReference), singleTypeReference); return true; } @@ -1710,8 +1708,8 @@ public boolean visit(StringLiteralConcatenation literal, BlockScope scope) { @Override public boolean visit(CaseStatement caseStatement, BlockScope scope) { - if (context.stack.peek().node instanceof CaseStatement) { - context.exit(context.stack.peek().node); + if (context.getCurrentNode() instanceof CaseStatement) { + context.exit(context.getCurrentNode()); } context.enter(factory.Core().createCase(), caseStatement); diff --git a/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderHelper.java b/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderHelper.java index f54fbeacbf4..53606466163 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderHelper.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderHelper.java @@ -1,17 +1,19 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; +import java.util.Arrays; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.ExportsStatement; import org.eclipse.jdt.internal.compiler.ast.FieldReference; +import org.eclipse.jdt.internal.compiler.ast.ImportReference; import org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration; import org.eclipse.jdt.internal.compiler.ast.ModuleReference; import org.eclipse.jdt.internal.compiler.ast.OpensStatement; @@ -124,7 +126,7 @@ static String createQualifiedTypeName(char[][] typeName) { * @return a catch variable. */ CtCatchVariable createCatchVariable(TypeReference typeReference, Scope scope) { - final Argument jdtCatch = (Argument) jdtTreeBuilder.getContextBuilder().stack.peekFirst().node; + final Argument jdtCatch = (Argument) jdtTreeBuilder.getContextBuilder().getCurrentNode(); final Set modifiers = getModifiers(jdtCatch.modifiers, false, ModifierTarget.LOCAL_VARIABLE); CtCatchVariable result = jdtTreeBuilder.getFactory().Core().createCatchVariable(); @@ -213,7 +215,7 @@ CtVariableAccess createVariableAccessNoClasspath(SingleNameReference sing // find executable's corresponding jdt element AbstractMethodDeclaration executableJDT = null; - for (final ASTPair astPair : contextBuilder.stack) { + for (final ASTPair astPair : contextBuilder.getAllContexts()) { if (astPair.element == executable) { executableJDT = (AbstractMethodDeclaration) astPair.node; } @@ -283,8 +285,9 @@ CtVariableAccess createVariableAccess(QualifiedNameReference qualifiedNam sourceStart = (int) (positions[qualifiedNameReference.indexOfFirstFieldBinding - 1] >>> 32); for (FieldBinding b : qualifiedNameReference.otherBindings) { isOtherBinding = qualifiedNameReference.otherBindings.length == i + 1; + TypeBinding type = ((VariableBinding) qualifiedNameReference.binding).type; CtFieldAccess other = createFieldAccess( - jdtTreeBuilder.getReferencesBuilder().getVariableReference(b, qualifiedNameReference.tokens[i + 1]), va, isOtherBinding && fromAssignment); + jdtTreeBuilder.getReferencesBuilder().getVariableReference(type, b, qualifiedNameReference.tokens[i + 1]), va, isOtherBinding && fromAssignment); //set source position of fa if (i + qualifiedNameReference.indexOfFirstFieldBinding >= qualifiedNameReference.otherBindings.length) { sourceEnd = qualifiedNameReference.sourceEnd(); @@ -299,8 +302,9 @@ CtVariableAccess createVariableAccess(QualifiedNameReference qualifiedNam sourceStart = (int) (positions[0] >>> 32); for (int i = 1; i < qualifiedNameReference.tokens.length; i++) { isOtherBinding = qualifiedNameReference.tokens.length == i + 1; + TypeBinding type = ((VariableBinding) qualifiedNameReference.binding).type; CtFieldAccess other = createFieldAccess(// - jdtTreeBuilder.getReferencesBuilder().getVariableReference(null, qualifiedNameReference.tokens[i]), va, isOtherBinding && fromAssignment); + jdtTreeBuilder.getReferencesBuilder().getVariableReference(type, null, qualifiedNameReference.tokens[i]), va, isOtherBinding && fromAssignment); //set source position of va; sourceEnd = (int) (positions[i]); va.setPosition(jdtTreeBuilder.getPositionBuilder().buildPosition(sourceStart, sourceEnd)); @@ -392,6 +396,60 @@ CtFieldAccess createFieldAccessNoClasspath(SingleNameReference singleName return va; } + boolean isProblemNameRefProbablyTypeRef(QualifiedNameReference qualifiedNameReference) { + ContextBuilder contextBuilder = jdtTreeBuilder.getContextBuilder(); + if (contextBuilder.compilationunitdeclaration == null) { + return false; + } + if (contextBuilder.compilationunitdeclaration.imports == null) { + return false; + } + char[][] ourName = qualifiedNameReference.tokens; + for (ImportReference anImport : contextBuilder.compilationunitdeclaration.imports) { + char[][] importName = anImport.getImportName(); + int i = indexOfSubList(importName, ourName); + if (i > 0) { + boolean extendsToEndOfImport = i + ourName.length == importName.length; + boolean isStaticImport = anImport.isStatic(); + if (!isStaticImport) { + // import foo.bar.baz.A; => "A" is probably a type + // import foo.bar.baz.A; => "baz" is probably a type + return true; + } + // import static foo.Bar.bar; => bar is probably a method/field + // import static foo.Bar; => Bar is probably a type + char[] simpleName = qualifiedNameReference.tokens[qualifiedNameReference.tokens.length - 1]; + return !extendsToEndOfImport || !Character.isLowerCase(simpleName[0]); + } + } + return false; + } + + /** + * Finds the lowest index where {@code needle} appears in {@code haystack}. This is akin to a + * substring search, but JDT uses a String[] to omit separators and a char[] to represent strings. + * If we want to find out where "String" appears in "java.lang.String", we would call + * {@code indexOfSubList(["java", "lang", "String"], ["lang", "String"])} and receive {@code 1}. + * + * @param haystack the haystack to search in + * @param needle the needle to search + * @return the first index where needle appears in haystack + * @see java.util.Collections#indexOfSubList(List, List) Collections#indexOfSubList for a more + * general version that does not correctly handle array equality + */ + private static int indexOfSubList(char[][] haystack, char[][] needle) { + outer: + for (int i = 0; i < haystack.length - needle.length; i++) { + for (int j = 0; j < needle.length; j++) { + if (!Arrays.equals(haystack[i + j], needle[j])) { + continue outer; + } + } + return i; + } + return -1; + } + /** * In no classpath mode, when we build a field access, we have a binding typed by ProblemBinding. * We try to get all information we can get from this binding. @@ -430,7 +488,7 @@ CtFieldAccess createFieldAccess(FieldReference fieldReference) { } else { fieldAccess = jdtTreeBuilder.getFactory().Core().createFieldRead(); } - fieldAccess.setVariable(jdtTreeBuilder.getReferencesBuilder().getVariableReference(fieldReference.binding, fieldReference.token)); + fieldAccess.setVariable(jdtTreeBuilder.getReferencesBuilder().getVariableReference(fieldReference.actualReceiverType, fieldReference.binding, fieldReference.token)); fieldAccess.setType(jdtTreeBuilder.getReferencesBuilder().getTypeReference(fieldReference.resolvedType)); return fieldAccess; } diff --git a/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderQuery.java b/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderQuery.java index 10197649430..97c3de7a902 100644 --- a/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderQuery.java +++ b/src/main/java/spoon/support/compiler/jdt/JDTTreeBuilderQuery.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; @@ -239,7 +239,7 @@ static boolean isResolvedField(QualifiedNameReference qualifiedNameReference) { * @return true if the lhs is equals to the given expression. */ static boolean isLhsAssignment(ContextBuilder context, Expression lhs) { - return context.stack.peek().node instanceof Assignment && ((Assignment) context.stack.peek().node).lhs.equals(lhs); + return context.getCurrentNode() instanceof Assignment && ((Assignment) context.getCurrentNode()).lhs.equals(lhs); } /** diff --git a/src/main/java/spoon/support/compiler/jdt/ModifierTarget.java b/src/main/java/spoon/support/compiler/jdt/ModifierTarget.java index 89ee7ad7346..9bddd535051 100644 --- a/src/main/java/spoon/support/compiler/jdt/ModifierTarget.java +++ b/src/main/java/spoon/support/compiler/jdt/ModifierTarget.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/ParentExiter.java b/src/main/java/spoon/support/compiler/jdt/ParentExiter.java index e407702e9c8..ff2932da2a8 100644 --- a/src/main/java/spoon/support/compiler/jdt/ParentExiter.java +++ b/src/main/java/spoon/support/compiler/jdt/ParentExiter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; @@ -275,14 +275,14 @@ public void scanCtVariable(CtVariable v) { } private boolean hasChildEqualsToDefaultValue(CtVariable ctVariable) { - if (jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof AnnotationMethodDeclaration) { - final AnnotationMethodDeclaration parent = (AnnotationMethodDeclaration) jdtTreeBuilder.getContextBuilder().stack.peek().node; + if (jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof AnnotationMethodDeclaration) { + final AnnotationMethodDeclaration parent = (AnnotationMethodDeclaration) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // Default value is equals to the jdt child. return parent.defaultValue != null && getFinalExpressionFromCast(parent.defaultValue).equals(childJDT) // Return type not yet initialized. && !child.equals(ctVariable.getDefaultExpression()); } - final AbstractVariableDeclaration parent = (AbstractVariableDeclaration) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final AbstractVariableDeclaration parent = (AbstractVariableDeclaration) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // Default value is equals to the jdt child. return parent.initialization != null && getFinalExpressionFromCast(parent.initialization).equals(childJDT) // Return type not yet initialized. @@ -326,7 +326,7 @@ public void visitCtMethod(CtMethod e) { } private boolean hasChildEqualsToType(CtMethod ctMethod) { - final MethodDeclaration parent = (MethodDeclaration) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final MethodDeclaration parent = (MethodDeclaration) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // Return type is equals to the jdt child. return parent.returnType != null && parent.returnType.equals(childJDT) // Return type not yet initialized. @@ -343,7 +343,7 @@ public void visitCtAnnotationMethod(CtAnnotationMethod annotationMethod) } private boolean hasChildEqualsToDefaultValue(CtAnnotationMethod ctAnnotationMethod) { - final AnnotationMethodDeclaration parent = (AnnotationMethodDeclaration) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final AnnotationMethodDeclaration parent = (AnnotationMethodDeclaration) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // Default value is equals to the jdt child. return parent.defaultValue != null && parent.defaultValue.equals(childJDT) // Default value not yet initialized. @@ -445,7 +445,7 @@ public void visitCtBinaryOperator(CtBinaryOperator operator) { } operator.setRightHandOperand((CtExpression) child); return; - } else if (jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof StringLiteralConcatenation) { + } else if (jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof StringLiteralConcatenation) { CtBinaryOperator op = operator.getFactory().Core().createBinaryOperator(); op.setKind(BinaryOperatorKind.PLUS); op.setLeftHandOperand(operator.getLeftHandOperand()); @@ -479,7 +479,7 @@ public void visitCtBreak(CtBreak b) { @Override public void visitCtCase(CtCase caseStatement) { - final ASTNode node = jdtTreeBuilder.getContextBuilder().stack.peek().node; + final ASTNode node = jdtTreeBuilder.getContextBuilder().getCurrentNode(); if (node instanceof CaseStatement) { caseStatement.setCaseKind(((CaseStatement) node).isExpr ? CaseKind.ARROW : CaseKind.COLON); } @@ -512,7 +512,7 @@ public void visitCtCatch(CtCatch catchBlock) { @Override public void visitCtCatchVariable(CtCatchVariable e) { - if (jdtTreeBuilder.getContextBuilder().stack.peekFirst().node instanceof UnionTypeReference) { + if (jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof UnionTypeReference) { e.addMultiType((CtTypeReference) child); return; } @@ -614,10 +614,10 @@ public void visitCtFor(CtFor forLoop) { } private boolean isContainedInForInit() { - if (!(jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof ForStatement)) { + if (!(jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof ForStatement)) { return false; } - final ForStatement parent = (ForStatement) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final ForStatement parent = (ForStatement) jdtTreeBuilder.getContextBuilder().getCurrentNode(); if (parent.initializations == null) { return false; } @@ -630,10 +630,10 @@ private boolean isContainedInForInit() { } private boolean isContainedInForUpdate() { - if (!(jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof ForStatement)) { + if (!(jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof ForStatement)) { return false; } - final ForStatement parent = (ForStatement) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final ForStatement parent = (ForStatement) jdtTreeBuilder.getContextBuilder().getCurrentNode(); if (parent.increments == null) { return false; } @@ -646,23 +646,22 @@ private boolean isContainedInForUpdate() { } private boolean isContainedInForCondition() { - if (!(jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof ForStatement)) { + if (!(jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof ForStatement)) { return false; } - final ForStatement parent = (ForStatement) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final ForStatement parent = (ForStatement) jdtTreeBuilder.getContextBuilder().getCurrentNode(); return parent.condition != null && parent.condition.equals(childJDT); } @Override public void visitCtForEach(CtForEach foreach) { - if (foreach.getVariable() == null && child instanceof CtVariable) { + if (foreach.getVariable() == null && child instanceof CtLocalVariable) { foreach.setVariable((CtLocalVariable) child); - return; } else if (foreach.getExpression() == null && child instanceof CtExpression) { foreach.setExpression((CtExpression) child); - return; + } else { + super.visitCtForEach(foreach); } - super.visitCtForEach(foreach); } @Override @@ -786,10 +785,10 @@ private boolean setTargetFromUnqualifiedAccess(CtInvocation invocation) { } private boolean hasChildEqualsToQualification(CtInvocation ctInvocation) { - if (!(jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof ExplicitConstructorCall)) { + if (!(jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof ExplicitConstructorCall)) { return false; } - final ExplicitConstructorCall parent = (ExplicitConstructorCall) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final ExplicitConstructorCall parent = (ExplicitConstructorCall) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // qualification is equals to the jdt child. return parent.qualification != null && getFinalExpressionFromCast(parent.qualification).equals(childJDT) // qualification not yet initialized. @@ -797,10 +796,10 @@ private boolean hasChildEqualsToQualification(CtInvocation ctInvocation) } private boolean hasChildEqualsToReceiver(CtInvocation ctInvocation) { - if (!(jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof MessageSend)) { + if (!(jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof MessageSend)) { return false; } - final MessageSend parent = (MessageSend) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final MessageSend parent = (MessageSend) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // Receiver is equals to the jdt child. return parent.receiver != null && getFinalExpressionFromCast(parent.receiver).equals(childJDT) // Receiver not yet initialized. @@ -817,12 +816,12 @@ private Expression getFinalExpressionFromCast(Expression potentialCase) { @Override public void visitCtNewArray(CtNewArray newArray) { if (childJDT instanceof TypeReference && child instanceof CtTypeAccess) { - final ArrayAllocationExpression arrayAlloc = (ArrayAllocationExpression) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final ArrayAllocationExpression arrayAlloc = (ArrayAllocationExpression) jdtTreeBuilder.getContextBuilder().getCurrentNode(); newArray.setType((CtArrayTypeReference) jdtTreeBuilder.getFactory().Type().createArrayReference(((CtTypeAccess) child).getAccessedType(), arrayAlloc.dimensions.length)); } else if (child instanceof CtExpression) { if (isContainedInDimensionExpression()) { newArray.addDimensionExpression((CtExpression) child); - } else if (child instanceof CtNewArray && childJDT instanceof ArrayInitializer && jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof ArrayAllocationExpression) { + } else if (child instanceof CtNewArray && childJDT instanceof ArrayInitializer && jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof ArrayAllocationExpression) { newArray.setElements(((CtNewArray) child).getElements()); } else { newArray.addElement((CtExpression) child); @@ -831,10 +830,10 @@ public void visitCtNewArray(CtNewArray newArray) { } private boolean isContainedInDimensionExpression() { - if (!(jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof ArrayAllocationExpression)) { + if (!(jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof ArrayAllocationExpression)) { return false; } - final ArrayAllocationExpression parent = (ArrayAllocationExpression) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final ArrayAllocationExpression parent = (ArrayAllocationExpression) jdtTreeBuilder.getContextBuilder().getCurrentNode(); if (parent.dimensions == null) { return false; } @@ -867,10 +866,10 @@ public void visitCtConstructorCall(CtConstructorCall ctConstructorCall) { } private boolean hasChildEqualsToEnclosingInstance(CtConstructorCall ctConstructorCall) { - if (!(jdtTreeBuilder.getContextBuilder().stack.peek().node instanceof QualifiedAllocationExpression)) { + if (!(jdtTreeBuilder.getContextBuilder().getCurrentNode() instanceof QualifiedAllocationExpression)) { return false; } - final QualifiedAllocationExpression parent = (QualifiedAllocationExpression) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final QualifiedAllocationExpression parent = (QualifiedAllocationExpression) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // Enclosing instance is equals to the jdt child. return parent.enclosingInstance != null && getFinalExpressionFromCast(parent.enclosingInstance).equals(childJDT) // Enclosing instance not yet initialized. @@ -878,7 +877,7 @@ private boolean hasChildEqualsToEnclosingInstance(CtConstructorCall ctCon } private boolean hasChildEqualsToType(CtConstructorCall ctConstructorCall) { - final AllocationExpression parent = (AllocationExpression) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final AllocationExpression parent = (AllocationExpression) jdtTreeBuilder.getContextBuilder().getCurrentNode(); // Type is equals to the jdt child. return parent.type != null && parent.type.equals(childJDT); } @@ -888,7 +887,7 @@ private boolean hasChildEqualsToType(CtConstructorCall ctConstructorCall) public void visitCtNewClass(CtNewClass newClass) { if (child instanceof CtClass) { newClass.setAnonymousClass((CtClass) child); - final QualifiedAllocationExpression node = (QualifiedAllocationExpression) jdtTreeBuilder.getContextBuilder().stack.peek().node; + final QualifiedAllocationExpression node = (QualifiedAllocationExpression) jdtTreeBuilder.getContextBuilder().getCurrentNode(); final ReferenceBinding[] referenceBindings = node.resolvedType == null ? null : node.resolvedType.superInterfaces(); if (referenceBindings != null && referenceBindings.length > 0) { //the interface of anonymous class is not printed so it must have no position @@ -1066,7 +1065,7 @@ public void visitCtTryWithResource(CtTryWithResource tryWithResource) { .clone().setImplicit(true).putMetadata(CtTryWithResource.RESOURCE_REF_KEY, variableRef)); } else { // we have to find it manually - outer: for (ASTPair pair: this.jdtTreeBuilder.getContextBuilder().stack) { + outer: for (ASTPair pair: this.jdtTreeBuilder.getContextBuilder().getAllContexts()) { final List variables = pair.element.getElements(new TypeFilter<>(CtLocalVariable.class)); for (CtLocalVariable v: variables) { if (v.getSimpleName().equals(variableRef.getSimpleName())) { diff --git a/src/main/java/spoon/support/compiler/jdt/PositionBuilder.java b/src/main/java/spoon/support/compiler/jdt/PositionBuilder.java index 5df478fa620..59a0cf511ec 100644 --- a/src/main/java/spoon/support/compiler/jdt/PositionBuilder.java +++ b/src/main/java/spoon/support/compiler/jdt/PositionBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; @@ -467,7 +467,7 @@ SourcePosition buildPositionCtElement(CtElement e, ASTNode node) { } private int getParentsSourceStart() { - Iterator iter = this.jdtTreeBuilder.getContextBuilder().stack.iterator(); + Iterator iter = this.jdtTreeBuilder.getContextBuilder().getAllContexts().iterator(); if (iter.hasNext()) { iter.next(); if (iter.hasNext()) { @@ -519,7 +519,6 @@ SourcePosition buildPosition(CtCatch catcher) { lineSeparatorPositions); } - @Nullable SourcePosition buildPosition(CtCase child) { List statements = child.getStatements(); SourcePosition oldPosition = child.getPosition(); diff --git a/src/main/java/spoon/support/compiler/jdt/ReferenceBuilder.java b/src/main/java/spoon/support/compiler/jdt/ReferenceBuilder.java index 4bd2980db26..9b566123e13 100644 --- a/src/main/java/spoon/support/compiler/jdt/ReferenceBuilder.java +++ b/src/main/java/spoon/support/compiler/jdt/ReferenceBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; @@ -60,6 +60,7 @@ import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; +import org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding; import org.eclipse.jdt.internal.compiler.lookup.VariableBinding; import org.eclipse.jdt.internal.compiler.lookup.VoidTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; @@ -90,7 +91,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Deque; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -453,6 +453,12 @@ CtExecutableReference getExecutableReference(MethodBinding exec, int sour // original() method returns a result not null when the current method is generic. if (exec.original() != null) { + // if polymorphic, the original return type differs from the actual return type + // therefore we use the original one here + // see https://github.com/INRIA/spoon/issues/4863 + if (exec.isPolymorphic()) { + ref.setType(getTypeReference(exec.original().returnType)); + } final List> parameters = new ArrayList<>(exec.original().parameters.length); for (TypeBinding b : exec.original().parameters) { parameters.add(getTypeReference(b, true)); @@ -667,14 +673,14 @@ private void insertGenericTypesInNoClasspathFromJDTInSpoon(TypeReference ori * See #3360 for details. */ private void tryRecoverTypeArguments(CtTypeReference type) { - final Deque stack = jdtTreeBuilder.getContextBuilder().stack; - if (stack.peek() == null || !(stack.peek().node instanceof AllocationExpression)) { + ContextBuilder contextBuilder = jdtTreeBuilder.getContextBuilder(); + if (!contextBuilder.hasCurrentContext() || !(contextBuilder.getCurrentNode() instanceof AllocationExpression)) { // have thus far only ended up here with a generic array type, // don't know if we want or need to deal with those return; } - AllocationExpression alloc = (AllocationExpression) stack.peek().node; + AllocationExpression alloc = (AllocationExpression) contextBuilder.getCurrentNode(); if (alloc.expectedType() instanceof ParameterizedTypeBinding) { ParameterizedTypeBinding expectedType = (ParameterizedTypeBinding) alloc.expectedType(); if (expectedType.typeArguments() != null) { @@ -862,6 +868,8 @@ CtTypeReference getTypeReference(TypeBinding binding, boolean resolveGene ref = getTypeReferenceFromProblemReferenceBinding((ProblemReferenceBinding) binding); } else if (binding instanceof IntersectionTypeBinding18) { ref = getTypeReferenceFromIntersectionTypeBinding((IntersectionTypeBinding18) binding); + } else if (binding instanceof UnresolvedReferenceBinding) { + ref = getTypeReferenceFromUnresolvedReferenceBinding((UnresolvedReferenceBinding) binding); } else { throw new RuntimeException("Unknown TypeBinding: " + binding.getClass() + " " + binding); } @@ -870,6 +878,25 @@ CtTypeReference getTypeReference(TypeBinding binding, boolean resolveGene return (CtTypeReference) ref; } + /** + * Resolves a {@link UnresolvedReferenceBinding} to their closest match. + * For this we use the {@link UnresolvedReferenceBinding#closestMatch()} method. This is a best effort approach and can fail. + * + * @param binding the binding to resolve to a type reference. + * @return a type reference or null if the binding has no closest match + */ + @SuppressWarnings("ReturnOfNull") + private CtTypeReference getTypeReferenceFromUnresolvedReferenceBinding(UnresolvedReferenceBinding binding) { + TypeBinding closestMatch = binding.closestMatch(); + if (closestMatch != null) { + CtTypeReference ref = this.jdtTreeBuilder.getFactory().Core().createTypeReference(); + ref.setSimpleName(new String(binding.sourceName())); + ref.setPackage(getPackageReference(binding.getPackage())); + return ref; + } + return null; + } + private static boolean isParameterizedProblemReferenceBinding(TypeBinding binding) { String sourceName = String.valueOf(binding.sourceName()); return binding instanceof ProblemReferenceBinding && typeRefContainsTypeArgs(sourceName); @@ -1168,26 +1195,25 @@ private CtTypeReference getCtCircularTypeReference(TypeBinding b) { return bindingCache.get(b).clone(); } - CtFieldReference getVariableReference(FieldBinding varbin) { + CtFieldReference getVariableReference(TypeBinding type, FieldBinding varbin) { CtFieldReference ref = this.jdtTreeBuilder.getFactory().Core().createFieldReference(); if (varbin == null) { return ref; } ref.setSimpleName(new String(varbin.name)); ref.setType(this.getTypeReference(varbin.type)); - - if (varbin.declaringClass != null) { - ref.setDeclaringType(getTypeReference(varbin.declaringClass)); + if (type != null && type.isArrayType()) { + ref.setDeclaringType(getTypeReference(type)); } else { - ref.setDeclaringType(ref.getType() == null ? null : ref.getType().clone()); + ref.setDeclaringType(getTypeReference(varbin.declaringClass)); } ref.setFinal(varbin.isFinal()); ref.setStatic((varbin.modifiers & ClassFileConstants.AccStatic) != 0); return ref; } - CtFieldReference getVariableReference(FieldBinding fieldBinding, char[] tokens) { - final CtFieldReference ref = getVariableReference(fieldBinding); + CtFieldReference getVariableReference(TypeBinding type, FieldBinding fieldBinding, char[] tokens) { + final CtFieldReference ref = getVariableReference(type, fieldBinding); if (fieldBinding != null) { return ref; } @@ -1199,7 +1225,7 @@ CtFieldReference getVariableReference(FieldBinding fieldBinding, char[] t CtVariableReference getVariableReference(VariableBinding varbin) { if (varbin instanceof FieldBinding) { - return getVariableReference((FieldBinding) varbin); + return getVariableReference(((FieldBinding) varbin).declaringClass, (FieldBinding) varbin); } else if (varbin instanceof LocalVariableBinding) { final LocalVariableBinding localVariableBinding = (LocalVariableBinding) varbin; if (localVariableBinding.declaration instanceof Argument && localVariableBinding.declaringScope instanceof MethodScope) { @@ -1308,7 +1334,7 @@ private static boolean containsStarImport(ImportReference[] imports) { */ public CtExecutableReference getLambdaExecutableReference(SingleNameReference singleNameReference) { ASTPair potentialLambda = null; - for (ASTPair astPair : jdtTreeBuilder.getContextBuilder().stack) { + for (ASTPair astPair : jdtTreeBuilder.getContextBuilder().getAllContexts()) { if (astPair.node instanceof LambdaExpression) { potentialLambda = astPair; // stop at innermost lambda, fixes #1100 diff --git a/src/main/java/spoon/support/compiler/jdt/TreeBuilderCompiler.java b/src/main/java/spoon/support/compiler/jdt/TreeBuilderCompiler.java index b63b4ce4b49..8c27439ed06 100644 --- a/src/main/java/spoon/support/compiler/jdt/TreeBuilderCompiler.java +++ b/src/main/java/spoon/support/compiler/jdt/TreeBuilderCompiler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/compiler/jdt/TreeBuilderRequestor.java b/src/main/java/spoon/support/compiler/jdt/TreeBuilderRequestor.java index dfe934a3557..fc856c132a3 100644 --- a/src/main/java/spoon/support/compiler/jdt/TreeBuilderRequestor.java +++ b/src/main/java/spoon/support/compiler/jdt/TreeBuilderRequestor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.compiler.jdt; diff --git a/src/main/java/spoon/support/gui/SpoonModelTree.java b/src/main/java/spoon/support/gui/SpoonModelTree.java index 66ff9b62011..c78eff90043 100644 --- a/src/main/java/spoon/support/gui/SpoonModelTree.java +++ b/src/main/java/spoon/support/gui/SpoonModelTree.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.gui; diff --git a/src/main/java/spoon/support/gui/SpoonObjectFieldsTable.java b/src/main/java/spoon/support/gui/SpoonObjectFieldsTable.java index 1ea1aa2c6ea..5f80fd90289 100644 --- a/src/main/java/spoon/support/gui/SpoonObjectFieldsTable.java +++ b/src/main/java/spoon/support/gui/SpoonObjectFieldsTable.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.gui; diff --git a/src/main/java/spoon/support/gui/SpoonTreeBuilder.java b/src/main/java/spoon/support/gui/SpoonTreeBuilder.java index 42b953deed7..d30df3fd19b 100644 --- a/src/main/java/spoon/support/gui/SpoonTreeBuilder.java +++ b/src/main/java/spoon/support/gui/SpoonTreeBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.gui; diff --git a/src/main/java/spoon/support/modelobs/ActionBasedChangeListener.java b/src/main/java/spoon/support/modelobs/ActionBasedChangeListener.java index fdef324bbce..98fbea686e8 100644 --- a/src/main/java/spoon/support/modelobs/ActionBasedChangeListener.java +++ b/src/main/java/spoon/support/modelobs/ActionBasedChangeListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs; diff --git a/src/main/java/spoon/support/modelobs/ActionBasedChangeListenerImpl.java b/src/main/java/spoon/support/modelobs/ActionBasedChangeListenerImpl.java index 75704c609bd..587ee430e88 100644 --- a/src/main/java/spoon/support/modelobs/ActionBasedChangeListenerImpl.java +++ b/src/main/java/spoon/support/modelobs/ActionBasedChangeListenerImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs; diff --git a/src/main/java/spoon/support/modelobs/ChangeCollector.java b/src/main/java/spoon/support/modelobs/ChangeCollector.java index 89f0e72761f..2324e8f6a79 100644 --- a/src/main/java/spoon/support/modelobs/ChangeCollector.java +++ b/src/main/java/spoon/support/modelobs/ChangeCollector.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs; diff --git a/src/main/java/spoon/support/modelobs/EmptyModelChangeListener.java b/src/main/java/spoon/support/modelobs/EmptyModelChangeListener.java index e5c8ac38022..47a9c478ba0 100644 --- a/src/main/java/spoon/support/modelobs/EmptyModelChangeListener.java +++ b/src/main/java/spoon/support/modelobs/EmptyModelChangeListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs; diff --git a/src/main/java/spoon/support/modelobs/FineModelChangeListener.java b/src/main/java/spoon/support/modelobs/FineModelChangeListener.java index fc522d96980..e3a5ea52bbf 100644 --- a/src/main/java/spoon/support/modelobs/FineModelChangeListener.java +++ b/src/main/java/spoon/support/modelobs/FineModelChangeListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs; diff --git a/src/main/java/spoon/support/modelobs/SourceFragmentCreator.java b/src/main/java/spoon/support/modelobs/SourceFragmentCreator.java index 2d10e278986..17fc737177f 100644 --- a/src/main/java/spoon/support/modelobs/SourceFragmentCreator.java +++ b/src/main/java/spoon/support/modelobs/SourceFragmentCreator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs; diff --git a/src/main/java/spoon/support/modelobs/action/Action.java b/src/main/java/spoon/support/modelobs/action/Action.java index 4a25a0ef998..10559b65b52 100644 --- a/src/main/java/spoon/support/modelobs/action/Action.java +++ b/src/main/java/spoon/support/modelobs/action/Action.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.action; diff --git a/src/main/java/spoon/support/modelobs/action/AddAction.java b/src/main/java/spoon/support/modelobs/action/AddAction.java index 05076460c34..4e8ddb992bb 100644 --- a/src/main/java/spoon/support/modelobs/action/AddAction.java +++ b/src/main/java/spoon/support/modelobs/action/AddAction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.action; diff --git a/src/main/java/spoon/support/modelobs/action/DeleteAction.java b/src/main/java/spoon/support/modelobs/action/DeleteAction.java index 025121c974c..8a3c6a750b6 100644 --- a/src/main/java/spoon/support/modelobs/action/DeleteAction.java +++ b/src/main/java/spoon/support/modelobs/action/DeleteAction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.action; diff --git a/src/main/java/spoon/support/modelobs/action/DeleteAllAction.java b/src/main/java/spoon/support/modelobs/action/DeleteAllAction.java index fecfb4d3690..f801af4f499 100644 --- a/src/main/java/spoon/support/modelobs/action/DeleteAllAction.java +++ b/src/main/java/spoon/support/modelobs/action/DeleteAllAction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.action; diff --git a/src/main/java/spoon/support/modelobs/action/UpdateAction.java b/src/main/java/spoon/support/modelobs/action/UpdateAction.java index 6dda91f344b..bc71164aceb 100644 --- a/src/main/java/spoon/support/modelobs/action/UpdateAction.java +++ b/src/main/java/spoon/support/modelobs/action/UpdateAction.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.action; diff --git a/src/main/java/spoon/support/modelobs/context/CollectionContext.java b/src/main/java/spoon/support/modelobs/context/CollectionContext.java index 69205cd7b5b..a62ce8f52e3 100644 --- a/src/main/java/spoon/support/modelobs/context/CollectionContext.java +++ b/src/main/java/spoon/support/modelobs/context/CollectionContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.context; diff --git a/src/main/java/spoon/support/modelobs/context/Context.java b/src/main/java/spoon/support/modelobs/context/Context.java index af7cfab906d..0b9cf6c3520 100644 --- a/src/main/java/spoon/support/modelobs/context/Context.java +++ b/src/main/java/spoon/support/modelobs/context/Context.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.context; diff --git a/src/main/java/spoon/support/modelobs/context/ListContext.java b/src/main/java/spoon/support/modelobs/context/ListContext.java index 2e7727cb139..ec34ff330ff 100644 --- a/src/main/java/spoon/support/modelobs/context/ListContext.java +++ b/src/main/java/spoon/support/modelobs/context/ListContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.context; diff --git a/src/main/java/spoon/support/modelobs/context/MapContext.java b/src/main/java/spoon/support/modelobs/context/MapContext.java index a69eb315bb8..20b231d7a18 100644 --- a/src/main/java/spoon/support/modelobs/context/MapContext.java +++ b/src/main/java/spoon/support/modelobs/context/MapContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.context; diff --git a/src/main/java/spoon/support/modelobs/context/ObjectContext.java b/src/main/java/spoon/support/modelobs/context/ObjectContext.java index 37cefa4ef68..b47b2277b86 100644 --- a/src/main/java/spoon/support/modelobs/context/ObjectContext.java +++ b/src/main/java/spoon/support/modelobs/context/ObjectContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.context; diff --git a/src/main/java/spoon/support/modelobs/context/SetContext.java b/src/main/java/spoon/support/modelobs/context/SetContext.java index 6dca39d9bbc..65404f1a8f5 100644 --- a/src/main/java/spoon/support/modelobs/context/SetContext.java +++ b/src/main/java/spoon/support/modelobs/context/SetContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.modelobs.context; diff --git a/src/main/java/spoon/support/package-info.java b/src/main/java/spoon/support/package-info.java index 5c0721158b3..80b804cc442 100644 --- a/src/main/java/spoon/support/package-info.java +++ b/src/main/java/spoon/support/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package contains some default implementations for commonly used processing tasks.

diff --git a/src/main/java/spoon/support/reflect/CtExtendedModifier.java b/src/main/java/spoon/support/reflect/CtExtendedModifier.java index f93a76ea12f..3fb74373f63 100644 --- a/src/main/java/spoon/support/reflect/CtExtendedModifier.java +++ b/src/main/java/spoon/support/reflect/CtExtendedModifier.java @@ -2,9 +2,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect; diff --git a/src/main/java/spoon/support/reflect/CtModifierHandler.java b/src/main/java/spoon/support/reflect/CtModifierHandler.java index 1cd43091cc5..66bf2623d8c 100644 --- a/src/main/java/spoon/support/reflect/CtModifierHandler.java +++ b/src/main/java/spoon/support/reflect/CtModifierHandler.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect; diff --git a/src/main/java/spoon/support/reflect/code/CtAnnotationFieldAccessImpl.java b/src/main/java/spoon/support/reflect/code/CtAnnotationFieldAccessImpl.java index 040ae233400..fa4bf1bc691 100644 --- a/src/main/java/spoon/support/reflect/code/CtAnnotationFieldAccessImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtAnnotationFieldAccessImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtArrayAccessImpl.java b/src/main/java/spoon/support/reflect/code/CtArrayAccessImpl.java index 63e9eb1e3bc..276c09a9986 100644 --- a/src/main/java/spoon/support/reflect/code/CtArrayAccessImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtArrayAccessImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtArrayReadImpl.java b/src/main/java/spoon/support/reflect/code/CtArrayReadImpl.java index 0f6a2cc0e35..16a1e4f8fa1 100644 --- a/src/main/java/spoon/support/reflect/code/CtArrayReadImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtArrayReadImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtArrayWriteImpl.java b/src/main/java/spoon/support/reflect/code/CtArrayWriteImpl.java index 7c6ee3778ca..9b03b91bf0a 100644 --- a/src/main/java/spoon/support/reflect/code/CtArrayWriteImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtArrayWriteImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtAssertImpl.java b/src/main/java/spoon/support/reflect/code/CtAssertImpl.java index 19b9d1a665e..2b467fcb59d 100644 --- a/src/main/java/spoon/support/reflect/code/CtAssertImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtAssertImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtAssignmentImpl.java b/src/main/java/spoon/support/reflect/code/CtAssignmentImpl.java index 3f4aad373d1..a10d8c307d6 100644 --- a/src/main/java/spoon/support/reflect/code/CtAssignmentImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtAssignmentImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtBinaryOperatorImpl.java b/src/main/java/spoon/support/reflect/code/CtBinaryOperatorImpl.java index f80085ef896..83cc117353d 100644 --- a/src/main/java/spoon/support/reflect/code/CtBinaryOperatorImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtBinaryOperatorImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtBlockImpl.java b/src/main/java/spoon/support/reflect/code/CtBlockImpl.java index 4eb5289fe42..cdf0fa79111 100644 --- a/src/main/java/spoon/support/reflect/code/CtBlockImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtBlockImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtBreakImpl.java b/src/main/java/spoon/support/reflect/code/CtBreakImpl.java index 7a6d5481f20..27733ef43a1 100644 --- a/src/main/java/spoon/support/reflect/code/CtBreakImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtBreakImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtCaseImpl.java b/src/main/java/spoon/support/reflect/code/CtCaseImpl.java index 1305291ecef..d0518dc636b 100644 --- a/src/main/java/spoon/support/reflect/code/CtCaseImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCaseImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtCatchImpl.java b/src/main/java/spoon/support/reflect/code/CtCatchImpl.java index 42e69b04c34..93822552519 100644 --- a/src/main/java/spoon/support/reflect/code/CtCatchImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCatchImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtCatchVariableImpl.java b/src/main/java/spoon/support/reflect/code/CtCatchVariableImpl.java index b4d5e5fc151..3137122dcc6 100644 --- a/src/main/java/spoon/support/reflect/code/CtCatchVariableImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCatchVariableImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtCodeElementImpl.java b/src/main/java/spoon/support/reflect/code/CtCodeElementImpl.java index 48149831936..1ec1accad8f 100644 --- a/src/main/java/spoon/support/reflect/code/CtCodeElementImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCodeElementImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtCodeSnippetExpressionImpl.java b/src/main/java/spoon/support/reflect/code/CtCodeSnippetExpressionImpl.java index 0795420bca9..a246a33035a 100644 --- a/src/main/java/spoon/support/reflect/code/CtCodeSnippetExpressionImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCodeSnippetExpressionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtCodeSnippetStatementImpl.java b/src/main/java/spoon/support/reflect/code/CtCodeSnippetStatementImpl.java index dee85c7c3ef..0b3fa986240 100644 --- a/src/main/java/spoon/support/reflect/code/CtCodeSnippetStatementImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCodeSnippetStatementImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtCommentImpl.java b/src/main/java/spoon/support/reflect/code/CtCommentImpl.java index dc548202aeb..095a0815ad6 100644 --- a/src/main/java/spoon/support/reflect/code/CtCommentImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCommentImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtConditionalImpl.java b/src/main/java/spoon/support/reflect/code/CtConditionalImpl.java index 8c0fe5bdc02..13a2df441f5 100644 --- a/src/main/java/spoon/support/reflect/code/CtConditionalImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtConditionalImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtConstructorCallImpl.java b/src/main/java/spoon/support/reflect/code/CtConstructorCallImpl.java index 97aeb029ecd..78840b9946b 100644 --- a/src/main/java/spoon/support/reflect/code/CtConstructorCallImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtConstructorCallImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtContinueImpl.java b/src/main/java/spoon/support/reflect/code/CtContinueImpl.java index abd5d1c9db7..55edd2746c5 100644 --- a/src/main/java/spoon/support/reflect/code/CtContinueImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtContinueImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtDoImpl.java b/src/main/java/spoon/support/reflect/code/CtDoImpl.java index 0f766d19359..1ee14519f11 100644 --- a/src/main/java/spoon/support/reflect/code/CtDoImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtDoImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtExecutableReferenceExpressionImpl.java b/src/main/java/spoon/support/reflect/code/CtExecutableReferenceExpressionImpl.java index aec4ec27ea8..b5b9e573176 100644 --- a/src/main/java/spoon/support/reflect/code/CtExecutableReferenceExpressionImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtExecutableReferenceExpressionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtExpressionImpl.java b/src/main/java/spoon/support/reflect/code/CtExpressionImpl.java index 5d707c46331..6b0374b6228 100644 --- a/src/main/java/spoon/support/reflect/code/CtExpressionImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtExpressionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtFieldAccessImpl.java b/src/main/java/spoon/support/reflect/code/CtFieldAccessImpl.java index 6c3f7c445f7..fd70233ece3 100644 --- a/src/main/java/spoon/support/reflect/code/CtFieldAccessImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtFieldAccessImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtFieldReadImpl.java b/src/main/java/spoon/support/reflect/code/CtFieldReadImpl.java index 256977a3eff..43f80609615 100644 --- a/src/main/java/spoon/support/reflect/code/CtFieldReadImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtFieldReadImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtFieldWriteImpl.java b/src/main/java/spoon/support/reflect/code/CtFieldWriteImpl.java index 2e106cd024a..93d9fa63bda 100644 --- a/src/main/java/spoon/support/reflect/code/CtFieldWriteImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtFieldWriteImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtForEachImpl.java b/src/main/java/spoon/support/reflect/code/CtForEachImpl.java index 39739073c66..8d9623b3416 100644 --- a/src/main/java/spoon/support/reflect/code/CtForEachImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtForEachImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtForImpl.java b/src/main/java/spoon/support/reflect/code/CtForImpl.java index 1d87bb8b76b..6ec6e7c17fb 100644 --- a/src/main/java/spoon/support/reflect/code/CtForImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtForImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtIfImpl.java b/src/main/java/spoon/support/reflect/code/CtIfImpl.java index 66604eda1a9..94e64a49c3d 100644 --- a/src/main/java/spoon/support/reflect/code/CtIfImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtIfImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtInvocationImpl.java b/src/main/java/spoon/support/reflect/code/CtInvocationImpl.java index 2c21adc061d..c7eaa354ce0 100644 --- a/src/main/java/spoon/support/reflect/code/CtInvocationImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtInvocationImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtJavaDocImpl.java b/src/main/java/spoon/support/reflect/code/CtJavaDocImpl.java index f95d667ea96..e998f875a97 100644 --- a/src/main/java/spoon/support/reflect/code/CtJavaDocImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtJavaDocImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtJavaDocTagImpl.java b/src/main/java/spoon/support/reflect/code/CtJavaDocTagImpl.java index 9563249ecb9..c8878af44ec 100644 --- a/src/main/java/spoon/support/reflect/code/CtJavaDocTagImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtJavaDocTagImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtLambdaImpl.java b/src/main/java/spoon/support/reflect/code/CtLambdaImpl.java index 5b8608942e4..d88da66226a 100644 --- a/src/main/java/spoon/support/reflect/code/CtLambdaImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtLambdaImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtLiteralImpl.java b/src/main/java/spoon/support/reflect/code/CtLiteralImpl.java index 0a9450228d7..77332dd0d74 100644 --- a/src/main/java/spoon/support/reflect/code/CtLiteralImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtLiteralImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtLocalVariableImpl.java b/src/main/java/spoon/support/reflect/code/CtLocalVariableImpl.java index 46dcd66ce73..dd9c14b3540 100644 --- a/src/main/java/spoon/support/reflect/code/CtLocalVariableImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtLocalVariableImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtLoopImpl.java b/src/main/java/spoon/support/reflect/code/CtLoopImpl.java index 0b94e0c1f0b..512d9e72b9b 100644 --- a/src/main/java/spoon/support/reflect/code/CtLoopImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtLoopImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtNewArrayImpl.java b/src/main/java/spoon/support/reflect/code/CtNewArrayImpl.java index 36ce7d8b49a..5e0fb435519 100644 --- a/src/main/java/spoon/support/reflect/code/CtNewArrayImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtNewArrayImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtNewClassImpl.java b/src/main/java/spoon/support/reflect/code/CtNewClassImpl.java index 4db0c7585c3..7f5cd4a61de 100644 --- a/src/main/java/spoon/support/reflect/code/CtNewClassImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtNewClassImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtOperatorAssignmentImpl.java b/src/main/java/spoon/support/reflect/code/CtOperatorAssignmentImpl.java index c82b17739d7..a873dc1ac89 100644 --- a/src/main/java/spoon/support/reflect/code/CtOperatorAssignmentImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtOperatorAssignmentImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtReturnImpl.java b/src/main/java/spoon/support/reflect/code/CtReturnImpl.java index 2185be459d0..9b7922b7d86 100644 --- a/src/main/java/spoon/support/reflect/code/CtReturnImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtReturnImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtStatementImpl.java b/src/main/java/spoon/support/reflect/code/CtStatementImpl.java index 64211aabcd9..9d33b25c95c 100644 --- a/src/main/java/spoon/support/reflect/code/CtStatementImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtStatementImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtStatementListImpl.java b/src/main/java/spoon/support/reflect/code/CtStatementListImpl.java index 5a94e12278e..13cfc812c72 100644 --- a/src/main/java/spoon/support/reflect/code/CtStatementListImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtStatementListImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtSuperAccessImpl.java b/src/main/java/spoon/support/reflect/code/CtSuperAccessImpl.java index 10ba098987c..bf4c61b29b9 100644 --- a/src/main/java/spoon/support/reflect/code/CtSuperAccessImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtSuperAccessImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtSwitchExpressionImpl.java b/src/main/java/spoon/support/reflect/code/CtSwitchExpressionImpl.java index 632e22b7062..9875d95ba94 100644 --- a/src/main/java/spoon/support/reflect/code/CtSwitchExpressionImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtSwitchExpressionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtSwitchImpl.java b/src/main/java/spoon/support/reflect/code/CtSwitchImpl.java index 4c212f570f5..3729293803f 100644 --- a/src/main/java/spoon/support/reflect/code/CtSwitchImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtSwitchImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtSynchronizedImpl.java b/src/main/java/spoon/support/reflect/code/CtSynchronizedImpl.java index a746cd18c39..2c1234fcb9d 100644 --- a/src/main/java/spoon/support/reflect/code/CtSynchronizedImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtSynchronizedImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtTargetedExpressionImpl.java b/src/main/java/spoon/support/reflect/code/CtTargetedExpressionImpl.java index f5894170179..8056be605a8 100644 --- a/src/main/java/spoon/support/reflect/code/CtTargetedExpressionImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtTargetedExpressionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtTextBlockImpl.java b/src/main/java/spoon/support/reflect/code/CtTextBlockImpl.java index b0251bab11e..467f92a34e7 100644 --- a/src/main/java/spoon/support/reflect/code/CtTextBlockImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtTextBlockImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtThisAccessImpl.java b/src/main/java/spoon/support/reflect/code/CtThisAccessImpl.java index 9355b0b3576..66e9c476764 100644 --- a/src/main/java/spoon/support/reflect/code/CtThisAccessImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtThisAccessImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtThrowImpl.java b/src/main/java/spoon/support/reflect/code/CtThrowImpl.java index 964a7d42b7a..b09dbf4211e 100644 --- a/src/main/java/spoon/support/reflect/code/CtThrowImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtThrowImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtTryImpl.java b/src/main/java/spoon/support/reflect/code/CtTryImpl.java index f50ea9e2ff3..df47a9a0a88 100644 --- a/src/main/java/spoon/support/reflect/code/CtTryImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtTryImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtTryWithResourceImpl.java b/src/main/java/spoon/support/reflect/code/CtTryWithResourceImpl.java index 21ea704d98c..2a358270055 100644 --- a/src/main/java/spoon/support/reflect/code/CtTryWithResourceImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtTryWithResourceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtTypeAccessImpl.java b/src/main/java/spoon/support/reflect/code/CtTypeAccessImpl.java index bb847e48c8e..840b1555873 100644 --- a/src/main/java/spoon/support/reflect/code/CtTypeAccessImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtTypeAccessImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtTypePatternImpl.java b/src/main/java/spoon/support/reflect/code/CtTypePatternImpl.java index 191ea44ec4c..4c8e6e3378f 100644 --- a/src/main/java/spoon/support/reflect/code/CtTypePatternImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtTypePatternImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtUnaryOperatorImpl.java b/src/main/java/spoon/support/reflect/code/CtUnaryOperatorImpl.java index 01a1ea746b8..0a92e05ffc8 100644 --- a/src/main/java/spoon/support/reflect/code/CtUnaryOperatorImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtUnaryOperatorImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtVariableAccessImpl.java b/src/main/java/spoon/support/reflect/code/CtVariableAccessImpl.java index 2604cc73b58..52e496e1ba3 100644 --- a/src/main/java/spoon/support/reflect/code/CtVariableAccessImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtVariableAccessImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtVariableReadImpl.java b/src/main/java/spoon/support/reflect/code/CtVariableReadImpl.java index 3f3e23b71b8..5c159528a2a 100644 --- a/src/main/java/spoon/support/reflect/code/CtVariableReadImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtVariableReadImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtVariableWriteImpl.java b/src/main/java/spoon/support/reflect/code/CtVariableWriteImpl.java index 5ea26bc8972..76978eb7495 100644 --- a/src/main/java/spoon/support/reflect/code/CtVariableWriteImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtVariableWriteImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtWhileImpl.java b/src/main/java/spoon/support/reflect/code/CtWhileImpl.java index 3b8813ed02e..6a729eb5460 100644 --- a/src/main/java/spoon/support/reflect/code/CtWhileImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtWhileImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/code/CtYieldStatementImpl.java b/src/main/java/spoon/support/reflect/code/CtYieldStatementImpl.java index c77e58a330d..a1767035366 100644 --- a/src/main/java/spoon/support/reflect/code/CtYieldStatementImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtYieldStatementImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.code; diff --git a/src/main/java/spoon/support/reflect/cu/position/BodyHolderSourcePositionImpl.java b/src/main/java/spoon/support/reflect/cu/position/BodyHolderSourcePositionImpl.java index 4993241075c..27f89e19e0f 100644 --- a/src/main/java/spoon/support/reflect/cu/position/BodyHolderSourcePositionImpl.java +++ b/src/main/java/spoon/support/reflect/cu/position/BodyHolderSourcePositionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.cu.position; diff --git a/src/main/java/spoon/support/reflect/cu/position/CompoundSourcePositionImpl.java b/src/main/java/spoon/support/reflect/cu/position/CompoundSourcePositionImpl.java index 8d04328dc47..aea3e94a200 100644 --- a/src/main/java/spoon/support/reflect/cu/position/CompoundSourcePositionImpl.java +++ b/src/main/java/spoon/support/reflect/cu/position/CompoundSourcePositionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.cu.position; diff --git a/src/main/java/spoon/support/reflect/cu/position/DeclarationSourcePositionImpl.java b/src/main/java/spoon/support/reflect/cu/position/DeclarationSourcePositionImpl.java index 4521ff76a9d..a322a69f2c7 100644 --- a/src/main/java/spoon/support/reflect/cu/position/DeclarationSourcePositionImpl.java +++ b/src/main/java/spoon/support/reflect/cu/position/DeclarationSourcePositionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.cu.position; diff --git a/src/main/java/spoon/support/reflect/cu/position/PartialSourcePositionImpl.java b/src/main/java/spoon/support/reflect/cu/position/PartialSourcePositionImpl.java index a0ed37fd602..dd735befb17 100644 --- a/src/main/java/spoon/support/reflect/cu/position/PartialSourcePositionImpl.java +++ b/src/main/java/spoon/support/reflect/cu/position/PartialSourcePositionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.cu.position; diff --git a/src/main/java/spoon/support/reflect/cu/position/SourcePositionImpl.java b/src/main/java/spoon/support/reflect/cu/position/SourcePositionImpl.java index cf1d73525c4..2a4533086d2 100644 --- a/src/main/java/spoon/support/reflect/cu/position/SourcePositionImpl.java +++ b/src/main/java/spoon/support/reflect/cu/position/SourcePositionImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.cu.position; diff --git a/src/main/java/spoon/support/reflect/declaration/CtAnnotationImpl.java b/src/main/java/spoon/support/reflect/declaration/CtAnnotationImpl.java index 65c3a7cef92..5ee3e8e199e 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtAnnotationImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtAnnotationImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtAnnotationMethodImpl.java b/src/main/java/spoon/support/reflect/declaration/CtAnnotationMethodImpl.java index 893e727be20..f518353228c 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtAnnotationMethodImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtAnnotationMethodImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtAnnotationTypeImpl.java b/src/main/java/spoon/support/reflect/declaration/CtAnnotationTypeImpl.java index 52266c00227..8044d9152cb 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtAnnotationTypeImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtAnnotationTypeImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtAnonymousExecutableImpl.java b/src/main/java/spoon/support/reflect/declaration/CtAnonymousExecutableImpl.java index 24d200b9ab1..24affc19902 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtAnonymousExecutableImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtAnonymousExecutableImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtClassImpl.java b/src/main/java/spoon/support/reflect/declaration/CtClassImpl.java index c3272176f72..94d19c342a5 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtClassImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtClassImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtCompilationUnitImpl.java b/src/main/java/spoon/support/reflect/declaration/CtCompilationUnitImpl.java index 8e8c6e9f978..f46f7eb443e 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtCompilationUnitImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtCompilationUnitImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtConstructorImpl.java b/src/main/java/spoon/support/reflect/declaration/CtConstructorImpl.java index 1f75f287d21..08e04b1345d 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtConstructorImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtConstructorImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java b/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java index ef3ba2666a4..416638eeee6 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtEnumImpl.java b/src/main/java/spoon/support/reflect/declaration/CtEnumImpl.java index 08133d51ce1..99b59dafa1f 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtEnumImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtEnumImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtEnumValueImpl.java b/src/main/java/spoon/support/reflect/declaration/CtEnumValueImpl.java index 0bd359c7724..00073ec9fb9 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtEnumValueImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtEnumValueImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtExecutableImpl.java b/src/main/java/spoon/support/reflect/declaration/CtExecutableImpl.java index e596e30575f..578dca12d96 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtExecutableImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtExecutableImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtFieldImpl.java b/src/main/java/spoon/support/reflect/declaration/CtFieldImpl.java index a76cb0c059a..e3a311521cd 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtFieldImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtFieldImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtImportImpl.java b/src/main/java/spoon/support/reflect/declaration/CtImportImpl.java index cdfe093fd65..176e42cb439 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtImportImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtImportImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtInterfaceImpl.java b/src/main/java/spoon/support/reflect/declaration/CtInterfaceImpl.java index 11f6b912523..de136696c7f 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtInterfaceImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtInterfaceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java b/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java index 4132191657b..13f99a84af3 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtModuleImpl.java b/src/main/java/spoon/support/reflect/declaration/CtModuleImpl.java index 7c019e3dd5c..763664065f0 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtModuleImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtModuleImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtModuleRequirementImpl.java b/src/main/java/spoon/support/reflect/declaration/CtModuleRequirementImpl.java index 87ac7077fe0..9689fabfdff 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtModuleRequirementImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtModuleRequirementImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtNamedElementImpl.java b/src/main/java/spoon/support/reflect/declaration/CtNamedElementImpl.java index 2e197b5157c..9c6bc25af43 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtNamedElementImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtNamedElementImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtPackageDeclarationImpl.java b/src/main/java/spoon/support/reflect/declaration/CtPackageDeclarationImpl.java index 82a51244eba..e755e6f004b 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtPackageDeclarationImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtPackageDeclarationImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtPackageExportImpl.java b/src/main/java/spoon/support/reflect/declaration/CtPackageExportImpl.java index 91e82c2ad15..d286bd4cce4 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtPackageExportImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtPackageExportImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtPackageImpl.java b/src/main/java/spoon/support/reflect/declaration/CtPackageImpl.java index 6580786898a..5ba95a97c27 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtPackageImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtPackageImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtParameterImpl.java b/src/main/java/spoon/support/reflect/declaration/CtParameterImpl.java index 31e5ea53522..17bead6fe54 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtParameterImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtParameterImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtProvidedServiceImpl.java b/src/main/java/spoon/support/reflect/declaration/CtProvidedServiceImpl.java index a1f3848811b..c0425118dd8 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtProvidedServiceImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtProvidedServiceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtRecordComponentImpl.java b/src/main/java/spoon/support/reflect/declaration/CtRecordComponentImpl.java index 3f6cc375f36..9fb7553abbd 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtRecordComponentImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtRecordComponentImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtRecordImpl.java b/src/main/java/spoon/support/reflect/declaration/CtRecordImpl.java index 2e0e46d81e2..09914075639 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtRecordImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtRecordImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java b/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java index 808cef26002..43eabf5a0db 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtTypeParameterImpl.java b/src/main/java/spoon/support/reflect/declaration/CtTypeParameterImpl.java index d4d64e8d04b..9100149980c 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtTypeParameterImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtTypeParameterImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/CtUsedServiceImpl.java b/src/main/java/spoon/support/reflect/declaration/CtUsedServiceImpl.java index d768c65716e..5898bd1988d 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtUsedServiceImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtUsedServiceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/declaration/InvisibleArrayConstructorImpl.java b/src/main/java/spoon/support/reflect/declaration/InvisibleArrayConstructorImpl.java index a050c8e2b04..bb4c7bc9ddc 100644 --- a/src/main/java/spoon/support/reflect/declaration/InvisibleArrayConstructorImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/InvisibleArrayConstructorImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.declaration; diff --git a/src/main/java/spoon/support/reflect/eval/EvalHelper.java b/src/main/java/spoon/support/reflect/eval/EvalHelper.java index 04d5f8160bb..ce42411c456 100644 --- a/src/main/java/spoon/support/reflect/eval/EvalHelper.java +++ b/src/main/java/spoon/support/reflect/eval/EvalHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.eval; diff --git a/src/main/java/spoon/support/reflect/eval/InlinePartialEvaluator.java b/src/main/java/spoon/support/reflect/eval/InlinePartialEvaluator.java index 6bc2dee1a89..25253247cea 100644 --- a/src/main/java/spoon/support/reflect/eval/InlinePartialEvaluator.java +++ b/src/main/java/spoon/support/reflect/eval/InlinePartialEvaluator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.eval; diff --git a/src/main/java/spoon/support/reflect/eval/VisitorPartialEvaluator.java b/src/main/java/spoon/support/reflect/eval/VisitorPartialEvaluator.java index 6a8da0db61e..a12e0837db9 100644 --- a/src/main/java/spoon/support/reflect/eval/VisitorPartialEvaluator.java +++ b/src/main/java/spoon/support/reflect/eval/VisitorPartialEvaluator.java @@ -1,12 +1,13 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.eval; +import spoon.SpoonException; import spoon.reflect.code.CtAnnotationFieldAccess; import spoon.reflect.code.CtAssignment; import spoon.reflect.code.CtBinaryOperator; @@ -45,9 +46,11 @@ import spoon.reflect.reference.CtExecutableReference; import spoon.reflect.reference.CtTypeReference; import spoon.reflect.visitor.CtScanner; +import spoon.reflect.visitor.OperatorHelper; import spoon.support.util.RtHelper; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -62,7 +65,7 @@ public class VisitorPartialEvaluator extends CtScanner implements PartialEvaluat CtElement result; - Number convert(CtTypeReference type, Number n) { + static Number convert(CtTypeReference type, Number n) { if ((type.getActualClass() == int.class) || (type.getActualClass() == Integer.class)) { return n.intValue(); } @@ -115,96 +118,178 @@ void setResult(CtElement element) { result = element; } + @SuppressWarnings({"rawtypes", "unchecked"}) + private static CtLiteral promoteLiteral(CtTypeReference type, CtLiteral literal) { + CtLiteral result = literal.clone(); + result.setType(type.clone()); + + // check if there is no need to cast + if (literal.getType().unbox().equals(type.unbox())) { + result.setValue(literal.getValue()); + return result; + } + + // casting a primitive to a string: + if (type.equals(type.getFactory().Type().createReference(String.class)) && literal.getType().isPrimitive()) { + result.setValue(literal.getValue().toString()); + return result; + } + + // It is not possible to cast an Integer to a Double directly, which is a problem. + if (type.unbox().isPrimitive()) { + // for instances of Number, one can use the convert method: + if (literal.getValue() instanceof Number) { + result.setValue(convert(type, (Number) literal.getValue())); + } else { + // primitive types that do not implement Number are: + // boolean, char + + // NOTE: it does not make sense to cast a boolean to any other primitive type + if (literal.getValue() instanceof Character) { + result.setValue(convert(type, (int) ((char) literal.getValue()))); + } + } + } else { + result.setValue(type.getActualClass().cast(literal.getValue())); + } + + return result; + } + @Override - @SuppressWarnings("unchecked") public void visitCtBinaryOperator(CtBinaryOperator operator) { CtExpression left = evaluate(operator.getLeftHandOperand()); CtExpression right = evaluate(operator.getRightHandOperand()); + if ((left instanceof CtLiteral) && (right instanceof CtLiteral)) { - Object leftObject = ((CtLiteral) left).getValue(); - Object rightObject = ((CtLiteral) right).getValue(); - CtLiteral res = operator.getFactory().Core().createLiteral(); + CtLiteral leftLiteral = (CtLiteral) left; + CtLiteral rightLiteral = (CtLiteral) right; + + CtTypeReference promotedType = OperatorHelper.getPromotedType( + operator.getKind(), + leftLiteral, + rightLiteral + ).orElse(null); + + if (promotedType == null) { + return; + } + + leftLiteral = promoteLiteral(promotedType, leftLiteral); + rightLiteral = promoteLiteral(promotedType, rightLiteral); + Object leftObject = leftLiteral.getValue(); + Object rightObject = rightLiteral.getValue(); + + Object value; switch (operator.getKind()) { case AND: - res.setValue((Boolean) leftObject && (Boolean) rightObject); + value = (Boolean) leftObject && (Boolean) rightObject; break; case OR: - res.setValue((Boolean) leftObject || (Boolean) rightObject); + value = (Boolean) leftObject || (Boolean) rightObject; break; case EQ: if (leftObject == null) { - res.setValue(leftObject == rightObject); + value = leftObject == rightObject; } else { - res.setValue(leftObject.equals(rightObject)); + value = leftObject.equals(rightObject); } break; case NE: if (leftObject == null) { - res.setValue(leftObject != rightObject); + value = leftObject != rightObject; } else { - res.setValue(!leftObject.equals(rightObject)); + value = !leftObject.equals(rightObject); } break; case GE: - res.setValue(((Number) leftObject).doubleValue() >= ((Number) rightObject).doubleValue()); + value = ((Number) leftObject).doubleValue() >= ((Number) rightObject).doubleValue(); break; case LE: - res.setValue(((Number) leftObject).doubleValue() <= ((Number) rightObject).doubleValue()); + value = ((Number) leftObject).doubleValue() <= ((Number) rightObject).doubleValue(); break; case GT: - res.setValue(((Number) leftObject).doubleValue() > ((Number) rightObject).doubleValue()); + value = ((Number) leftObject).doubleValue() > ((Number) rightObject).doubleValue(); break; case LT: - res.setValue(((Number) leftObject).doubleValue() < ((Number) rightObject).doubleValue()); + value = ((Number) leftObject).doubleValue() < ((Number) rightObject).doubleValue(); break; case MINUS: - res.setValue(convert(operator.getType(), - ((Number) leftObject).doubleValue() - ((Number) rightObject).doubleValue())); + value = convert(operator.getType(), + ((Number) leftObject).doubleValue() - ((Number) rightObject).doubleValue()); break; case MUL: - res.setValue(convert(operator.getType(), - ((Number) leftObject).doubleValue() * ((Number) rightObject).doubleValue())); + value = convert(operator.getType(), + ((Number) leftObject).doubleValue() * ((Number) rightObject).doubleValue()); break; case DIV: - res.setValue(convert(operator.getType(), - ((Number) leftObject).doubleValue() / ((Number) rightObject).doubleValue())); + try { + // handle floating point division differently than integer division, because + // dividing by 0 is not an error for floating point numbers. + if (isFloatingType(operator.getType())) { + value = convert(operator.getType(), + ((Number) leftObject).doubleValue() / ((Number) rightObject).doubleValue()); + } else { + value = convert(operator.getType(), + ((Number) leftObject).longValue() / ((Number) rightObject).longValue()); + } + } catch (ArithmeticException exception) { + // division by 0 + throw new SpoonException( + String.format( + "Expression '%s' evaluates to '%s %s %s' which can not be evaluated", + operator, + leftObject, + OperatorHelper.getOperatorText(operator.getKind()), + rightObject + ), + exception + ); + } break; case PLUS: if ((leftObject instanceof String) || (rightObject instanceof String)) { - res.setValue("" + leftObject + rightObject); + value = "" + leftObject + rightObject; } else { - res.setValue(convert(operator.getType(), - ((Number) leftObject).doubleValue() + ((Number) rightObject).doubleValue())); + value = convert(operator.getType(), + ((Number) leftObject).doubleValue() + ((Number) rightObject).doubleValue()); } break; + case MOD: + value = convert(operator.getType(), + ((Number) leftObject).doubleValue() % ((Number) rightObject).doubleValue()); + break; case BITAND: if (leftObject instanceof Boolean) { - res.setValue((Boolean) leftObject & (Boolean) rightObject); + value = (Boolean) leftObject && (Boolean) rightObject; } else { - res.setValue(((Number) leftObject).intValue() & ((Number) rightObject).intValue()); + value = convert(operator.getType(), + ((Number) leftObject).longValue() & ((Number) rightObject).longValue()); } break; case BITOR: if (leftObject instanceof Boolean) { - res.setValue((Boolean) leftObject | (Boolean) rightObject); + value = (Boolean) leftObject || (Boolean) rightObject; } else { - res.setValue(((Number) leftObject).intValue() | ((Number) rightObject).intValue()); + value = convert(operator.getType(), + ((Number) leftObject).longValue() | ((Number) rightObject).longValue()); } break; case BITXOR: if (leftObject instanceof Boolean) { - res.setValue((Boolean) leftObject ^ (Boolean) rightObject); + value = (Boolean) leftObject ^ (Boolean) rightObject; } else { - res.setValue(((Number) leftObject).intValue() ^ ((Number) rightObject).intValue()); + value = convert(operator.getType(), + ((Number) leftObject).longValue() ^ ((Number) rightObject).longValue()); } break; case SL: if (isIntegralType(leftObject) && isIntegralType(rightObject)) { long rightObjectValue = ((Number) rightObject).longValue(); if (leftObject instanceof Long) { - res.setValue((long) leftObject << rightObjectValue); + value = (long) leftObject << rightObjectValue; } else { - res.setValue(((Number) leftObject).intValue() << rightObjectValue); + value = ((Number) leftObject).intValue() << rightObjectValue; } break; } @@ -213,9 +298,20 @@ public void visitCtBinaryOperator(CtBinaryOperator operator) { if (isIntegralType(leftObject) && isIntegralType(rightObject)) { long rightObjectValue = ((Number) rightObject).longValue(); if (leftObject instanceof Long) { - res.setValue((long) leftObject >> rightObjectValue); + value = (long) leftObject >> rightObjectValue; + } else { + value = ((Number) leftObject).intValue() >> rightObjectValue; + } + break; + } + throw new RuntimeException(operator.getKind() + " is only supported for integral types on both sides"); + case USR: + if (isIntegralType(leftObject) && isIntegralType(rightObject)) { + long rightObjectValue = ((Number) rightObject).longValue(); + if (leftObject instanceof Long) { + value = (long) leftObject >>> rightObjectValue; } else { - res.setValue(((Number) leftObject).intValue() >> rightObjectValue); + value = ((Number) leftObject).intValue() >>> rightObjectValue; } break; } @@ -223,6 +319,11 @@ public void visitCtBinaryOperator(CtBinaryOperator operator) { default: throw new RuntimeException("unsupported operator " + operator.getKind()); } + + CtLiteral res = operator.getFactory().createLiteral(value); + // the type of the result should not change + res.setType(operator.getType().clone()); + setResult(res); } else if ((left instanceof CtLiteral) || (right instanceof CtLiteral)) { CtLiteral literal; @@ -235,28 +336,25 @@ public void visitCtBinaryOperator(CtBinaryOperator operator) { expr = left; } Object o = literal.getValue(); - CtLiteral res = operator.getFactory().Core().createLiteral(); + switch (operator.getKind()) { case AND: if ((Boolean) o) { setResult(expr); } else { - res.setValue(false); - setResult(res); + setResult(operator.getFactory().createLiteral(false)); } return; case OR: if ((Boolean) o) { - res.setValue(true); - setResult(res); + setResult(operator.getFactory().createLiteral(true)); } else { setResult(expr); } return; case BITOR: if ((o instanceof Boolean) && (Boolean) o) { - res.setValue(true); - setResult(res); + setResult(operator.getFactory().createLiteral(true)); } return; default: @@ -308,8 +406,7 @@ private void visitFieldAccess(CtFieldAccess fieldAccess) { if ("class".equals(fieldAccess.getVariable().getSimpleName())) { Class actualClass = fieldAccess.getVariable().getDeclaringType().getActualClass(); if (actualClass != null) { - CtLiteral> literal = fieldAccess.getFactory().Core().createLiteral(); - literal.setValue(actualClass); + CtLiteral> literal = fieldAccess.getFactory().createLiteral(actualClass); setResult(literal); return; } @@ -463,8 +560,7 @@ public void visitCtInvocation(CtInvocation invocation) { try { r = RtHelper.invoke(i); if (isLiteralType(r)) { - CtLiteral l = invocation.getFactory().Core().createLiteral(); - l.setValue(r); + CtLiteral l = invocation.getFactory().createLiteral(r); setResult(l); return; } @@ -476,7 +572,8 @@ public void visitCtInvocation(CtInvocation invocation) { } private boolean isIntegralType(Object object) { - return object instanceof Byte || object instanceof Short || object instanceof Integer || object instanceof Long; + // see https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.2.1 + return object instanceof Byte || object instanceof Short || object instanceof Integer || object instanceof Long || object instanceof Character; } private boolean isLiteralType(Object object) { @@ -492,6 +589,9 @@ private boolean isLiteralType(Object object) { if (object instanceof Character) { return true; } + if (object instanceof Boolean) { + return true; + } return object instanceof Class; } @@ -502,6 +602,22 @@ public void visitCtField(CtField f) { setResult(r); } + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public void visitCtLiteral(CtLiteral ctLiteral) { + CtLiteral result = ctLiteral.clone(); + + List> casts = new ArrayList<>(ctLiteral.getTypeCasts()); + Collections.reverse(casts); + result.setTypeCasts(new ArrayList<>()); + + for (CtTypeReference cast : casts) { + result = promoteLiteral(cast, result); + } + + setResult(result); + } + @Override public void visitCtLocalVariable(final CtLocalVariable localVariable) { @@ -550,22 +666,46 @@ public void visitCtCatch(CtCatch catchBlock) { public void visitCtUnaryOperator(CtUnaryOperator operator) { CtExpression operand = evaluate(operator.getOperand()); if (operand instanceof CtLiteral) { - Object object = ((CtLiteral) operand).getValue(); - CtLiteral res = operator.getFactory().Core().createLiteral(); + CtLiteral literal = (CtLiteral) operand; + CtTypeReference promotedType = OperatorHelper.getPromotedType(operator.getKind(), literal) + .orElse(null); + + if (promotedType == null) { + return; + } + + literal = promoteLiteral(promotedType, literal); + Object object = literal.getValue(); + Object value; switch (operator.getKind()) { case NOT: - res.setValue(!(Boolean) object); + value = !(Boolean) object; break; case NEG: if (isFloatingType(operator.getType())) { - res.setValue(convert(operator.getType(), -1 * ((Number) object).doubleValue())); + value = convert(operator.getType(), -1 * ((Number) object).doubleValue()); } else { - res.setValue(convert(operator.getType(), -1 * ((Number) object).longValue())); + value = convert(operator.getType(), -1 * ((Number) object).longValue()); } - break; + break; + case POS: + if (isFloatingType(literal.getType())) { + value = convert(operator.getType(), +((Number) object).doubleValue()); + } else { + value = convert(operator.getType(), +((Number) object).longValue()); + } + break; + case COMPL: + if (!isIntegralType(object)) { + return; + } + + value = convert(operator.getType(), ~((Number) object).longValue()); + break; default: throw new RuntimeException("unsupported operator " + operator.getKind()); } + CtLiteral res = operator.getFactory().createLiteral(value); setResult(res); return; } diff --git a/src/main/java/spoon/support/reflect/package-info.java b/src/main/java/spoon/support/reflect/package-info.java index f239ef0f098..67c9c9a12c0 100644 --- a/src/main/java/spoon/support/reflect/package-info.java +++ b/src/main/java/spoon/support/reflect/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package provides an implementation of the spoon.reflect package.

diff --git a/src/main/java/spoon/support/reflect/reference/CtArrayTypeReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtArrayTypeReferenceImpl.java index 910ece52cc8..142a70c90eb 100644 --- a/src/main/java/spoon/support/reflect/reference/CtArrayTypeReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtArrayTypeReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtCatchVariableReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtCatchVariableReferenceImpl.java index 006a0f45ec6..348ada80d11 100644 --- a/src/main/java/spoon/support/reflect/reference/CtCatchVariableReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtCatchVariableReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtExecutableReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtExecutableReferenceImpl.java index 8070f190338..cea5c816b7f 100644 --- a/src/main/java/spoon/support/reflect/reference/CtExecutableReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtExecutableReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtFieldReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtFieldReferenceImpl.java index 8941ce75451..e2f902d2f2b 100644 --- a/src/main/java/spoon/support/reflect/reference/CtFieldReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtFieldReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; @@ -69,13 +69,9 @@ public Member getActualField() { throw e; } try { - if (clazz.isAnnotation()) { - return clazz.getDeclaredMethod(getSimpleName()); - } else { - return clazz.getDeclaredField(getSimpleName()); - } - } catch (NoSuchMethodException | NoSuchFieldException e) { - throw new SpoonException("The field " + getQualifiedName() + " not found", e); + return clazz.getDeclaredField(getSimpleName()); + } catch (NoSuchFieldException e) { + throw new SpoonException("The field " + getQualifiedName() + " was not found", e); } } @@ -172,6 +168,12 @@ public > C setStatic(boolean stat) { @Override public Set getModifiers() { + // special-case the length field of array, as it doesn't have a declaration + // as arrays only have one field, we do not need to check the name additionally + CtTypeReference declaringType = getDeclaringType(); + if (declaringType != null && declaringType.isArray()) { + return Set.of(ModifierKind.PUBLIC, ModifierKind.FINAL); + } CtVariable v = getDeclaration(); if (v != null) { return v.getModifiers(); diff --git a/src/main/java/spoon/support/reflect/reference/CtIntersectionTypeReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtIntersectionTypeReferenceImpl.java index b4553760d03..6949aea6bf4 100644 --- a/src/main/java/spoon/support/reflect/reference/CtIntersectionTypeReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtIntersectionTypeReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtLocalVariableReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtLocalVariableReferenceImpl.java index b3bfe7cca2b..c32051722eb 100644 --- a/src/main/java/spoon/support/reflect/reference/CtLocalVariableReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtLocalVariableReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtModuleReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtModuleReferenceImpl.java index 792d7fc06be..077d05ba300 100644 --- a/src/main/java/spoon/support/reflect/reference/CtModuleReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtModuleReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtPackageReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtPackageReferenceImpl.java index 62c7083775b..c3e38b4b288 100644 --- a/src/main/java/spoon/support/reflect/reference/CtPackageReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtPackageReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtParameterReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtParameterReferenceImpl.java index 8501447a243..c8326d23d97 100644 --- a/src/main/java/spoon/support/reflect/reference/CtParameterReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtParameterReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtReferenceImpl.java index ca40a0edb11..145b149ae84 100644 --- a/src/main/java/spoon/support/reflect/reference/CtReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtTypeMemberWildcardImportReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtTypeMemberWildcardImportReferenceImpl.java index d8a3e78ef32..b2343960781 100644 --- a/src/main/java/spoon/support/reflect/reference/CtTypeMemberWildcardImportReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtTypeMemberWildcardImportReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtTypeParameterReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtTypeParameterReferenceImpl.java index 9325fa994e6..d16f3a8325d 100644 --- a/src/main/java/spoon/support/reflect/reference/CtTypeParameterReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtTypeParameterReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtTypeReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtTypeReferenceImpl.java index 6b25fe3c630..26f3d46e97e 100644 --- a/src/main/java/spoon/support/reflect/reference/CtTypeReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtTypeReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtUnboundVariableReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtUnboundVariableReferenceImpl.java index eaf4578cfc5..b3c455922ff 100644 --- a/src/main/java/spoon/support/reflect/reference/CtUnboundVariableReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtUnboundVariableReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtVariableReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtVariableReferenceImpl.java index fe20f48d948..b0e078e0355 100644 --- a/src/main/java/spoon/support/reflect/reference/CtVariableReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtVariableReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/reflect/reference/CtWildcardReferenceImpl.java b/src/main/java/spoon/support/reflect/reference/CtWildcardReferenceImpl.java index 8e02d9c2c7a..6f94d1953d1 100644 --- a/src/main/java/spoon/support/reflect/reference/CtWildcardReferenceImpl.java +++ b/src/main/java/spoon/support/reflect/reference/CtWildcardReferenceImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.reflect.reference; diff --git a/src/main/java/spoon/support/sniper/SniperJavaPrettyPrinter.java b/src/main/java/spoon/support/sniper/SniperJavaPrettyPrinter.java index e8ca283cf23..ee3a4553547 100644 --- a/src/main/java/spoon/support/sniper/SniperJavaPrettyPrinter.java +++ b/src/main/java/spoon/support/sniper/SniperJavaPrettyPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper; diff --git a/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentContextCollection.java b/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentContextCollection.java index 32d684d1254..d024b1b117b 100644 --- a/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentContextCollection.java +++ b/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentContextCollection.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentPrinter.java b/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentPrinter.java index 6f794c6a002..ade4a3d21c3 100644 --- a/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentPrinter.java +++ b/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/ChangeResolver.java b/src/main/java/spoon/support/sniper/internal/ChangeResolver.java index 5ca9078c20c..00132aa5a10 100644 --- a/src/main/java/spoon/support/sniper/internal/ChangeResolver.java +++ b/src/main/java/spoon/support/sniper/internal/ChangeResolver.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/CollectionSourceFragment.java b/src/main/java/spoon/support/sniper/internal/CollectionSourceFragment.java index 913d71e4e36..b742ed18e27 100644 --- a/src/main/java/spoon/support/sniper/internal/CollectionSourceFragment.java +++ b/src/main/java/spoon/support/sniper/internal/CollectionSourceFragment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/DefaultSourceFragmentPrinter.java b/src/main/java/spoon/support/sniper/internal/DefaultSourceFragmentPrinter.java index 23b8b36010d..818842c2b59 100644 --- a/src/main/java/spoon/support/sniper/internal/DefaultSourceFragmentPrinter.java +++ b/src/main/java/spoon/support/sniper/internal/DefaultSourceFragmentPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/ElementPrinterEvent.java b/src/main/java/spoon/support/sniper/internal/ElementPrinterEvent.java index 3a71ddd283f..96b0a4e7ea0 100644 --- a/src/main/java/spoon/support/sniper/internal/ElementPrinterEvent.java +++ b/src/main/java/spoon/support/sniper/internal/ElementPrinterEvent.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/ElementSourceFragment.java b/src/main/java/spoon/support/sniper/internal/ElementSourceFragment.java index 5acc9bc7f2c..25e8ed0cae3 100644 --- a/src/main/java/spoon/support/sniper/internal/ElementSourceFragment.java +++ b/src/main/java/spoon/support/sniper/internal/ElementSourceFragment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/IndentationDetector.java b/src/main/java/spoon/support/sniper/internal/IndentationDetector.java index 28e4af4cdd8..40a2eddb723 100644 --- a/src/main/java/spoon/support/sniper/internal/IndentationDetector.java +++ b/src/main/java/spoon/support/sniper/internal/IndentationDetector.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/ModificationStatus.java b/src/main/java/spoon/support/sniper/internal/ModificationStatus.java index 1c52ee25b8e..9ddec39c566 100644 --- a/src/main/java/spoon/support/sniper/internal/ModificationStatus.java +++ b/src/main/java/spoon/support/sniper/internal/ModificationStatus.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/MutableTokenWriter.java b/src/main/java/spoon/support/sniper/internal/MutableTokenWriter.java index 0b4432710c9..35f39085846 100644 --- a/src/main/java/spoon/support/sniper/internal/MutableTokenWriter.java +++ b/src/main/java/spoon/support/sniper/internal/MutableTokenWriter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/PrinterEvent.java b/src/main/java/spoon/support/sniper/internal/PrinterEvent.java index cac9fba988b..82befb678b4 100644 --- a/src/main/java/spoon/support/sniper/internal/PrinterEvent.java +++ b/src/main/java/spoon/support/sniper/internal/PrinterEvent.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/SourceFragment.java b/src/main/java/spoon/support/sniper/internal/SourceFragment.java index bbc1a900881..6a6d1693e6e 100644 --- a/src/main/java/spoon/support/sniper/internal/SourceFragment.java +++ b/src/main/java/spoon/support/sniper/internal/SourceFragment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/SourceFragmentContextList.java b/src/main/java/spoon/support/sniper/internal/SourceFragmentContextList.java index f58eb498c36..640263bdefe 100644 --- a/src/main/java/spoon/support/sniper/internal/SourceFragmentContextList.java +++ b/src/main/java/spoon/support/sniper/internal/SourceFragmentContextList.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/SourceFragmentContextNormal.java b/src/main/java/spoon/support/sniper/internal/SourceFragmentContextNormal.java index f6ba7759f07..777edd3f119 100644 --- a/src/main/java/spoon/support/sniper/internal/SourceFragmentContextNormal.java +++ b/src/main/java/spoon/support/sniper/internal/SourceFragmentContextNormal.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/SourceFragmentPrinter.java b/src/main/java/spoon/support/sniper/internal/SourceFragmentPrinter.java index f81144007d1..70ab0f65986 100644 --- a/src/main/java/spoon/support/sniper/internal/SourceFragmentPrinter.java +++ b/src/main/java/spoon/support/sniper/internal/SourceFragmentPrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/TokenPrinterEvent.java b/src/main/java/spoon/support/sniper/internal/TokenPrinterEvent.java index 74791721fb1..0f6b1e017a3 100644 --- a/src/main/java/spoon/support/sniper/internal/TokenPrinterEvent.java +++ b/src/main/java/spoon/support/sniper/internal/TokenPrinterEvent.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/TokenSourceFragment.java b/src/main/java/spoon/support/sniper/internal/TokenSourceFragment.java index d3d34e4988c..834a3cba52c 100644 --- a/src/main/java/spoon/support/sniper/internal/TokenSourceFragment.java +++ b/src/main/java/spoon/support/sniper/internal/TokenSourceFragment.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/TokenType.java b/src/main/java/spoon/support/sniper/internal/TokenType.java index c79716597da..04a825d743c 100644 --- a/src/main/java/spoon/support/sniper/internal/TokenType.java +++ b/src/main/java/spoon/support/sniper/internal/TokenType.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/internal/TokenWriterProxy.java b/src/main/java/spoon/support/sniper/internal/TokenWriterProxy.java index 20491a7ae29..331781b407a 100644 --- a/src/main/java/spoon/support/sniper/internal/TokenWriterProxy.java +++ b/src/main/java/spoon/support/sniper/internal/TokenWriterProxy.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.sniper.internal; diff --git a/src/main/java/spoon/support/sniper/package-info.java b/src/main/java/spoon/support/sniper/package-info.java index 655a1ba1b72..5d7cb626f96 100644 --- a/src/main/java/spoon/support/sniper/package-info.java +++ b/src/main/java/spoon/support/sniper/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** * This package provides support for the sniper mode: only the transformed part of classes is rewritten to disk. All the other code is kept as is (formatting, newlines) as the original code. diff --git a/src/main/java/spoon/support/template/Parameters.java b/src/main/java/spoon/support/template/Parameters.java index ced2bf9c797..50ab8886147 100644 --- a/src/main/java/spoon/support/template/Parameters.java +++ b/src/main/java/spoon/support/template/Parameters.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.template; diff --git a/src/main/java/spoon/support/template/UndefinedParameterException.java b/src/main/java/spoon/support/template/UndefinedParameterException.java index 6eaa1d6e3a3..9fabd57f8a7 100644 --- a/src/main/java/spoon/support/template/UndefinedParameterException.java +++ b/src/main/java/spoon/support/template/UndefinedParameterException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.template; diff --git a/src/main/java/spoon/support/template/package-info.java b/src/main/java/spoon/support/template/package-info.java index 14e39a7f09b..f733d0cdb41 100644 --- a/src/main/java/spoon/support/template/package-info.java +++ b/src/main/java/spoon/support/template/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines the substitution and matching engines for Java templates.

diff --git a/src/main/java/spoon/support/util/ByteSerialization.java b/src/main/java/spoon/support/util/ByteSerialization.java index 89e16ca3c95..b52e17357e4 100644 --- a/src/main/java/spoon/support/util/ByteSerialization.java +++ b/src/main/java/spoon/support/util/ByteSerialization.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/EmptyClearableList.java b/src/main/java/spoon/support/util/EmptyClearableList.java index b336b1c4595..28ae0136132 100644 --- a/src/main/java/spoon/support/util/EmptyClearableList.java +++ b/src/main/java/spoon/support/util/EmptyClearableList.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/EmptyClearableSet.java b/src/main/java/spoon/support/util/EmptyClearableSet.java index 921d1ce525f..877adf530da 100644 --- a/src/main/java/spoon/support/util/EmptyClearableSet.java +++ b/src/main/java/spoon/support/util/EmptyClearableSet.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/EmptyIterator.java b/src/main/java/spoon/support/util/EmptyIterator.java index db8474d762f..f8c2190711a 100644 --- a/src/main/java/spoon/support/util/EmptyIterator.java +++ b/src/main/java/spoon/support/util/EmptyIterator.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/ImmutableMap.java b/src/main/java/spoon/support/util/ImmutableMap.java index 8b921989879..fc875443b0c 100644 --- a/src/main/java/spoon/support/util/ImmutableMap.java +++ b/src/main/java/spoon/support/util/ImmutableMap.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/ImmutableMapImpl.java b/src/main/java/spoon/support/util/ImmutableMapImpl.java index 3a6bdb337c7..e30da77774e 100644 --- a/src/main/java/spoon/support/util/ImmutableMapImpl.java +++ b/src/main/java/spoon/support/util/ImmutableMapImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/ModelList.java b/src/main/java/spoon/support/util/ModelList.java index 166245e9da3..febd9d0a000 100644 --- a/src/main/java/spoon/support/util/ModelList.java +++ b/src/main/java/spoon/support/util/ModelList.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/ModelSet.java b/src/main/java/spoon/support/util/ModelSet.java index adb60dad49a..114166ed501 100644 --- a/src/main/java/spoon/support/util/ModelSet.java +++ b/src/main/java/spoon/support/util/ModelSet.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/QualifiedNameBasedSortedSet.java b/src/main/java/spoon/support/util/QualifiedNameBasedSortedSet.java index b9af679a581..927147b870e 100644 --- a/src/main/java/spoon/support/util/QualifiedNameBasedSortedSet.java +++ b/src/main/java/spoon/support/util/QualifiedNameBasedSortedSet.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/RtHelper.java b/src/main/java/spoon/support/util/RtHelper.java index de05f986661..3831331f022 100644 --- a/src/main/java/spoon/support/util/RtHelper.java +++ b/src/main/java/spoon/support/util/RtHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/SignatureBasedSortedSet.java b/src/main/java/spoon/support/util/SignatureBasedSortedSet.java index 39f3e8b7ed1..b10437fea64 100644 --- a/src/main/java/spoon/support/util/SignatureBasedSortedSet.java +++ b/src/main/java/spoon/support/util/SignatureBasedSortedSet.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/SortedList.java b/src/main/java/spoon/support/util/SortedList.java index c077360674e..34033b4b51d 100644 --- a/src/main/java/spoon/support/util/SortedList.java +++ b/src/main/java/spoon/support/util/SortedList.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util; diff --git a/src/main/java/spoon/support/util/internal/ElementNameMap.java b/src/main/java/spoon/support/util/internal/ElementNameMap.java index 716c4a0a707..50601d3bd60 100644 --- a/src/main/java/spoon/support/util/internal/ElementNameMap.java +++ b/src/main/java/spoon/support/util/internal/ElementNameMap.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util.internal; diff --git a/src/main/java/spoon/support/util/internal/ModelCollectionUtils.java b/src/main/java/spoon/support/util/internal/ModelCollectionUtils.java index 5eaf990a882..92ba30af5da 100644 --- a/src/main/java/spoon/support/util/internal/ModelCollectionUtils.java +++ b/src/main/java/spoon/support/util/internal/ModelCollectionUtils.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.util.internal; diff --git a/src/main/java/spoon/support/visitor/AbstractTypingContext.java b/src/main/java/spoon/support/visitor/AbstractTypingContext.java index d49be953ec8..67549a092f0 100644 --- a/src/main/java/spoon/support/visitor/AbstractTypingContext.java +++ b/src/main/java/spoon/support/visitor/AbstractTypingContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/ClassTypingContext.java b/src/main/java/spoon/support/visitor/ClassTypingContext.java index 7ef9b590528..9076a89f617 100644 --- a/src/main/java/spoon/support/visitor/ClassTypingContext.java +++ b/src/main/java/spoon/support/visitor/ClassTypingContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/GenericTypeAdapter.java b/src/main/java/spoon/support/visitor/GenericTypeAdapter.java index d5429939a48..22f7bb61989 100644 --- a/src/main/java/spoon/support/visitor/GenericTypeAdapter.java +++ b/src/main/java/spoon/support/visitor/GenericTypeAdapter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/HashcodeVisitor.java b/src/main/java/spoon/support/visitor/HashcodeVisitor.java index b52120d07a2..279377dc33e 100644 --- a/src/main/java/spoon/support/visitor/HashcodeVisitor.java +++ b/src/main/java/spoon/support/visitor/HashcodeVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/MethodTypingContext.java b/src/main/java/spoon/support/visitor/MethodTypingContext.java index 95d810f3d47..c020481ab8d 100644 --- a/src/main/java/spoon/support/visitor/MethodTypingContext.java +++ b/src/main/java/spoon/support/visitor/MethodTypingContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/ProcessingVisitor.java b/src/main/java/spoon/support/visitor/ProcessingVisitor.java index 6e6763874de..c9592a7b9e7 100644 --- a/src/main/java/spoon/support/visitor/ProcessingVisitor.java +++ b/src/main/java/spoon/support/visitor/ProcessingVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/SignaturePrinter.java b/src/main/java/spoon/support/visitor/SignaturePrinter.java index 47371b3e261..22de1ed6704 100644 --- a/src/main/java/spoon/support/visitor/SignaturePrinter.java +++ b/src/main/java/spoon/support/visitor/SignaturePrinter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/SubInheritanceHierarchyResolver.java b/src/main/java/spoon/support/visitor/SubInheritanceHierarchyResolver.java index ce7df7bc754..4a96fdec052 100644 --- a/src/main/java/spoon/support/visitor/SubInheritanceHierarchyResolver.java +++ b/src/main/java/spoon/support/visitor/SubInheritanceHierarchyResolver.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/TypeReferenceScanner.java b/src/main/java/spoon/support/visitor/TypeReferenceScanner.java index 508abf7e017..8fe7ed58a2d 100644 --- a/src/main/java/spoon/support/visitor/TypeReferenceScanner.java +++ b/src/main/java/spoon/support/visitor/TypeReferenceScanner.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor; diff --git a/src/main/java/spoon/support/visitor/clone/CloneBuilder.java b/src/main/java/spoon/support/visitor/clone/CloneBuilder.java index f1bf76dd9f6..7f31f5ff11f 100644 --- a/src/main/java/spoon/support/visitor/clone/CloneBuilder.java +++ b/src/main/java/spoon/support/visitor/clone/CloneBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.clone; /** diff --git a/src/main/java/spoon/support/visitor/clone/CloneVisitor.java b/src/main/java/spoon/support/visitor/clone/CloneVisitor.java index ee82bc1a210..89e1d17823a 100644 --- a/src/main/java/spoon/support/visitor/clone/CloneVisitor.java +++ b/src/main/java/spoon/support/visitor/clone/CloneVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.clone; /** diff --git a/src/main/java/spoon/support/visitor/equals/CloneHelper.java b/src/main/java/spoon/support/visitor/equals/CloneHelper.java index 3355dc71518..833c82de3f6 100644 --- a/src/main/java/spoon/support/visitor/equals/CloneHelper.java +++ b/src/main/java/spoon/support/visitor/equals/CloneHelper.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.equals; diff --git a/src/main/java/spoon/support/visitor/equals/EqualsChecker.java b/src/main/java/spoon/support/visitor/equals/EqualsChecker.java index 69dcb5e681e..20117347a48 100644 --- a/src/main/java/spoon/support/visitor/equals/EqualsChecker.java +++ b/src/main/java/spoon/support/visitor/equals/EqualsChecker.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.equals; diff --git a/src/main/java/spoon/support/visitor/equals/EqualsVisitor.java b/src/main/java/spoon/support/visitor/equals/EqualsVisitor.java index f732dedf077..eea1269bc9a 100644 --- a/src/main/java/spoon/support/visitor/equals/EqualsVisitor.java +++ b/src/main/java/spoon/support/visitor/equals/EqualsVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.equals; diff --git a/src/main/java/spoon/support/visitor/equals/NotEqualException.java b/src/main/java/spoon/support/visitor/equals/NotEqualException.java index f266050c6aa..a5ace5ff2e7 100644 --- a/src/main/java/spoon/support/visitor/equals/NotEqualException.java +++ b/src/main/java/spoon/support/visitor/equals/NotEqualException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.equals; diff --git a/src/main/java/spoon/support/visitor/java/JavaReflectionTreeBuilder.java b/src/main/java/spoon/support/visitor/java/JavaReflectionTreeBuilder.java index 38b66a70d0a..1a1ce2a4cc8 100644 --- a/src/main/java/spoon/support/visitor/java/JavaReflectionTreeBuilder.java +++ b/src/main/java/spoon/support/visitor/java/JavaReflectionTreeBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java; @@ -70,11 +70,12 @@ * element comes from the reflection api, use {@link spoon.reflect.declaration.CtShadowable#isShadow()}. */ public class JavaReflectionTreeBuilder extends JavaReflectionVisitorImpl { - private Deque contexts = new ArrayDeque<>(); - private Factory factory; + private final Deque contexts; + private final Factory factory; public JavaReflectionTreeBuilder(Factory factory) { this.factory = factory; + this.contexts = new ArrayDeque<>(); } private void enter(RuntimeBuilderContext context) { @@ -87,46 +88,53 @@ private RuntimeBuilderContext exit() { /** transforms a java.lang.Class into a CtType (ie a shadow type in Spoon's parlance) */ public > R scan(Class clazz) { - CtPackage ctPackage; - CtType ctEnclosingClass; - if (clazz.getEnclosingClass() != null && !clazz.isAnonymousClass()) { - ctEnclosingClass = factory.Type().get(clazz.getEnclosingClass()); - return ctEnclosingClass.getNestedType(clazz.getSimpleName()); - } else { - if (clazz.getPackage() == null) { - ctPackage = factory.Package().getRootPackage(); + // We modify and query our modified model in this part. If another thread were to do the same + // on the same model, things will explode (e.g. with a ParentNotInitialized exception). + // We only synchronize in the main entrypoint, as that should be enough for normal consumers. + // The shadow factory should not be modified in other places and nobody should be directly calling + // the visit methods. + synchronized (factory) { + CtPackage ctPackage; + CtType ctEnclosingClass; + if (clazz.getEnclosingClass() != null && !clazz.isAnonymousClass()) { + ctEnclosingClass = factory.Type().get(clazz.getEnclosingClass()); + return ctEnclosingClass.getNestedType(clazz.getSimpleName()); } else { - ctPackage = factory.Package().getOrCreate(clazz.getPackage().getName()); - } - if (contexts.isEmpty()) { - enter(new PackageRuntimeBuilderContext(ctPackage)); - } - boolean visited = false; - if (clazz.isAnnotation()) { - visited = true; - visitAnnotationClass((Class) clazz); - } - if (clazz.isInterface() && !visited) { - visited = true; - visitInterface(clazz); - } - if (clazz.isEnum() && !visited) { - visited = true; - visitEnum(clazz); - } - if (MethodHandleUtils.isRecord(clazz) && !visited) { - visited = true; - visitRecord(clazz); - } - if (!visited) { - visitClass(clazz); - } - exit(); - final R type = ctPackage.getType(clazz.getSimpleName()); - if (clazz.isPrimitive() && type.getParent() instanceof CtPackage) { - type.setParent(null); // primitive type isn't in a package. + if (clazz.getPackage() == null) { + ctPackage = factory.Package().getRootPackage(); + } else { + ctPackage = factory.Package().getOrCreate(clazz.getPackage().getName()); + } + if (contexts.isEmpty()) { + enter(new PackageRuntimeBuilderContext(ctPackage)); + } + boolean visited = false; + if (clazz.isAnnotation()) { + visited = true; + visitAnnotationClass((Class) clazz); + } + if (clazz.isInterface() && !visited) { + visited = true; + visitInterface(clazz); + } + if (clazz.isEnum() && !visited) { + visited = true; + visitEnum(clazz); + } + if (MethodHandleUtils.isRecord(clazz) && !visited) { + visited = true; + visitRecord(clazz); + } + if (!visited) { + visitClass(clazz); + } + exit(); + final R type = ctPackage.getType(clazz.getSimpleName()); + if (clazz.isPrimitive() && type.getParent() instanceof CtPackage) { + type.setParent(null); // primitive type isn't in a package. + } + return type; } - return type; } } diff --git a/src/main/java/spoon/support/visitor/java/JavaReflectionVisitor.java b/src/main/java/spoon/support/visitor/java/JavaReflectionVisitor.java index 00728fa7185..7df50df582e 100644 --- a/src/main/java/spoon/support/visitor/java/JavaReflectionVisitor.java +++ b/src/main/java/spoon/support/visitor/java/JavaReflectionVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java; diff --git a/src/main/java/spoon/support/visitor/java/JavaReflectionVisitorImpl.java b/src/main/java/spoon/support/visitor/java/JavaReflectionVisitorImpl.java index a25e829613f..e50a8479e1a 100644 --- a/src/main/java/spoon/support/visitor/java/JavaReflectionVisitorImpl.java +++ b/src/main/java/spoon/support/visitor/java/JavaReflectionVisitorImpl.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java; diff --git a/src/main/java/spoon/support/visitor/java/MethodHandleUtils.java b/src/main/java/spoon/support/visitor/java/MethodHandleUtils.java index 3f4b0650938..9b0b4f6b508 100644 --- a/src/main/java/spoon/support/visitor/java/MethodHandleUtils.java +++ b/src/main/java/spoon/support/visitor/java/MethodHandleUtils.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java; diff --git a/src/main/java/spoon/support/visitor/java/internal/AbstractRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/AbstractRuntimeBuilderContext.java index 9d1ff6faca2..c2128a3ce54 100644 --- a/src/main/java/spoon/support/visitor/java/internal/AbstractRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/AbstractRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/AnnotationRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/AnnotationRuntimeBuilderContext.java index 7ec9f62d868..21f6e1d5c79 100644 --- a/src/main/java/spoon/support/visitor/java/internal/AnnotationRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/AnnotationRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/ExecutableRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/ExecutableRuntimeBuilderContext.java index 0dffaf7b3a9..8fe635b9a01 100644 --- a/src/main/java/spoon/support/visitor/java/internal/ExecutableRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/ExecutableRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/PackageRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/PackageRuntimeBuilderContext.java index 06ce0c7ddf7..63324d87fa5 100644 --- a/src/main/java/spoon/support/visitor/java/internal/PackageRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/PackageRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/RecordComponentRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/RecordComponentRuntimeBuilderContext.java index 45a5e880ca6..01cdefe1bfb 100644 --- a/src/main/java/spoon/support/visitor/java/internal/RecordComponentRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/RecordComponentRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/RuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/RuntimeBuilderContext.java index 4c718715be4..6898e83b8aa 100644 --- a/src/main/java/spoon/support/visitor/java/internal/RuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/RuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/TypeReferenceRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/TypeReferenceRuntimeBuilderContext.java index 3500e427ebb..e5036a0a1e7 100644 --- a/src/main/java/spoon/support/visitor/java/internal/TypeReferenceRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/TypeReferenceRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/TypeRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/TypeRuntimeBuilderContext.java index 5faf93249f0..4a3261a1887 100644 --- a/src/main/java/spoon/support/visitor/java/internal/TypeRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/TypeRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/internal/VariableRuntimeBuilderContext.java b/src/main/java/spoon/support/visitor/java/internal/VariableRuntimeBuilderContext.java index b2910a04cd5..22890125e9b 100644 --- a/src/main/java/spoon/support/visitor/java/internal/VariableRuntimeBuilderContext.java +++ b/src/main/java/spoon/support/visitor/java/internal/VariableRuntimeBuilderContext.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.internal; diff --git a/src/main/java/spoon/support/visitor/java/reflect/RtMethod.java b/src/main/java/spoon/support/visitor/java/reflect/RtMethod.java index 4f368e8001b..e931d9685c7 100644 --- a/src/main/java/spoon/support/visitor/java/reflect/RtMethod.java +++ b/src/main/java/spoon/support/visitor/java/reflect/RtMethod.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.reflect; diff --git a/src/main/java/spoon/support/visitor/java/reflect/RtParameter.java b/src/main/java/spoon/support/visitor/java/reflect/RtParameter.java index 8847aa29168..a6afeac6827 100644 --- a/src/main/java/spoon/support/visitor/java/reflect/RtParameter.java +++ b/src/main/java/spoon/support/visitor/java/reflect/RtParameter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.java.reflect; diff --git a/src/main/java/spoon/support/visitor/replace/InvalidReplaceException.java b/src/main/java/spoon/support/visitor/replace/InvalidReplaceException.java index 5607bf91ccd..6d38f4cf2c1 100644 --- a/src/main/java/spoon/support/visitor/replace/InvalidReplaceException.java +++ b/src/main/java/spoon/support/visitor/replace/InvalidReplaceException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.replace; diff --git a/src/main/java/spoon/support/visitor/replace/ReplaceListListener.java b/src/main/java/spoon/support/visitor/replace/ReplaceListListener.java index 6e313c94f40..a946b7539c2 100644 --- a/src/main/java/spoon/support/visitor/replace/ReplaceListListener.java +++ b/src/main/java/spoon/support/visitor/replace/ReplaceListListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.replace; diff --git a/src/main/java/spoon/support/visitor/replace/ReplaceListener.java b/src/main/java/spoon/support/visitor/replace/ReplaceListener.java index f8750c14ed0..077af175367 100644 --- a/src/main/java/spoon/support/visitor/replace/ReplaceListener.java +++ b/src/main/java/spoon/support/visitor/replace/ReplaceListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.replace; diff --git a/src/main/java/spoon/support/visitor/replace/ReplaceMapListener.java b/src/main/java/spoon/support/visitor/replace/ReplaceMapListener.java index f38ded4014d..d031c0371a9 100644 --- a/src/main/java/spoon/support/visitor/replace/ReplaceMapListener.java +++ b/src/main/java/spoon/support/visitor/replace/ReplaceMapListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.replace; diff --git a/src/main/java/spoon/support/visitor/replace/ReplaceSetListener.java b/src/main/java/spoon/support/visitor/replace/ReplaceSetListener.java index 95f7f9ddc1a..ac166355045 100644 --- a/src/main/java/spoon/support/visitor/replace/ReplaceSetListener.java +++ b/src/main/java/spoon/support/visitor/replace/ReplaceSetListener.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.replace; diff --git a/src/main/java/spoon/support/visitor/replace/ReplacementVisitor.java b/src/main/java/spoon/support/visitor/replace/ReplacementVisitor.java index 2e46736c4c8..5a079f71151 100644 --- a/src/main/java/spoon/support/visitor/replace/ReplacementVisitor.java +++ b/src/main/java/spoon/support/visitor/replace/ReplacementVisitor.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.support.visitor.replace; /** diff --git a/src/main/java/spoon/template/AbstractTemplate.java b/src/main/java/spoon/template/AbstractTemplate.java index adcb812a298..e65731163b4 100644 --- a/src/main/java/spoon/template/AbstractTemplate.java +++ b/src/main/java/spoon/template/AbstractTemplate.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/BlockTemplate.java b/src/main/java/spoon/template/BlockTemplate.java index 4cf7ad7a988..0d0e02e2790 100644 --- a/src/main/java/spoon/template/BlockTemplate.java +++ b/src/main/java/spoon/template/BlockTemplate.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/ExpressionTemplate.java b/src/main/java/spoon/template/ExpressionTemplate.java index fc5a9edf954..9a5fdb3d3ca 100644 --- a/src/main/java/spoon/template/ExpressionTemplate.java +++ b/src/main/java/spoon/template/ExpressionTemplate.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/ExtensionTemplate.java b/src/main/java/spoon/template/ExtensionTemplate.java index 6a6eeb35824..8a9c63cf4f6 100644 --- a/src/main/java/spoon/template/ExtensionTemplate.java +++ b/src/main/java/spoon/template/ExtensionTemplate.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/Local.java b/src/main/java/spoon/template/Local.java index 2699455239e..ca1a9a1d47b 100644 --- a/src/main/java/spoon/template/Local.java +++ b/src/main/java/spoon/template/Local.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/Parameter.java b/src/main/java/spoon/template/Parameter.java index 517e048ceca..061bf8e56ca 100644 --- a/src/main/java/spoon/template/Parameter.java +++ b/src/main/java/spoon/template/Parameter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/StatementTemplate.java b/src/main/java/spoon/template/StatementTemplate.java index 95d6b2c80d3..f9a1f65f44f 100644 --- a/src/main/java/spoon/template/StatementTemplate.java +++ b/src/main/java/spoon/template/StatementTemplate.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/Substitution.java b/src/main/java/spoon/template/Substitution.java index a061c952722..c83ae06cd53 100644 --- a/src/main/java/spoon/template/Substitution.java +++ b/src/main/java/spoon/template/Substitution.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/Template.java b/src/main/java/spoon/template/Template.java index d6d1e2591ea..f9decc1af99 100644 --- a/src/main/java/spoon/template/Template.java +++ b/src/main/java/spoon/template/Template.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/TemplateBuilder.java b/src/main/java/spoon/template/TemplateBuilder.java index 2ea5d5ab540..d9b9d47b0de 100644 --- a/src/main/java/spoon/template/TemplateBuilder.java +++ b/src/main/java/spoon/template/TemplateBuilder.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/TemplateException.java b/src/main/java/spoon/template/TemplateException.java index 7e80aa45625..703714fddfe 100644 --- a/src/main/java/spoon/template/TemplateException.java +++ b/src/main/java/spoon/template/TemplateException.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/TemplateMatcher.java b/src/main/java/spoon/template/TemplateMatcher.java index 0b229836fc0..5dbdb82e226 100644 --- a/src/main/java/spoon/template/TemplateMatcher.java +++ b/src/main/java/spoon/template/TemplateMatcher.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/TemplateParameter.java b/src/main/java/spoon/template/TemplateParameter.java index 78890c0018c..36414ec0722 100644 --- a/src/main/java/spoon/template/TemplateParameter.java +++ b/src/main/java/spoon/template/TemplateParameter.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.template; diff --git a/src/main/java/spoon/template/package-info.java b/src/main/java/spoon/template/package-info.java index fac1920f2f6..7f9816cf4fa 100644 --- a/src/main/java/spoon/template/package-info.java +++ b/src/main/java/spoon/template/package-info.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ /** *

This package defines a framework for well-typed pure-Java templates.

diff --git a/src/main/java/spoon/testing/AbstractAssert.java b/src/main/java/spoon/testing/AbstractAssert.java index 2b3ca28ef2a..63de36a8993 100644 --- a/src/main/java/spoon/testing/AbstractAssert.java +++ b/src/main/java/spoon/testing/AbstractAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/AbstractCtElementAssert.java b/src/main/java/spoon/testing/AbstractCtElementAssert.java index 250e1c6cf67..151eebb25ee 100644 --- a/src/main/java/spoon/testing/AbstractCtElementAssert.java +++ b/src/main/java/spoon/testing/AbstractCtElementAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/AbstractCtPackageAssert.java b/src/main/java/spoon/testing/AbstractCtPackageAssert.java index 9d0bfd57a65..793007e89d6 100644 --- a/src/main/java/spoon/testing/AbstractCtPackageAssert.java +++ b/src/main/java/spoon/testing/AbstractCtPackageAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/AbstractFileAssert.java b/src/main/java/spoon/testing/AbstractFileAssert.java index 0d273484ac5..ffb206ef0d4 100644 --- a/src/main/java/spoon/testing/AbstractFileAssert.java +++ b/src/main/java/spoon/testing/AbstractFileAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/Assert.java b/src/main/java/spoon/testing/Assert.java index 34136014aed..7d000a14db4 100644 --- a/src/main/java/spoon/testing/Assert.java +++ b/src/main/java/spoon/testing/Assert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/CtElementAssert.java b/src/main/java/spoon/testing/CtElementAssert.java index c089baf1184..82e762a4565 100644 --- a/src/main/java/spoon/testing/CtElementAssert.java +++ b/src/main/java/spoon/testing/CtElementAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/CtPackageAssert.java b/src/main/java/spoon/testing/CtPackageAssert.java index 14703a47cb4..0ae64bb9c97 100644 --- a/src/main/java/spoon/testing/CtPackageAssert.java +++ b/src/main/java/spoon/testing/CtPackageAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/FileAssert.java b/src/main/java/spoon/testing/FileAssert.java index 685b6b524fe..5137e7bf97c 100644 --- a/src/main/java/spoon/testing/FileAssert.java +++ b/src/main/java/spoon/testing/FileAssert.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing; diff --git a/src/main/java/spoon/testing/utils/Check.java b/src/main/java/spoon/testing/utils/Check.java index 7fd19cc38d5..cb912352b7e 100644 --- a/src/main/java/spoon/testing/utils/Check.java +++ b/src/main/java/spoon/testing/utils/Check.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing.utils; diff --git a/src/main/java/spoon/testing/utils/ModelUtils.java b/src/main/java/spoon/testing/utils/ModelUtils.java index 712173cf2ae..8f76e7c0b39 100644 --- a/src/main/java/spoon/testing/utils/ModelUtils.java +++ b/src/main/java/spoon/testing/utils/ModelUtils.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing.utils; diff --git a/src/main/java/spoon/testing/utils/ProcessorUtils.java b/src/main/java/spoon/testing/utils/ProcessorUtils.java index d49af854b84..f6156391ae9 100644 --- a/src/main/java/spoon/testing/utils/ProcessorUtils.java +++ b/src/main/java/spoon/testing/utils/ProcessorUtils.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.testing.utils; diff --git a/src/test/java/spoon/generating/clone/CloneBuilderTemplate.java b/src/test/java/spoon/generating/clone/CloneBuilderTemplate.java index 1dc2b833e23..ef9e0e8f439 100644 --- a/src/test/java/spoon/generating/clone/CloneBuilderTemplate.java +++ b/src/test/java/spoon/generating/clone/CloneBuilderTemplate.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.generating.clone; diff --git a/src/test/java/spoon/generating/clone/CloneVisitorTemplate.java b/src/test/java/spoon/generating/clone/CloneVisitorTemplate.java index 586dc42475a..490a946911e 100644 --- a/src/test/java/spoon/generating/clone/CloneVisitorTemplate.java +++ b/src/test/java/spoon/generating/clone/CloneVisitorTemplate.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.generating.clone; diff --git a/src/test/java/spoon/generating/clone/GetterTemplateMatcher.java b/src/test/java/spoon/generating/clone/GetterTemplateMatcher.java index e17e3470ee5..e41cbc2f9e5 100644 --- a/src/test/java/spoon/generating/clone/GetterTemplateMatcher.java +++ b/src/test/java/spoon/generating/clone/GetterTemplateMatcher.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.generating.clone; diff --git a/src/test/java/spoon/generating/clone/SetterTemplateMatcher.java b/src/test/java/spoon/generating/clone/SetterTemplateMatcher.java index 7c135cc343f..ef3892d1969 100644 --- a/src/test/java/spoon/generating/clone/SetterTemplateMatcher.java +++ b/src/test/java/spoon/generating/clone/SetterTemplateMatcher.java @@ -1,9 +1,9 @@ /* * SPDX-License-Identifier: (MIT OR CECILL-C) * - * Copyright (C) 2006-2019 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * - * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ package spoon.generating.clone; diff --git a/src/test/java/spoon/reflect/factory/PackageFactoryTest.java b/src/test/java/spoon/reflect/factory/PackageFactoryTest.java index 13cb1897fa1..f5f663e21cd 100644 --- a/src/test/java/spoon/reflect/factory/PackageFactoryTest.java +++ b/src/test/java/spoon/reflect/factory/PackageFactoryTest.java @@ -3,13 +3,16 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.sameInstance; import static org.hamcrest.MatcherAssert.assertThat; - +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; import spoon.Launcher; +import spoon.reflect.declaration.CtClass; import spoon.reflect.declaration.CtPackage; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; class PackageFactoryTest { + @Test @GitHubIssue(issueNumber = 4764, fixed = true) void getOrCreate_returnsNestedPackageStructure_whenQualifiedNameRepeatsSimpleName() { // contract: A qualified name that is simply repetitions of a single simple name results in the expected @@ -28,4 +31,20 @@ void getOrCreate_returnsNestedPackageStructure_whenQualifiedNameRepeatsSimpleNam assertThat(topLevelPackage.getPackage(topLevelPackageName), sameInstance(packageWithDuplicatedSimpleNames)); assertThat(packageWithDuplicatedSimpleNames.getParent(), sameInstance(topLevelPackage)); } + + @Test + @GitHubIssue(issueNumber = 5140, fixed = true) + void testGetPackageWithNameContainingDollarSign() { + // contract: A package with a name containing a dollar sign can be retrieved using the PackageFactory + // Create a package with a name containing a dollar sign + String packageName = "com.example.package$with$dollar$sign"; + CtClass clazz = Launcher.parseClass("package " + packageName + ";" + "\n" + "enum Foo { }"); + + // Get the package using the PackageFactory + CtPackage ctPackage = clazz.getFactory().Package().get(packageName); + + // Verify that the package was found + assertNotNull(ctPackage); + assertEquals(packageName, ctPackage.getQualifiedName()); + } } \ No newline at end of file diff --git a/src/test/java/spoon/reflect/visitor/CtScannerTest.java b/src/test/java/spoon/reflect/visitor/CtScannerTest.java index 4fec9e4c921..3d793db6c0d 100644 --- a/src/test/java/spoon/reflect/visitor/CtScannerTest.java +++ b/src/test/java/spoon/reflect/visitor/CtScannerTest.java @@ -271,9 +271,9 @@ public void exit(CtElement o) { // this is a coarse-grain check to see if the scanner changes // no more exec ref in paramref // also takes into account the comments - assertEquals(3631, counter.nElement + countOfCommentsInCompilationUnits); - assertEquals(2423, counter.nEnter + countOfCommentsInCompilationUnits); - assertEquals(2423, counter.nExit + countOfCommentsInCompilationUnits); + assertEquals(3667, counter.nElement + countOfCommentsInCompilationUnits); + assertEquals(2449, counter.nEnter + countOfCommentsInCompilationUnits); + assertEquals(2449, counter.nExit + countOfCommentsInCompilationUnits); // contract: all AST nodes which are part of Collection or Map are visited first by method "scan(Collection|Map)" and then by method "scan(CtElement)" Counter counter2 = new Counter(); diff --git a/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java b/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java index 039ef7e30b3..d88d4f69ed5 100644 --- a/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java +++ b/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java @@ -32,8 +32,8 @@ import spoon.reflect.reference.CtTypeReference; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.reflect.reference.CtArrayTypeReferenceImpl; -import spoon.test.GitHubIssue; import spoon.test.SpoonTestHelpers; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelTest; import java.io.FileNotFoundException; @@ -271,6 +271,7 @@ public Stream provideArguments(ExtensionContext extensionCo @Nested class SquareBracketsForArrayInitialization_ArrayIsBuiltUsingFactoryMethods { + @Test @GitHubIssue(issueNumber = 4887, fixed = true) void bracketsShouldBeAttachedToTypeByDefault() { // contract: the square brackets should be attached to type by default when array is built using factory methods @@ -333,6 +334,7 @@ void testKeepGenericType(Factory factory) { assertThat(printed, containsRegexMatch("List<.*List<\\? super T>>")); } + @Test @GitHubIssue(issueNumber = 4881, fixed = true) void bracketsShouldBeMinimallyPrintedForTypeCastOnFieldRead() throws FileNotFoundException { // contract: the brackets should be minimally printed for type cast on field read diff --git a/src/test/java/spoon/reflect/visitor/ImportCleanerTest.java b/src/test/java/spoon/reflect/visitor/ImportCleanerTest.java index e6ece30d9dc..70d210a37c8 100644 --- a/src/test/java/spoon/reflect/visitor/ImportCleanerTest.java +++ b/src/test/java/spoon/reflect/visitor/ImportCleanerTest.java @@ -7,7 +7,7 @@ import spoon.reflect.declaration.CtImport; import spoon.reflect.declaration.CtType; -import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import static org.hamcrest.CoreMatchers.equalTo; @@ -68,19 +68,19 @@ private static void testImportCleanerDoesNotAlterImports(String source, String t CtModel model = launcher.buildModel(); CtType type = model.getUnnamedModule().getFactory().Type().get(targetClassQualname); CtCompilationUnit cu = type.getFactory().CompilationUnit().getOrCreate(type); - List importsBefore = getTextualImports(cu); + Set importsBefore = getTextualImports(cu); // act new ImportCleaner().process(cu); // assert - List importsAfter = getTextualImports(cu); + Set importsAfter = getTextualImports(cu); assertThat(importsAfter, equalTo(importsBefore)); } - private static List getTextualImports(CtCompilationUnit cu) { + private static Set getTextualImports(CtCompilationUnit cu) { return cu.getImports().stream() .map(CtImport::toString) - .collect(Collectors.toList()); + .collect(Collectors.toSet()); } } diff --git a/src/test/java/spoon/support/TypeAdaptorTest.java b/src/test/java/spoon/support/TypeAdaptorTest.java index 01b0ec1d82d..bab12ea8af5 100644 --- a/src/test/java/spoon/support/TypeAdaptorTest.java +++ b/src/test/java/spoon/support/TypeAdaptorTest.java @@ -1,5 +1,6 @@ package spoon.support; +import java.util.stream.Collectors; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -12,7 +13,9 @@ import spoon.reflect.declaration.CtTypeParameter; import spoon.reflect.factory.Factory; import spoon.reflect.reference.CtTypeReference; +import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.adaption.TypeAdaptor; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelTest; import java.util.List; @@ -440,4 +443,54 @@ public void overloaded(T t) {} public void overriden(T t) {} } + + @Test + @GitHubIssue(issueNumber = 5226, fixed = true) + void testAdaptingTypeFromEnclosingClass() { + Launcher launcher = new Launcher(); + launcher.getEnvironment().setComplianceLevel(11); + launcher.addInputResource("src/test/java/spoon/support/TypeAdaptorTest.java"); + CtType type = launcher.getFactory() + .Type() + .get(UseGenericFromEnclosingType.class); + @SuppressWarnings("rawtypes") + List methods = type.getElements(new TypeFilter<>(CtMethod.class)) + .stream() + .filter(it -> it.getSimpleName().equals("someMethod")) + .collect(Collectors.toList()); + CtMethod test1Method = methods.stream() + .filter(it -> !it.getDeclaringType().getSimpleName().startsWith("Extends")) + .findAny() + .orElseThrow(); + CtMethod test2Method = methods.stream() + .filter(it -> it.getDeclaringType().getSimpleName().startsWith("Extends")) + .findAny() + .orElseThrow(); + + assertTrue(test2Method.isOverriding(test1Method)); + assertFalse(test1Method.isOverriding(test2Method)); + } + + public static class UseGenericFromEnclosingType { + + public static class Enclosing { + + public class Enclosed { + + void someMethod(S s, T t) { + } + } + } + + public static class ExtendsEnclosing extends Enclosing { + + public class ExtendsEnclosed extends Enclosed { + + @Override + void someMethod(Integer s, String t) { + throw new UnsupportedOperationException(); + } + } + } + } } diff --git a/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java b/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java index c075478f03a..56a6eda71aa 100644 --- a/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java +++ b/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java @@ -106,13 +106,13 @@ import spoon.support.util.compilation.JavacFacade; import spoon.support.visitor.equals.EqualsChecker; import spoon.support.visitor.equals.EqualsVisitor; -import spoon.test.GitHubIssue; import spoon.test.generics.testclasses3.ComparableComparatorBug; import spoon.test.innerclasses.InnerClasses; import spoon.test.pkg.PackageTest; import spoon.test.pkg.cyclic.Outside; import spoon.test.pkg.cyclic.direct.Cyclic; import spoon.test.pkg.cyclic.indirect.Indirect; +import spoon.testing.utils.GitHubIssue; public class JavaReflectionTreeBuilderTest { @@ -850,6 +850,7 @@ void testInnerClassesConstructorParameters() { assertThat(asClass.getConstructors().iterator().next().getParameters().size(), equalTo(inners.size())); } + @Test @GitHubIssue(issueNumber = 4972, fixed = true) void parameterNamesAreParsedWhenCompilingWithParametersFlag() throws ClassNotFoundException { ClassLoader loader = JavacFacade.compileFiles( diff --git a/src/test/java/spoon/test/comment/CommentTest.java b/src/test/java/spoon/test/comment/CommentTest.java index 41b92dacecc..0ad77376ec5 100644 --- a/src/test/java/spoon/test/comment/CommentTest.java +++ b/src/test/java/spoon/test/comment/CommentTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2018 INRIA and contributors + * Copyright (C) 2006-2023 INRIA and contributors * Spoon - http://spoon.gforge.inria.fr/ * * This software is governed by the CeCILL-C License under French law and @@ -24,6 +24,7 @@ import spoon.Launcher; import spoon.SpoonException; import spoon.reflect.CtModel; +import spoon.reflect.code.CtArrayAccess; import spoon.reflect.code.CtBinaryOperator; import spoon.reflect.code.CtBlock; import spoon.reflect.code.CtCatch; @@ -46,6 +47,7 @@ import spoon.reflect.code.CtSwitch; import spoon.reflect.code.CtSynchronized; import spoon.reflect.code.CtTry; +import spoon.reflect.declaration.CtAnnotation; import spoon.reflect.declaration.CtAnnotationMethod; import spoon.reflect.declaration.CtAnnotationType; import spoon.reflect.declaration.CtAnonymousExecutable; @@ -61,6 +63,7 @@ import spoon.reflect.declaration.CtPackage; import spoon.reflect.declaration.CtParameter; import spoon.reflect.declaration.CtType; +import spoon.reflect.declaration.CtTypeParameter; import spoon.reflect.declaration.ModifierKind; import spoon.reflect.factory.Factory; import spoon.reflect.factory.FactoryImpl; @@ -83,6 +86,7 @@ import spoon.test.comment.testclasses.TestClassWithComments; import spoon.test.comment.testclasses.WildComments; import spoon.test.comment.testclasses.WindowsEOL; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.LineSeparatorExtension; import spoon.testing.utils.ModelTest; @@ -1249,4 +1253,76 @@ public void testCatchComments(CtModel model) { assertEquals(1, catches.get(0).getBody().getComments().size()); assertEquals("second comment", catches.get(0).getBody().getComments().get(0).getContent()); } + + @ModelTest("./src/test/java/spoon/test/comment/testclasses/AnnotationComments.java") + @GitHubIssue(issueNumber = 2482, fixed = false) + public void testAnnotationComments(CtModel model) { + //contract: comments at annotations should be properly added to the AST + List comments = model.getElements(new TypeFilter<>(CtComment.class)); + List> annotations = model.getElements(new TypeFilter<>(CtAnnotation.class)); + + assertEquals(3, comments.size()); + assertEquals("comment 1", comments.get(0).getContent()); + assertEquals("comment 2", comments.get(1).getContent()); + assertEquals("comment 3", comments.get(2).getContent()); + + assertEquals(1, annotations.get(0).getComments().size()); + assertEquals("comment 1", annotations.get(0).getComments().get(0).getContent()); + assertEquals(1, annotations.get(1).getComments().size()); + assertEquals("comment 2", annotations.get(1).getComments().get(0).getContent()); + assertEquals(1, annotations.get(2).getComments().size()); + assertEquals("comment 3", annotations.get(2).getComments().get(0).getContent()); + } + + @ModelTest("./src/test/java/spoon/test/comment/testclasses/ArrayAccessComments.java") + @GitHubIssue(issueNumber = 2482, fixed = false) + public void testArrayAccessComments(CtModel model) { + //contract: comments at array accesses should be properly added to the AST + List comments = model.getElements(new TypeFilter<>(CtComment.class)); + List> arrayAccesses = model.getElements(new TypeFilter<>(CtArrayAccess.class)); + + assertEquals(2,comments.size()); + assertEquals("comment 1", comments.get(0).getContent()); + assertEquals("comment 2", comments.get(1).getContent()); + + assertEquals(1, arrayAccesses.get(0).getComments().size()); + assertEquals("comment 1", arrayAccesses.get(0).getComments().get(0).getContent()); + assertEquals(1, arrayAccesses.get(1).getComments().size()); + assertEquals("comment 2", arrayAccesses.get(1).getComments().get(0).getContent()); + } + + @ModelTest("./src/test/java/spoon/test/comment/testclasses/BinaryOperatorComments.java") + @GitHubIssue(issueNumber = 2482, fixed = false) + public void testBinaryOperatorComments(CtModel model) { + //contract: comments at binary operators should be properly added to the AST + List comments = model.getElements(new TypeFilter<>(CtComment.class)); + List> binaryOperators = model.getElements(new TypeFilter<>(CtBinaryOperator.class)); + + assertEquals(1, comments.size()); + assertEquals("comment 1", comments.get(0).getContent()); + + assertEquals(1, binaryOperators.get(0).getComments().size()); + assertEquals("comment 1", binaryOperators.get(0).getComments().get(0).getContent()); + } + + @ModelTest("./src/test/java/spoon/test/comment/testclasses/TypeParameterComments.java") + @GitHubIssue(issueNumber = 2482, fixed = false) + public void testTypeParameterComments(CtModel model) { + //contract: comments at type parameters should be properly added to the AST + List comments = model.getElements(new TypeFilter<>(CtComment.class)); + List typeParameters = model.getElements(new TypeFilter<>(CtTypeParameter.class)); + + assertEquals(4, comments.size()); + assertEquals("comment 1", comments.get(0).getContent()); + assertEquals("comment 2", comments.get(1).getContent()); + assertEquals("comment 3", comments.get(2).getContent()); + assertEquals("comment 4", comments.get(3).getContent()); + + assertEquals(1, typeParameters.get(0).getComments().size()); + assertEquals("comment 1", typeParameters.get(0).getComments().get(0).getContent()); + assertEquals(3, typeParameters.get(1).getComments().size()); + assertEquals("comment 2", typeParameters.get(1).getComments().get(0).getContent()); + assertEquals("comment 3", typeParameters.get(1).getComments().get(1).getContent()); + assertEquals("comment 4", typeParameters.get(1).getComments().get(2).getContent()); + } } diff --git a/src/test/java/spoon/test/comment/testclasses/AnnotationComments.java b/src/test/java/spoon/test/comment/testclasses/AnnotationComments.java new file mode 100644 index 00000000000..23721f75751 --- /dev/null +++ b/src/test/java/spoon/test/comment/testclasses/AnnotationComments.java @@ -0,0 +1,12 @@ +package spoon.test.comment.testclasses; + +@SuppressWarnings/*comment 1*/("unused") +public class AnnotationComments { + @SuppressWarnings/*comment 2*/("unused") + public String foo = "bar"; + + @SuppressWarnings/*comment 3*/("unused") + public void bar(){ + + } +} diff --git a/src/test/java/spoon/test/comment/testclasses/ArrayAccessComments.java b/src/test/java/spoon/test/comment/testclasses/ArrayAccessComments.java new file mode 100644 index 00000000000..daa38175a65 --- /dev/null +++ b/src/test/java/spoon/test/comment/testclasses/ArrayAccessComments.java @@ -0,0 +1,12 @@ +package spoon.test.comment.testclasses; + +public class ArrayAccessComments { + + public void bar(int[] foo) + { + foo// comment 1 + [1] = 0; + int bar = foo // comment 2 + [0]; + } +} diff --git a/src/test/java/spoon/test/comment/testclasses/BinaryOperatorComments.java b/src/test/java/spoon/test/comment/testclasses/BinaryOperatorComments.java new file mode 100644 index 00000000000..471cfaf5ee5 --- /dev/null +++ b/src/test/java/spoon/test/comment/testclasses/BinaryOperatorComments.java @@ -0,0 +1,14 @@ +package spoon.test.comment.testclasses; + +public class BinaryOperatorComments { + + public void foo(int bar) + { + if (!(bar < 0 + // comment 1 + )) + { + + } + } +} diff --git a/src/test/java/spoon/test/comment/testclasses/TypeParameterComments.java b/src/test/java/spoon/test/comment/testclasses/TypeParameterComments.java new file mode 100644 index 00000000000..bc22f352d09 --- /dev/null +++ b/src/test/java/spoon/test/comment/testclasses/TypeParameterComments.java @@ -0,0 +1,5 @@ +package spoon.test.comment.testclasses; + +public class TypeParameterComments { + +} diff --git a/src/test/java/spoon/test/enums/EnumsTest.java b/src/test/java/spoon/test/enums/EnumsTest.java index 98e59b209f6..25d8dd37459 100644 --- a/src/test/java/spoon/test/enums/EnumsTest.java +++ b/src/test/java/spoon/test/enums/EnumsTest.java @@ -43,13 +43,13 @@ import spoon.reflect.reference.CtExecutableReference; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.reflect.CtExtendedModifier; -import spoon.test.GitHubIssue; import spoon.test.SpoonTestHelpers; import spoon.test.annotation.AnnotationTest; import spoon.test.enums.testclasses.Burritos; import spoon.test.enums.testclasses.EnumWithMembers; import spoon.test.enums.testclasses.NestedEnums; import spoon.test.enums.testclasses.Regular; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelUtils; import java.io.File; @@ -286,6 +286,7 @@ void testLocalEnumExists() { )); } + @Test @GitHubIssue(issueNumber = 4758, fixed = true) @DisplayName("Implicit enum constructors do not contain a super call") void testImplicitEnumConstructorSuperCall() { diff --git a/src/test/java/spoon/test/eval/EvalTest.java b/src/test/java/spoon/test/eval/EvalTest.java index f1d45d4e3e4..49c9bc4beb0 100644 --- a/src/test/java/spoon/test/eval/EvalTest.java +++ b/src/test/java/spoon/test/eval/EvalTest.java @@ -18,11 +18,19 @@ import java.io.File; +import java.util.Arrays; +import java.util.Collection; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.MethodSource; import spoon.Launcher; import spoon.SpoonException; import spoon.reflect.code.BinaryOperatorKind; @@ -30,10 +38,14 @@ import spoon.reflect.code.CtBlock; import spoon.reflect.code.CtCodeElement; import spoon.reflect.code.CtExpression; +import spoon.reflect.code.CtFieldAccess; import spoon.reflect.code.CtIf; import spoon.reflect.code.CtInvocation; +import spoon.reflect.code.CtLiteral; import spoon.reflect.code.CtLocalVariable; import spoon.reflect.code.CtReturn; +import spoon.reflect.code.CtUnaryOperator; +import spoon.reflect.code.UnaryOperatorKind; import spoon.reflect.declaration.CtClass; import spoon.reflect.declaration.CtElement; import spoon.reflect.declaration.CtMethod; @@ -41,17 +53,17 @@ import spoon.reflect.declaration.CtVariable; import spoon.reflect.eval.PartialEvaluator; import spoon.reflect.factory.Factory; +import spoon.reflect.reference.CtTypeReference; import spoon.reflect.visitor.AccessibleVariablesFinder; +import spoon.reflect.visitor.OperatorHelper; import spoon.reflect.visitor.filter.TypeFilter; +import spoon.support.compiler.VirtualFile; import spoon.support.reflect.eval.EvalHelper; import spoon.support.reflect.eval.InlinePartialEvaluator; import spoon.support.reflect.eval.VisitorPartialEvaluator; import spoon.test.eval.testclasses.Foo; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assertions.*; import static spoon.testing.utils.ModelUtils.build; public class EvalTest { @@ -165,7 +177,7 @@ public void testIsKnownAtCompileTime() throws Exception { @Test public void testVisitorPartialEvaluator_binary() { Launcher launcher = new Launcher(); - + { // binary operator CtCodeElement el = launcher.getFactory().Code().createCodeSnippetExpression("0+1").compile(); VisitorPartialEvaluator eval = new VisitorPartialEvaluator(); @@ -315,18 +327,55 @@ public void testconvertElementToRuntimeObject() { } + private static CtTypeReference inferType(CtBinaryOperator ctBinaryOperator) { + switch (ctBinaryOperator.getKind()) { + case AND: + case OR: + case INSTANCEOF: + case EQ: + case NE: + case LT: + case LE: + case GT: + case GE: + return ctBinaryOperator.getFactory().Type().BOOLEAN_PRIMITIVE; + case SL: + case SR: + case USR: + case MUL: + case DIV: + case MOD: + case MINUS: + case PLUS: + case BITAND: + case BITXOR: + case BITOR: + return OperatorHelper.getPromotedType( + ctBinaryOperator.getKind(), + ctBinaryOperator.getLeftHandOperand(), + ctBinaryOperator.getRightHandOperand() + ).orElseThrow(); + default: + throw new IllegalArgumentException("Unknown operator: " + ctBinaryOperator.getKind()); + } + } + private CtBinaryOperator createBinaryOperatorOnLiterals(Factory factory, Object leftLiteral, Object rightLiteral, BinaryOperatorKind opKind) { - return factory.createBinaryOperator(factory.createLiteral(leftLiteral), factory.createLiteral(rightLiteral), opKind); + CtBinaryOperator result = factory.createBinaryOperator(factory.createLiteral(leftLiteral), factory.createLiteral(rightLiteral), opKind); + if (result.getType() == null) { + result.setType(inferType(result)); + } + return result; } - + @ParameterizedTest @CsvSource( delimiter = '|', useHeadersInDisplayName = true, value = { - " Literal | Expected ", + " Literal | Expected ", "-1.234567 | -1.234567 ", - "-2.345F | -2.345F ", + "-2.345F | -2.345F ", "-3 | -3 ", "-4L | -4L " } @@ -343,4 +392,221 @@ void testDoublePrecisionLost(String literal, String expected) { method.setBody(method.getBody().partiallyEvaluate()); assertEquals(expected, parameter.getArguments().get(0).toString()); } + + private static final Map, Function>> LITERAL_PROVIDER = Map.ofEntries( + Map.entry(byte.class, factory -> factory.createLiteral((byte) 1)), + Map.entry(short.class, factory -> factory.createLiteral((short) 1)), + Map.entry(int.class, factory -> factory.createLiteral((int) 1)), + Map.entry(long.class, factory -> factory.createLiteral(1L)), + Map.entry(float.class, factory -> factory.createLiteral(1.0f)), + Map.entry(double.class, factory -> factory.createLiteral(1.0d)), + Map.entry(boolean.class, factory -> factory.createLiteral(true)), + Map.entry(char.class, factory -> factory.createLiteral('a')), + Map.entry(String.class, factory -> factory.createLiteral("a")), + // null can be any type, so use Object.class + Map.entry(Object.class, factory -> factory.createLiteral(null)) + ); + + // Returns a stream of all ordered pairs. For example, cartesianProduct([1, 2], [a, b]) + // returns [(1, a), (1, b), (2, a), (2, b)] + private static Stream> cartesianProduct(Collection left, Collection right) { + return left.stream().flatMap(l -> right.stream().map(r -> Map.entry(l, r))); + } + + private static Stream provideBinaryOperatorsForAllLiterals() { + // This generates all combinations of binary operators and literals: + // + // There are 10 types, so 10 * 10 = 100 pairs + // For each pair, all operators are tested: 100 * 19 = 1900 tests + return cartesianProduct(LITERAL_PROVIDER.entrySet(), LITERAL_PROVIDER.entrySet()) + .flatMap(tuple -> Arrays.stream(BinaryOperatorKind.values()) + // not yet implemented and does not make sense on literals + .filter(operator -> operator != BinaryOperatorKind.INSTANCEOF) + .map(operator -> Arguments.of(operator, tuple.getKey().getKey(), tuple.getKey().getValue(), tuple.getValue().getKey(), tuple.getValue().getValue()))); + } + + @ParameterizedTest(name = "{0}({1}, {3})") + @MethodSource("provideBinaryOperatorsForAllLiterals") + void testVisitCtBinaryOperatorLiteralType( + BinaryOperatorKind operator, + Class leftType, + Function> leftLiteralProvider, + Class rightType, + Function> rightLiteralProvider + ) { + // contract: the type is preserved during partial evaluation + + Launcher launcher = new Launcher(); + + CtLiteral leftLiteral = leftLiteralProvider.apply(launcher.getFactory()); + CtLiteral rightLiteral = rightLiteralProvider.apply(launcher.getFactory()); + + Optional> expectedType = OperatorHelper.getPromotedType(operator, leftLiteral, rightLiteral); + + if (expectedType.isEmpty()) { + return; + } + String code = "public class Test {\n" + + " void test() {\n" + + " System.out.println(%s);\n" + + " }\n" + + "}\n"; + + launcher.addInputResource(new VirtualFile(String.format( + code, + String.format("(%s) %s (%s)", leftLiteral, OperatorHelper.getOperatorText(operator), rightLiteral) + ))); + + launcher.getEnvironment().setNoClasspath(true); + launcher.getEnvironment().setAutoImports(true); + + CtClass ctClass = (CtClass) launcher.buildModel().getAllTypes().stream().findFirst().get(); + CtBinaryOperator ctBinaryOperator = ctClass + .getElements(new TypeFilter<>(CtBinaryOperator.class)) + .get(0); + + CtType currentType = ctBinaryOperator.getType().getTypeDeclaration().clone(); + CtExpression evaluated = ctBinaryOperator.partiallyEvaluate(); + assertNotNull( + evaluated.getType(), + String.format("type of '%s' is null after evaluation", ctBinaryOperator) + ); + assertEquals(currentType, evaluated.getType().getTypeDeclaration()); + } + + @Test + void testEvaluateLiteralTypeCasts() { + String code = "public class Test {\n" + + " void test() {\n" + + " System.out.println((byte) 400 + 20);\n" + + " }\n" + + "}\n"; + CtBinaryOperator ctBinaryOperator = Launcher.parseClass(code) + .getElements(new TypeFilter<>(CtBinaryOperator.class)) + .get(0); + CtLiteral evaluated = ctBinaryOperator.partiallyEvaluate(); + assertNotNull( + evaluated.getType(), + String.format("type of '%s' is null after evaluation", ctBinaryOperator) + ); + assertEquals( + ctBinaryOperator.getFactory().Type().INTEGER_PRIMITIVE, + evaluated.getType() + ); + assertEquals( + -92, + evaluated.getValue() + ); + } + + private static Stream provideUnaryOperatorsForAllLiterals() { + // This generates all combinations of unary operators and literals: + return LITERAL_PROVIDER.entrySet() + .stream() + // String cannot be used with unary operators + .filter(entry -> !entry.getKey().equals(String.class)) + .flatMap(entry -> Arrays.stream(UnaryOperatorKind.values()) + .map(operator -> Arguments.of(operator, entry.getKey(), entry.getValue())) + ); + } + + @ParameterizedTest(name = "{0}({1})") + @MethodSource("provideUnaryOperatorsForAllLiterals") + void testVisitCtUnaryOperatorLiteralType(UnaryOperatorKind operator, Class type, Function> provider) { + // contract: the type is preserved during partial evaluation + Launcher launcher = new Launcher(); + + CtLiteral literal = provider.apply(launcher.getFactory()); + + Optional> expectedType = OperatorHelper.getPromotedType(operator, literal); + + if (expectedType.isEmpty()) { + return; + } + + String code = "public class Test {\n" + + " void test() {\n" + + " System.out.println(%s);\n" + + " }\n" + + "}\n"; + + launcher.addInputResource(new VirtualFile(String.format( + code, + String.format("%s(%s)", OperatorHelper.getOperatorText(operator), literal) + ))); + + launcher.getEnvironment().setNoClasspath(true); + launcher.getEnvironment().setAutoImports(true); + + CtClass ctClass = (CtClass) launcher.buildModel().getAllTypes().stream().findFirst().get(); + CtUnaryOperator ctUnaryOperator = ctClass + .getElements(new TypeFilter<>(CtUnaryOperator.class)) + .get(0); + CtType currentType = ctUnaryOperator.getType().getTypeDeclaration().clone(); + CtExpression evaluated = ctUnaryOperator.partiallyEvaluate(); + assertNotNull( + evaluated.getType(), + String.format("type of '%s' is null after evaluation", ctUnaryOperator) + ); + assertEquals(currentType, evaluated.getType().getTypeDeclaration()); + } + + @Test + void testVisitCtFieldAccessLiteralType() { + // contract: the type is preserved during partial evaluation + String code = "public class Test {\n" + + " void test() {\n" + + " System.out.println(String.class);\n" + + " }\n" + + "}\n"; + CtFieldAccess ctFieldAccess = Launcher.parseClass(code) + .getElements(new TypeFilter<>(CtFieldAccess.class)) + .get(0); + CtType currentType = ctFieldAccess.getType().getTypeDeclaration(); + CtExpression evaluated = ctFieldAccess.partiallyEvaluate(); + assertNotNull( + evaluated.getType(), + String.format("type of '%s' is null after evaluation", ctFieldAccess) + ); + assertEquals(currentType, evaluated.getType().getTypeDeclaration()); + } + + @Test + void testVisitCtBinaryOperatorIntegerDivision() { + String code = "public class Test {\n" + + " void test() {\n" + + " System.out.println(1 / 0);\n" + + " }\n" + + "}\n"; + CtBinaryOperator ctBinaryOperator = Launcher.parseClass(code) + .getElements(new TypeFilter<>(CtBinaryOperator.class)) + .get(0); + SpoonException exception = assertThrows( + SpoonException.class, + ctBinaryOperator::partiallyEvaluate + ); + + assertEquals( + "Expression '1 / 0' evaluates to '1 / 0' which can not be evaluated", + exception.getMessage() + ); + } + + @Test + void testVisitCtBinaryOperatorFloatingDivision() { + String code = "public class Test {\n" + + " void test() {\n" + + " System.out.println(1.0 / 0);\n" + + " }\n" + + "}\n"; + CtBinaryOperator ctBinaryOperator = Launcher.parseClass(code) + .getElements(new TypeFilter<>(CtBinaryOperator.class)) + .get(0); + CtLiteral ctLiteral = ctBinaryOperator.partiallyEvaluate(); + + assertEquals( + ctBinaryOperator.getFactory().createLiteral(Double.POSITIVE_INFINITY), + ctLiteral + ); + } } diff --git a/src/test/java/spoon/test/factory/CodeFactoryTest.java b/src/test/java/spoon/test/factory/CodeFactoryTest.java index 01d507f1f03..8a6f558203e 100644 --- a/src/test/java/spoon/test/factory/CodeFactoryTest.java +++ b/src/test/java/spoon/test/factory/CodeFactoryTest.java @@ -29,8 +29,7 @@ import spoon.reflect.factory.Factory; import spoon.reflect.reference.CtTypeReference; import spoon.support.util.compilation.JavacFacade; -import spoon.test.GitHubIssue; - +import spoon.testing.utils.GitHubIssue; import java.util.List; import java.util.Map; @@ -66,8 +65,9 @@ public void testCreateVariableAssignement() { assertEquals(f.getReference(), ((CtVariableWrite) va.getAssigned()).getVariable()); } + @Test @GitHubIssue(issueNumber= 4956, fixed = true) - void createCtCatcVariablehWithoutModifiers() { + void createCtCatchVariableWithoutModifiers() { // contract: CtCatchVariable without modifiers is created. This a test for the regression of #4940 Factory factory = createFactory(); CtTypeReference exceptionType = factory.Type().createReference(Exception.class); diff --git a/src/test/java/spoon/test/field/FieldTest.java b/src/test/java/spoon/test/field/FieldTest.java index eb435249e53..7e9657f8fcd 100644 --- a/src/test/java/spoon/test/field/FieldTest.java +++ b/src/test/java/spoon/test/field/FieldTest.java @@ -23,6 +23,8 @@ import java.io.File; import java.util.HashSet; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -33,11 +35,13 @@ import spoon.reflect.declaration.CtClass; import spoon.reflect.declaration.CtField; import spoon.reflect.declaration.CtMethod; +import spoon.reflect.declaration.CtType; import spoon.reflect.declaration.ModifierKind; import spoon.reflect.factory.Factory; import spoon.reflect.reference.CtFieldReference; import spoon.reflect.reference.CtTypeReference; import spoon.reflect.visitor.filter.TypeFilter; +import spoon.support.compiler.VirtualFile; import spoon.support.reflect.eval.VisitorPartialEvaluator; import spoon.test.field.testclasses.A; import spoon.test.field.testclasses.AddFieldAtTop; @@ -215,5 +219,57 @@ public void bugAfterRefactoringImports() { } + @ModelTest( + "./src/test/java/spoon/test/field/testclasses/AnnoWithConst.java" + ) + void testGetActualFieldForConstantInAnnotation(CtModel ctModel) { + // contract: CtFieldReference#getActualField() returns the field for constants in annotations + CtFieldReference access = ctModel.getElements(new TypeFilter>(CtFieldReference.class)) + .stream() + .filter(field -> field.getSimpleName().equals("VALUE")) + .findFirst() + .orElseGet(() -> fail("No reference to VALUE found")); + assertNotNull(assertDoesNotThrow(access::getActualField)); + } + + @Test + void testArrayLengthDeclaringType() { + // contract: the "length" field of arrays has a proper declaring type + Launcher launcher = new Launcher(); + launcher.addInputResource(new VirtualFile("public class Example {\n" + + " static final String[] field;\n" + + " public static void main(String[] args) {\n" + + " int i = args.length;\n" + + " int j = field.length;\n" + + " }\n" + + "}\n")); + CtModel ctModel = launcher.buildModel(); + List> elements = ctModel.getElements(new TypeFilter>(CtFieldReference.class)) + .stream() + .filter(field -> field.getSimpleName().equals("length")) + .collect(Collectors.toList()); + CtType component = launcher.getFactory().Type().get(String.class); + CtTypeReference arrayType = launcher.getFactory().Type().createArrayReference(component); + + assertEquals(2, elements.size(), "Unexpected number of .length references"); + + assertEquals(arrayType, elements.get(0).getDeclaringType()); + assertEquals(arrayType, elements.get(1).getDeclaringType()); + } + + @Test + void testArrayLengthModifiers() { + // contract: the "length" field in arrays has exactly the modifiers "public" and "final" + Launcher launcher = new Launcher(); + launcher.addInputResource(new VirtualFile("public class Example {\n" + + " public static void main(String[] args) {\n" + + " int i = args.length;\n" + + " }\n" + + "}\n")); + CtModel ctModel = launcher.buildModel(); + List> elements = ctModel.getElements(new TypeFilter<>(CtFieldReference.class)); + assertEquals(1, elements.size()); + assertEquals(Set.of(ModifierKind.PUBLIC, ModifierKind.FINAL), elements.get(0).getModifiers()); + } } diff --git a/src/test/java/spoon/test/field/testclasses/AnnoWithConst.java b/src/test/java/spoon/test/field/testclasses/AnnoWithConst.java new file mode 100644 index 00000000000..d4e2f866757 --- /dev/null +++ b/src/test/java/spoon/test/field/testclasses/AnnoWithConst.java @@ -0,0 +1,9 @@ +package spoon.test.field.testclasses; + +public @interface AnnoWithConst { + int VALUE = 42; +} + +class User { + int i = AnnoWithConst.VALUE; +} \ No newline at end of file diff --git a/src/test/java/spoon/test/imports/ImportTest.java b/src/test/java/spoon/test/imports/ImportTest.java index 05971de4777..3fadc9ed36f 100644 --- a/src/test/java/spoon/test/imports/ImportTest.java +++ b/src/test/java/spoon/test/imports/ImportTest.java @@ -73,6 +73,7 @@ import spoon.test.imports.testclasses.Tacos; import spoon.test.imports.testclasses.ToBeModified; import spoon.test.imports.testclasses.badimportissue3320.source.TestSource; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.LineSeparatorExtension; import spoon.testing.utils.ModelTest; import spoon.testing.utils.ModelUtils; @@ -99,6 +100,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.core.IsCollectionContaining.hasItem; import static org.junit.jupiter.api.Assertions.*; import static spoon.testing.utils.ModelUtils.canBeBuilt; @@ -1529,10 +1531,10 @@ public void testMethodChainAutoImports() { List statements = ctor.getBody().getStatements(); assertEquals("super(context, attributeSet)", statements.get(0).toString()); - assertEquals("mButton = ((Button) (findViewById(page_button_button)))", statements.get(1).toString()); - assertEquals("mCurrentActiveColor = getColor(c4_active_button_color)", statements.get(2).toString()); - assertEquals("mCurrentActiveColor = getResources().getColor(c4_active_button_color)", statements.get(3).toString()); - assertEquals("mCurrentActiveColor = getData().getResources().getColor(c4_active_button_color)", statements.get(4).toString()); + assertEquals("mButton = ((Button) (findViewById(id.page_button_button)))", statements.get(1).toString()); + assertEquals("mCurrentActiveColor = getColor(color.c4_active_button_color)", statements.get(2).toString()); + assertEquals("mCurrentActiveColor = getResources().getColor(color.c4_active_button_color)", statements.get(3).toString()); + assertEquals("mCurrentActiveColor = getData().getResources().getColor(color.c4_active_button_color)", statements.get(4).toString()); } @Test @@ -1861,4 +1863,41 @@ void testAutoimportConflictingSimpleNames() { ); } + @GitHubIssue(issueNumber = 5210, fixed = true) + @ModelTest(value = {"src/test/resources/inner-class"}, complianceLevel = 11, autoImport = true) + void staticImports_ofNestedTypes_shouldBeRecorded(CtModel model) { + // contract: static imports of nested types should be recorded + // arrange + CtType mainType = model.getElements(new TypeFilter<>(CtType.class)).stream() + .filter(t -> t.getSimpleName().equals("Main")) + .findFirst().orElseThrow(); + + // assert + List imports = mainType.getPosition().getCompilationUnit().getImports(); + assertThat(imports, hasSize(2)); + + CtImport import0 = imports.get(0); + assertThat(import0.getReference().getSimpleName(), is("InnerClass")); + } + + @ModelTest(value = {"src/test/resources/static-method-and-type"}, autoImport = true) + void staticTypeAndMethodImport_importShouldAppearOnlyOnceIfTheirSimpleNamesAreEqual(CtModel model) { + // contract: static type and method import should appear only once if their simple names are equal + // arrange + CtType mainType = model.getElements(new TypeFilter<>(CtType.class)).stream() + .filter(t -> t.getSimpleName().equals("Main")) + .findFirst().orElseThrow(); + + // assert + List imports = mainType.getPosition().getCompilationUnit().getImports(); + assertThat(imports, hasSize(2)); + + CtImport import0 = imports.get(0); + assertThat(import0.getImportKind(), is(CtImportKind.METHOD)); + assertThat(import0.getReference().getSimpleName(), is("foo")); + + CtImport import1 = imports.get(1); + assertThat(import1.getImportKind(), is(CtImportKind.TYPE)); + assertThat(import1.getReference().getSimpleName(), is("foo")); + } } diff --git a/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java b/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java index 1905ced6cf7..d62f9485886 100644 --- a/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java +++ b/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java @@ -1,20 +1,21 @@ package spoon.test.issue3321; -import spoon.test.GitHubIssue; import spoon.reflect.cu.SourcePosition; import spoon.Launcher; import spoon.reflect.factory.Factory; import spoon.test.issue3321.testclasses.AnnoUser; +import spoon.testing.utils.GitHubIssue; import spoon.reflect.declaration.CtParameter; import spoon.reflect.declaration.CtClass; import spoon.reflect.declaration.CtMethod; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; public class AnnotationPositionTest { - + @Test @GitHubIssue(issueNumber = 3358, fixed = false) public void testUsageOfTypeAnnotationOnParameterInMethod() { final Launcher launcher = new Launcher(); @@ -68,6 +69,7 @@ public void testUsageOfTypeAnnotationOnParameterInMethod() { } + @Test @GitHubIssue(issueNumber = 3358, fixed = false) public void testSneakyAnnotationsOnParameters() { final Launcher launcher = new Launcher(); diff --git a/src/test/java/spoon/test/literal/LiteralTest.java b/src/test/java/spoon/test/literal/LiteralTest.java index 4f39387898e..2ae4581fc89 100644 --- a/src/test/java/spoon/test/literal/LiteralTest.java +++ b/src/test/java/spoon/test/literal/LiteralTest.java @@ -25,11 +25,13 @@ import spoon.test.literal.testclasses.Tacos; import spoon.Launcher; import spoon.reflect.code.LiteralBase; +import spoon.reflect.cu.SourcePosition; import spoon.reflect.factory.TypeFactory; import spoon.reflect.declaration.CtClass; import org.junit.jupiter.api.Test; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelTest; - +import java.util.List; import java.util.TreeSet; import static spoon.testing.utils.ModelUtils.buildClass; @@ -257,4 +259,29 @@ public void testLiteralBasePrinter(Factory factory) { assertEquals("'c'", ctClass.getField("c1").getDefaultExpression().toString()); assertEquals("\"hello\"", ctClass.getField("s1").getDefaultExpression().toString()); } + + @Test + @GitHubIssue(issueNumber = 5070, fixed = true) + void tooStrictEscaping() { + // contract: inside a string without a position ' are not escaped. + List> literals = Launcher.parseClass("class Foo { String s = \"'\"; }") + .getElements(new TypeFilter<>(CtLiteral.class)); + CtLiteral ctLiteral = literals.get(0); + ctLiteral.setPosition(SourcePosition.NOPOSITION); + String literal = (String) ctLiteral.getValue(); + assertEquals("'", literal); + assertEquals("\"'\"", ctLiteral.toString()); + } + + @Test + @GitHubIssue(issueNumber = 5070, fixed = true) + void tooStrictEscapingCharTest() { + // contract: inside a string with a position ' are escaped. + List> literals = Launcher.parseClass("class Foo { char c = \'\\'\'; }") + .getElements(new TypeFilter<>(CtLiteral.class)); + CtLiteral ctLiteral = literals.get(0); + char literal = (char) ctLiteral.getValue(); + assertEquals('\'', literal); + assertEquals("\'\\'\'", ctLiteral.toString()); + } } diff --git a/src/test/java/spoon/test/logging/LogTest.java b/src/test/java/spoon/test/logging/LogTest.java index d795c55ca9d..74fefdac4a7 100644 --- a/src/test/java/spoon/test/logging/LogTest.java +++ b/src/test/java/spoon/test/logging/LogTest.java @@ -31,7 +31,7 @@ import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.JavaOutputProcessor; import spoon.support.Level; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; import uk.org.lidalia.slf4jtest.TestLogger; import uk.org.lidalia.slf4jtest.TestLoggerFactory; import java.util.List; @@ -112,6 +112,7 @@ public void testLoggingOff() { assertEquals(0, logger.getLoggingEvents().size()); } + @Test @GitHubIssue(issueNumber = 4997, fixed = true) void innerTypesCrashesLogging() { // contract: when a class has inner types, the logging should not crash with a NPE diff --git a/src/test/java/spoon/test/method/MethodTest.java b/src/test/java/spoon/test/method/MethodTest.java index b48bf44a92d..50d8fa1e21b 100644 --- a/src/test/java/spoon/test/method/MethodTest.java +++ b/src/test/java/spoon/test/method/MethodTest.java @@ -16,9 +16,10 @@ */ package spoon.test.method; -import org.hamcrest.CoreMatchers; +import spoon.reflect.code.CtInvocation; import spoon.reflect.factory.Factory; import spoon.reflect.declaration.CtParameter; +import spoon.reflect.visitor.filter.TypeFilter; import spoon.test.method.testclasses.Hierarchy; import spoon.test.method.testclasses.Tacos; import spoon.reflect.reference.CtTypeReference; @@ -34,7 +35,6 @@ import org.junit.jupiter.api.Test; import spoon.testing.utils.ModelTest; -import java.util.Collection; import java.util.List; import java.util.Set; import java.util.ConcurrentModificationException; @@ -43,6 +43,7 @@ import java.util.Arrays; import static org.hamcrest.CoreMatchers.anyOf; +import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.sameInstance; import static spoon.testing.utils.ModelUtils.buildClass; @@ -245,4 +246,20 @@ void test_getTopDefinitions_findsTopOnly(Factory factory) { assertThat(m0.getTopDefinitions().size(), equalTo(0)); assertThat(m1.getTopDefinitions().size(), equalTo(0)); } + + @ModelTest("src/test/resources/signature-polymorphic-methods/SignaturePolymorphicMethods.java") + void testSignaturePolymorphicMethodInvocations(Factory factory) { + // contract: calls to signature-polymorphic methods should be equal to their declaration signature + CtType type = factory.Type().get("SignaturePolymorphicMethods"); + Set> methods = type.getMethods(); + assertThat(methods.size(), equalTo(4)); + for (CtMethod method : methods) { + // MethodHandle#invoke and MethodHandle#invokeExact have the declaration signature (Object[])Object + CtInvocation invocation = method.getBody().getElements(new TypeFilter<>(CtInvocation.class)).get(0); + assertThat(invocation.getType(), equalTo(factory.Type().objectType())); + List> parameters = invocation.getExecutable().getParameters(); + assertThat(parameters.size(), equalTo(1)); + assertThat(parameters.get(0), equalTo(factory.Type().createArrayReference(factory.Type().objectType()))); + } + } } diff --git a/src/test/java/spoon/test/model/SwitchCaseTest.java b/src/test/java/spoon/test/model/SwitchCaseTest.java index a4ed14deff4..5b6dd376372 100644 --- a/src/test/java/spoon/test/model/SwitchCaseTest.java +++ b/src/test/java/spoon/test/model/SwitchCaseTest.java @@ -51,7 +51,7 @@ import spoon.reflect.factory.Factory; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.compiler.VirtualFile; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; @DisplayName("Switchcase Tests") public class SwitchCaseTest { @@ -233,6 +233,7 @@ public void testSwitchColons() { ); } + @Test @GitHubIssue(issueNumber = 4696, fixed = true) void testVariableScopeInSwitch() { // contract: different cases do not introduce different scopes in colon-switches diff --git a/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java b/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java index 47a5d048b1f..f1d234878e1 100644 --- a/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java +++ b/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java @@ -10,7 +10,7 @@ import org.apache.commons.io.FileUtils; import org.hamcrest.CoreMatchers; import org.junit.jupiter.api.BeforeAll; - +import org.junit.jupiter.api.Test; import spoon.Launcher; import spoon.compiler.Environment; import spoon.reflect.CtModel; @@ -18,7 +18,7 @@ import spoon.reflect.declaration.CtClass; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.sniper.SniperJavaPrettyPrinter; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; public class SniperAnnotatedEnumTest { private static final Path INPUT_PATH = Paths.get("src/test/java/"); @@ -29,6 +29,7 @@ public static void setup() throws IOException { FileUtils.deleteDirectory(OUTPUT_PATH.toFile()); } + @Test @GitHubIssue(issueNumber = 4779, fixed = true) public void annotatedEnumTest() throws IOException { runSniperJavaPrettyPrinter("spoon/test/prettyprinter/testclasses/AnnotatedEnum.java"); diff --git a/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java b/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java index 228f2c6a2a3..a41cd0bfa71 100644 --- a/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java +++ b/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java @@ -49,12 +49,11 @@ import spoon.support.modelobs.ChangeCollector; import spoon.support.modelobs.SourceFragmentCreator; import spoon.support.sniper.SniperJavaPrettyPrinter; -import spoon.test.GitHubIssue; import spoon.test.prettyprinter.testclasses.OneLineMultipleVariableDeclaration; import spoon.test.prettyprinter.testclasses.Throw; import spoon.test.prettyprinter.testclasses.InvocationReplacement; import spoon.test.prettyprinter.testclasses.ToBeChanged; - +import spoon.testing.utils.GitHubIssue; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -774,6 +773,7 @@ void testSniperRespectsDeletionInForUpdate() { testSniper("ForLoop", deleteForUpdate, assertNotStaticFindFirstIsEmpty); } + @Test @GitHubIssue(issueNumber = 4021, fixed = true) void testSniperRespectsSuperWithUnaryOperator() { // Combining CtSuperAccess and CtUnaryOperator leads to SpoonException with Sniper @@ -787,6 +787,7 @@ void testSniperRespectsSuperWithUnaryOperator() { testSniper("superCall.SuperCallSniperTestClass", deleteForUpdate, assertContainsSuperWithUnaryOperator); } + @Test @GitHubIssue(issueNumber = 3911, fixed = false) void testRoundBracketPrintingInComplexArithmeticExpression() { Consumer> noOpModifyFieldAssignment = type -> @@ -801,6 +802,7 @@ void testRoundBracketPrintingInComplexArithmeticExpression() { testSniper("ArithmeticExpression", noOpModifyFieldAssignment, assertPrintsRoundBracketsCorrectly); } + @Test @GitHubIssue(issueNumber = 4218, fixed = true) void testSniperDoesNotPrintTheDeletedAnnotation() { Consumer> deleteAnnotation = type -> { @@ -813,6 +815,7 @@ void testSniperDoesNotPrintTheDeletedAnnotation() { testSniper("sniperPrinter.DeleteAnnotation", deleteAnnotation, assertDoesNotContainAnnotation); } + @Test @GitHubIssue(issueNumber = 4220, fixed = true) void testSniperAddsSpaceAfterFinal() { Consumer> modifyField = type -> { @@ -896,6 +899,7 @@ private BiConsumer, String> assertPrintsBracketForArrayInitialisation( assertThat(result, containsString(arrayDeclaration)); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketShouldBePrintedWhenArrayIsNull() { testSniper( @@ -904,6 +908,7 @@ void test_bracketShouldBePrintedWhenArrayIsNull() { assertPrintsBracketForArrayInitialisation("int array[];")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketShouldBePrintedWhenArrayIsInitialisedToIntegers() { testSniper( @@ -912,6 +917,7 @@ void test_bracketShouldBePrintedWhenArrayIsInitialisedToIntegers() { assertPrintsBracketForArrayInitialisation("int array[] = {1, 2, 3, 4, 5};")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketShouldBePrintedWhenArrayIsInitialisedToNullElements() { testSniper( @@ -920,6 +926,7 @@ void test_bracketShouldBePrintedWhenArrayIsInitialisedToNullElements() { assertPrintsBracketForArrayInitialisation("String array[] = new String[42];")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketsShouldBePrintedForMultiDimensionalArray() { testSniper( @@ -928,6 +935,7 @@ void test_bracketsShouldBePrintedForMultiDimensionalArray() { assertPrintsBracketForArrayInitialisation("String array[][][] = new String[1][2][3];")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketsShouldBePrintedForArrayInitialisedInLocalVariable() { Consumer> noOpModifyLocalVariable = type -> { @@ -941,6 +949,7 @@ void test_bracketsShouldBePrintedForArrayInitialisedInLocalVariable() { assertPrintsBracketForArrayInitialisation("int array[] = new int[]{ };")); } + @Test @GitHubIssue(issueNumber = 4421, fixed = true) void test_bracketsShouldBePrintedForGenericTypeOfArray() { testSniper( @@ -1087,32 +1096,38 @@ public void testToStringWithSniperPrinter(String inputSourcePath) throws Excepti public void testToStringWithSniperOnElementScan() throws Exception { testToStringWithSniperPrinter("src/test/java/spoon/test/prettyprinter/testclasses/ElementScan.java"); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffBrackets() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/Brackets").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffConditionalComment() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/ConditionalComment").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffEnumComment() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/EnumComment").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffEnumTest() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/EnumTest").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffExceptionTest() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/ExceptionTest").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffMethodComment() throws IOException { testNoChangeDiffFailing( diff --git a/src/test/java/spoon/test/role/TestCtRole.java b/src/test/java/spoon/test/role/TestCtRole.java index b74420dab8d..169398c8886 100644 --- a/src/test/java/spoon/test/role/TestCtRole.java +++ b/src/test/java/spoon/test/role/TestCtRole.java @@ -28,8 +28,7 @@ import spoon.support.reflect.declaration.CtConstructorImpl; import spoon.support.reflect.declaration.CtFieldImpl; import spoon.support.reflect.declaration.CtMethodImpl; -import spoon.test.GitHubIssue; - +import spoon.testing.utils.GitHubIssue; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -112,6 +111,7 @@ public void testCtRoleGetSubRoleFailsOnNull() { } } + @Test @GitHubIssue(issueNumber = 4698, fixed = true) void testArrayListRoleInParent() { // contract: Printing an element should not cause getRoleInParent to fail afterwards diff --git a/src/test/java/spoon/test/type/TypeTest.java b/src/test/java/spoon/test/type/TypeTest.java index 765b7c5fb1f..8625becf176 100644 --- a/src/test/java/spoon/test/type/TypeTest.java +++ b/src/test/java/spoon/test/type/TypeTest.java @@ -37,6 +37,7 @@ import spoon.reflect.code.CtLocalVariable; import spoon.reflect.code.CtNewClass; import spoon.reflect.code.CtTypeAccess; +import spoon.reflect.cu.SourcePosition; import spoon.reflect.declaration.CtClass; import spoon.reflect.declaration.CtMethod; import spoon.reflect.declaration.CtType; @@ -56,6 +57,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -417,4 +419,15 @@ public void testBinaryOpStringsType() { List concats = model.getElements(new TypeFilter<>(CtBinaryOperator.class)); concats.forEach(c -> assertEquals("java.lang.String", c.getType().toString())); } + + @ModelTest( + value = {"./src/test/resources/noclasspath/issue5208/"}, + noClasspath = true + ) + void testClassNotReplacedInNoClasspathMode(Factory factory) { + // contract: ClassT1 is not replaced once present when looking up the ClassT1#classT3 field from ClassT2 + CtType type = factory.Type().get("p20.ClassT1"); + assertNotNull(type); + assertNotEquals(SourcePosition.NOPOSITION, type.getPosition()); + } } diff --git a/src/test/java/spoon/test/variable/VariableTest.java b/src/test/java/spoon/test/variable/VariableTest.java index a3f8697c717..4ef3958e352 100644 --- a/src/test/java/spoon/test/variable/VariableTest.java +++ b/src/test/java/spoon/test/variable/VariableTest.java @@ -21,6 +21,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledForJreRange; import org.junit.jupiter.api.condition.JRE; +import org.junit.jupiter.api.io.TempDir; import spoon.Launcher; import spoon.processing.AbstractProcessor; import spoon.reflect.CtModel; @@ -152,13 +153,12 @@ public void testInferredVariableAreMarked() { @Test @DisabledForJreRange(max = JRE.JAVA_9) - public void testInferredVariableArePrintedWithVar() throws IOException { + public void testInferredVariableArePrintedWithVar(@TempDir File outputDir) throws IOException { // contract: if a variable is marked as inferred in the model, it must be pretty-printed with a 'var' keyword Launcher launcher = new Launcher(); launcher.getEnvironment().setComplianceLevel(10); launcher.addInputResource("./src/test/resources/spoon/test/var/Main.java"); - File outputDir = Files.createTempDir(); launcher.setSourceOutputDirectory(outputDir); launcher.run(); diff --git a/src/test/java/spoon/test/GitHubIssue.java b/src/test/java/spoon/testing/utils/GitHubIssue.java similarity index 88% rename from src/test/java/spoon/test/GitHubIssue.java rename to src/test/java/spoon/testing/utils/GitHubIssue.java index 0cc3c9e5307..da991e1fe0d 100644 --- a/src/test/java/spoon/test/GitHubIssue.java +++ b/src/test/java/spoon/testing/utils/GitHubIssue.java @@ -5,7 +5,7 @@ * * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ -package spoon.test; +package spoon.testing.utils; import static org.junit.jupiter.api.Assertions.fail; import java.lang.annotation.ElementType; @@ -14,7 +14,6 @@ import java.lang.annotation.Target; import java.util.Objects; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.AfterTestExecutionCallback; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtensionContext; @@ -23,13 +22,21 @@ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) -@Test @ExtendWith(GitHubIssue.UnresolvedBugExtension.class) /** * This meta annotation is used to mark a test method as a test that should fail if {@link #fixed} is false. * The test will be executed and the result will be checked. If the test fails, the test will be marked as success. - * As this is a meta annotation you can simple only add this to a test method and omit the {@link Test} aonntation. - * Mark {@link #fixed} as true if you want to signal that the test should succed and the issue is fixed. + * Mark {@link #fixed} as true if you want to signal that the test should succeed and the issue is fixed. + * + * Example usage: + *
+ * {@literal @}Test
+ * {@literal @}GitHubIssue(issueNumber = 123, fixed = false)
+ * public void testSomething() {
+ *     // Perform some test that should fail if issue #123 is not fixed
+ *     Assertions.fail("This test should fail if issue #123 is not fixed");
+ * }
+ * 
*/ public @interface GitHubIssue { diff --git a/src/test/resources/inner-class/Main.java b/src/test/resources/inner-class/Main.java new file mode 100644 index 00000000000..48efd82e59a --- /dev/null +++ b/src/test/resources/inner-class/Main.java @@ -0,0 +1,12 @@ +package inner_class; + +import java.util.List; +import static inner_class.constants.Constants.InnerClass; + +public class Main { + public void fun() { + List list = List.of(1, 2, 3); + InnerClass innerClass = new InnerClass(); + innerClass.print(); + } +} diff --git a/src/test/resources/inner-class/constants/Constants.java b/src/test/resources/inner-class/constants/Constants.java new file mode 100644 index 00000000000..d104034e497 --- /dev/null +++ b/src/test/resources/inner-class/constants/Constants.java @@ -0,0 +1,11 @@ +package inner_class.constants; + +public class Constants { + public static int ZERO = 0; + + public static class InnerClass { + public void print() { + + } + } +} diff --git a/src/test/resources/noclasspath/issue5208/p20/ClassT1.java b/src/test/resources/noclasspath/issue5208/p20/ClassT1.java new file mode 100644 index 00000000000..ba3b1c398bc --- /dev/null +++ b/src/test/resources/noclasspath/issue5208/p20/ClassT1.java @@ -0,0 +1,11 @@ +package p20; +public abstract class ClassT1 { + ClassT3 classT3; + + public ClassT1(){ + this.classT3 = new ClassT3(this); + } + + void fun2(ClassT3 classT3){ + } +} \ No newline at end of file diff --git a/src/test/resources/noclasspath/issue5208/p20/ClassT2.java b/src/test/resources/noclasspath/issue5208/p20/ClassT2.java new file mode 100644 index 00000000000..1d012664781 --- /dev/null +++ b/src/test/resources/noclasspath/issue5208/p20/ClassT2.java @@ -0,0 +1,10 @@ +package p20; +import p8.GlobalExecutor; + +public class ClassT2 extends ClassT1 { + public void fun(){ + GlobalExecutor.executeByCommon(() -> { + fun2(classT3); + }); + } +} \ No newline at end of file diff --git a/src/test/resources/noclasspath/issue5208/p20/ClassT3.java b/src/test/resources/noclasspath/issue5208/p20/ClassT3.java new file mode 100644 index 00000000000..893541a672f --- /dev/null +++ b/src/test/resources/noclasspath/issue5208/p20/ClassT3.java @@ -0,0 +1,9 @@ +package p20; + +public class ClassT3 { + final ClassT1 classT1; + + public ClassT3(ClassT1 classT1) { + this.classT1 = classT1; + } +} \ No newline at end of file diff --git a/src/test/resources/signature-polymorphic-methods/SignaturePolymorphicMethods.java b/src/test/resources/signature-polymorphic-methods/SignaturePolymorphicMethods.java new file mode 100644 index 00000000000..3186eb8fbbf --- /dev/null +++ b/src/test/resources/signature-polymorphic-methods/SignaturePolymorphicMethods.java @@ -0,0 +1,21 @@ +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + +public class SignaturePolymorphicMethods { + private static final MethodHandle STRING_IDENTITY = MethodHandles.identity(String.class); + private static final MethodHandle HELLO_WORLD = MethodHandles.constant(String.class, "Hello World"); + private static final MethodHandle NOP = MethodHandles.empty(MethodType.methodType(void.class, CharSequence.class, int.class)); + public String a() throws Throwable { + return (String) STRING_IDENTITY.invokeExact("Hello World"); + } + public String b() throws Throwable { + return (String) HELLO_WORLD.invokeExact(); + } + public Object c() throws Throwable { + return HELLO_WORLD.invoke(); + } + public void d() throws Throwable { + NOP.invokeExact((CharSequence) "Hello World", 123); + } +} diff --git a/src/test/resources/static-method-and-type/Main.java b/src/test/resources/static-method-and-type/Main.java new file mode 100644 index 00000000000..3e4aa5538f6 --- /dev/null +++ b/src/test/resources/static-method-and-type/Main.java @@ -0,0 +1,12 @@ +package static_method_and_type; + +import static static_method_and_type.imports_are_here.Bar.foo; + +public class Main { + public void fun() { + foo(); + } + + static class another_bar extends foo { } + +} diff --git a/src/test/resources/static-method-and-type/imports-are-here/Bar.java b/src/test/resources/static-method-and-type/imports-are-here/Bar.java new file mode 100644 index 00000000000..7550917f122 --- /dev/null +++ b/src/test/resources/static-method-and-type/imports-are-here/Bar.java @@ -0,0 +1,6 @@ +package static_method_and_type.imports_are_here; + +public class Bar { + public static void foo() {} + public static class foo {} +}

+ * This class also contains the attributes of the tag and the body as its first element. The body can be parsed using + * the {@link spoon.javadoc.api.parsing.SnippetFileParser}. + */ +public class JavadocSnippetTag extends JavadocInlineTag { + + private final Map attributes; + + /** + * Creates a new snippet inline tag with the given body and attributes. + * + * @param body the body of the snippet + * @param attributes the attributes of the snippet + */ + public JavadocSnippetTag(JavadocText body, Map attributes) { + super(List.of(body), StandardJavadocTagType.SNIPPET); + + this.attributes = attributes; + } + + /** + * @return the snippet attributes + */ + public Map getAttributes() { + return Collections.unmodifiableMap(attributes); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + JavadocSnippetTag that = (JavadocSnippetTag) o; + return Objects.equals(attributes, that.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), attributes); + } + + @Override + public T accept(JavadocVisitor visitor) { + return visitor.visitSnippet(this); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/BlockTagParser.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/BlockTagParser.java new file mode 100644 index 00000000000..71d15c296ac --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/BlockTagParser.java @@ -0,0 +1,177 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.parsing; + +import java.util.ArrayList; +import java.util.List; +import spoon.javadoc.api.JavadocTagType; +import spoon.javadoc.api.StandardJavadocTagType; +import spoon.javadoc.api.elements.JavadocBlockTag; +import spoon.javadoc.api.elements.JavadocElement; +import spoon.javadoc.api.elements.JavadocInlineTag; +import spoon.javadoc.api.elements.JavadocReference; +import spoon.javadoc.api.elements.JavadocText; +import spoon.reflect.declaration.CtElement; + +/** + * A parser for javadoc block tags. + */ +class BlockTagParser { + + private final CtElement documentedElement; + private final LinkResolver linkResolver; + + /** + * Creates a new parser with a given element as context and a given link resolver. + * + * @param documentedElement the element the comment belongs to. Used for relative link lookups + * @param linkResolver the link resolver for {@code @link} and {@code @see} tags + */ + BlockTagParser(CtElement documentedElement, LinkResolver linkResolver) { + this.documentedElement = documentedElement; + this.linkResolver = linkResolver; + } + + /** + * Parses a blocktag found in the passed reader. Assumes the complete reader contains a single tag. + * + * @param reader the reader to read from + * @param type the type of the block tag + * @return the created block or inline tag + */ + public JavadocElement parse(StringReader reader, JavadocTagType type) { + if (!(type instanceof StandardJavadocTagType)) { + return new JavadocBlockTag(parseRestFromScratch(reader), type); + } + + return parseStandardTag(reader, (StandardJavadocTagType) type); + } + + private JavadocElement parseStandardTag(StringReader reader, StandardJavadocTagType type) { + // Skip preceding whitespace + reader.readWhile(Character::isWhitespace); + + switch (type) { + case AUTHOR: + case DEPRECATED: + case HIDDEN: + case RETURN: + case SERIAL_DATA: + case SINCE: + case SERIAL: + case VERSION: + return parseTagOneArgument(reader, type); + case THROWS: + case EXCEPTION: + return parseException(reader, type); + case PARAM: + case PROVIDES: + case USES: + return parseTagTwoArgument(reader, type); + case SEE: + return parseTagSee(reader); + case SERIAL_FIELD: + return parseTagSerialField(reader); + case INHERIT_DOC: + return new JavadocInlineTag(List.of(), StandardJavadocTagType.INHERIT_DOC); + default: + throw new AssertionError("Unreachable, was " + type); + } + } + + private JavadocBlockTag parseTagOneArgument(StringReader reader, StandardJavadocTagType type) { + return new JavadocBlockTag(parseRestFromScratch(reader), type); + } + + private JavadocBlockTag parseTagTwoArgument(StringReader reader, StandardJavadocTagType type) { + List elements = new ArrayList<>(); + + elements.add(new JavadocText(reader.readWhile(it -> !Character.isWhitespace(it)))); + + swallowOneChar(reader); + + if (reader.canRead()) { + elements.addAll(parseRestFromScratch(reader)); + } + + return new JavadocBlockTag(elements, type); + } + + private JavadocBlockTag parseException(StringReader reader, StandardJavadocTagType type) { + List elements = new ArrayList<>(); + + String referenceString = reader.readWhile(it -> !Character.isWhitespace(it)); + elements.add(linkResolver.resolve(referenceString) + .map(JavadocReference::new) + .orElse(new JavadocText(referenceString))); + + swallowOneChar(reader); + + if (reader.canRead()) { + elements.add(new JavadocText(reader.readRemaining())); + } + + return new JavadocBlockTag(elements, type); + } + + private JavadocBlockTag parseTagSee(StringReader reader) { + List elements = new ArrayList<>(); + + if (reader.matches("\"")) { + // as string + reader.read("\""); + elements.add(new JavadocText(reader.readWhile(it -> it != '"'))); + reader.read("\""); + } else if (reader.matches("<")) { + // html tag + elements.add(new JavadocText(reader.readRemaining())); + } else { + String reference = reader.readWhile(it -> !Character.isWhitespace(it)); + // read "@see #foo(int, char)" completely + if (reference.contains("(") && !reference.endsWith(")")) { + reference += reader.readWhile(it -> it != ')'); + reader.read(1); + } + elements.add( + linkResolver.resolve(reference) + .map(JavadocReference::new) + .orElse(new JavadocText(reference)) + ); + + // label + swallowOneChar(reader); + if (reader.canRead()) { + elements.add(new JavadocText(reader.readRemaining())); + } + } + + return new JavadocBlockTag(elements, StandardJavadocTagType.SEE); + } + + private static void swallowOneChar(StringReader reader) { + if (reader.canRead()) { + reader.read(1); + } + } + + private JavadocBlockTag parseTagSerialField(StringReader reader) { + List elements = new ArrayList<>(); + elements.add(new JavadocText(reader.readWhile(it -> !Character.isWhitespace(it)))); + swallowOneChar(reader); + elements.add(new JavadocText(reader.readWhile(it -> !Character.isWhitespace(it)))); + swallowOneChar(reader); + + elements.addAll(parseRestFromScratch(reader)); + + return new JavadocBlockTag(elements, StandardJavadocTagType.SERIAL_FIELD); + } + + private List parseRestFromScratch(StringReader reader) { + return new JavadocParser(reader, documentedElement).parse(); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/InheritanceResolver.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/InheritanceResolver.java new file mode 100644 index 00000000000..6d3e5e47db2 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/InheritanceResolver.java @@ -0,0 +1,385 @@ +package spoon.javadoc.api.parsing; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import spoon.javadoc.api.JavadocTagType; +import spoon.javadoc.api.StandardJavadocTagType; +import spoon.javadoc.api.elements.JavadocBlockTag; +import spoon.javadoc.api.elements.JavadocCommentView; +import spoon.javadoc.api.elements.JavadocElement; +import spoon.javadoc.api.elements.JavadocInlineTag; +import spoon.javadoc.api.elements.JavadocReference; +import spoon.javadoc.api.elements.JavadocText; +import spoon.javadoc.api.elements.JavadocVisitor; +import spoon.javadoc.api.elements.snippets.JavadocSnippetTag; +import spoon.reflect.declaration.CtElement; +import spoon.reflect.declaration.CtMethod; +import spoon.reflect.declaration.CtNamedElement; +import spoon.reflect.declaration.CtType; +import spoon.reflect.declaration.CtTypeInformation; +import spoon.reflect.declaration.CtTypedElement; +import spoon.reflect.reference.CtTypeReference; + +/** + * Javadoc specifies comment inheritance for methods. This class provides utilities to look up inherited elements. + */ +public class InheritanceResolver { + + /** + * Returns a list with all super methods in + * + * inheritance order + * + * @param startType the type to search upwards from + * @param target the target method + * @return a list with all super methods in inheritance order + */ + public List> findSuperMethodsInCommentInheritanceOrder(CtType startType, CtMethod target) { + List> methods = new ArrayList<>(); + + // Look in each directly implemented (or extended) interface in the order they appear following the word + // implements (or extends) in the type declaration. + // Use the first documentation comment found for this method. + List> superInterfaces = sortByPosition(startType.getSuperInterfaces()) + .stream() + .map(CtTypeReference::getTypeDeclaration) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + + for (CtType type : superInterfaces) { + CtMethod method = getMethod(type, target); + + if (method != null) { + methods.add(method); + } + } + + // If Step 1 failed to find a documentation comment, then recursively apply this entire algorithm to each + // directly implemented (or extended) interface in the same order they were examined in Step 1. + for (CtType type : superInterfaces) { + methods.addAll(findSuperMethodsInCommentInheritanceOrder(type, target)); + } + + if (!startType.isInterface() && !startType.getQualifiedName().equals(Object.class.getName())) { + // When Step 2 fails to find a documentation comment and this is a class other than the Object class, + // but not an interface: + + // If the superclass has a documentation comment for this method, then use it. + addSuperclassMethods(startType, target, methods); + } + + return methods; + } + + private void addSuperclassMethods(CtType startType, CtMethod target, List> methods) { + CtTypeReference superTypeRef = startType.getSuperclass(); + if (superTypeRef == null) { + return; + } + CtType superType = superTypeRef.getTypeDeclaration(); + if (superType == null) { + return; + } + + CtMethod method = getMethod(superType, target); + if (method != null) { + methods.add(method); + } + // If Step 3a failed to find a documentation comment, then recursively apply this entire algorithm + // to the superclass. + methods.addAll(findSuperMethodsInCommentInheritanceOrder(superType, target)); + } + + private static CtMethod getMethod(CtType type, CtMethod target) { + return type.getMethod( + target.getSimpleName(), + target.getParameters().stream().map(CtTypedElement::getType).toArray(CtTypeReference[]::new) + ); + } + + private List> sortByPosition(Collection> references) { + return references.stream() + .sorted(Comparator.comparing(CtElement::getPosition, (o1, o2) -> { + if (!o1.isValidPosition() && !o2.isValidPosition()) { + return 0; + } + if (!o1.isValidPosition()) { + return 1; + } + if (!o2.isValidPosition()) { + return -1; + } + return Integer.compare(o1.getSourceStart(), o2.getSourceStart()); + })) + .collect(Collectors.toList()); + } + + /** + * Completes the javadoc for a {@link CtElement} with inherited documentation. + * + * @param element the element to fetch inheritance information for + * @param view a view of the existing comments for the element + * @return the new and completed javadoc + */ + public List completeJavadocWithInheritedTags(CtElement element, JavadocCommentView view) { + if (!(element instanceof CtMethod)) { + return view.getElements(); + } + CtMethod method = (CtMethod) element; + Set paramsToFind = method.getParameters() + .stream() + .map(CtNamedElement::getSimpleName) + .collect(Collectors.toCollection(HashSet::new)); + view.getBlockTagArguments(StandardJavadocTagType.PARAM, JavadocText.class) + .forEach(it -> paramsToFind.remove(it.getText())); + + Set throwsToFind = method.getThrownTypes() + .stream() + .map(CtTypeInformation::getQualifiedName) + .collect(Collectors.toCollection(HashSet::new)); + view.getBlockTagArguments(StandardJavadocTagType.THROWS, JavadocText.class) + .forEach(it -> throwsToFind.remove(it.getText())); + view.getBlockTagArguments(StandardJavadocTagType.EXCEPTION, JavadocText.class) + .forEach(it -> throwsToFind.remove(it.getText())); + + boolean needsReturn = view.getBlockTag(StandardJavadocTagType.RETURN).isEmpty(); + boolean needsBody = view.getBody().isEmpty(); + + InheritedJavadoc inheritedJavadoc = lookupInheritedDocForMethod(method); + + List newElements = new ArrayList<>(); + if (needsBody) { + newElements.addAll(inheritedJavadoc.getBody()); + } + paramsToFind.stream() + .map(it -> inheritedJavadoc.getParams().get(it)) + .filter(Objects::nonNull) + .forEach(newElements::add); + throwsToFind.stream() + .map(it -> inheritedJavadoc.getThrowsClauses().get(it)) + .filter(Objects::nonNull) + .forEach(newElements::add); + if (needsReturn && inheritedJavadoc.getReturnTag() != null) { + newElements.add(inheritedJavadoc.getReturnTag()); + } + + List finalElements = new ArrayList<>(view.getElements()); + finalElements.addAll(newElements); + + JavadocReplaceInheritDocVisitor visitor = new JavadocReplaceInheritDocVisitor(inheritedJavadoc); + return finalElements.stream() + .flatMap(it -> it.accept(visitor).stream()) + .collect(Collectors.toList()); + } + + public static InheritedJavadoc lookupInheritedDocForMethod(CtMethod method) { + List> targets = new InheritanceResolver() + .findSuperMethodsInCommentInheritanceOrder(method.getDeclaringType(), method); + + List body = new ArrayList<>(); + JavadocInheritanceCollectionVisitor visitor = new JavadocInheritanceCollectionVisitor(method); + + for (CtMethod target : targets) { + if (visitor.isFinished() && !body.isEmpty()) { + break; + } + JavadocCommentView view = new JavadocCommentView(JavadocParser.forElement(target)); + if (body.isEmpty() && !view.getBody().isEmpty()) { + body.addAll(view.getBody()); + } + + for (JavadocElement element : view.getElements()) { + element.accept(visitor); + } + } + + return new InheritedJavadoc( + body, + visitor.returnTag, + visitor.params, + visitor.throwsClauses + ); + } + + private static class InheritedJavadoc { + + private final List body; + private final JavadocBlockTag returnTag; + private final Map params; + private final Map throwsClauses; + + public InheritedJavadoc( + List body, + JavadocBlockTag returnTag, + Map params, + Map throwsClauses + ) { + this.body = body; + this.returnTag = returnTag; + this.params = params; + this.throwsClauses = throwsClauses; + } + + public JavadocBlockTag getReturnTag() { + return returnTag; + } + + public List getBody() { + return Collections.unmodifiableList(body); + } + + public Map getParams() { + return Collections.unmodifiableMap(params); + } + + public Map getThrowsClauses() { + return Collections.unmodifiableMap(throwsClauses); + } + } + + private static class JavadocInheritanceCollectionVisitor implements JavadocVisitor { + + private final Set missingParameters; + private final Set missingThrowsClauses; + private final Map params; + private final Map throwsClauses; + private JavadocBlockTag returnTag; + + public JavadocInheritanceCollectionVisitor(CtMethod method) { + this.missingParameters = method.getParameters().stream() + .map(CtNamedElement::getSimpleName) + .collect(Collectors.toCollection(HashSet::new)); + this.missingThrowsClauses = method.getThrownTypes().stream() + .map(CtTypeInformation::getQualifiedName) + .collect(Collectors.toCollection(HashSet::new)); + + this.returnTag = null; + this.params = new HashMap<>(); + this.throwsClauses = new HashMap<>(); + } + + public boolean isFinished() { + return missingParameters.isEmpty() && missingThrowsClauses.isEmpty() && returnTag != null; + } + + @Override + public Void defaultValue() { + return null; + } + + @Override + public Void visitInlineTag(JavadocInlineTag tag) { + if (returnTag == null && tag.getTagType() == StandardJavadocTagType.RETURN) { + returnTag = new JavadocBlockTag(tag.getElements(), StandardJavadocTagType.RETURN); + } + return JavadocVisitor.super.visitInlineTag(tag); + } + + @Override + public Void visitBlockTag(JavadocBlockTag tag) { + if (tag.getTagType() == StandardJavadocTagType.PARAM) { + tag.getArgument(JavadocText.class) + .map(JavadocText::getText) + .filter(missingParameters::contains) + .ifPresent(arg -> { + missingParameters.remove(arg); + params.put(arg, tag); + }); + } + if (tag.getTagType() == StandardJavadocTagType.THROWS) { + tag.getArgument(JavadocText.class) + .map(JavadocText::getText) + .filter(missingThrowsClauses::contains) + .ifPresent(arg -> { + missingThrowsClauses.remove(arg); + throwsClauses.put(arg, tag); + }); + } + if (returnTag == null && tag.getTagType() == StandardJavadocTagType.RETURN) { + returnTag = tag; + } + return JavadocVisitor.super.visitBlockTag(tag); + } + } + + private static class JavadocReplaceInheritDocVisitor implements JavadocVisitor> { + + private final InheritedJavadoc inheritedJavadoc; + private JavadocTagType currentType; + + private JavadocReplaceInheritDocVisitor(InheritedJavadoc inheritedJavadoc) { + this.inheritedJavadoc = inheritedJavadoc; + } + + @Override + public List defaultValue() { + throw new IllegalStateException("Default value called, a case was probably missed?"); + } + + @Override + public List visitInlineTag(JavadocInlineTag tag) { + if (tag.getTagType() == StandardJavadocTagType.INHERIT_DOC) { + if (currentType == null) { + return inheritedJavadoc.getBody(); + } + Optional argument = tag.getArgument(JavadocText.class); + if (argument.isEmpty()) { + return List.of(tag); + } + if (currentType == StandardJavadocTagType.PARAM) { + JavadocBlockTag blockTag = inheritedJavadoc.getParams().get(argument.get().getText()); + if (blockTag != null) { + return blockTag.getElements(); + } + } + if (currentType == StandardJavadocTagType.THROWS || currentType == StandardJavadocTagType.EXCEPTION) { + JavadocBlockTag blockTag = inheritedJavadoc.getThrowsClauses().get(argument.get().getText()); + if (blockTag != null) { + return blockTag.getElements(); + } + } + } + return List.of(tag); + } + + @Override + public List visitBlockTag(JavadocBlockTag tag) { + currentType = tag.getTagType(); + List newElements = new ArrayList<>(); + + for (JavadocElement element : tag.getElements()) { + newElements.addAll(element.accept(this)); + } + + return List.of(new JavadocBlockTag(newElements, tag.getTagType())); + } + + @Override + public List visitSnippet(JavadocSnippetTag snippet) { + return List.of(snippet); + } + + @Override + public List visitText(JavadocText text) { + return List.of(text); + } + + @Override + public List visitReference(JavadocReference reference) { + return List.of(reference); + } + + } + +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/InlineTagParser.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/InlineTagParser.java new file mode 100644 index 00000000000..d4708e9ca07 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/InlineTagParser.java @@ -0,0 +1,193 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.parsing; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import spoon.javadoc.api.JavadocTagType; +import spoon.javadoc.api.StandardJavadocTagType; +import spoon.javadoc.api.elements.JavadocElement; +import spoon.javadoc.api.elements.JavadocInlineTag; +import spoon.javadoc.api.elements.JavadocReference; +import spoon.javadoc.api.elements.JavadocText; +import spoon.javadoc.api.elements.snippets.JavadocSnippetTag; + +/** + * A parser for inline tags + */ +class InlineTagParser { + + private final LinkResolver linkResolver; + + /** + * @param linkResolver the link resolver to use + */ + InlineTagParser(LinkResolver linkResolver) { + this.linkResolver = linkResolver; + } + + /** + * Parses a given reader as a single inline tag of the given type. + * + * @param reader the reader to parse + * @param type the type of the tag + * @return the created inline tag + */ + public JavadocInlineTag parse(StringReader reader, JavadocTagType type) { + if (!(type instanceof StandardJavadocTagType)) { + String content = reader.readRemaining(); + return new JavadocInlineTag(makeTextIfNotEmpty(content), type); + } + + return parseStandardTag(reader, (StandardJavadocTagType) type); + } + + private JavadocInlineTag parseStandardTag(StringReader reader, StandardJavadocTagType type) { + reader.readWhile(Character::isWhitespace); + switch (type) { + case CODE: + case DOC_ROOT: + case INHERIT_DOC: + case LITERAL: + case RETURN: + case SUMMARY: + return parseStandardTagNoArgument(reader, type); + + case INDEX: + return parseIndexTag(reader); + + case LINK: + case LINKPLAIN: + case VALUE: + return parseLinkTag(reader, type); + case SEE: + return parseLinkTag(reader, StandardJavadocTagType.LINK); + case SYSTEM_PROPERTY: + return parseStandardTagWithArgument(reader, type); + + case SNIPPET: + return parseSnippetTag(reader); + default: + throw new AssertionError("Unreachable"); + } + } + + private JavadocInlineTag parseLinkTag(StringReader reader, StandardJavadocTagType type) { + String referenceText = reader.readWhile(it -> !Character.isWhitespace(it)); + if (referenceText.contains("(") && !referenceText.contains(")")) { + referenceText += reader.readWhile(it -> it != ')'); + referenceText += reader.read(1); + + // Skip whitespace between reference and label + if (reader.canRead() && Character.isWhitespace(reader.peek())) { + reader.read(1); + } + } + List elements = new ArrayList<>(); + + elements.add( + linkResolver.resolve(referenceText) + .map(JavadocReference::new) + .orElse(new JavadocText(referenceText)) + ); + + String label = reader.readRemaining().strip(); + elements.addAll(makeTextIfNotEmpty(label)); + + return new JavadocInlineTag(elements, type); + } + + private JavadocInlineTag parseIndexTag(StringReader reader) { + if (!reader.matches("\"")) { + return parseStandardTagWithArgument(reader, StandardJavadocTagType.INDEX); + } + + List elements = new ArrayList<>(); + + // @index "phrase" description + reader.read("\""); + elements.add(new JavadocText(reader.readWhile(it -> it != '"'))); + + // Closing paren, I guess that might be missing... + reader.read("\""); + if (reader.canRead() && Character.isWhitespace(reader.peek())) { + reader.read(1); + } + + // And our description + if (reader.canRead()) { + elements.add(new JavadocText(reader.readRemaining())); + } + + return new JavadocInlineTag(elements, StandardJavadocTagType.INDEX); + } + + private JavadocInlineTag parseStandardTagNoArgument(StringReader reader, StandardJavadocTagType type) { + String content = reader.readRemaining(); + + return new JavadocInlineTag(makeTextIfNotEmpty(content), type); + } + + private JavadocInlineTag parseStandardTagWithArgument(StringReader reader, StandardJavadocTagType type) { + String firstArgument = reader.readWhile(it -> !Character.isWhitespace(it)); + + // Swallow one space after it + if (reader.canRead()) { + reader.read(1); + } + + List elements = new ArrayList<>(makeTextIfNotEmpty(firstArgument)); + + // Read the rest if there is any + if (reader.canRead()) { + elements.add(new JavadocText(reader.readRemaining())); + } + + return new JavadocInlineTag(elements, type); + } + + private JavadocInlineTag parseSnippetTag(StringReader reader) { + Map attributes = parseSnippetAttributes(new StringReader(reader.readWhile(it -> it != ':'))); + + reader.readWhile(Character::isWhitespace); + if (reader.canRead() && reader.peek() == ':') { + reader.read(":"); + } + + JavadocText content = new JavadocText(reader.readRemaining()); + + return new JavadocSnippetTag(content, attributes); + } + + static Map parseSnippetAttributes(StringReader reader) { + Map attributes = new HashMap<>(); + reader.readWhile(Character::isWhitespace); + + while (reader.canRead()) { + String name = reader.readWhile(it -> it != '=').strip(); + if (!reader.canRead() || reader.peek() != '=') { + break; + } + reader.read("="); + reader.readWhile(Character::isWhitespace); + + String value = reader.readPotentiallyQuoted(); + attributes.put(name, value); + + reader.readWhile(Character::isWhitespace); + } + + return attributes; + } + + private static List makeTextIfNotEmpty(String text) { + return text.isEmpty() ? List.of() : List.of(new JavadocText(text)); + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/JavadocParser.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/JavadocParser.java new file mode 100644 index 00000000000..4b2b4c75328 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/JavadocParser.java @@ -0,0 +1,188 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.parsing; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import spoon.javadoc.api.JavadocTagCategory; +import spoon.javadoc.api.JavadocTagType; +import spoon.javadoc.api.StandardJavadocTagType; +import spoon.javadoc.api.elements.JavadocElement; +import spoon.javadoc.api.elements.JavadocText; +import spoon.reflect.code.CtComment; +import spoon.reflect.code.CtJavaDoc; +import spoon.reflect.declaration.CtElement; +import spoon.reflect.declaration.CtType; + +/** + * A javadoc parser. + */ +public class JavadocParser { + + private final StringReader underlying; + private final CtElement documentedElement; + + JavadocParser(StringReader underlying, CtElement documentedElement) { + this.underlying = underlying; + if (documentedElement instanceof CtType) { + this.documentedElement = documentedElement; + } else { + // Try to generify to the enclosing type + CtType typeParent = documentedElement.getParent(CtType.class); + this.documentedElement = typeParent != null ? typeParent : documentedElement; + } + } + + /** + * Creates a new javadoc parser from a raw javadoc comment ({@link CtComment#getRawContent()}). + * + * @param underlying the underlying raw comment + * @param documentedElement the element the comment belongs to + */ + public JavadocParser(String underlying, CtElement documentedElement) { + this( + new StringReader( + stripStars(underlying.replaceFirst("/\\*\\*", "").replace("*/", "")).strip() + ), + documentedElement + ); + } + + /** + * @return the parsed representation of the supplied javadoc + */ + public List parse() { + if (!underlying.canRead()) { + return Collections.emptyList(); + } + List elements = new ArrayList<>(); + while (underlying.canRead()) { + if (inlineTagStarts()) { + elements.add(readInlineTag()); + } else if (blockTagStarts()) { + elements.add(readBlockTag()); + } else { + elements.add(readText()); + } + } + + return elements; + } + + private JavadocElement readText() { + StringBuilder read = new StringBuilder(); + while (underlying.canRead()) { + read.append(underlying.readWhile(it -> it != '{' && it != '@')); + if (inlineTagStarts()) { + break; + } + if (blockTagStarts() && endsWithNewline(read.toString())) { + break; + } + read.append(underlying.read(1)); + } + return new JavadocText(read.toString()); + } + + private boolean endsWithNewline(String input) { + for (int index = input.length() - 1; index >= 0; index--) { + if (!Character.isWhitespace(input.charAt(index))) { + return false; + } + if (input.charAt(index) == '\n') { + return true; + } + } + return false; + } + + private JavadocElement readInlineTag() { + StringReader inner = new StringReader(underlying.readBalancedBraced()); + inner.read("@"); + String tagName = inner.readWhile(it -> it != '}' && !Character.isWhitespace(it)); + inner.read(1); // eat some whitespace + + JavadocTagType tagType = StandardJavadocTagType.fromString(tagName) + .orElse(JavadocTagType.unknown(tagName, JavadocTagCategory.INLINE)); + + return new InlineTagParser( + new LinkResolver(documentedElement, documentedElement.getFactory()) + ) + .parse(inner, tagType); + } + + private JavadocElement readBlockTag() { + underlying.readWhile(Character::isWhitespace); + underlying.read("@"); + + StringBuilder text = new StringBuilder(); + while (underlying.canRead()) { + String read = underlying.read(1); + if (read.equals("\n") && blockTagStarts()) { + break; + } + text.append(read); + } + StringReader inner = new StringReader(text.toString()); + + String name = inner.readWhile(it -> !Character.isWhitespace(it)); + inner.read(1); // eat some whitespace + + JavadocTagType tagType = StandardJavadocTagType.fromString(name) + .orElse(JavadocTagType.unknown(name, JavadocTagCategory.BLOCK)); + + return new BlockTagParser( + documentedElement, + new LinkResolver(documentedElement, documentedElement.getFactory()) + ) + .parse(inner, tagType); + } + + private boolean blockTagStarts() { + StringReader fork = underlying.fork(); + fork.readWhile(Character::isWhitespace); + return fork.canRead() && fork.peek() == '@'; + } + + private boolean inlineTagStarts() { + return underlying.matches("{@"); + } + + private static String stripStars(String input) { + return input.lines() + .map(JavadocParser::stripStar) + .collect(Collectors.joining("\n")); + } + + private static String stripStar(String line) { + int starIndex = line.indexOf('*'); + if (starIndex < 0 || !line.substring(0, starIndex).isBlank()) { + return line; + } + + // Also swallow a single whitespace after the star + if (starIndex + 1 < line.length() && Character.isWhitespace(line.charAt(starIndex + 1))) { + return line.substring(starIndex + 2); + } + return line.substring(starIndex + 1); + } + + public static List forElement(CtElement element) { + return element.getComments() + .stream() + .filter(comment -> comment instanceof CtJavaDoc) + .map(comment -> new JavadocParser(comment.getRawContent(), element)) + .map(JavadocParser::parse) + .flatMap(Collection::stream) + .collect(Collectors.toCollection(ArrayList::new)); + } + +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/LinkResolver.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/LinkResolver.java new file mode 100644 index 00000000000..c7a4dc3795a --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/LinkResolver.java @@ -0,0 +1,395 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.parsing; + +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.Optional; +import java.util.stream.Collectors; +import spoon.JLSViolation; +import spoon.experimental.CtUnresolvedImport; +import spoon.reflect.declaration.CtCompilationUnit; +import spoon.reflect.declaration.CtElement; +import spoon.reflect.declaration.CtEnum; +import spoon.reflect.declaration.CtField; +import spoon.reflect.declaration.CtImportKind; +import spoon.reflect.declaration.CtModule; +import spoon.reflect.declaration.CtPackage; +import spoon.reflect.declaration.CtType; +import spoon.reflect.factory.Factory; +import spoon.reflect.reference.CtExecutableReference; +import spoon.reflect.reference.CtReference; +import spoon.reflect.reference.CtTypeReference; + +/** + * Resolves a string to a {@link CtReference}. + */ +class LinkResolver { + + private final CtElement context; + private final Factory factory; + + /** + * @param context the annotated type + * @param factory the factory to use + */ + LinkResolver(CtElement context, Factory factory) { + this.context = context; + this.factory = factory; + } + + /** + * Tries to resolve a string to a {@link CtReference}. + * + * @param string the content of a {@code @see} or {@code @link} tag + * @return the referenced element, if any + */ + public Optional resolve(String string) { + // Format: + // + // + // # + // # + // # + // #() + // #([,]) + // #( [^,]*) + // module/package.class#member label + + if (!string.contains("#")) { + return resolveModulePackageOrClassRef(string); + } + int fragmentIndex = string.indexOf('#'); + String modulePackage = string.substring(0, fragmentIndex); + Optional contextRef = resolveModulePackageOrClassRef(modulePackage); + + // Fragment qualifier only works on types (Foo#bar) + if (contextRef.isEmpty() || !(contextRef.get() instanceof CtTypeReference)) { + return contextRef; + } + + CtType outerType = ((CtTypeReference) contextRef.get()).getTypeDeclaration(); + String fragment = string.substring(fragmentIndex + 1); + + return qualifyName(outerType, extractMemberName(fragment), extractParameters(fragment)); + } + + private String extractMemberName(String fragment) { + if (fragment.contains("(")) { + return fragment.substring(0, fragment.indexOf('(')); + } + return fragment; + } + + private List>> extractParameters(String fragment) { + int startIndex = fragment.indexOf('(') + 1; + if (startIndex <= 0) { + return List.of(); + } + int endIndex = fragment.indexOf(')'); + if (endIndex < 0) { + endIndex = fragment.length(); + } + String raw = fragment.substring(startIndex, endIndex).replace(")", "").strip(); + + if (raw.isEmpty()) { + return List.of(); + } + + return Arrays.stream(raw.split(",")) + .map(it -> it.strip().split(" ")[0]) + .map(this::qualifyTypeName) + .collect(Collectors.toList()); + } + + private Optional resolveModulePackageOrClassRef(String name) { + if (name.contains("/") && !name.endsWith("/")) { + // java.base/java.lang.String + int moduleEndIndex = name.indexOf('/'); + String rest = name.substring(moduleEndIndex + 1); + + // TODO: This currently throws away module information when resolving the rest. This is likely + // fine for now, but not correct. + return resolveTypePackageModuleAsIs(rest); + } + if (name.endsWith("/")) { + // Format: "module/" + CtModule module = factory.Module().getModule(name.replace("/", "")); + if (module != null) { + return Optional.of(module.getReference()); + } + } + + return resolveTypePackageModuleAsIs(name); + } + + private Optional resolveTypePackageModuleAsIs(String name) { + return qualifyTypeName(name).map(it -> (CtReference) it) + .or(() -> Optional.ofNullable(factory.Package().get(name)).map(CtPackage::getReference)) + .or(() -> Optional.ofNullable(factory.Module().getModule(name)).map(CtModule::getReference)) + .or(() -> guessPackageOrModuleReferenceFromName(name)); + } + + private Optional guessPackageOrModuleReferenceFromName(String name) { + // Upper case letters indicate this is no package or module and we just don't understand it + if (!name.toLowerCase(Locale.ROOT).equals(name)) { + return Optional.empty(); + } + + try { + if (name.contains("/")) { + return Optional.of( + factory.Core().createModuleReference().setSimpleName(name.replace("/", "")) + ); + } + return Optional.of(factory.Package().createReference(name)); + } catch (JLSViolation ignored) { + // Looks like that name wasn't quite valid... + return Optional.empty(); + } + } + + private Optional qualifyName( + CtType enclosingType, + String memberName, + List>> parameters + ) { + if (parameters.isEmpty()) { + CtType next = enclosingType; + while (next != null) { + Optional field = qualifyTypeNameForField(enclosingType, memberName); + if (field.isPresent()) { + return field; + } + next = next.getParent(CtType.class); + } + + // Try again as an executable + return qualifyTypeNameForExecutable(memberName, List.of(), enclosingType); + } + + return qualifyTypeNameForExecutable(memberName, parameters, enclosingType); + } + + private Optional qualifyTypeNameForField(CtType enclosingType, String memberName) { + if (enclosingType instanceof CtEnum) { + Optional enumRef = ((CtEnum) enclosingType).getEnumValues() + .stream() + .filter(it -> it.getSimpleName().equals(memberName)) + .map(CtField::getReference) + .findFirst(); + + if (enumRef.isPresent()) { + return enumRef; + } + } + return enclosingType.getAllFields() + .stream() + .filter(it -> it.getSimpleName().equals(memberName)) + .map(it -> (CtReference) it) + .findFirst(); + } + + private Optional qualifyTypeNameForExecutable( + String elementName, + List>> parameters, + CtType type + ) { + // References in Javadoc for inner classes can just "#name" reference elements of the enclosing class + CtType next = type; + while (next != null) { + Optional ref = qualifyTypeNameForExecutableForExactType(elementName, parameters, next); + if (ref.isPresent()) { + return ref; + } + next = next.getParent(CtType.class); + } + + return Optional.empty(); + } + + private Optional qualifyTypeNameForExecutableForExactType( + String elementName, + List>> parameters, + CtType type + ) { + List> possibleMethods = type.getAllExecutables() + .stream() + .filter(it -> executableNameMatches(elementName, it)) + .collect(Collectors.toList()); + + Optional relevantMethod; + if (possibleMethods.size() == 1) { + relevantMethod = Optional.of(possibleMethods.get(0)); + } else { + relevantMethod = possibleMethods + .stream() + .filter(it -> it.getParameters().size() == parameters.size()) + .filter(it -> parameterTypesMatch(it.getParameters(), parameters)) + .map(it -> (CtReference) it) + .findFirst(); + } + + return relevantMethod; + } + + private static boolean executableNameMatches(String elementName, CtExecutableReference it) { + if (it.getSimpleName().equals(elementName)) { + return true; + } + return it.isConstructor() && it.getDeclaringType().getSimpleName().equals(elementName); + } + + private boolean parameterTypesMatch( + List> actualParams, + List>> expectedParameters + ) { + for (int i = 0; i < expectedParameters.size(); i++) { + // We don't know all parameters (incomplete classpath?) so just assume they'd match + if (expectedParameters.get(i).isEmpty()) { + continue; + } + + String actualName = actualParams.get(i).getQualifiedName(); + if (!actualName.equals(expectedParameters.get(i).get().getQualifiedName())) { + return false; + } + } + return true; + } + + private Optional> qualifyTypeName(String name) { + Optional> qualifiedNameOpt = qualifyTypeNameNoArray( + name.replace("[]", "").replace("...", "") + ); + + if (qualifiedNameOpt.isEmpty()) { + return Optional.empty(); + } + CtTypeReference qualifiedName = qualifiedNameOpt.get(); + + if (!name.contains("[]") && !name.endsWith("...")) { + return Optional.of(qualifiedName); + } + + int arrayDepth = 0; + for (int i = 0; i < name.length(); i++) { + if (name.charAt(i) == '[') { + arrayDepth++; + } + } + if (name.endsWith("...")) { + arrayDepth++; + } + + for (int i = 0; i < arrayDepth; i++) { + qualifiedName = factory.createArrayReference(qualifiedName); + } + + return Optional.of(qualifiedName); + } + + private Optional> qualifyTypeNameNoArray(String name) { + return qualifyType(name).map(CtType::getReference); + } + + private Optional> qualifyType(String name) { + CtType contextType = context instanceof CtType ? (CtType) context : context.getParent(CtType.class); + + if (contextType != null && !name.isBlank()) { + Optional> type = contextType.getReferencedTypes() + .stream() + .filter(it -> it.getSimpleName().equals(name) || it.getQualifiedName().equals(name)) + .findAny(); + if (type.isPresent()) { + return Optional.ofNullable(type.get().getTypeDeclaration()); + } + + CtPackage contextPackage = contextType.getPackage(); + if (contextPackage == null && contextType.getDeclaringType() != null) { + contextPackage = contextType.getDeclaringType().getPackage(); + } + if (contextPackage != null) { + CtType siblingType = contextPackage.getType(name); + if (siblingType != null) { + return Optional.of(siblingType); + } + } + } + if (contextType != null && name.isBlank()) { + return Optional.of(contextType); + } + + CtCompilationUnit parentUnit = context.getPosition().getCompilationUnit(); + Optional> importedType = getImportedType(name, parentUnit); + if (importedType.isPresent()) { + return importedType; + } + + // The classes are not imported and not referenced if they are only used in javadoc... + if (name.startsWith("java.lang")) { + return tryLoadModelOrReflection(name); + } + + CtType directLookupType = factory.Type().get(name); + if (directLookupType != null) { + return Optional.of(directLookupType); + } + + return tryLoadModelOrReflection(name) + .or(() -> tryLoadModelOrReflection("java.lang." + name)); + } + + private Optional> getImportedType(String name, CtCompilationUnit parentUnit) { + Optional> referencedImportedType = parentUnit.getImports() + .stream() + .filter(it -> it.getImportKind() != CtImportKind.UNRESOLVED) + .filter(it -> it.getReference().getSimpleName().equals(name)) + .findAny() + .flatMap(ctImport -> + ctImport.getReferencedTypes() + .stream() + .filter(it -> it.getSimpleName().equals(name)) + .findFirst() + .map(CtTypeReference::getTypeDeclaration) + ); + + if (referencedImportedType.isPresent()) { + return referencedImportedType; + } + + return parentUnit.getImports() + .stream() + .filter(it -> it.getImportKind() == CtImportKind.UNRESOLVED) + .filter(it -> ((CtUnresolvedImport) it).getUnresolvedReference().endsWith("*")) + .flatMap(it -> { + String reference = ((CtUnresolvedImport) it).getUnresolvedReference(); + reference = reference.substring(0, reference.length() - 1); + + return tryLoadModelOrReflection(reference + name).stream(); + }) + .findFirst(); + } + + private Optional> tryLoadModelOrReflection(String name) { + CtType inModel = factory.Type().get(name); + if (inModel != null) { + return Optional.of(inModel); + } + return tryLoadClass(name).map(factory.Type()::get); + } + + private Optional> tryLoadClass(String name) { + try { + return Optional.of(Class.forName(name)); + } catch (ClassNotFoundException e) { + return Optional.empty(); + } + } +} diff --git a/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/SnippetFileParser.java b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/SnippetFileParser.java new file mode 100644 index 00000000000..d750e61a0f4 --- /dev/null +++ b/spoon-javadoc/src/main/java/spoon/javadoc/api/parsing/SnippetFileParser.java @@ -0,0 +1,152 @@ +/* + * SPDX-License-Identifier: (MIT OR CECILL-C) + * + * Copyright (C) 2006-2019 INRIA and contributors + * + * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. + */ +package spoon.javadoc.api.parsing; + +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import spoon.javadoc.api.elements.snippets.JavadocSnippetMarkupRegion; +import spoon.javadoc.api.elements.snippets.JavadocSnippetRegionType; +import spoon.support.Internal; + +/** + * A parser for snippet files and bodies. + *