diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 745a00bf72..279cc4639f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -7,6 +7,9 @@ on: branches: - master # Check branch after merge +env: + DEFAULT_JAVA_VERSION: '21' + concurrency: # Only run once for latest commit per ref and cancel other (previous) runs. group: ci-${{ github.ref }} @@ -20,17 +23,27 @@ jobs: matrix: jdk: [ 17, 21 ] os: [ubuntu-latest, windows-latest] + include: + - target: 17 + jdk: 17 + - target: 21 + jdk: 21 + exclude: # only build specific os on java 17 + - os: windows-latest + jdk: 17 + - os: windows-latest + jdk: 24 - name: Check / Tests -> JDK-${{ matrix.jdk }}/${{ matrix.os }} + name: Build / Tests -> JDK-${{ matrix.jdk }}/ Target java-${{ matrix.target }} / ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 - name: Set up python 3 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.x' architecture: 'x64' @@ -39,14 +52,14 @@ jobs: - run: pip install -r python/requirements.txt - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: ${{ matrix.jdk }} distribution: 'adopt' - name: Build with Ant working-directory: ./framework - run: ant test + run: ant test -Dbuild-release=${{ matrix.target }} build: needs: @@ -55,31 +68,69 @@ jobs: name: BUILD ${{ github.sha }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 - name: Set up python 3 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.x' architecture: 'x64' - - name: Set up JDK 21 - uses: actions/setup-java@v4 + - name: Set up JDK ${{ env.DEFAULT_JAVA_VERSION }} + uses: actions/setup-java@v5 with: - java-version: 21 + java-version: ${{ env.DEFAULT_JAVA_VERSION }} distribution: 'adopt' - name: Build with Ant working-directory: ./framework - run: ant artifact + run: ant artifact -Dbuild-release=${{ env.DEFAULT_JAVA_VERSION }} - - name: ziping artifact - uses: actions/upload-artifact@v4 + - name: Zipping artifact + uses: actions/upload-artifact@v5 with: name: play-${{ github.sha }} if-no-files-found: error path: | ./framework/dist/* + + # Specific build on mac because of issue with firephoque browser (FIXME) + build-on-mac: + runs-on: ${{ matrix.os }} + name: Build -> JDK-${{ matrix.jdk }}/ Target java-${{ matrix.target }} / ${{ matrix.os }} + strategy: + matrix: + jdk: [ 21 ] + os: [ macos-latest ] + include: + - target: 21 + jdk: 21 + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves + fetch-depth: 0 + + - name: Set up python 3 + uses: actions/setup-python@v6 + with: + python-version: '3.x' + architecture: 'x64' + cache: 'pip' + cache-dependency-path: '**/requirements.txt' + - run: pip install -r python/requirements.txt + + - name: Set up JDK ${{ matrix.jdk }} + uses: actions/setup-java@v5 + with: + java-version: ${{ matrix.jdk }} + distribution: 'adopt' + + - name: Build with Ant + working-directory: ./framework + run: ant build -Dbuild-release=${{ matrix.target }} \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 04f7db0d86..7ef3b9d7c8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -8,6 +8,9 @@ on: schedule: - cron: '15 1 * * 6' +env: + DEFAULT_JAVA_VERSION: '21' + jobs: analyze: name: Analyze @@ -39,11 +42,17 @@ jobs: distribution: 'adopt' - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 + + - name: Set up JDK ${{ env.DEFAULT_JAVA_VERSION }} + uses: actions/setup-java@v5 + with: + java-version: ${{ env.DEFAULT_JAVA_VERSION }} + distribution: 'adopt' # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -59,6 +68,6 @@ jobs: run: ant jar - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/delete-caches.yml b/.github/workflows/delete-caches.yml index 3c6e1a09de..851e79b35a 100644 --- a/.github/workflows/delete-caches.yml +++ b/.github/workflows/delete-caches.yml @@ -16,7 +16,7 @@ jobs: name: Delete unneeded caches runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: | gh cache list --limit 500 --order asc --sort last_accessed_at | grep 'play-published-local' > caches.txt || true echo "Found $(wc -l < caches.txt | xargs) published local cache entries" diff --git a/.gitignore b/.gitignore index 0ded2a2277..7c65ea98de 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,7 @@ samples-and-tests/test-scala/tmp samples-and-tests/test-scala/logs samples-and-tests/i-am-a-developer/i-am-working-here samples-and-tests/i-am-a-developer/i-am-creating-jobs-here +samples-and-tests/i-am-a-developer/i-am-testing-auto-test-here samples-and-tests/i-am-a-developer/i-am-testing-log-levels-here samples-and-tests/i-am-a-developer/i-am-testing-ssl-config-here samples-and-tests/just-test-cases/attachments diff --git a/README.md b/README.md index c7bfedf8a6..3be9354eae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Welcome to Play framework [![GitHub Discussions](https://img.shields.io/github/discussions/playframework/play1?&logo=github&color=brightgreen)](https://github.com/playframework/play1/discussions) -[![Gitter](https://img.shields.io/gitter/room/playframework/play1)](https://gitter.im/playframework/play1) +[![Discord](https://img.shields.io/discord/931647755942776882?logo=discord&logoColor=white)](https://discord.gg/YVRgAp2Zj4) [![Contributors](https://img.shields.io/github/contributors/playframework/play1)](https://github.com/playframework/play1/graphs/contributors) [![StackOverflow](https://img.shields.io/static/v1?label=stackoverflow&logo=stackoverflow&logoColor=fe7a16&color=brightgreen&message=playframework)](https://stackoverflow.com/tags/playframework) diff --git a/documentation/manual/crud.textile b/documentation/manual/crud.textile index 598752d49c..3413b5eebb 100644 --- a/documentation/manual/crud.textile +++ b/documentation/manual/crud.textile @@ -36,7 +36,7 @@ bc. package models; import play.*; import play.db.jpa.*; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; @Entity @@ -86,7 +86,7 @@ bc. package models; import play.*; import play.db.jpa.*; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; import play.data.validation.*; diff --git a/documentation/manual/dependency.textile b/documentation/manual/dependency.textile index 2c2266a9cf..6182ad3176 100644 --- a/documentation/manual/dependency.textile +++ b/documentation/manual/dependency.textile @@ -326,7 +326,7 @@ require: exclude: - javassist -> javassist * - org.hibernate -> hibernate-annotations * - - javax.persistence -> persistence-api * + - jakarta.persistence -> persistence-api * repositories: - jboss: type: iBiblio diff --git a/documentation/manual/emails.textile b/documentation/manual/emails.textile index 12d9b1048e..a731c92f94 100644 --- a/documentation/manual/emails.textile +++ b/documentation/manual/emails.textile @@ -37,7 +37,7 @@ Each public static method will be an e-mail sender, in a similar manner as actio bc. package notifiers; -import org.apache.commons.mail.*; +import org.apache.commons.mail2.*; import play.*; import play.mvc.*; import java.util.*; diff --git a/documentation/manual/guide2.textile b/documentation/manual/guide2.textile index 74734b60aa..01483d4e4c 100644 --- a/documentation/manual/guide2.textile +++ b/documentation/manual/guide2.textile @@ -21,7 +21,7 @@ We will start to code the blog engine by creating the User class. Create a new f bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; @@ -139,7 +139,7 @@ The @Post@ class will represent blog posts. Let’s write a first implementation bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; @@ -221,7 +221,7 @@ Creating the @Comment@ class is pretty straightforward. bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; diff --git a/documentation/manual/guide6.textile b/documentation/manual/guide6.textile index 3b3aab2cbb..5456a6095f 100644 --- a/documentation/manual/guide6.textile +++ b/documentation/manual/guide6.textile @@ -9,7 +9,7 @@ We will add one more object to the blog model definition. The @Tag@ class itself bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; diff --git a/documentation/manual/guide7.textile b/documentation/manual/guide7.textile index ee9327c1d4..eb82201950 100644 --- a/documentation/manual/guide7.textile +++ b/documentation/manual/guide7.textile @@ -89,7 +89,7 @@ Let’s add some annotations to the @User@ class: bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; @@ -117,7 +117,7 @@ Let’s do the same for the @Post@ class: bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; @@ -158,7 +158,7 @@ Finally we can add validation rules to the @Comment@ and @Tag@ classes as well: bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; @@ -173,7 +173,7 @@ public class Tag extends Model implements Comparable { bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; diff --git a/documentation/manual/home.textile b/documentation/manual/home.textile index 3ed0415926..0af3310fcc 100644 --- a/documentation/manual/home.textile +++ b/documentation/manual/home.textile @@ -189,6 +189,9 @@ h2. Version notes New versions of Play include certain changes. Check older release notes for: # "About Play releases":releases/releases +# "Play 1.11.0":releases/release1.11.x/releasenotes-1.11.0 +# "Play 1.10.0":releases/release1.10.x/releasenotes-1.10.0 +# "Play 1.9.0":releases/release1.9.x/releasenotes-1.9.0 # "Play 1.8.0":releases/release1.8.x/releasenotes-1.8.0 # "Play 1.7.1":releases/release1.7.x/releasenotes-1.7.1 # "Play 1.7.0":releases/release1.7.x/releasenotes-1.7.0 diff --git a/documentation/manual/install.textile b/documentation/manual/install.textile index 549d25c6b5..d43a31feaf 100644 --- a/documentation/manual/install.textile +++ b/documentation/manual/install.textile @@ -3,11 +3,11 @@ h1. Installation guide h2. Prerequisites -To run the Play framework, you need "Java 11 or later":http://java.sun.com. If you wish to build Play from source, you will need the "Git source control client":http://git-scm.com/ to fetch the source code and "Ant":http://ant.apache.org/ to build it. +To run the Play framework, you need "Java 17 or later":https://adoptium.net/temurin/releases. If you wish to build Play from source, you will need the "Git source control client":http://git-scm.com/ to fetch the source code and "Ant":http://ant.apache.org/ to build it. Be sure to have Java in the current path (enter @java -version@ to check). Play will use the default Java or the one available at the @$JAVA_HOME@ path if defined. -The *play* command line utility uses Python. So it should work out of the box on any UNIX system (however it requires at least Python 2.5). +The *play* command line utility uses Python. So it should work out of the box on any UNIX system (however it requires at least Python 3.x). h2. Installation from the binary package diff --git a/documentation/manual/jpa.textile b/documentation/manual/jpa.textile index 2aa58f7d1a..bd31ba818d 100644 --- a/documentation/manual/jpa.textile +++ b/documentation/manual/jpa.textile @@ -6,7 +6,7 @@ p(note). **Note** that you can still go back to the plain JPA API whenever you w h2. Starting the JPA entity manager -Play will automatically start the Hibernate entity manager when it finds one or more classes annotated with the @javax.persistence.Entity annotation. However, make sure that you have correctly configured a JDBC datasource or it will fail. +Play will automatically start the Hibernate entity manager when it finds one or more classes annotated with the @jakarta.persistence.Entity annotation. However, make sure that you have correctly configured a JDBC datasource or it will fail. h2. Obtaining the JPA entity manager diff --git a/documentation/manual/lambdaj.textile b/documentation/manual/lambdaj.textile index f1b13b6173..51a004c857 100644 --- a/documentation/manual/lambdaj.textile +++ b/documentation/manual/lambdaj.textile @@ -19,7 +19,7 @@ bc. package models; import play.*; import play.db.jpa.*; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; @Entity diff --git a/documentation/manual/model.textile b/documentation/manual/model.textile index 5b850a22cb..a5fc2a7aba 100644 --- a/documentation/manual/model.textile +++ b/documentation/manual/model.textile @@ -168,7 +168,7 @@ h2. Persist your object model with Hibernate You can use Hibernate (through JPA) to persist your Java objects in the Database automatically. -When you define JPA entities by adding @javax.persistence.Entity annotations to any Java object, Play will automatically start a JPA entity manager. +When you define JPA entities by adding @jakarta.persistence.Entity annotations to any Java object, Play will automatically start a JPA entity manager. bc. @Entity public class Product { diff --git a/documentation/manual/releases/release1.10.x/releasenotes-1.10.0.textile b/documentation/manual/releases/release1.10.x/releasenotes-1.10.0.textile new file mode 100644 index 0000000000..e152c353aa --- /dev/null +++ b/documentation/manual/releases/release1.10.x/releasenotes-1.10.0.textile @@ -0,0 +1,42 @@ +# Play 1.10.0 -- Release notes + +Play 1.10.0 has been released of the master branch. + +The changes in this release are listed in the "1.10.0":https://github.com/playframework/play1/milestone/13352426 including 31 resolved tickets. + + +## What's new in Play 1.10.0 + +* "#1506":https://github.com/playframework/play1/issues/1506 : feat(dependencies): migrate javax.persistence to jakarta.persistence +* "#1510":https://github.com/playframework/play1/issues/1510 : Update lib test +* "#1513":https://github.com/playframework/play1/issues/1513 : Make java 17 as default +* "#1514":https://github.com/playframework/play1/issues/1514 : chore(java): set build for java 17 instead of java 11 + test 21 + build mac-os (#1513) +* "#1517":https://github.com/playframework/play1/issues/1517 : Migrate from javax.activation » jakarta.activation +* "#1529":https://github.com/playframework/play1/issues/1529 : chore(dependencies): migrate from javax.inject 1.0 to jakarta.inject-api 2.0.1 (#1525) +* "#1530":https://github.com/playframework/play1/issues/1530 : chore(securitymanager): remove deprecated Security manager (#1527) +* "#1533":https://github.com/playframework/play1/issues/1533 : junit5 upgrade + +## What's fixed in Play 1.10.0 + +* "#1390":https://github.com/playframework/play1/issues/1390 : When should play! migrate to jakarta-jpa? +* "#1418":https://github.com/playframework/play1/issues/1418 : Firephoque dependencies update 20220618 +* "#1439":https://github.com/playframework/play1/issues/1439 : Fix class newinstance deprecation +* "#1480":https://github.com/playframework/play1/issues/1480 : Fix issue #1463 by restoring behavior of --timeout parameter +* "#1505":https://github.com/playframework/play1/issues/1505 : chore(dependencies): update hibernate-commons-annotations from 5.1.2.Final to 7.0.3.Final +* "#1509":https://github.com/playframework/play1/issues/1509 : feat(testrunner): update firephoque dependencies +* "#1511":https://github.com/playframework/play1/issues/1511 : Fix class newinstance deprecation +* "#1515":https://github.com/playframework/play1/issues/1515 : chore(deps): bump actions/checkout from 4 to 5 +* "#1516":https://github.com/playframework/play1/issues/1516 : Migrate from javax.servlet.* to jakarta.servlet +* "#1518":https://github.com/playframework/play1/issues/1518 : Migrate from javax.validation » jakarta.validation +* "#1519":https://github.com/playframework/play1/issues/1519 : chore(servlet): update geronimo-servlet_2.5_spec 1.2 to jakarta.servl… +* "#1521":https://github.com/playframework/play1/issues/1521 : chore(activation): update commons-email 1.6.0 to commons-email2-core … +* "#1522":https://github.com/playframework/play1/issues/1522 : 1518 jakarta validation +* "#1523":https://github.com/playframework/play1/issues/1523 : Update to junit 5 +* "#1525":https://github.com/playframework/play1/issues/1525 : Migrate javax.inject to jakarta.inject +* "#1526":https://github.com/playframework/play1/issues/1526 : Fix warning about deprecated parameters -Xverify:none and -noverify were deprecated in JDK 13 a +* "#1527":https://github.com/playframework/play1/issues/1527 : Remove deprecated SecurityManager usage +* "#1528":https://github.com/playframework/play1/issues/1528 : chore(deps): bump actions/setup-java from 4 to 5 +* "#1531":https://github.com/playframework/play1/issues/1531 : fix(command): remove deprecated use of -noverify jvm parameter (1526) +* "#1532":https://github.com/playframework/play1/issues/1532 : chore(deps): bump actions/setup-python from 5 to 6 +* "#1535":https://github.com/playframework/play1/issues/1535 : chore(deps): bump github/codeql-action from 3 to 4 +* "#1536":https://github.com/playframework/play1/issues/1536 : chore(deps): bump actions/upload-artifact from 4 to 5 diff --git a/documentation/manual/releases/release1.11.x/releasenotes-1.11.0.textile b/documentation/manual/releases/release1.11.x/releasenotes-1.11.0.textile new file mode 100644 index 0000000000..8943259a61 --- /dev/null +++ b/documentation/manual/releases/release1.11.x/releasenotes-1.11.0.textile @@ -0,0 +1,24 @@ +# Play 1.11.0 -- Release notes + +Play 1.11.0 has been released of the master branch. + +The changes in this release are listed in the "1.11.0":https://github.com/playframework/play1/milestone/13541142 including 12 resolved tickets. + + +## What's new in Play 1.11.0 + +* "#1483":https://github.com/playframework/play1/issues/1483 : Support for JDK 21 +* "#1484":https://github.com/playframework/play1/issues/1484 : Upgrade to Hibernate 5.6 -> 6.x +* "#1524":https://github.com/playframework/play1/issues/1524 : Update to ANTLR 4.x +* "#1534":https://github.com/playframework/play1/issues/1534 : update hibernate up to 6.6.31 version +* "#1538":https://github.com/playframework/play1/issues/1538 : 1458 support java 21 + +## What's fixed in Play 1.11.0 + +* "#1031":https://github.com/playframework/play1/issues/1031 : transitiveDependencies in dependencies.conf doesn't work +* "#1034":https://github.com/playframework/play1/issues/1034 : [#1031] - fix transitiveDependencies global setting in dependency.yml +* "#1488":https://github.com/playframework/play1/issues/1488 : Cleanup +* "#1539":https://github.com/playframework/play1/issues/1539 : Jpa cleanup +* "#1540":https://github.com/playframework/play1/issues/1540 : Bugfix/1031 +* "#1541":https://github.com/playframework/play1/issues/1541 : use property "release" instead of "source" and "target" +* "#1542":https://github.com/playframework/play1/issues/1542 : chore(deps): bump actions/checkout from 5 to 6 diff --git a/documentation/manual/releases/release1.9.x/releasenotes-1.9.0.textile b/documentation/manual/releases/release1.9.x/releasenotes-1.9.0.textile new file mode 100644 index 0000000000..fa3e6fb204 --- /dev/null +++ b/documentation/manual/releases/release1.9.x/releasenotes-1.9.0.textile @@ -0,0 +1,24 @@ +# Play 1.9.0 -- Release notes + +Play 1.9.0 has been released of the master branch. + +The changes in this release are listed in the "1.9.0":https://github.com/playframework/play1/milestone/10624965 including 12 resolved tickets. + + +## What's new in Play 1.9.0 + + +## What's fixed in Play 1.9.0 + +* "#1358":https://github.com/playframework/play1/issues/1358 : Update the README, use Markdown instead of Textile +* "#1472":https://github.com/playframework/play1/issues/1472 : Fix "play build-module" by replacing yaml.load with yaml.safe_load +* "#1473":https://github.com/playframework/play1/issues/1473 : feat(dependabot): add dependabot.yml configuration +* "#1474":https://github.com/playframework/play1/issues/1474 : Convert README from textile to markdown +* "#1475":https://github.com/playframework/play1/issues/1475 : Bump actions/setup-python from 4 to 5 +* "#1476":https://github.com/playframework/play1/issues/1476 : Bump actions/setup-java from 3 to 4 +* "#1477":https://github.com/playframework/play1/issues/1477 : GitHub actions configuration +* "#1478":https://github.com/playframework/play1/issues/1478 : Update issue templates +* "#1479":https://github.com/playframework/play1/issues/1479 : fix(release-draft): fix version number +* "#1482":https://github.com/playframework/play1/issues/1482 : Updated dependencies +* "#1502":https://github.com/playframework/play1/issues/1502 : dependencies upgrade: +* "#1503":https://github.com/playframework/play1/issues/1503 : 1502 update dependencies diff --git a/documentation/manual/releases/releases.textile b/documentation/manual/releases/releases.textile index 90d795b38f..a0feab903c 100644 --- a/documentation/manual/releases/releases.textile +++ b/documentation/manual/releases/releases.textile @@ -2,6 +2,19 @@ h1. About Play releases You can download Play releases "here":https://www.playframework.com/download. Each release has a Migration Guide that explains how to upgrade from the previous release. + +h2. Play 1.11.x + +# "Play 1.11.0":release1.11.x/releasenotes-1.11.0 + +h2. Play 1.9.x + +# "Play 1.10.0":release1.10.x/releasenotes-1.10.0 + +h2. Play 1.9.x + +# "Play 1.9.0":release1.9.x/releasenotes-1.9.0 + h2. Play 1.8.x # "Play 1.8.0":release1.8.x/releasenotes-1.8.0 diff --git a/documentation/manual/yaml.textile b/documentation/manual/yaml.textile index 01b3d7117e..e6544ce780 100644 --- a/documentation/manual/yaml.textile +++ b/documentation/manual/yaml.textile @@ -47,7 +47,7 @@ p. @City.java@ bc.. package models; import java.util.List; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.Model; @Entity @@ -65,7 +65,7 @@ p. @Neighborhood.java@ bc.. package models; import java.util.List; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.Model; @Entity @@ -88,7 +88,7 @@ p. @User.java@ bc.. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.Model; @Entity diff --git a/documentation/manual_ja/configuration.textile b/documentation/manual_ja/configuration.textile index bbceb26181..137e6949ff 100644 --- a/documentation/manual_ja/configuration.textile +++ b/documentation/manual_ja/configuration.textile @@ -517,11 +517,11 @@ h3(#java.source). java.source Java ソースレベルです。これは @java.version@ システムプロパティをオーバーライドします。設定例: -bc. java.source=1.8 +bc. java.source=17 -Values: @1.7@ (No longer supported since 1.5.0), @1.8@. +Values: @17@. -デフォルト: @1.8@ +デフォルト: @18@ h2(#jpa). JPA diff --git a/documentation/manual_ja/crud.textile b/documentation/manual_ja/crud.textile index 557fbf6c01..1738e21f8e 100644 --- a/documentation/manual_ja/crud.textile +++ b/documentation/manual_ja/crud.textile @@ -36,7 +36,7 @@ bc. package models; import play.*; import play.db.jpa.*; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; @Entity @@ -86,7 +86,7 @@ bc. package models; import play.*; import play.db.jpa.*; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; import play.data.validation.*; diff --git a/documentation/manual_ja/dependency.textile b/documentation/manual_ja/dependency.textile index 130d4f04ae..8a93331d5d 100644 --- a/documentation/manual_ja/dependency.textile +++ b/documentation/manual_ja/dependency.textile @@ -272,7 +272,7 @@ require: exclude: - javassist -> javassist * - org.hibernate -> hibernate-annotations * - - javax.persistence -> persistence-api * + - jakarta.persistence -> persistence-api * repositories: - jboss: type: iBiblio diff --git a/documentation/manual_ja/emails.textile b/documentation/manual_ja/emails.textile index 22a980ee06..201b479934 100644 --- a/documentation/manual_ja/emails.textile +++ b/documentation/manual_ja/emails.textile @@ -37,7 +37,7 @@ MVC コントローラにおけるアクションのやり方と同じように bc. package notifiers; -import org.apache.commons.mail.*; +import org.apache.commons.mail2.*; import play.*; import play.mvc.*; import java.util.*; diff --git a/documentation/manual_ja/guide2.textile b/documentation/manual_ja/guide2.textile index b3d26ffe7d..e608e187fa 100755 --- a/documentation/manual_ja/guide2.textile +++ b/documentation/manual_ja/guide2.textile @@ -21,7 +21,7 @@ User クラスを作成するところからブログエンジンのコーディ bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; @@ -139,7 +139,7 @@ h2. Post クラス bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; @@ -221,7 +221,7 @@ h2. コメントの追加 bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; diff --git a/documentation/manual_ja/guide6.textile b/documentation/manual_ja/guide6.textile index 675d7e8b08..aa123f8a36 100644 --- a/documentation/manual_ja/guide6.textile +++ b/documentation/manual_ja/guide6.textile @@ -9,7 +9,7 @@ h2. Tag モデルオブジェクト bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; diff --git a/documentation/manual_ja/guide7.textile b/documentation/manual_ja/guide7.textile index 10298d3a1a..1295ed890d 100755 --- a/documentation/manual_ja/guide7.textile +++ b/documentation/manual_ja/guide7.textile @@ -89,7 +89,7 @@ h2. バリデーションの追加 bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; @@ -117,7 +117,7 @@ public class User extends Model { bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; @@ -158,7 +158,7 @@ public class Post extends Model { bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; @@ -173,7 +173,7 @@ public class Tag extends Model implements Comparable { bc. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.*; import play.data.validation.*; diff --git a/documentation/manual_ja/jpa.textile b/documentation/manual_ja/jpa.textile index 87423817e7..cbe05ecbcd 100644 --- a/documentation/manual_ja/jpa.textile +++ b/documentation/manual_ja/jpa.textile @@ -6,7 +6,7 @@ p(note). いつでも素の JPA API に立ち返ることができることに * h2. JPA エンティティマネージャの開始 -Playは、 @javax.persistence.Entity アノテーションで注釈されたクラスをひとつ以上見つけた場合、自動的に Hibernate エンティティマネージャを開始します。とは言え、JDBC データソースを正しく設定していない場合、エンティティマネージャの開始は失敗してしまうので、確実に設定してください。 +Playは、 @jakarta.persistence.Entity アノテーションで注釈されたクラスをひとつ以上見つけた場合、自動的に Hibernate エンティティマネージャを開始します。とは言え、JDBC データソースを正しく設定していない場合、エンティティマネージャの開始は失敗してしまうので、確実に設定してください。 h2. JPA エンティティマネージャの取得 diff --git a/documentation/manual_ja/lambdaj.textile b/documentation/manual_ja/lambdaj.textile index f1b13b6173..51a004c857 100644 --- a/documentation/manual_ja/lambdaj.textile +++ b/documentation/manual_ja/lambdaj.textile @@ -19,7 +19,7 @@ bc. package models; import play.*; import play.db.jpa.*; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; @Entity diff --git a/documentation/manual_ja/model.textile b/documentation/manual_ja/model.textile index 09c798ed9f..176783980f 100644 --- a/documentation/manual_ja/model.textile +++ b/documentation/manual_ja/model.textile @@ -168,7 +168,7 @@ h2. Hibernate によるモデルの永続化 Java オブジェクトを自動的にデータベースに永続化するために (JPA を通して) Hibernate を使用することができます。 -どんな Java オブジェクトでも、 @javax.persistence.Entity アノテーションを追加して JPA エンティティとして定義した場合、Play は自動的に JPA EntityManager を起動します。 +どんな Java オブジェクトでも、 @jakarta.persistence.Entity アノテーションを追加して JPA エンティティとして定義した場合、Play は自動的に JPA EntityManager を起動します。 bc. @Entity public class Product { diff --git a/documentation/manual_ja/yaml.textile b/documentation/manual_ja/yaml.textile index 01b3d7117e..e6544ce780 100644 --- a/documentation/manual_ja/yaml.textile +++ b/documentation/manual_ja/yaml.textile @@ -47,7 +47,7 @@ p. @City.java@ bc.. package models; import java.util.List; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.Model; @Entity @@ -65,7 +65,7 @@ p. @Neighborhood.java@ bc.. package models; import java.util.List; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.Model; @Entity @@ -88,7 +88,7 @@ p. @User.java@ bc.. package models; import java.util.*; -import javax.persistence.*; +import jakarta.persistence.*; import play.db.jpa.Model; @Entity diff --git a/framework/build.gradle b/framework/build.gradle index f48ea7c144..4975401157 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -21,7 +21,7 @@ plugins { } group 'com.nosto.play' -version '1.8.0-nosto-GA-12' +version '1.11.0-nosto-GA-1' java { withSourcesJar() @@ -86,16 +86,16 @@ dependencies { implementation group: 'commons-collections', name: 'commons-collections', version: '3.2.2' // libs not listed in dependencies.yml, but required for compilation - compileOnly(group: 'org.apache.ant', name: 'ant', version: '1.10.14') + compileOnly(group: 'org.apache.ant', name: 'ant', version: '1.10.15') compileOnly(group: 'org.apache.ant', name: 'ant-junit', version: '1.10.14') compileOnly group: 'com.google.code.maven-play-plugin.org.playframework', name: 'jj-simplecaptcha', version: '1.1' - testImplementation(group: 'org.apache.ant', name: 'ant', version: '1.10.14') - testImplementation(group: 'org.apache.ant', name: 'ant-junit', version: '1.10.14') - testImplementation(group: 'org.easytesting', name: 'fest-assert', version: '1.4') - testImplementation(group: 'org.easytesting', name: 'fest-util', version: '1.1.6') - testImplementation(group: 'org.mockito', name: 'mockito-core', version: '2.21.0') - testImplementation(group: 'org.objenesis', name: 'objenesis', version: '2.6') + testImplementation(group: 'org.apache.ant', name: 'ant', version: '1.10.15') + testImplementation(group: 'org.apache.ant', name: 'ant-junitlauncher', version: '1.10.15') + testImplementation(group: 'org.assertj', name: 'assertj-core', version: '3.27.3') + testImplementation(group: 'org.mockito', name: 'mockito-core', version: '5.19.0') + testImplementation(group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.19.0') + testImplementation(group: 'org.objenesis', name: 'objenesis', version: '3.4') } jar { diff --git a/framework/build.xml b/framework/build.xml index 31ed81b0ac..67f4c44473 100644 --- a/framework/build.xml +++ b/framework/build.xml @@ -2,7 +2,8 @@ - + + @@ -64,7 +65,7 @@ - + @@ -105,9 +106,14 @@ + + + + + @@ -129,6 +135,7 @@ + @@ -231,9 +238,12 @@ - - - + + + + @@ -342,41 +352,53 @@ - - + + + + + + + + + - - - - - - + + + + + - - + + + + + + + + - - - - - + + + + + - + @@ -389,6 +411,7 @@ + @@ -398,14 +421,17 @@ - + - - + - - - + + + + + + + diff --git a/framework/dependencies.yml b/framework/dependencies.yml index befcde1eb0..d4b1895573 100644 --- a/framework/dependencies.yml +++ b/framework/dependencies.yml @@ -7,68 +7,75 @@ transitiveDependencies: false # This core dependencies are required by Play framework require: &allDependencies - - antlr 2.7.7 - - org.ow2.asm -> asm 9.6 - - org.ow2.asm -> asm-commons 9.6 - - org.ow2.asm -> asm-util 9.6 - - org.ow2.asm -> asm-tree 9.6 - - org.ow2.asm -> asm-analysis 9.6 + - org.antlr -> antlr4-runtime 4.13.0 + - org.ow2.asm -> asm 9.8 + - org.ow2.asm -> asm-commons 9.8 + - org.ow2.asm -> asm-util 9.8 + - org.ow2.asm -> asm-tree 9.8 + - org.ow2.asm -> asm-analysis 9.8 - cglib -> cglib 3.3.0 - - com.google.code.gson -> gson 2.10.1 + - com.google.code.gson -> gson 2.13.1 - com.jamonapi -> jamon 2.82 - com.ning -> async-http-client 1.9.40 - - commons-beanutils 1.9.4 - - commons-codec 1.16.1 - - org.apache.commons -> commons-email 1.6.0 - - commons-fileupload 1.5 - - commons-io 2.15.1 + - commons-beanutils 1.11.0 + - commons-codec 1.18.0 + - org.apache.commons -> commons-email2-core 2.0.0-M1 + - org.apache.commons -> commons-email2-jakarta 2.0.0-M1 + - commons-fileupload 1.6.0 + - commons-io 2.19.0 - com.google.code.maven-play-plugin.org.apache.commons -> commons-javaflow 1590792 - - org.apache.commons -> commons-lang3 3.14.0 - - org.apache.commons -> commons-text 1.11.0 - - commons-logging 1.3.0 - - org.dom4j -> dom4j 2.1.4 - - javax.activation -> javax.activation-api 1.2.0 - - com.sun.mail -> javax.mail 1.6.2 - - jakarta.inject -> jakarta.inject-api 1.0 - - javax.validation -> validation-api 1.1.0.Final - - javax.activation -> activation 1.1.1 + - org.apache.commons -> commons-lang3 3.18.0 + - org.apache.commons -> commons-text 1.13.1 + - commons-logging 1.3.5 + - org.dom4j -> dom4j 2.2.0 + - com.h2database -> h2 2.2.224 + - jakarta.activation -> jakarta.activation-api 2.1.3 + - com.sun.mail -> jakarta.mail 2.0.2 + - jakarta.inject -> jakarta.inject-api 2.0.1 + - jakarta.validation -> jakarta.validation-api 3.1.1 - jaxen 2.0.0 - - joda-time 2.12.7 + - joda-time 2.14.0 - org.hamcrest -> hamcrest-all 1.3 - junit 4.13.2 - - net.sourceforge.jregex -> jregex 1.2_01 - - org.apache.logging.log4j -> log4j-api 2.23.0 - - org.apache.logging.log4j -> log4j-core 2.23.0 + - org.junit.jupiter -> junit-jupiter-api 5.13.4 + - org.junit.jupiter -> junit-jupiter-engine 5.13.4 + - org.junit.jupiter -> junit-jupiter-params 5.13.4 + - org.junit.platform -> junit-platform-launcher 1.13.4 + - org.junit.platform -> junit-platform-engine 1.13.4 + - org.junit.platform -> junit-platform-commons 1.13.4 + - org.opentest4j -> opentest4j 1.3.0 + - org.apiguardian -> apiguardian-api 1.1.2 + - net.sourceforge.jregex -> jregex 1.2_01 + - org.apache.logging.log4j -> log4j-api 2.23.1 + - org.apache.logging.log4j -> log4j-core 2.23.1 - net.sf.ehcache -> ehcache 2.10.9.2 - net.sf.ezmorph -> ezmorph 1.0.6 - net.sf.jsr107cache -> jsr107cache 1.1 - net.sf.oval -> oval 3.2.1 - oauth.signpost -> signpost-core 1.2.1.2 - - javax.servlet -> javax.servlet-api 3.0.1 - jakarta.servlet -> jakarta.servlet-api 6.0.0 - - org.apache.ivy -> ivy 2.5.2 - - org.bouncycastle -> bcprov-jdk18on 1.78.1 - - org.bouncycastle -> bcpkix-jdk18on 1.78.1 - - org.bouncycastle -> bcutil-jdk18on 1.78.1 - - org.codehaus.groovy -> groovy 3.0.20 - - org.codehaus.groovy -> groovy-xml 3.0.20 - - org.eclipse.jdt -> org.eclipse.jdt.core 3.36.0 - - org.eclipse.jdt -> ecj 3.36.0 - - net.bytebuddy -> byte-buddy 1.14.19 - - io.smallrye -> jandex 3.1.6 - - org.jboss.logging -> jboss-logging 3.5.3.Final - - org.jboss.spec.javax.transaction -> jboss-transaction-api_1.2_spec 1.1.1.Final - - javax.persistence -> javax.persistence-api 2.2 - - javax.xml.bind -> jaxb-api 2.3.1 + - org.apache.ivy -> ivy 2.5.3 + - org.bouncycastle -> bcprov-jdk18on 1.81 + - org.bouncycastle -> bcpkix-jdk18on 1.81 + - org.bouncycastle -> bcutil-jdk18on 1.81 + - org.codehaus.groovy -> groovy 3.0.25 + - org.codehaus.groovy -> groovy-xml 3.0.25 + - org.eclipse.jdt -> org.eclipse.jdt.core 3.40.0 + - org.eclipse.jdt -> ecj 3.40.0 + - net.bytebuddy -> byte-buddy 1.17.6 + - io.smallrye -> jandex 3.2.7 + - org.jboss.logging -> jboss-logging 3.6.1.Final + - jakarta.transaction -> jakarta.transaction-api 2.0.1 + - jakarta.xml.bind -> jakarta.xml.bind-api 4.0.2 - org.glassfish.jaxb -> jaxb-runtime 2.3.9 - com.fasterxml -> classmate 1.7.0 - - com.mchange -> mchange-commons-java 0.2.20 + - com.mchange -> mchange-commons-java 0.3.2 - org.javassist -> javassist 3.30.2-GA - io.netty -> netty 3.10.6.Final.Nosto20250401 - - org.postgresql -> postgresql 42.7.2 - - org.slf4j -> slf4j-api 2.0.12 - - org.apache.logging.log4j -> log4j-slf4j2-impl 2.23.0 - - org.yaml -> snakeyaml 2.2 + - org.postgresql -> postgresql 42.7.7 + - org.slf4j -> slf4j-api 2.0.17 + - org.apache.logging.log4j -> log4j-slf4j2-impl 2.23.1 + - org.yaml -> snakeyaml 2.4 - net.spy -> spymemcached 2.12.3 - com.thoughtworks.xstream -> xstream 1.4.21 - xmlpull 1.1.3.4d_b4_min diff --git a/framework/lib-test/ant-1.10.15.jar b/framework/lib-test/ant-1.10.15.jar new file mode 100644 index 0000000000..e06c352d89 Binary files /dev/null and b/framework/lib-test/ant-1.10.15.jar differ diff --git a/framework/lib-test/ant-junitlauncher-1.10.15.jar b/framework/lib-test/ant-junitlauncher-1.10.15.jar new file mode 100644 index 0000000000..ed086b0b2b Binary files /dev/null and b/framework/lib-test/ant-junitlauncher-1.10.15.jar differ diff --git a/framework/lib-test/ant.jar b/framework/lib-test/ant.jar deleted file mode 100644 index 1c348e3eb5..0000000000 Binary files a/framework/lib-test/ant.jar and /dev/null differ diff --git a/framework/lib-test/assertj-core-3.27.3.jar b/framework/lib-test/assertj-core-3.27.3.jar new file mode 100644 index 0000000000..435ee7ad2e Binary files /dev/null and b/framework/lib-test/assertj-core-3.27.3.jar differ diff --git a/framework/lib-test/byte-buddy-agent-1.17.6.jar b/framework/lib-test/byte-buddy-agent-1.17.6.jar new file mode 100644 index 0000000000..51ac40ebc3 Binary files /dev/null and b/framework/lib-test/byte-buddy-agent-1.17.6.jar differ diff --git a/framework/lib-test/fest-assert-1.4.jar b/framework/lib-test/fest-assert-1.4.jar deleted file mode 100644 index 1d42207037..0000000000 Binary files a/framework/lib-test/fest-assert-1.4.jar and /dev/null differ diff --git a/framework/lib-test/fest-util-1.1.6.jar b/framework/lib-test/fest-util-1.1.6.jar deleted file mode 100644 index 629e6c0704..0000000000 Binary files a/framework/lib-test/fest-util-1.1.6.jar and /dev/null differ diff --git a/framework/lib-test/mockito-core-2.21.0.jar b/framework/lib-test/mockito-core-2.21.0.jar deleted file mode 100644 index 73de643e08..0000000000 Binary files a/framework/lib-test/mockito-core-2.21.0.jar and /dev/null differ diff --git a/framework/lib-test/mockito-core-5.19.0.jar b/framework/lib-test/mockito-core-5.19.0.jar new file mode 100644 index 0000000000..897f5aa47c Binary files /dev/null and b/framework/lib-test/mockito-core-5.19.0.jar differ diff --git a/framework/lib-test/mockito-junit-jupiter-5.19.0.jar b/framework/lib-test/mockito-junit-jupiter-5.19.0.jar new file mode 100644 index 0000000000..fc33c35a63 Binary files /dev/null and b/framework/lib-test/mockito-junit-jupiter-5.19.0.jar differ diff --git a/framework/lib-test/objenesis-2.6.jar b/framework/lib-test/objenesis-2.6.jar deleted file mode 100644 index b4b29d563b..0000000000 Binary files a/framework/lib-test/objenesis-2.6.jar and /dev/null differ diff --git a/framework/lib-test/objenesis-3.4.jar b/framework/lib-test/objenesis-3.4.jar new file mode 100644 index 0000000000..bb025e232d Binary files /dev/null and b/framework/lib-test/objenesis-3.4.jar differ diff --git a/framework/lib/HikariCP-5.1.0.jar b/framework/lib/HikariCP-5.1.0.jar deleted file mode 100644 index 0aa1c9fb12..0000000000 Binary files a/framework/lib/HikariCP-5.1.0.jar and /dev/null differ diff --git a/framework/lib/activation-1.1.1.jar b/framework/lib/activation-1.1.1.jar deleted file mode 100644 index 29a59a9ee1..0000000000 Binary files a/framework/lib/activation-1.1.1.jar and /dev/null differ diff --git a/framework/lib/antlr-2.7.7.jar b/framework/lib/antlr-2.7.7.jar deleted file mode 100644 index 5e5f14b355..0000000000 Binary files a/framework/lib/antlr-2.7.7.jar and /dev/null differ diff --git a/framework/lib/antlr4-runtime-4.13.0.jar b/framework/lib/antlr4-runtime-4.13.0.jar new file mode 100644 index 0000000000..40c77ffa54 Binary files /dev/null and b/framework/lib/antlr4-runtime-4.13.0.jar differ diff --git a/framework/lib/apiguardian-api-1.1.2.jar b/framework/lib/apiguardian-api-1.1.2.jar new file mode 100644 index 0000000000..2b678e154d Binary files /dev/null and b/framework/lib/apiguardian-api-1.1.2.jar differ diff --git a/framework/lib/asm-9.6.jar b/framework/lib/asm-9.6.jar deleted file mode 100644 index cc1c2cd8e4..0000000000 Binary files a/framework/lib/asm-9.6.jar and /dev/null differ diff --git a/framework/lib/asm-9.8.jar b/framework/lib/asm-9.8.jar new file mode 100644 index 0000000000..4f0c86e08b Binary files /dev/null and b/framework/lib/asm-9.8.jar differ diff --git a/framework/lib/asm-analysis-9.6.jar b/framework/lib/asm-analysis-9.6.jar deleted file mode 100644 index f4e8691b97..0000000000 Binary files a/framework/lib/asm-analysis-9.6.jar and /dev/null differ diff --git a/framework/lib/asm-analysis-9.8.jar b/framework/lib/asm-analysis-9.8.jar new file mode 100644 index 0000000000..d03a1f8e57 Binary files /dev/null and b/framework/lib/asm-analysis-9.8.jar differ diff --git a/framework/lib/asm-commons-9.6.jar b/framework/lib/asm-commons-9.6.jar deleted file mode 100644 index 75f3bad86a..0000000000 Binary files a/framework/lib/asm-commons-9.6.jar and /dev/null differ diff --git a/framework/lib/asm-commons-9.8.jar b/framework/lib/asm-commons-9.8.jar new file mode 100644 index 0000000000..d6e4780711 Binary files /dev/null and b/framework/lib/asm-commons-9.8.jar differ diff --git a/framework/lib/asm-tree-9.6.jar b/framework/lib/asm-tree-9.8.jar similarity index 91% rename from framework/lib/asm-tree-9.6.jar rename to framework/lib/asm-tree-9.8.jar index 9fe5275876..83d38631d6 100644 Binary files a/framework/lib/asm-tree-9.6.jar and b/framework/lib/asm-tree-9.8.jar differ diff --git a/framework/lib/asm-util-9.6.jar b/framework/lib/asm-util-9.6.jar deleted file mode 100644 index cc109b03d0..0000000000 Binary files a/framework/lib/asm-util-9.6.jar and /dev/null differ diff --git a/framework/lib/asm-util-9.8.jar b/framework/lib/asm-util-9.8.jar new file mode 100644 index 0000000000..f628b2f5d7 Binary files /dev/null and b/framework/lib/asm-util-9.8.jar differ diff --git a/framework/lib/bcpkix-jdk18on-1.78.1.jar b/framework/lib/bcpkix-jdk18on-1.81.jar similarity index 56% rename from framework/lib/bcpkix-jdk18on-1.78.1.jar rename to framework/lib/bcpkix-jdk18on-1.81.jar index dca7170eeb..11f73d689d 100644 Binary files a/framework/lib/bcpkix-jdk18on-1.78.1.jar and b/framework/lib/bcpkix-jdk18on-1.81.jar differ diff --git a/framework/lib/bcprov-jdk18on-1.78.1.jar b/framework/lib/bcprov-jdk18on-1.81.jar similarity index 69% rename from framework/lib/bcprov-jdk18on-1.78.1.jar rename to framework/lib/bcprov-jdk18on-1.81.jar index 6726f83391..d0410eb115 100644 Binary files a/framework/lib/bcprov-jdk18on-1.78.1.jar and b/framework/lib/bcprov-jdk18on-1.81.jar differ diff --git a/framework/lib/bcutil-jdk18on-1.78.1.jar b/framework/lib/bcutil-jdk18on-1.81.jar similarity index 64% rename from framework/lib/bcutil-jdk18on-1.78.1.jar rename to framework/lib/bcutil-jdk18on-1.81.jar index 348a2fff6d..26fc9e0d68 100644 Binary files a/framework/lib/bcutil-jdk18on-1.78.1.jar and b/framework/lib/bcutil-jdk18on-1.81.jar differ diff --git a/framework/lib/byte-buddy-1.14.19.jar b/framework/lib/byte-buddy-1.14.19.jar deleted file mode 100644 index a7f2921196..0000000000 Binary files a/framework/lib/byte-buddy-1.14.19.jar and /dev/null differ diff --git a/framework/lib/byte-buddy-1.17.6.jar b/framework/lib/byte-buddy-1.17.6.jar new file mode 100644 index 0000000000..3cdb6b2e31 Binary files /dev/null and b/framework/lib/byte-buddy-1.17.6.jar differ diff --git a/framework/lib/c3p0-0.9.5.5.jar b/framework/lib/c3p0-0.9.5.5.jar deleted file mode 100644 index 043263e5ac..0000000000 Binary files a/framework/lib/c3p0-0.9.5.5.jar and /dev/null differ diff --git a/framework/lib/c3p0-oracle-thin-extras-0.9.5.jar b/framework/lib/c3p0-oracle-thin-extras-0.9.5.jar deleted file mode 100644 index 1fd18cb3d7..0000000000 Binary files a/framework/lib/c3p0-oracle-thin-extras-0.9.5.jar and /dev/null differ diff --git a/framework/lib/commons-beanutils-1.11.0.jar b/framework/lib/commons-beanutils-1.11.0.jar new file mode 100644 index 0000000000..6b7b993661 Binary files /dev/null and b/framework/lib/commons-beanutils-1.11.0.jar differ diff --git a/framework/lib/commons-beanutils-1.9.4.jar b/framework/lib/commons-beanutils-1.9.4.jar deleted file mode 100644 index b73543cbac..0000000000 Binary files a/framework/lib/commons-beanutils-1.9.4.jar and /dev/null differ diff --git a/framework/lib/commons-codec-1.16.1.jar b/framework/lib/commons-codec-1.16.1.jar deleted file mode 100644 index f896649735..0000000000 Binary files a/framework/lib/commons-codec-1.16.1.jar and /dev/null differ diff --git a/framework/lib/commons-codec-1.18.0.jar b/framework/lib/commons-codec-1.18.0.jar new file mode 100644 index 0000000000..9cb58515be Binary files /dev/null and b/framework/lib/commons-codec-1.18.0.jar differ diff --git a/framework/lib/commons-collections-3.2.2.jar b/framework/lib/commons-collections-3.2.2.jar new file mode 100644 index 0000000000..fa5df82a63 Binary files /dev/null and b/framework/lib/commons-collections-3.2.2.jar differ diff --git a/framework/lib/commons-email-1.6.0.jar b/framework/lib/commons-email-1.6.0.jar deleted file mode 100644 index c520d58430..0000000000 Binary files a/framework/lib/commons-email-1.6.0.jar and /dev/null differ diff --git a/framework/lib/commons-email2-core-2.0.0-M1.jar b/framework/lib/commons-email2-core-2.0.0-M1.jar new file mode 100644 index 0000000000..88739fc7ea Binary files /dev/null and b/framework/lib/commons-email2-core-2.0.0-M1.jar differ diff --git a/framework/lib/commons-email2-jakarta-2.0.0-M1.jar b/framework/lib/commons-email2-jakarta-2.0.0-M1.jar new file mode 100644 index 0000000000..e635a6f03a Binary files /dev/null and b/framework/lib/commons-email2-jakarta-2.0.0-M1.jar differ diff --git a/framework/lib/commons-fileupload-1.5.jar b/framework/lib/commons-fileupload-1.5.jar deleted file mode 100644 index 5e608753c1..0000000000 Binary files a/framework/lib/commons-fileupload-1.5.jar and /dev/null differ diff --git a/framework/lib/commons-fileupload-1.6.0.jar b/framework/lib/commons-fileupload-1.6.0.jar new file mode 100644 index 0000000000..63af9e1294 Binary files /dev/null and b/framework/lib/commons-fileupload-1.6.0.jar differ diff --git a/framework/lib/commons-io-2.15.1.jar b/framework/lib/commons-io-2.15.1.jar deleted file mode 100644 index d53be1f140..0000000000 Binary files a/framework/lib/commons-io-2.15.1.jar and /dev/null differ diff --git a/framework/lib/commons-io-2.19.0.jar b/framework/lib/commons-io-2.19.0.jar new file mode 100644 index 0000000000..38e7fd20a4 Binary files /dev/null and b/framework/lib/commons-io-2.19.0.jar differ diff --git a/framework/lib/commons-lang3-3.18.0.jar b/framework/lib/commons-lang3-3.18.0.jar new file mode 100644 index 0000000000..9359e524af Binary files /dev/null and b/framework/lib/commons-lang3-3.18.0.jar differ diff --git a/framework/lib/commons-logging-1.3.0.jar b/framework/lib/commons-logging-1.3.0.jar deleted file mode 100644 index 127dd00d30..0000000000 Binary files a/framework/lib/commons-logging-1.3.0.jar and /dev/null differ diff --git a/framework/lib/commons-logging-1.3.5.jar b/framework/lib/commons-logging-1.3.5.jar new file mode 100644 index 0000000000..75d93a15cf Binary files /dev/null and b/framework/lib/commons-logging-1.3.5.jar differ diff --git a/framework/lib/commons-text-1.11.0.jar b/framework/lib/commons-text-1.11.0.jar deleted file mode 100644 index 78154978a0..0000000000 Binary files a/framework/lib/commons-text-1.11.0.jar and /dev/null differ diff --git a/framework/lib/commons-text-1.13.1.jar b/framework/lib/commons-text-1.13.1.jar new file mode 100644 index 0000000000..ddba18d10e Binary files /dev/null and b/framework/lib/commons-text-1.13.1.jar differ diff --git a/framework/lib/dom4j-2.1.4.jar b/framework/lib/dom4j-2.1.4.jar deleted file mode 100644 index 0769bed921..0000000000 Binary files a/framework/lib/dom4j-2.1.4.jar and /dev/null differ diff --git a/framework/lib/dom4j-2.2.0.jar b/framework/lib/dom4j-2.2.0.jar new file mode 100644 index 0000000000..f7d2d124cd Binary files /dev/null and b/framework/lib/dom4j-2.2.0.jar differ diff --git a/framework/lib/ecj-3.36.0.jar b/framework/lib/ecj-3.36.0.jar deleted file mode 100644 index 5fe2e5dc71..0000000000 Binary files a/framework/lib/ecj-3.36.0.jar and /dev/null differ diff --git a/framework/lib/ecj-3.40.0.jar b/framework/lib/ecj-3.40.0.jar new file mode 100644 index 0000000000..3e07fc5ed8 Binary files /dev/null and b/framework/lib/ecj-3.40.0.jar differ diff --git a/framework/lib/groovy-3.0.20.jar b/framework/lib/groovy-3.0.25.jar similarity index 83% rename from framework/lib/groovy-3.0.20.jar rename to framework/lib/groovy-3.0.25.jar index d3b704edcf..dfa97405e3 100644 Binary files a/framework/lib/groovy-3.0.20.jar and b/framework/lib/groovy-3.0.25.jar differ diff --git a/framework/lib/groovy-xml-3.0.20.jar b/framework/lib/groovy-xml-3.0.25.jar similarity index 84% rename from framework/lib/groovy-xml-3.0.20.jar rename to framework/lib/groovy-xml-3.0.25.jar index 5e1e17728e..93d48f0c5a 100644 Binary files a/framework/lib/groovy-xml-3.0.20.jar and b/framework/lib/groovy-xml-3.0.25.jar differ diff --git a/framework/lib/gson-2.10.1.jar b/framework/lib/gson-2.10.1.jar deleted file mode 100644 index a88c5bd9b5..0000000000 Binary files a/framework/lib/gson-2.10.1.jar and /dev/null differ diff --git a/framework/lib/gson-2.13.1.jar b/framework/lib/gson-2.13.1.jar new file mode 100644 index 0000000000..159b930f92 Binary files /dev/null and b/framework/lib/gson-2.13.1.jar differ diff --git a/framework/lib/h2-1.4.200.jar b/framework/lib/h2-1.4.200.jar deleted file mode 100644 index 3d194f2dca..0000000000 Binary files a/framework/lib/h2-1.4.200.jar and /dev/null differ diff --git a/framework/lib/h2-2.2.224.jar b/framework/lib/h2-2.2.224.jar new file mode 100644 index 0000000000..ff1997a234 Binary files /dev/null and b/framework/lib/h2-2.2.224.jar differ diff --git a/framework/lib/hibernate-c3p0-5.6.15.Final.jar b/framework/lib/hibernate-c3p0-5.6.15.Final.jar deleted file mode 100644 index 21e5801556..0000000000 Binary files a/framework/lib/hibernate-c3p0-5.6.15.Final.jar and /dev/null differ diff --git a/framework/lib/hibernate-commons-annotations-5.1.2.Final.jar b/framework/lib/hibernate-commons-annotations-5.1.2.Final.jar deleted file mode 100644 index 0b2e88ff76..0000000000 Binary files a/framework/lib/hibernate-commons-annotations-5.1.2.Final.jar and /dev/null differ diff --git a/framework/lib/hibernate-core-5.6.5.Final.patched.jar b/framework/lib/hibernate-core-5.6.5.Final.patched.jar deleted file mode 100644 index 8ca50a34d3..0000000000 Binary files a/framework/lib/hibernate-core-5.6.5.Final.patched.jar and /dev/null differ diff --git a/framework/lib/hibernate-ehcache-5.6.15.Final.jar b/framework/lib/hibernate-ehcache-5.6.15.Final.jar deleted file mode 100644 index 7e927e4911..0000000000 Binary files a/framework/lib/hibernate-ehcache-5.6.15.Final.jar and /dev/null differ diff --git a/framework/lib/hibernate-validator-5.4.3.Final.jar b/framework/lib/hibernate-validator-5.4.3.Final.jar deleted file mode 100644 index e9870ebf29..0000000000 Binary files a/framework/lib/hibernate-validator-5.4.3.Final.jar and /dev/null differ diff --git a/framework/lib/ivy-2.5.2.jar b/framework/lib/ivy-2.5.2.jar deleted file mode 100644 index 7d2648a898..0000000000 Binary files a/framework/lib/ivy-2.5.2.jar and /dev/null differ diff --git a/framework/lib/ivy-2.5.3.jar b/framework/lib/ivy-2.5.3.jar new file mode 100644 index 0000000000..88d88d4928 Binary files /dev/null and b/framework/lib/ivy-2.5.3.jar differ diff --git a/framework/lib/jakarta.activation-api-2.1.3.jar b/framework/lib/jakarta.activation-api-2.1.3.jar new file mode 100644 index 0000000000..0d015d5420 Binary files /dev/null and b/framework/lib/jakarta.activation-api-2.1.3.jar differ diff --git a/framework/lib/jakarta.inject-api-2.0.1.jar b/framework/lib/jakarta.inject-api-2.0.1.jar new file mode 100644 index 0000000000..a92e099d4f Binary files /dev/null and b/framework/lib/jakarta.inject-api-2.0.1.jar differ diff --git a/framework/lib/jakarta.mail-2.0.2.jar b/framework/lib/jakarta.mail-2.0.2.jar new file mode 100644 index 0000000000..078d11fa8a Binary files /dev/null and b/framework/lib/jakarta.mail-2.0.2.jar differ diff --git a/framework/lib/jakarta.transaction-api-2.0.1.jar b/framework/lib/jakarta.transaction-api-2.0.1.jar new file mode 100644 index 0000000000..b1e7da4be4 Binary files /dev/null and b/framework/lib/jakarta.transaction-api-2.0.1.jar differ diff --git a/framework/lib/jakarta.validation-api-3.1.1.jar b/framework/lib/jakarta.validation-api-3.1.1.jar new file mode 100644 index 0000000000..10a9d0616e Binary files /dev/null and b/framework/lib/jakarta.validation-api-3.1.1.jar differ diff --git a/framework/lib/jakarta.xml.bind-api-4.0.2.jar b/framework/lib/jakarta.xml.bind-api-4.0.2.jar new file mode 100644 index 0000000000..48242829bc Binary files /dev/null and b/framework/lib/jakarta.xml.bind-api-4.0.2.jar differ diff --git a/framework/lib/jandex-3.1.6.jar b/framework/lib/jandex-3.1.6.jar deleted file mode 100644 index bd64a7239d..0000000000 Binary files a/framework/lib/jandex-3.1.6.jar and /dev/null differ diff --git a/framework/lib/jandex-3.2.7.jar b/framework/lib/jandex-3.2.7.jar new file mode 100644 index 0000000000..c9e5cacdce Binary files /dev/null and b/framework/lib/jandex-3.2.7.jar differ diff --git a/framework/lib/javax.activation-api-1.2.0.jar b/framework/lib/javax.activation-api-1.2.0.jar deleted file mode 100644 index 986c365096..0000000000 Binary files a/framework/lib/javax.activation-api-1.2.0.jar and /dev/null differ diff --git a/framework/lib/javax.mail-1.6.2.jar b/framework/lib/javax.mail-1.6.2.jar deleted file mode 100644 index 0cd05289b6..0000000000 Binary files a/framework/lib/javax.mail-1.6.2.jar and /dev/null differ diff --git a/framework/lib/javax.persistence-api-2.2.jar b/framework/lib/javax.persistence-api-2.2.jar deleted file mode 100644 index 164ef3a99e..0000000000 Binary files a/framework/lib/javax.persistence-api-2.2.jar and /dev/null differ diff --git a/framework/lib/javax.servlet-api-3.0.1.jar b/framework/lib/javax.servlet-api-3.0.1.jar deleted file mode 100644 index 4e2edcc9df..0000000000 Binary files a/framework/lib/javax.servlet-api-3.0.1.jar and /dev/null differ diff --git a/framework/lib/jaxb-api-2.3.1.jar b/framework/lib/jaxb-api-2.3.1.jar deleted file mode 100644 index 4565865471..0000000000 Binary files a/framework/lib/jaxb-api-2.3.1.jar and /dev/null differ diff --git a/framework/lib/jboss-logging-3.5.3.Final.jar b/framework/lib/jboss-logging-3.5.3.Final.jar deleted file mode 100644 index a922e47523..0000000000 Binary files a/framework/lib/jboss-logging-3.5.3.Final.jar and /dev/null differ diff --git a/framework/lib/jboss-logging-3.6.1.Final.jar b/framework/lib/jboss-logging-3.6.1.Final.jar new file mode 100644 index 0000000000..6bb6f7fe06 Binary files /dev/null and b/framework/lib/jboss-logging-3.6.1.Final.jar differ diff --git a/framework/lib/jboss-transaction-api_1.2_spec-1.1.1.Final.jar b/framework/lib/jboss-transaction-api_1.2_spec-1.1.1.Final.jar deleted file mode 100644 index 627f7cea80..0000000000 Binary files a/framework/lib/jboss-transaction-api_1.2_spec-1.1.1.Final.jar and /dev/null differ diff --git a/framework/lib/joda-time-2.12.7.jar b/framework/lib/joda-time-2.14.0.jar similarity index 56% rename from framework/lib/joda-time-2.12.7.jar rename to framework/lib/joda-time-2.14.0.jar index 7994777eda..e9509ba6d8 100644 Binary files a/framework/lib/joda-time-2.12.7.jar and b/framework/lib/joda-time-2.14.0.jar differ diff --git a/framework/lib/junit-jupiter-api-5.13.4.jar b/framework/lib/junit-jupiter-api-5.13.4.jar new file mode 100644 index 0000000000..576f468b91 Binary files /dev/null and b/framework/lib/junit-jupiter-api-5.13.4.jar differ diff --git a/framework/lib/junit-jupiter-engine-5.13.4.jar b/framework/lib/junit-jupiter-engine-5.13.4.jar new file mode 100644 index 0000000000..ac6a308d2a Binary files /dev/null and b/framework/lib/junit-jupiter-engine-5.13.4.jar differ diff --git a/framework/lib/junit-jupiter-params-5.13.4.jar b/framework/lib/junit-jupiter-params-5.13.4.jar new file mode 100644 index 0000000000..68cb7f417b Binary files /dev/null and b/framework/lib/junit-jupiter-params-5.13.4.jar differ diff --git a/framework/lib/junit-platform-commons-1.13.4.jar b/framework/lib/junit-platform-commons-1.13.4.jar new file mode 100644 index 0000000000..d2861c8675 Binary files /dev/null and b/framework/lib/junit-platform-commons-1.13.4.jar differ diff --git a/framework/lib/junit-platform-engine-1.13.4.jar b/framework/lib/junit-platform-engine-1.13.4.jar new file mode 100644 index 0000000000..dc46158a65 Binary files /dev/null and b/framework/lib/junit-platform-engine-1.13.4.jar differ diff --git a/framework/lib/junit-platform-launcher-1.13.4.jar b/framework/lib/junit-platform-launcher-1.13.4.jar new file mode 100644 index 0000000000..cbeec155d0 Binary files /dev/null and b/framework/lib/junit-platform-launcher-1.13.4.jar differ diff --git a/framework/lib/log4j-api-2.23.0.jar b/framework/lib/log4j-api-2.23.1.jar similarity index 79% rename from framework/lib/log4j-api-2.23.0.jar rename to framework/lib/log4j-api-2.23.1.jar index dd00e8fb12..0e8e3f5e59 100644 Binary files a/framework/lib/log4j-api-2.23.0.jar and b/framework/lib/log4j-api-2.23.1.jar differ diff --git a/framework/lib/log4j-core-2.23.0.jar b/framework/lib/log4j-core-2.23.1.jar similarity index 87% rename from framework/lib/log4j-core-2.23.0.jar rename to framework/lib/log4j-core-2.23.1.jar index cba2887db6..4a5d553d89 100644 Binary files a/framework/lib/log4j-core-2.23.0.jar and b/framework/lib/log4j-core-2.23.1.jar differ diff --git a/framework/lib/log4j-slf4j2-impl-2.23.0.jar b/framework/lib/log4j-slf4j2-impl-2.23.1.jar similarity index 78% rename from framework/lib/log4j-slf4j2-impl-2.23.0.jar rename to framework/lib/log4j-slf4j2-impl-2.23.1.jar index cae4d1e121..f4f7c8cd38 100644 Binary files a/framework/lib/log4j-slf4j2-impl-2.23.0.jar and b/framework/lib/log4j-slf4j2-impl-2.23.1.jar differ diff --git a/framework/lib/log4j-web-2.18.0.jar b/framework/lib/log4j-web-2.18.0.jar deleted file mode 100644 index 87e7a9bf74..0000000000 Binary files a/framework/lib/log4j-web-2.18.0.jar and /dev/null differ diff --git a/framework/lib/mchange-commons-java-0.2.20.jar b/framework/lib/mchange-commons-java-0.2.20.jar deleted file mode 100644 index 7ff9c0280f..0000000000 Binary files a/framework/lib/mchange-commons-java-0.2.20.jar and /dev/null differ diff --git a/framework/lib/mchange-commons-java-0.3.2.jar b/framework/lib/mchange-commons-java-0.3.2.jar new file mode 100644 index 0000000000..b7ddccf988 Binary files /dev/null and b/framework/lib/mchange-commons-java-0.3.2.jar differ diff --git a/framework/lib/opentest4j-1.3.0.jar b/framework/lib/opentest4j-1.3.0.jar new file mode 100644 index 0000000000..7ec7bc5494 Binary files /dev/null and b/framework/lib/opentest4j-1.3.0.jar differ diff --git a/framework/lib/org.eclipse.jdt.core-3.36.0.jar b/framework/lib/org.eclipse.jdt.core-3.36.0.jar deleted file mode 100644 index c7a65695a9..0000000000 Binary files a/framework/lib/org.eclipse.jdt.core-3.36.0.jar and /dev/null differ diff --git a/framework/lib/org.eclipse.jdt.core-3.40.0.jar b/framework/lib/org.eclipse.jdt.core-3.40.0.jar new file mode 100644 index 0000000000..5f6b3f527f Binary files /dev/null and b/framework/lib/org.eclipse.jdt.core-3.40.0.jar differ diff --git a/framework/lib/oval-4.0.0.jar b/framework/lib/oval-4.0.0.jar new file mode 100644 index 0000000000..13cd0a53e8 Binary files /dev/null and b/framework/lib/oval-4.0.0.jar differ diff --git a/framework/lib/postgresql-42.7.2.jar b/framework/lib/postgresql-42.7.2.jar deleted file mode 100644 index 729776b004..0000000000 Binary files a/framework/lib/postgresql-42.7.2.jar and /dev/null differ diff --git a/framework/lib/postgresql-42.7.7.jar b/framework/lib/postgresql-42.7.7.jar new file mode 100644 index 0000000000..886dce112c Binary files /dev/null and b/framework/lib/postgresql-42.7.7.jar differ diff --git a/framework/lib/slf4j-api-2.0.12.jar b/framework/lib/slf4j-api-2.0.17.jar similarity index 54% rename from framework/lib/slf4j-api-2.0.12.jar rename to framework/lib/slf4j-api-2.0.17.jar index bfa1de399d..26b1545546 100644 Binary files a/framework/lib/slf4j-api-2.0.12.jar and b/framework/lib/slf4j-api-2.0.17.jar differ diff --git a/framework/lib/snakeyaml-2.2.jar b/framework/lib/snakeyaml-2.2.jar deleted file mode 100644 index 275dd5700a..0000000000 Binary files a/framework/lib/snakeyaml-2.2.jar and /dev/null differ diff --git a/framework/lib/snakeyaml-2.4.jar b/framework/lib/snakeyaml-2.4.jar new file mode 100644 index 0000000000..697acde8ca Binary files /dev/null and b/framework/lib/snakeyaml-2.4.jar differ diff --git a/framework/lib/validation-api-1.1.0.Final.jar b/framework/lib/validation-api-1.1.0.Final.jar deleted file mode 100644 index de85403868..0000000000 Binary files a/framework/lib/validation-api-1.1.0.Final.jar and /dev/null differ diff --git a/framework/patches/hibernate-5.6.5-patch-play.README b/framework/patches/hibernate-5.6.5-patch-play.README deleted file mode 100644 index 20d0451341..0000000000 --- a/framework/patches/hibernate-5.6.5-patch-play.README +++ /dev/null @@ -1,6 +0,0 @@ ----- -Download Hibernate 5.6.5.Final source code, apply the patch, and build with gradle (tip use export GRADLE_OPTS=-Xmx1G -XX:MaxPermSize=512m) ----- - -DRY RUN -> patch --dry-run -p1 -i hibernate-5.6.5-patch-play.patch -APPLY -> patch -p1 -i hibernate-5.6.5-patch-play.patch diff --git a/framework/patches/hibernate-5.6.5-patch-play.patch b/framework/patches/hibernate-5.6.5-patch-play.patch deleted file mode 100644 index 8d3a2dc8bb..0000000000 --- a/framework/patches/hibernate-5.6.5-patch-play.patch +++ /dev/null @@ -1,174 +0,0 @@ -Index: hibernate-core/src/main/java/org/hibernate/EmptyInterceptor.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/hibernate-core/src/main/java/org/hibernate/EmptyInterceptor.java b/hibernate-core/src/main/java/org/hibernate/EmptyInterceptor.java ---- a/hibernate-core/src/main/java/org/hibernate/EmptyInterceptor.java (revision dca2cabaf26fafb30baead8ba0e3d7229fb67c65) -+++ b/hibernate-core/src/main/java/org/hibernate/EmptyInterceptor.java (revision 1d894ccfd3e5740a5a764ac95e71e1f73fd454df) -@@ -120,15 +120,4 @@ - return sql; - } - -- @Override -- public void onCollectionRemove(Object collection, Serializable key) throws CallbackException { -- } -- -- @Override -- public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException { -- } -- -- @Override -- public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException { -- } - } -Index: hibernate-core/src/main/java/org/hibernate/Interceptor.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/hibernate-core/src/main/java/org/hibernate/Interceptor.java b/hibernate-core/src/main/java/org/hibernate/Interceptor.java ---- a/hibernate-core/src/main/java/org/hibernate/Interceptor.java (revision dca2cabaf26fafb30baead8ba0e3d7229fb67c65) -+++ b/hibernate-core/src/main/java/org/hibernate/Interceptor.java (revision 1d894ccfd3e5740a5a764ac95e71e1f73fd454df) -@@ -121,7 +121,9 @@ - * - * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. - */ -- void onCollectionRecreate(Object collection, Serializable key) throws CallbackException; -+ default boolean onCollectionRecreate(Object collection, Serializable key) throws CallbackException { -+ return true; -+ } - - /** - * Called before a collection is deleted. -@@ -131,7 +133,9 @@ - * - * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. - */ -- void onCollectionRemove(Object collection, Serializable key) throws CallbackException; -+ default boolean onCollectionRemove(Object collection, Serializable key) throws CallbackException { -+ return true; -+ } - - /** - * Called before a collection is updated. -@@ -141,7 +145,9 @@ - * - * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. - */ -- void onCollectionUpdate(Object collection, Serializable key) throws CallbackException; -+ default boolean onCollectionUpdate(Object collection, Serializable key) throws CallbackException { -+ return true; -+ } - - /** - * Called before a flush. -Index: hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java ---- a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java (revision dca2cabaf26fafb30baead8ba0e3d7229fb67c65) -+++ b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java (revision 1d894ccfd3e5740a5a764ac95e71e1f73fd454df) -@@ -142,9 +142,30 @@ - final Object anything = getAnything(); - //safe from concurrent modification because of how concurrentEntries() is implemented on IdentityMap - for ( Map.Entry me : persistenceContext.reentrantSafeEntityEntries() ) { --// for ( Map.Entry me : IdentityMap.concurrentEntries( persistenceContext.getEntityEntries() ) ) { -- EntityEntry entry = (EntityEntry) me.getValue(); -+ EntityEntry entry = me.getValue(); - Status status = entry.getStatus(); -+ -+ // This entity will be saved? -+ boolean willBeSaved = true; -+ try { -+ Object o = me.getKey(); -+ Class c = o.getClass(); -+ Class jpaBase = Class.forName("play.db.jpa.JPABase"); -+ while (!c.equals(Object.class)) { -+ if (c.equals(jpaBase)) { -+ willBeSaved = (Boolean) jpaBase.getDeclaredField("willBeSaved").get(o); -+ break; -+ } -+ c = c.getSuperclass(); -+ } -+ if (!willBeSaved) { -+ continue; -+ } -+ } -+ catch(ReflectiveOperationException ignore) { -+ // do nothing -+ } -+ - if ( status == Status.MANAGED || status == Status.SAVING || status == Status.READ_ONLY ) { - cascadeOnFlush( session, entry.getPersister(), me.getKey(), anything ); - } -@@ -261,8 +282,7 @@ - final Interceptor interceptor = session.getInterceptor(); - persistenceContext.forEachCollectionEntry( - (coll, ce) -> { -- if ( ce.isDorecreate() ) { -- interceptor.onCollectionRecreate( coll, ce.getCurrentKey() ); -+ if ( ce.isDorecreate() && interceptor.onCollectionRecreate( coll, ce.getCurrentKey() ) ) { - actionQueue.addAction( - new CollectionRecreateAction( - coll, -@@ -272,8 +292,7 @@ - ) - ); - } -- if ( ce.isDoremove() ) { -- interceptor.onCollectionRemove( coll, ce.getLoadedKey() ); -+ if ( ce.isDoremove() && interceptor.onCollectionRemove( coll, ce.getLoadedKey() ) ) { - actionQueue.addAction( - new CollectionRemoveAction( - coll, -@@ -284,8 +303,7 @@ - ) - ); - } -- if ( ce.isDoupdate() ) { -- interceptor.onCollectionUpdate( coll, ce.getLoadedKey() ); -+ if ( ce.isDoupdate() && interceptor.onCollectionUpdate( coll, ce.getLoadedKey() ) ) { - actionQueue.addAction( - new CollectionUpdateAction( - coll, -Index: hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/DocumentInterceptor.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/DocumentInterceptor.java b/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/DocumentInterceptor.java ---- a/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/DocumentInterceptor.java (revision dca2cabaf26fafb30baead8ba0e3d7229fb67c65) -+++ b/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/DocumentInterceptor.java (revision 1d894ccfd3e5740a5a764ac95e71e1f73fd454df) -@@ -94,8 +94,4 @@ - return sql; - } - -- public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {} -- public void onCollectionRemove(Object collection, Serializable key) throws CallbackException {} -- public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {} -- - } -Index: hibernate-core/src/test/java/org/hibernate/test/mixed/DocumentInterceptor.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/hibernate-core/src/test/java/org/hibernate/test/mixed/DocumentInterceptor.java b/hibernate-core/src/test/java/org/hibernate/test/mixed/DocumentInterceptor.java ---- a/hibernate-core/src/test/java/org/hibernate/test/mixed/DocumentInterceptor.java (revision dca2cabaf26fafb30baead8ba0e3d7229fb67c65) -+++ b/hibernate-core/src/test/java/org/hibernate/test/mixed/DocumentInterceptor.java (revision 1d894ccfd3e5740a5a764ac95e71e1f73fd454df) -@@ -111,12 +111,4 @@ - return sql; - } - -- public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException { -- } -- -- public void onCollectionRemove(Object collection, Serializable key) throws CallbackException { -- } -- -- public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException { -- } - } diff --git a/framework/patches/hibernate-6.6.31-patch-play.README b/framework/patches/hibernate-6.6.31-patch-play.README new file mode 100644 index 0000000000..ef6fab6fe4 --- /dev/null +++ b/framework/patches/hibernate-6.6.31-patch-play.README @@ -0,0 +1,6 @@ +---- +Download Hibernate 6.6.31.Final source code, apply the patch, and build with gradle (tip use export GRADLE_OPTS=-Xmx1G -XX:MaxPermSize=512m) +---- + +DRY RUN -> patch --dry-run -p1 -i hibernate-6.6.31-patch-play.patch +APPLY -> patch -p1 -i hibernate-6.6.31-patch-play.patch diff --git a/framework/patches/hibernate-6.6.31-patch-play.patch b/framework/patches/hibernate-6.6.31-patch-play.patch new file mode 100644 index 0000000000..6120093a93 --- /dev/null +++ b/framework/patches/hibernate-6.6.31-patch-play.patch @@ -0,0 +1,388 @@ +Subject: [PATCH] play1 patch +--- +Index: hibernate-core/src/main/java/org/hibernate/Interceptor.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/hibernate-core/src/main/java/org/hibernate/Interceptor.java b/hibernate-core/src/main/java/org/hibernate/Interceptor.java +--- a/hibernate-core/src/main/java/org/hibernate/Interceptor.java (revision 2a8ea797ca4b4b158cc74bd2165fb54c52495f4f) ++++ b/hibernate-core/src/main/java/org/hibernate/Interceptor.java (revision 84defc90227c02ee1583235e331dd445fd9567b6) +@@ -333,7 +333,9 @@ + * @deprecated use {@link #onCollectionRecreate(Object, Object)} + */ + @Deprecated(since = "6.0") +- default void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {} ++ default boolean onCollectionRecreate(Object collection, Serializable key) throws CallbackException { ++ return true; ++ } + + /** + * Called before a collection is (re)created. +@@ -343,10 +345,11 @@ + * + * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. + */ +- default void onCollectionRecreate(Object collection, Object key) throws CallbackException { ++ default boolean onCollectionRecreate(Object collection, Object key) throws CallbackException { + if (key instanceof Serializable) { +- onCollectionRecreate(collection, (Serializable) key); ++ return onCollectionRecreate(collection, (Serializable) key); + } ++ return true; + } + + /** +@@ -360,7 +363,9 @@ + * @deprecated use {@link #onCollectionRemove(Object, Object)} + */ + @Deprecated(since = "6.0") +- default void onCollectionRemove(Object collection, Serializable key) throws CallbackException {} ++ default boolean onCollectionRemove(Object collection, Serializable key) throws CallbackException { ++ return true; ++ } + + /** + * Called before a collection is deleted. +@@ -370,10 +375,11 @@ + * + * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. + */ +- default void onCollectionRemove(Object collection, Object key) throws CallbackException { ++ default boolean onCollectionRemove(Object collection, Object key) throws CallbackException { + if (key instanceof Serializable) { +- onCollectionRemove(collection, (Serializable) key); ++ return onCollectionRemove(collection, (Serializable) key); + } ++ return true; + } + + /** +@@ -387,7 +393,9 @@ + * @deprecated use {@link #onCollectionUpdate(Object, Object)} + */ + @Deprecated(since = "6.0") +- default void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {} ++ default boolean onCollectionUpdate(Object collection, Serializable key) throws CallbackException { ++ return true; ++ } + + /** + * Called before a collection is updated. +@@ -397,10 +405,11 @@ + * + * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. + */ +- default void onCollectionUpdate(Object collection, Object key) throws CallbackException { ++ default boolean onCollectionUpdate(Object collection, Object key) throws CallbackException { + if (key instanceof Serializable) { +- onCollectionUpdate(collection, (Serializable) key); ++ return onCollectionUpdate(collection, (Serializable) key); + } ++ return true; + } + /** + * Called before a flush. +Index: hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java +--- a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java (revision 2a8ea797ca4b4b158cc74bd2165fb54c52495f4f) ++++ b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractFlushingEventListener.java (revision 84defc90227c02ee1583235e331dd445fd9567b6) +@@ -152,8 +152,29 @@ + final PersistContext context = getContext( session ); + //safe from concurrent modification because of how concurrentEntries() is implemented on IdentityMap + for ( Map.Entry me : persistenceContext.reentrantSafeEntityEntries() ) { +-// for ( Map.Entry me : IdentityMap.concurrentEntries( persistenceContext.getEntityEntries() ) ) { + final EntityEntry entry = me.getValue(); ++ ++ // This entity will be saved? ++ boolean willBeSaved = true; ++ try { ++ Object o = me.getKey(); ++ Class c = o.getClass(); ++ Class jpaBase = Class.forName("play.db.jpa.JPABase"); ++ while (!c.equals(Object.class)) { ++ if (c.equals(jpaBase)) { ++ willBeSaved = (Boolean) jpaBase.getDeclaredField("willBeSaved").get(o); ++ break; ++ } ++ c = c.getSuperclass(); ++ } ++ if (!willBeSaved) { ++ continue; ++ } ++ } ++ catch(ReflectiveOperationException ignore) { ++ // do nothing ++ } ++ + if ( flushable( entry ) ) { + cascadeOnFlush( session, entry.getPersister(), me.getKey(), context ); + } +@@ -328,8 +349,7 @@ + final Interceptor interceptor = session.getInterceptor(); + persistenceContext.forEachCollectionEntry( + (coll, ce) -> { +- if ( ce.isDorecreate() ) { +- interceptor.onCollectionRecreate( coll, ce.getCurrentKey() ); ++ if ( ce.isDorecreate() && interceptor.onCollectionRecreate( coll, ce.getCurrentKey() ) ) { + actionQueue.addAction( + new CollectionRecreateAction( + coll, +@@ -339,8 +359,7 @@ + ) + ); + } +- if ( ce.isDoremove() ) { +- interceptor.onCollectionRemove( coll, ce.getLoadedKey() ); ++ if ( ce.isDoremove() && interceptor.onCollectionRemove( coll, ce.getLoadedKey() ) ) { + if ( !skipRemoval( session, ce.getLoadedPersister(), ce.getLoadedKey() ) ) { + actionQueue.addAction( + new CollectionRemoveAction( +@@ -353,8 +372,7 @@ + ); + } + } +- if ( ce.isDoupdate() ) { +- interceptor.onCollectionUpdate( coll, ce.getLoadedKey() ); ++ if ( ce.isDoupdate() && interceptor.onCollectionUpdate( coll, ce.getLoadedKey() ) ) { + actionQueue.addAction( + new CollectionUpdateAction( + coll, +Index: hibernate-core/src/main/java/org/hibernate/internal/EmptyInterceptor.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/hibernate-core/src/main/java/org/hibernate/internal/EmptyInterceptor.java b/hibernate-core/src/main/java/org/hibernate/internal/EmptyInterceptor.java +--- a/hibernate-core/src/main/java/org/hibernate/internal/EmptyInterceptor.java (revision 2a8ea797ca4b4b158cc74bd2165fb54c52495f4f) ++++ b/hibernate-core/src/main/java/org/hibernate/internal/EmptyInterceptor.java (revision 84defc90227c02ee1583235e331dd445fd9567b6) +@@ -28,45 +28,9 @@ + private EmptyInterceptor() { + } + +- @Override +- public boolean onLoad(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) { +- return false; +- } +- +- @Override +- public boolean onFlushDirty( +- Object entity, +- Object id, +- Object[] currentState, +- Object[] previousState, +- String[] propertyNames, +- Type[] types) { +- return false; +- } +- + @Override + public boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) { + return false; + } + +- @Override +- public void onDelete(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) { +- } +- +- @Override +- public int[] findDirty( +- Object entity, +- Object id, +- Object[] currentState, +- Object[] previousState, +- String[] propertyNames, +- Type[] types) { +- return null; +- } +- +- @Override +- public Object getEntity(String entityName, Object id) { +- return null; +- } +- + } +Index: hibernate-core/src/test/java/org/hibernate/orm/test/interfaceproxy/DocumentInterceptor.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/interfaceproxy/DocumentInterceptor.java b/hibernate-core/src/test/java/org/hibernate/orm/test/interfaceproxy/DocumentInterceptor.java +--- a/hibernate-core/src/test/java/org/hibernate/orm/test/interfaceproxy/DocumentInterceptor.java (revision 2a8ea797ca4b4b158cc74bd2165fb54c52495f4f) ++++ b/hibernate-core/src/test/java/org/hibernate/orm/test/interfaceproxy/DocumentInterceptor.java (revision 84defc90227c02ee1583235e331dd445fd9567b6) +@@ -10,12 +10,9 @@ + + import java.io.Serializable; + import java.util.Calendar; +-import java.util.Iterator; + + import org.hibernate.CallbackException; + import org.hibernate.Interceptor; +-import org.hibernate.Transaction; +-import org.hibernate.metamodel.RepresentationMode; + import org.hibernate.type.Type; + + /** +@@ -23,11 +20,6 @@ + */ + public class DocumentInterceptor implements Interceptor { + +- public boolean onLoad(Object entity, Serializable id, Object[] state, +- String[] propertyNames, Type[] types) throws CallbackException { +- return false; +- } +- + public boolean onFlushDirty(Object entity, Serializable id, + Object[] currentState, Object[] previousState, + String[] propertyNames, Type[] types) throws CallbackException { +@@ -51,48 +43,4 @@ + } + } + +- public void onDelete(Object entity, Serializable id, Object[] state, +- String[] propertyNames, Type[] types) throws CallbackException { +- +- } +- +- public void preFlush(Iterator entities) throws CallbackException { +- +- } +- +- public void postFlush(Iterator entities) throws CallbackException { +- +- } +- +- public Boolean isTransient(Object entity) { +- return null; +- } +- +- public int[] findDirty(Object entity, Serializable id, +- Object[] currentState, Object[] previousState, +- String[] propertyNames, Type[] types) { +- return null; +- } +- +- public Object instantiate(String entityName, RepresentationMode entityMode, Object id) throws CallbackException { +- return null; +- } +- +- public String getEntityName(Object object) throws CallbackException { +- return null; +- } +- +- public Object getEntity(String entityName, Serializable id) +- throws CallbackException { +- return null; +- } +- +- public void afterTransactionBegin(Transaction tx) {} +- public void afterTransactionCompletion(Transaction tx) {} +- public void beforeTransactionCompletion(Transaction tx) {} +- +- public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {} +- public void onCollectionRemove(Object collection, Serializable key) throws CallbackException {} +- public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {} +- + } +Index: hibernate-core/src/test/java/org/hibernate/orm/test/mixed/DocumentInterceptor.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mixed/DocumentInterceptor.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mixed/DocumentInterceptor.java +--- a/hibernate-core/src/test/java/org/hibernate/orm/test/mixed/DocumentInterceptor.java (revision 2a8ea797ca4b4b158cc74bd2165fb54c52495f4f) ++++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mixed/DocumentInterceptor.java (revision 84defc90227c02ee1583235e331dd445fd9567b6) +@@ -10,12 +10,9 @@ + + import java.io.Serializable; + import java.util.Calendar; +-import java.util.Iterator; + + import org.hibernate.CallbackException; + import org.hibernate.Interceptor; +-import org.hibernate.Transaction; +-import org.hibernate.metamodel.RepresentationMode; + import org.hibernate.type.Type; + + /** +@@ -23,14 +20,6 @@ + */ + public class DocumentInterceptor implements Interceptor { + +- +- public boolean onLoad( +- Object entity, Serializable id, Object[] state, +- String[] propertyNames, Type[] types +- ) throws CallbackException { +- return false; +- } +- + public boolean onFlushDirty( + Object entity, Serializable id, + Object[] currentState, Object[] previousState, +@@ -58,61 +47,4 @@ + } + } + +- public void onDelete( +- Object entity, Serializable id, Object[] state, +- String[] propertyNames, Type[] types +- ) throws CallbackException { +- +- } +- +- public void preFlush(Iterator entities) throws CallbackException { +- +- } +- +- public void postFlush(Iterator entities) throws CallbackException { +- +- } +- +- public Boolean isTransient(Object entity) { +- return null; +- } +- +- public int[] findDirty( +- Object entity, Serializable id, +- Object[] currentState, Object[] previousState, +- String[] propertyNames, Type[] types +- ) { +- return null; +- } +- +- public Object instantiate(String entityName, RepresentationMode entityMode, Object id) throws CallbackException { +- return null; +- } +- +- public String getEntityName(Object object) throws CallbackException { +- return null; +- } +- +- public Object getEntity(String entityName, Serializable id) +- throws CallbackException { +- return null; +- } +- +- public void afterTransactionBegin(Transaction tx) { +- } +- +- public void afterTransactionCompletion(Transaction tx) { +- } +- +- public void beforeTransactionCompletion(Transaction tx) { +- } +- +- public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException { +- } +- +- public void onCollectionRemove(Object collection, Serializable key) throws CallbackException { +- } +- +- public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException { +- } + } diff --git a/framework/patches/oval-4.0.0_from_3.2.1.patch b/framework/patches/oval-4.0.0_from_3.2.1.patch new file mode 100644 index 0000000000..36bd26aa93 --- /dev/null +++ b/framework/patches/oval-4.0.0_from_3.2.1.patch @@ -0,0 +1,439 @@ + USERGUIDE.md | 64 +++++++-------- + pom.xml | 18 ++-- + .../BeanValidationAnnotationsConfigurer.java | 95 +++++++++++----------- + .../annotation/JPAAnnotationsConfigurer.java | 21 ++--- + src/main/resources/META-INF/MANIFEST.MF | 2 +- + .../oval/test/guard/ChainedConstructorsTest.java | 3 +- + .../net/sf/oval/test/guard/InheritanceTest.java | 3 +- + .../SpringAOPAllianceBeanValidationTest.java | 5 +- + .../BeanValidationAnnotationsConfigurerTest.java | 11 +-- + .../validator/JPAAnnotationsConfigurerTest.java | 14 ++-- + 10 files changed, 121 insertions(+), 115 deletions(-) + +diff --git a/USERGUIDE.md b/USERGUIDE.md +index c42ed16c..36a985f2 100644 +--- a/USERGUIDE.md ++++ b/USERGUIDE.md +@@ -260,14 +260,14 @@ ### Interpreting EJB3 JPA annotations + OVal comes with a configurer that is capable of translating certain EJB3 JPA annotations into equivalent OVal constraints. + The `net.sf.oval.configuration.annotation.JPAAnnotationsConfigurer` interprets the EJB3 JPA annotations as follows: + +- @jakarta.persistence.Basic(optional=false) => @net.sf.oval.constraint.NotNull +- @jakarta.persistence.OneToOne(optional=false) => @net.sf.oval.constraint.NotNull +- @jakarta.persistence.OneToOne => @net.sf.oval.constraint.AssertValid +- @jakarta.persistence.OneToMany => @net.sf.oval.constraint.AssertValid +- @jakarta.persistence.ManyToOne(optional=false) => @net.sf.oval.constraint.NotNull +- @jakarta.persistence.ManyToOne => @net.sf.oval.constraint.AssertValid +- @jakarta.persistence.Column(nullable=false) => @net.sf.oval.constraint.NotNull (only applied for fields not annotated with @javax.persistence.GeneratedValue or @javax.persistence.Version) +- @jakarta.persistence.Column(length=5) => @net.sf.oval.constraint.Length ++ @javax.persistence.Basic(optional=false) => @net.sf.oval.constraint.NotNull ++ @javax.persistence.OneToOne(optional=false) => @net.sf.oval.constraint.NotNull ++ @javax.persistence.OneToOne => @net.sf.oval.constraint.AssertValid ++ @javax.persistence.OneToMany => @net.sf.oval.constraint.AssertValid ++ @javax.persistence.ManyToOne(optional=false) => @net.sf.oval.constraint.NotNull ++ @javax.persistence.ManyToOne => @net.sf.oval.constraint.AssertValid ++ @javax.persistence.Column(nullable=false) => @net.sf.oval.constraint.NotNull (only applied for fields not annotated with @javax.persistence.GeneratedValue or @javax.persistence.Version) ++ @javax.persistence.Column(length=5) => @net.sf.oval.constraint.Length + + ```java + @Entity +@@ -303,33 +303,33 @@ ### Interpreting EJB3 JPA annotations + ### Interpreting Bean Validation annotations + + OVal itself is not a JSR303/JSR380 compliant bean validation framework. However it now comes with a configurer +-that can translate the standard Bean Validation constraints (jakarta.validation.constraints.\*) into equivalent ++that can translate the standard Bean Validation constraints (javax.validation.constraints.\*) into equivalent + OVal constraints. The `net.sf.oval.configuration.annotation.BeanValidationAnnotationsConfigurer` + interprets the annotations as follows: + +- @jakarta.validation.constraints.AssertFalse => @net.sf.oval.constraint.AssertFalse +- @jakarta.validation.constraints.AssertTrue => @net.sf.oval.constraint.AssertTrue +- @jakarta.validation.constraints.DecimalMax => @net.sf.oval.constraint.Max +- @jakarta.validation.constraints.DecimalMin => @net.sf.oval.constraint.Min +- @jakarta.validation.constraints.Digits => @net.sf.oval.constraint.Digits +- @jakarta.validation.constraints.Email => @net.sf.oval.constraint.Email +- @jakarta.validation.constraints.Future => @net.sf.oval.constraint.Future +- @jakarta.validation.constraints.FutureOrPresent => @net.sf.oval.constraint.Future(min="now") +- @jakarta.validation.constraints.Max => @net.sf.oval.constraint.Max +- @jakarta.validation.constraints.Min => @net.sf.oval.constraint.Min +- @jakarta.validation.constraints.Negative => @net.sf.oval.constraint.Max(max=0, inclusive=false) +- @jakarta.validation.constraints.NegativeOrZero => @net.sf.oval.constraint.Max(max=0, inclusive=true) +- @jakarta.validation.constraints.NotBlank => @net.sf.oval.constraint.NotNull+NotBlank +- @jakarta.validation.constraints.NotEmpty => @net.sf.oval.constraint.NotNull+NotEmpty +- @jakarta.validation.constraints.NotNull => @net.sf.oval.constraint.NotNull +- @jakarta.validation.constraints.Null => @net.sf.oval.constraint.Null +- @jakarta.validation.constraints.Past => @net.sf.oval.constraint.Past +- @jakarta.validation.constraints.PastOrPresent => @net.sf.oval.constraint.Past(max="now") +- @jakarta.validation.constraints.Pattern => @net.sf.oval.constraint.Pattern +- @jakarta.validation.constraints.Size => @net.sf.oval.constraint.Size +- @jakarta.validation.constraints.Positive => @net.sf.oval.constraint.Min(min=0, inclusive=false) +- @jakarta.validation.constraints.PositiveOrZero => @net.sf.oval.constraint.NotNegative +- @jakarta.validation.constraints.Valid => @net.sf.oval.constraint.AssertValid ++ @javax.validation.constraints.AssertFalse => @net.sf.oval.constraint.AssertFalse ++ @javax.validation.constraints.AssertTrue => @net.sf.oval.constraint.AssertTrue ++ @javax.validation.constraints.DecimalMax => @net.sf.oval.constraint.Max ++ @javax.validation.constraints.DecimalMin => @net.sf.oval.constraint.Min ++ @javax.validation.constraints.Digits => @net.sf.oval.constraint.Digits ++ @javax.validation.constraints.Email => @net.sf.oval.constraint.Email ++ @javax.validation.constraints.Future => @net.sf.oval.constraint.Future ++ @javax.validation.constraints.FutureOrPresent => @net.sf.oval.constraint.Future(min="now") ++ @javax.validation.constraints.Max => @net.sf.oval.constraint.Max ++ @javax.validation.constraints.Min => @net.sf.oval.constraint.Min ++ @javax.validation.constraints.Negative => @net.sf.oval.constraint.Max(max=0, inclusive=false) ++ @javax.validation.constraints.NegativeOrZero => @net.sf.oval.constraint.Max(max=0, inclusive=true) ++ @javax.validation.constraints.NotBlank => @net.sf.oval.constraint.NotNull+NotBlank ++ @javax.validation.constraints.NotEmpty => @net.sf.oval.constraint.NotNull+NotEmpty ++ @javax.validation.constraints.NotNull => @net.sf.oval.constraint.NotNull ++ @javax.validation.constraints.Null => @net.sf.oval.constraint.Null ++ @javax.validation.constraints.Past => @net.sf.oval.constraint.Past ++ @javax.validation.constraints.PastOrPresent => @net.sf.oval.constraint.Past(max="now") ++ @javax.validation.constraints.Pattern => @net.sf.oval.constraint.Pattern ++ @javax.validation.constraints.Size => @net.sf.oval.constraint.Size ++ @javax.validation.constraints.Positive => @net.sf.oval.constraint.Min(min=0, inclusive=false) ++ @javax.validation.constraints.PositiveOrZero => @net.sf.oval.constraint.NotNegative ++ @javax.validation.constraints.Valid => @net.sf.oval.constraint.AssertValid + + ```java + public class MyEntity { +diff --git a/pom.xml b/pom.xml +index 76ef1902..4d756c5a 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -15,7 +15,7 @@ + + net.sf.oval + oval +- 4.0.0 ++ 3.2.2-SNAPSHOT + jar + + +@@ -88,7 +88,7 @@ + + true + +- 11 ++ 8 + + + 1.9.7 +@@ -363,19 +363,19 @@ + + commons-logging + commons-logging +- 1.3.5 ++ 1.2 + true + + + org.slf4j + slf4j-api +- 2.0.17 ++ 1.7.32 + true + + + com.thoughtworks.xstream + xstream +- 1.4.21 ++ 1.4.18 + true + + +@@ -453,7 +453,7 @@ + + org.apache.commons + commons-jexl3 +- 3.5.0 ++ 3.2.1 + true + + +@@ -469,9 +469,9 @@ + true + + +- jakarta.persistence +- jakarta.persistence-api +- 3.1.0 ++ javax.persistence ++ persistence-api ++ 1.0.2 + true + + +diff --git a/src/main/java/net/sf/oval/configuration/annotation/BeanValidationAnnotationsConfigurer.java b/src/main/java/net/sf/oval/configuration/annotation/BeanValidationAnnotationsConfigurer.java +index 93d31eb5..91adfd83 100644 +--- a/src/main/java/net/sf/oval/configuration/annotation/BeanValidationAnnotationsConfigurer.java ++++ b/src/main/java/net/sf/oval/configuration/annotation/BeanValidationAnnotationsConfigurer.java +@@ -16,29 +16,30 @@ + import java.util.List; + import java.util.Map; + +-import jakarta.validation.Valid; +-import jakarta.validation.constraints.AssertFalse; +-import jakarta.validation.constraints.AssertTrue; +-import jakarta.validation.constraints.DecimalMax; +-import jakarta.validation.constraints.DecimalMin; +-import jakarta.validation.constraints.Digits; +-import jakarta.validation.constraints.Future; +-import jakarta.validation.constraints.FutureOrPresent; +-import jakarta.validation.constraints.Max; +-import jakarta.validation.constraints.Min; +-import jakarta.validation.constraints.Negative; +-import jakarta.validation.constraints.NegativeOrZero; +-import jakarta.validation.constraints.NotBlank; +-import jakarta.validation.constraints.NotEmpty; +-import jakarta.validation.constraints.NotNull; +-import jakarta.validation.constraints.Null; +-import jakarta.validation.constraints.Past; +-import jakarta.validation.constraints.PastOrPresent; +-import jakarta.validation.constraints.Pattern; +-import jakarta.validation.constraints.Pattern.Flag; +-import jakarta.validation.constraints.Positive; +-import jakarta.validation.constraints.PositiveOrZero; +-import jakarta.validation.constraints.Size; ++import javax.validation.Valid; ++import javax.validation.constraints.AssertFalse; ++import javax.validation.constraints.AssertTrue; ++import javax.validation.constraints.DecimalMax; ++import javax.validation.constraints.DecimalMin; ++import javax.validation.constraints.Digits; ++import javax.validation.constraints.Future; ++import javax.validation.constraints.FutureOrPresent; ++import javax.validation.constraints.Max; ++import javax.validation.constraints.Min; ++import javax.validation.constraints.Negative; ++import javax.validation.constraints.NegativeOrZero; ++import javax.validation.constraints.NotBlank; ++import javax.validation.constraints.NotEmpty; ++import javax.validation.constraints.NotNull; ++import javax.validation.constraints.Null; ++import javax.validation.constraints.Past; ++import javax.validation.constraints.PastOrPresent; ++import javax.validation.constraints.Pattern; ++import javax.validation.constraints.Pattern.Flag; ++import javax.validation.constraints.Positive; ++import javax.validation.constraints.PositiveOrZero; ++import javax.validation.constraints.Size; ++ + import net.sf.oval.Check; + import net.sf.oval.ConstraintTarget; + import net.sf.oval.collection.CollectionFactory; +@@ -78,33 +79,33 @@ + *

+ * JSR-303: + *

    +- *
  • jakarta.validation.constraints.AssertFalse => net.sf.oval.constraint.AssertFalseCheck +- *
  • jakarta.validation.constraints.AssertTrue => net.sf.oval.constraint.AssertTrueCheck +- *
  • jakarta.validation.constraints.DecimalMax => net.sf.oval.constraint.MaxCheck +- *
  • jakarta.validation.constraints.DecimalMin => net.sf.oval.constraint.MinCheck +- *
  • jakarta.validation.constraints.Digits => net.sf.oval.constraint.DigitsCheck +- *
  • jakarta.validation.constraints.Future => net.sf.oval.constraint.FutureCheck +- *
  • jakarta.validation.constraints.Max => net.sf.oval.constraint.MaxCheck +- *
  • jakarta.validation.constraints.Min => net.sf.oval.constraint.MinCheck +- *
  • jakarta.validation.constraints.NotNull => net.sf.oval.constraint.NotNullCheck +- *
  • jakarta.validation.constraints.Null => net.sf.oval.constraint.AssertNullCheck +- *
  • jakarta.validation.constraints.Past => net.sf.oval.constraint.PastCheck +- *
  • jakarta.validation.constraints.Pattern => net.sf.oval.constraint.PatternCheck +- *
  • jakarta.validation.constraints.Size => net.sf.oval.constraint.SizeCheck +- *
  • jakarta.validation.Valid => net.sf.oval.constraint.AssertValidCheck ++ *
  • javax.validation.constraints.AssertFalse => net.sf.oval.constraint.AssertFalseCheck ++ *
  • javax.validation.constraints.AssertTrue => net.sf.oval.constraint.AssertTrueCheck ++ *
  • javax.validation.constraints.DecimalMax => net.sf.oval.constraint.MaxCheck ++ *
  • javax.validation.constraints.DecimalMin => net.sf.oval.constraint.MinCheck ++ *
  • javax.validation.constraints.Digits => net.sf.oval.constraint.DigitsCheck ++ *
  • javax.validation.constraints.Future => net.sf.oval.constraint.FutureCheck ++ *
  • javax.validation.constraints.Max => net.sf.oval.constraint.MaxCheck ++ *
  • javax.validation.constraints.Min => net.sf.oval.constraint.MinCheck ++ *
  • javax.validation.constraints.NotNull => net.sf.oval.constraint.NotNullCheck ++ *
  • javax.validation.constraints.Null => net.sf.oval.constraint.AssertNullCheck ++ *
  • javax.validation.constraints.Past => net.sf.oval.constraint.PastCheck ++ *
  • javax.validation.constraints.Pattern => net.sf.oval.constraint.PatternCheck ++ *
  • javax.validation.constraints.Size => net.sf.oval.constraint.SizeCheck ++ *
  • javax.validation.Valid => net.sf.oval.constraint.AssertValidCheck + *
+ *

+ * JSR-380: + *

    +- *
  • jakarta.validation.constraints.Email => net.sf.oval.constraint.EmailCheck +- *
  • jakarta.validation.constraints.FutureOrPresent => net.sf.oval.constraint.DateRangeCheck(min="now") +- *
  • jakarta.validation.constraints.Negative => net.sf.oval.constraint.MaxCheck(max=0, inclusive=false) +- *
  • jakarta.validation.constraints.NegativeOrZero => net.sf.oval.constraint.MaxCheck(max=0, inclusive=true) +- *
  • jakarta.validation.constraints.NotBlank => net.sf.oval.constraint.NotBlankCheck +- *
  • jakarta.validation.constraints.NotEmpty => net.sf.oval.constraint.NotEmptyCheck +- *
  • jakarta.validation.constraints.PastOrPresent => net.sf.oval.constraint.DateRange(max="now") +- *
  • jakarta.validation.constraints.Positive => net.sf.oval.constraint.MinCheck(min=0, inclusive=false) +- *
  • jakarta.validation.constraints.PositiveOrZero => net.sf.oval.constraint.NotNegativeCheck ++ *
  • javax.validation.constraints.Email => net.sf.oval.constraint.EmailCheck ++ *
  • javax.validation.constraints.FutureOrPresent => net.sf.oval.constraint.DateRangeCheck(min="now") ++ *
  • javax.validation.constraints.Negative => net.sf.oval.constraint.MaxCheck(max=0, inclusive=false) ++ *
  • javax.validation.constraints.NegativeOrZero => net.sf.oval.constraint.MaxCheck(max=0, inclusive=true) ++ *
  • javax.validation.constraints.NotBlank => net.sf.oval.constraint.NotBlankCheck ++ *
  • javax.validation.constraints.NotEmpty => net.sf.oval.constraint.NotEmptyCheck ++ *
  • javax.validation.constraints.PastOrPresent => net.sf.oval.constraint.DateRange(max="now") ++ *
  • javax.validation.constraints.Positive => net.sf.oval.constraint.MinCheck(min=0, inclusive=false) ++ *
  • javax.validation.constraints.PositiveOrZero => net.sf.oval.constraint.NotNegativeCheck + *
+ * + * @author Sebastian Thomschke +@@ -440,7 +441,7 @@ protected void initializeChecks(final Annotation anno, final Collection c + /* + * process bean validation annotations + */ +- if (annoClass.getAnnotation(jakarta.validation.Constraint.class) != null || anno instanceof Valid) { ++ if (annoClass.getAnnotation(javax.validation.Constraint.class) != null || anno instanceof Valid) { + + final Check[] mappedChecks = CONSTRAINT_MAPPER.map(anno); + +diff --git a/src/main/java/net/sf/oval/configuration/annotation/JPAAnnotationsConfigurer.java b/src/main/java/net/sf/oval/configuration/annotation/JPAAnnotationsConfigurer.java +index a60e09f7..2d7bf03e 100644 +--- a/src/main/java/net/sf/oval/configuration/annotation/JPAAnnotationsConfigurer.java ++++ b/src/main/java/net/sf/oval/configuration/annotation/JPAAnnotationsConfigurer.java +@@ -13,16 +13,17 @@ + import java.util.Collection; + import java.util.List; + +-import jakarta.persistence.Basic; +-import jakarta.persistence.Column; +-import jakarta.persistence.Enumerated; +-import jakarta.persistence.GeneratedValue; +-import jakarta.persistence.Lob; +-import jakarta.persistence.ManyToMany; +-import jakarta.persistence.ManyToOne; +-import jakarta.persistence.OneToMany; +-import jakarta.persistence.OneToOne; +-import jakarta.persistence.Version; ++import javax.persistence.Basic; ++import javax.persistence.Column; ++import javax.persistence.Enumerated; ++import javax.persistence.GeneratedValue; ++import javax.persistence.Lob; ++import javax.persistence.ManyToMany; ++import javax.persistence.ManyToOne; ++import javax.persistence.OneToMany; ++import javax.persistence.OneToOne; ++import javax.persistence.Version; ++ + import net.sf.oval.Check; + import net.sf.oval.collection.CollectionFactory; + import net.sf.oval.configuration.Configurer; +diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF +index d1ff14f3..ba6d0736 100644 +--- a/src/main/resources/META-INF/MANIFEST.MF ++++ b/src/main/resources/META-INF/MANIFEST.MF +@@ -20,7 +20,7 @@ Require-Bundle: org.aspectj.runtime;bundle-version="${org.aspectj:aspectjrt:jar. + Export-Package: net.sf.oval, + net.sf.oval.collection, + net.sf.oval.configuration, +- net.sf.oval.configuration.annotation;uses:="jakarta.persistence", ++ net.sf.oval.configuration.annotation;uses:="javax.persistence", + net.sf.oval.configuration.pojo, + net.sf.oval.configuration.pojo.elements, + net.sf.oval.configuration.xml, +diff --git a/src/test/java/net/sf/oval/test/guard/ChainedConstructorsTest.java b/src/test/java/net/sf/oval/test/guard/ChainedConstructorsTest.java +index 11c630fe..9217fc4b 100644 +--- a/src/test/java/net/sf/oval/test/guard/ChainedConstructorsTest.java ++++ b/src/test/java/net/sf/oval/test/guard/ChainedConstructorsTest.java +@@ -6,9 +6,10 @@ + + import static org.assertj.core.api.Assertions.*; + ++import javax.validation.ConstraintViolationException; ++ + import org.junit.Test; + +-import jakarta.validation.ConstraintViolationException; + import net.sf.oval.constraint.NotNull; + import net.sf.oval.guard.Guarded; + +diff --git a/src/test/java/net/sf/oval/test/guard/InheritanceTest.java b/src/test/java/net/sf/oval/test/guard/InheritanceTest.java +index f5884c77..4ddb3490 100644 +--- a/src/test/java/net/sf/oval/test/guard/InheritanceTest.java ++++ b/src/test/java/net/sf/oval/test/guard/InheritanceTest.java +@@ -6,9 +6,10 @@ + + import static org.assertj.core.api.Assertions.*; + ++import javax.validation.ConstraintViolationException; ++ + import org.junit.Test; + +-import jakarta.validation.ConstraintViolationException; + import net.sf.oval.constraint.AssertFieldConstraints; + import net.sf.oval.constraint.NotNull; + import net.sf.oval.exception.ConstraintsViolatedException; +diff --git a/src/test/java/net/sf/oval/test/integration/spring/SpringAOPAllianceBeanValidationTest.java b/src/test/java/net/sf/oval/test/integration/spring/SpringAOPAllianceBeanValidationTest.java +index 86f41538..7d2876b7 100644 +--- a/src/test/java/net/sf/oval/test/integration/spring/SpringAOPAllianceBeanValidationTest.java ++++ b/src/test/java/net/sf/oval/test/integration/spring/SpringAOPAllianceBeanValidationTest.java +@@ -6,11 +6,12 @@ + + import static org.assertj.core.api.Assertions.*; + ++import javax.validation.constraints.NotNull; ++import javax.validation.constraints.Size; ++ + import org.junit.Test; + import org.springframework.aop.framework.ProxyFactory; + +-import jakarta.validation.constraints.NotNull; +-import jakarta.validation.constraints.Size; + import net.sf.oval.configuration.annotation.BeanValidationAnnotationsConfigurer; + import net.sf.oval.exception.ConstraintsViolatedException; + import net.sf.oval.guard.Guard; +diff --git a/src/test/java/net/sf/oval/test/validator/BeanValidationAnnotationsConfigurerTest.java b/src/test/java/net/sf/oval/test/validator/BeanValidationAnnotationsConfigurerTest.java +index 9294c850..5ca4e8e9 100644 +--- a/src/test/java/net/sf/oval/test/validator/BeanValidationAnnotationsConfigurerTest.java ++++ b/src/test/java/net/sf/oval/test/validator/BeanValidationAnnotationsConfigurerTest.java +@@ -13,13 +13,14 @@ + import java.util.List; + import java.util.Map; + ++import javax.persistence.Entity; ++import javax.validation.Valid; ++import javax.validation.constraints.NotEmpty; ++import javax.validation.constraints.NotNull; ++import javax.validation.constraints.Size; ++ + import org.junit.Test; + +-import jakarta.persistence.Entity; +-import jakarta.validation.Valid; +-import jakarta.validation.constraints.NotEmpty; +-import jakarta.validation.constraints.NotNull; +-import jakarta.validation.constraints.Size; + import net.sf.oval.ConstraintViolation; + import net.sf.oval.Validator; + import net.sf.oval.configuration.annotation.BeanValidationAnnotationsConfigurer; +diff --git a/src/test/java/net/sf/oval/test/validator/JPAAnnotationsConfigurerTest.java b/src/test/java/net/sf/oval/test/validator/JPAAnnotationsConfigurerTest.java +index 3f827e84..0fba6ece 100644 +--- a/src/test/java/net/sf/oval/test/validator/JPAAnnotationsConfigurerTest.java ++++ b/src/test/java/net/sf/oval/test/validator/JPAAnnotationsConfigurerTest.java +@@ -10,19 +10,19 @@ + import java.util.Collection; + import java.util.List; + ++import javax.persistence.Basic; ++import javax.persistence.Column; ++import javax.persistence.Entity; ++import javax.persistence.ManyToOne; ++import javax.persistence.OneToMany; ++import javax.persistence.OneToOne; ++ + import org.junit.Test; + +-import jakarta.persistence.Basic; +-import jakarta.persistence.Column; +-import jakarta.persistence.Entity; +-import jakarta.persistence.ManyToOne; +-import jakarta.persistence.OneToMany; +-import jakarta.persistence.OneToOne; + import net.sf.oval.ConstraintViolation; + import net.sf.oval.Validator; + import net.sf.oval.configuration.annotation.JPAAnnotationsConfigurer; + +- + /** + * @author Sebastian Thomschke + * diff --git a/framework/patches/oval-4.0.0_from_3.2.1.patch.README b/framework/patches/oval-4.0.0_from_3.2.1.patch.README new file mode 100644 index 0000000000..9b48ad6791 --- /dev/null +++ b/framework/patches/oval-4.0.0_from_3.2.1.patch.README @@ -0,0 +1,6 @@ +---- +cf https://github.com/xael-fry/oval/pull/2 +---- + +DRY RUN -> patch --dry-run -p1 -i oval-3.2.1.patch +APPLY -> patch -p1 -i oval-3.2.1.patch diff --git a/framework/patches/pgjdbc.9.0.patch b/framework/patches/pgjdbc.9.0.patch deleted file mode 100644 index 4cbdbb10b6..0000000000 --- a/framework/patches/pgjdbc.9.0.patch +++ /dev/null @@ -1,16 +0,0 @@ -Index: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java -=================================================================== -RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java,v -retrieving revision 1.25 -diff -u -r1.25 AbstractJdbc2ResultSetMetaData.java ---- org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java 2 Apr 2011 11:09:26 -0000 1.25 -+++ org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java 8 Aug 2011 11:56:14 -0000 -@@ -299,7 +299,7 @@ - */ - public String getTableName(int column) throws SQLException - { -- return ""; -+ return getBaseTableName(column); - } - - public String getBaseTableName(int column) throws SQLException diff --git a/framework/pym/play/application.py b/framework/pym/play/application.py index 31730463ad..cce2cc9a61 100644 --- a/framework/pym/play/application.py +++ b/framework/pym/play/application.py @@ -291,15 +291,13 @@ def java_cmd(self, java_args, cp_args=None, className='play.server.Server', args java_args.append('-server') if 'jvm_version' in self.play_env: - javaVersion = self.play_env['jvm_version'] + java_version = self.play_env['jvm_version'] else: - javaVersion = getJavaVersion() - print("~ using java version \"%s\"" % javaVersion) - - if javaVersion.startswith("1.5") or javaVersion.startswith("1.6") or javaVersion.startswith("1.7") or javaVersion.startswith("1.8") or javaVersion.startswith("9") or javaVersion.startswith("10") : - print("~ ERROR: java version prior to 11 are no longer supported: current version \"%s\" : please update" % javaVersion) - - java_args.append('-noverify') + java_version = get_java_version() + print("~ using java version \"%s\"" % java_version) + + if not is_java_version_supported(java_version): + print("~ ERROR: java version prior to %s are no longer supported: current version \"%s\" : please update" % (get_minimal_supported_java_version(), java_version)) java_policy = self.readConf('java.policy') if java_policy != '': diff --git a/framework/pym/play/commands/autotest.py b/framework/pym/play/commands/autotest.py index 2fc95a7486..2b0a30c5a3 100644 --- a/framework/pym/play/commands/autotest.py +++ b/framework/pym/play/commands/autotest.py @@ -74,18 +74,18 @@ def autotest(app, args): add_options.append('-DrunSeleniumTests') # Handle timeout parameter - weblcient_timeout = -1 + webclient_timeout = None if app.readConf('webclient.timeout'): - weblcient_timeout = app.readConf('webclient.timeout') - + webclient_timeout = app.readConf('webclient.timeout') + for arg in args: if arg.startswith('--timeout='): args.remove(arg) - weblcient_timeout = arg[10:] - - if weblcient_timeout >= 0: - add_options.append('-DwebclientTimeout=' + weblcient_timeout) + webclient_timeout = arg[10:] + if webclient_timeout is not None: + add_options.append('-DwebclientTimeout=' + webclient_timeout) + # Run app test_result = os.path.join(app.path, 'test-result') if os.path.exists(test_result): diff --git a/framework/pym/play/commands/eclipse.py b/framework/pym/play/commands/eclipse.py index 01a6eb1b82..b6dd83d856 100644 --- a/framework/pym/play/commands/eclipse.py +++ b/framework/pym/play/commands/eclipse.py @@ -30,13 +30,11 @@ def execute(**kargs): application_name = app.readConf('application.name') vm_arguments = app.readConf('jvm.memory') - javaVersion = getJavaVersion() + javaVersion = get_java_version() print("~ using java version \"%s\"" % javaVersion) - if javaVersion.startswith("1.5") or javaVersion.startswith("1.6") or javaVersion.startswith("1.7"): - print("~ ERROR: java version prior to 1.8 are no longer supported: current version \"%s\" : please update" % javaVersion) - - vm_arguments = vm_arguments +' -noverify' + if not is_java_version_supported(javaVersion): + print("~ ERROR: java version prior to %s are no longer supported: current version \"%s\" : please update" % (get_minimal_supported_java_version(), javaVersion)) if application_name: application_name = application_name.replace("/", " ") diff --git a/framework/pym/play/commands/javadoc.py b/framework/pym/play/commands/javadoc.py index b366c6dbbf..4198433215 100644 --- a/framework/pym/play/commands/javadoc.py +++ b/framework/pym/play/commands/javadoc.py @@ -74,7 +74,7 @@ def defineJavadocOptions(app, outdir, args): args.remove('--links') # Add link to JavaDoc of JAVA - javaVersion = getJavaVersion() + javaVersion = get_java_version() print("~ using java version \"%s\"" % javaVersion) if javaVersion.startswith("1.5"): print("~ Java(TM) Platform, Platform Standard Edition 5.0") diff --git a/framework/pym/play/utils.py b/framework/pym/play/utils.py index d695c9b225..6999674be4 100644 --- a/framework/pym/play/utils.py +++ b/framework/pym/play/utils.py @@ -188,7 +188,7 @@ def package_as_war(app, env, war_path, war_zip_path, war_exclusion_list = None): zip.close() # Recursively delete all files/folders in root whose name equals to filename -# We could pass a "ignore" parameter to copytree, but that's not supported in Python 2.5 +# We could pass an "ignore" parameter to copytree, but that's not supported in Python 2.5 def deleteFrom(root, filenames): for f in os.listdir(root): @@ -250,15 +250,30 @@ def java_path(): else: return os.path.normpath("%s/bin/java" % os.environ['JAVA_HOME']) -def getJavaVersion(): +def get_java_version(): sp = subprocess.Popen([java_path(), "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - javaVersion = sp.communicate() - javaVersion = str(javaVersion) + java_version = sp.communicate() + java_version = str(java_version) - result = re.search('version "([a-zA-Z0-9\.\-_]{1,})"', javaVersion) + result = re.search('version "([a-zA-Z0-9\.\-_]{1,})"', java_version) if result: return result.group(1) else: - print("Unable to retrieve java version from " + javaVersion) + print("Unable to retrieve java version from " + java_version) return "" + +def get_minimal_supported_java_version(): + return 17 + +def is_java_version_supported(java_version): + try: + if java_version.startswith("1."): + num = int(java_version.split('.')[-1]) + elif java_version.count('.') >= 1: + num = int(java_version.split('.')[0]) + else: + num = int(java_version) + return num >= get_minimal_supported_java_version() + except ValueError: + return True diff --git a/framework/src/play/Play.java b/framework/src/play/Play.java index 2c17dfd51f..9ea94f24d6 100644 --- a/framework/src/play/Play.java +++ b/framework/src/play/Play.java @@ -13,7 +13,6 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; diff --git a/framework/src/play/classloading/ApplicationClassloader.java b/framework/src/play/classloading/ApplicationClassloader.java index b8a83df17f..4c7ccfba66 100644 --- a/framework/src/play/classloading/ApplicationClassloader.java +++ b/framework/src/play/classloading/ApplicationClassloader.java @@ -2,7 +2,6 @@ import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableMap; -import static org.apache.commons.io.IOUtils.closeQuietly; import java.io.File; import java.io.IOException; @@ -22,15 +21,11 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; - import play.Logger; import play.Play; import play.cache.Cache; @@ -222,12 +217,10 @@ byte[] getClassDefinition(String name) { if (is == null) { return null; } - try { - return IOUtils.toByteArray(is); + try (is) { + return is.readAllBytes(); } catch (Exception e) { throw new UnexpectedException(e); - } finally { - closeQuietly(is); } } @@ -239,7 +232,6 @@ public InputStream getResourceAsStream(String name) { return res.inputstream(); } } - URL url = getResource(name); return super.getResourceAsStream(name); } @@ -294,19 +286,8 @@ public Enumeration getResources(String name) throws IOException { urls.add(next); } } - final Iterator it = urls.iterator(); - return new Enumeration() { - @Override - public boolean hasMoreElements() { - return it.hasNext(); - } - - @Override - public URL nextElement() { - return it.next(); - } - }; + return Collections.enumeration(urls); } /** @@ -457,7 +438,7 @@ public List> getAllClasses() { for (ApplicationClass clazz : Play.classes.all()) { byNormalizedName.put(clazz.name.toLowerCase(), clazz); if (clazz.name.contains("$")) { - byNormalizedName.put(StringUtils.replace(clazz.name.toLowerCase(), "$", "."), clazz); + byNormalizedName.put(clazz.name.toLowerCase().replace('$', '.'), clazz); } } diff --git a/framework/src/play/classloading/ApplicationCompiler.java b/framework/src/play/classloading/ApplicationCompiler.java index 83d8276284..dce2c8fdc3 100644 --- a/framework/src/play/classloading/ApplicationCompiler.java +++ b/framework/src/play/classloading/ApplicationCompiler.java @@ -36,17 +36,13 @@ public class ApplicationCompiler { private static final String JAVA_SOURCE_DEFAULT_VERSION = "17"; static final Map compatibleJavaVersions = Map.ofEntries( - Map.entry("11", CompilerOptions.VERSION_11), - Map.entry("12", CompilerOptions.VERSION_12), - Map.entry("13", CompilerOptions.VERSION_13), - Map.entry("14", CompilerOptions.VERSION_14), - Map.entry("15", CompilerOptions.VERSION_15), - Map.entry("16", CompilerOptions.VERSION_16), Map.entry("17", CompilerOptions.VERSION_17), Map.entry("18", CompilerOptions.VERSION_18), Map.entry("19", CompilerOptions.VERSION_19), Map.entry("20", CompilerOptions.VERSION_20), - Map.entry("21", CompilerOptions.VERSION_21) + Map.entry("21", CompilerOptions.VERSION_21), + Map.entry("22", CompilerOptions.VERSION_22), + Map.entry("23", CompilerOptions.VERSION_23) ); final Map packagesCache = new HashMap<>(); @@ -61,8 +57,8 @@ public class ApplicationCompiler { */ public ApplicationCompiler(ApplicationClasses applicationClasses) { final String runningJavaVersion = System.getProperty("java.version"); - if (Stream.of("1.5", "1.6", "1.7", "1.8", "9", "10").anyMatch(runningJavaVersion::startsWith)) { - throw new CompilationException("JDK version prior to 11 are not supported to run the application"); + if (Stream.of("1.5", "1.6", "1.7", "1.8", "9", "10", "11", "12", "13", "14", "15", "16").anyMatch(runningJavaVersion::startsWith)) { + throw new CompilationException("JDK version prior to 17 are not supported to run the application"); } final String configSourceVersion = Play.configuration.getProperty("java.source", JAVA_SOURCE_DEFAULT_VERSION); @@ -307,7 +303,7 @@ public void cleanup() { /** * The JDT compiler */ - Compiler jdtCompiler = new Compiler(nameEnvironment, policy, settings, compilerRequestor, problemFactory) { + Compiler jdtCompiler = new Compiler(nameEnvironment, policy, new CompilerOptions(settings), compilerRequestor, problemFactory) { @Override protected void handleInternalException(Throwable e, CompilationUnitDeclaration ud, CompilationResult result) { diff --git a/framework/src/play/classloading/enhancers/ContinuationEnhancer.java b/framework/src/play/classloading/enhancers/ContinuationEnhancer.java index 456f28704e..dddfcf26e2 100644 --- a/framework/src/play/classloading/enhancers/ContinuationEnhancer.java +++ b/framework/src/play/classloading/enhancers/ContinuationEnhancer.java @@ -10,7 +10,6 @@ import play.classloading.ApplicationClasses.ApplicationClass; import java.io.InputStream; -import java.util.ArrayList; import java.util.List; public class ContinuationEnhancer extends Enhancer { diff --git a/framework/src/play/classloading/enhancers/Enhancer.java b/framework/src/play/classloading/enhancers/Enhancer.java index 04743fb644..a3afeb106a 100644 --- a/framework/src/play/classloading/enhancers/Enhancer.java +++ b/framework/src/play/classloading/enhancers/Enhancer.java @@ -111,7 +111,7 @@ public URL find(String className) { * @param ctClass * the javassist class representation * @param annotation - * fully qualified name of the annotation class eg."javax.persistence.Entity" + * fully qualified name of the annotation class eg."jakarta.persistence.Entity" * @return true if class has the annotation * @throws java.lang.ClassNotFoundException * if class not found @@ -132,7 +132,7 @@ protected boolean hasAnnotation(CtClass ctClass, String annotation) throws Class * @param ctField * the javassist field representation * @param annotation - * fully qualified name of the annotation class eg."javax.persistence.Entity" + * fully qualified name of the annotation class eg."jakarta.persistence.Entity" * @return true if field has the annotation * @throws java.lang.ClassNotFoundException * if class not found @@ -153,7 +153,7 @@ protected boolean hasAnnotation(CtField ctField, String annotation) throws Class * @param ctMethod * the javassist method representation * @param annotation - * fully qualified name of the annotation class eg."javax.persistence.Entity" + * fully qualified name of the annotation class eg."jakarta.persistence.Entity" * @return true if field has the annotation * @throws java.lang.ClassNotFoundException * if class not found diff --git a/framework/src/play/data/binding/Binder.java b/framework/src/play/data/binding/Binder.java index ef1cf88773..0947b9362a 100644 --- a/framework/src/play/data/binding/Binder.java +++ b/framework/src/play/data/binding/Binder.java @@ -671,7 +671,7 @@ public static Object directBind(String name, Annotation[] annotations, String va // Needs this because sometimes we need to know if no value was returned.. private static Object internalDirectBind(String name, Annotation[] annotations, String value, Class clazz, Type type) throws Exception { - boolean nullOrEmpty = value == null || value.trim().length() == 0; + boolean nullOrEmpty = value == null || value.isBlank(); if (annotations != null) { for (Annotation annotation : annotations) { diff --git a/framework/src/play/data/binding/Unbinder.java b/framework/src/play/data/binding/Unbinder.java index 577826560a..1d70ccfa15 100644 --- a/framework/src/play/data/binding/Unbinder.java +++ b/framework/src/play/data/binding/Unbinder.java @@ -121,14 +121,14 @@ private static void internalUnbind(Map result, Object src, Class Class> toInstantiate = (Class>) ((As) annotation) .unbinder(); if (!(toInstantiate.equals(As.DEFAULT.class))) { - TypeUnbinder myInstance = toInstantiate.newInstance(); + TypeUnbinder myInstance = toInstantiate.getDeclaredConstructor().newInstance(); isExtendedTypeBinder = myInstance.unBind(result, src, srcClazz, name, annotations); }else{ // unbinder is default, test if binder handle the unbinder too Class> toInstantiateBinder = ((As) annotation).binder(); if (!(toInstantiateBinder.equals(As.DEFAULT.class)) && TypeUnbinder.class.isAssignableFrom(toInstantiateBinder)) { - TypeUnbinder myInstance = (TypeUnbinder) toInstantiateBinder.newInstance(); + TypeUnbinder myInstance = (TypeUnbinder) toInstantiateBinder.getDeclaredConstructor().newInstance(); isExtendedTypeBinder = myInstance.unBind(result, src, srcClazz, name, annotations); } } diff --git a/framework/src/play/data/validation/Validation.java b/framework/src/play/data/validation/Validation.java index 74e651047b..a96e0504f5 100644 --- a/framework/src/play/data/validation/Validation.java +++ b/framework/src/play/data/validation/Validation.java @@ -6,7 +6,6 @@ import java.util.Collections; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -119,7 +118,7 @@ public static void removeErrors(String field) { */ public static boolean hasErrors() { Validation validation = current.get(); - return validation != null && validation.errors.size() > 0; + return validation != null && !validation.errors.isEmpty(); } /** diff --git a/framework/src/play/data/validation/ValidationPlugin.java b/framework/src/play/data/validation/ValidationPlugin.java index d4496de544..2118f7dfcc 100644 --- a/framework/src/play/data/validation/ValidationPlugin.java +++ b/framework/src/play/data/validation/ValidationPlugin.java @@ -25,18 +25,7 @@ import play.mvc.results.Result; import play.utils.Java; -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.net.URLDecoder; -import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; public class ValidationPlugin extends PlayPlugin { @@ -125,6 +114,7 @@ public void invocationFinally() { static class Validator extends Guard { public List validateAction(Method actionMethod) throws Exception { + List violations = new ArrayList<>(); Object instance = null; // Patch for scala defaults if (!Modifier.isStatic(actionMethod.getModifiers()) && actionMethod.getDeclaringClass().getSimpleName().endsWith("$")) { @@ -135,10 +125,11 @@ public List validateAction(Method actionMethod) throws Exce } } Object[] rArgs = ActionInvoker.getActionMethodArgs(actionMethod, instance); - InternalValidationCycle validationCycle = new InternalValidationCycle(null, new String[]{"default"}); - validateMethodParameters(null, actionMethod, rArgs, validationCycle); - validateMethodPre(null, actionMethod, rArgs, validationCycle); - return validationCycle.violations; + net.sf.oval.Validator.InternalValidationCycle cycle = new net.sf.oval.Validator.InternalValidationCycle(null, null); + cycle.violations = violations; + validateMethodParameters(null, actionMethod, rArgs, cycle); + validateMethodPre(null, actionMethod, rArgs, cycle); + return cycle.violations; } } static final Pattern errorsParser = Pattern.compile("\u0000([^:]*):([^\u0000]*)\u0000"); diff --git a/framework/src/play/deps/YamlParser.java b/framework/src/play/deps/YamlParser.java index 8924e6c441..743bf44615 100644 --- a/framework/src/play/deps/YamlParser.java +++ b/framework/src/play/deps/YamlParser.java @@ -2,7 +2,6 @@ import java.io.File; import java.io.FileNotFoundException; -import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -44,8 +43,8 @@ public class YamlParser extends AbstractModuleDescriptorParser { - static class Oops extends Exception { - public Oops(String message) { + private static final class Oops extends Exception { + Oops(String message) { super(message); } } @@ -57,26 +56,19 @@ public boolean accept(Resource rsrc) { @Override public ModuleDescriptor parseDescriptor(ParserSettings ps, URL url, Resource rsrc, boolean bln) throws ParseException, IOException { - try { - InputStream srcStream = rsrc.openStream(); - long lastModified = (rsrc != null?rsrc.getLastModified():0L); + try (InputStream srcStream = rsrc.openStream()) { + long lastModified = rsrc.getLastModified(); Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); - Object o = null; + Map data; // Try to parse the yaml try { - o = yaml.load(srcStream); + data = yaml.load(srcStream); } catch (Exception e) { throw new Oops(e.toString().replace("\n", "\n~ \t")); } - // We expect a Map here - if (!(o instanceof Map)) { - throw new Oops("Unexpected format -> " + o); - } - - Map data = (Map) o; ModuleRevisionId id = null; // Search for 'self' tag @@ -111,7 +103,7 @@ public ModuleDescriptorParser getParser() { descriptor.addArtifact("default", new MDArtifact(descriptor, id.getName(), "jar", "zip")); descriptor.setLastModified(lastModified); - boolean transitiveDependencies = get(data, "transitiveDependencies", boolean.class, true); + boolean transitiveDependencies = get(data, "transitiveDependencies", Boolean.class, true); List confs = new ArrayList<>(); if (data.containsKey("configurations")) { @@ -148,7 +140,6 @@ public ModuleDescriptorParser getParser() { if (data.containsKey("require")) { if (data.get("require") instanceof List) { - List dependencies = (List) data.get("require"); for (Object dep : dependencies) { @@ -254,9 +245,8 @@ public ModuleDescriptorParser getParser() { } } - } else { - throw new Oops("require list not found -> " + o); + throw new Oops("require list not found -> " + data); } } @@ -280,7 +270,7 @@ public void toIvyFile(InputStream in, Resource rsrc, File file, ModuleDescriptor T get(Map data, String key, Class type) { if (data.containsKey(key)) { Object o = data.get(key); - if (type.isAssignableFrom(o.getClass())) { + if (type.isInstance(o)) { if(o instanceof String) { o = o.toString().replace("${play.path}", System.getProperty("play.path")); o = o.toString().replace("${application.path}", System.getProperty("application.path")); @@ -305,7 +295,7 @@ public static Set getOrderedModuleList(File file) throws ParseException, return getOrderedModuleList(modules, file); } - private static Set getOrderedModuleList(Set modules, File file) throws ParseException, IOException { + private static Set getOrderedModuleList(Set modules, File file) throws ParseException, IOException { if (file == null || !file.exists()) { throw new FileNotFoundException("There was a problem to find the file"); } @@ -321,27 +311,24 @@ private static Set getOrderedModuleList(Set modules, File file) String moduleName = filterModuleName(rev); // Check if the module was already load to avoid circular parsing - if (moduleName != null && !modules.contains(moduleName)) { - // Add the given module - modules.add(moduleName); - + if (moduleName != null && modules.add(moduleName)) { // Need to load module dependencies of this given module File module = new File(localModules, moduleName); - if(module != null && module.isDirectory()) { + if (module.isDirectory()) { File ivyModule = new File(module, "conf/dependencies.yml"); - if(ivyModule != null && ivyModule.exists()) { + if (ivyModule.exists()) { getOrderedModuleList(modules, ivyModule); } } else { File modulePath = new File(IO.readContentAsString(module).trim()); if (modulePath.exists() && modulePath.isDirectory()) { File ivyModule = new File(modulePath, "conf/dependencies.yml"); - if(ivyModule != null && ivyModule.exists()) { + if (ivyModule.exists()) { getOrderedModuleList(modules, ivyModule); } } } - } else if(moduleName == null && rev.getRevision().equals("->")){ + } else if (moduleName == null && rev.getRevision().equals("->")) { Logger.error("Revision is required, module [%s -> %s] will not be loaded.", rev.getName(), rev.getExtraAttribute("classifier")); } } @@ -352,38 +339,24 @@ private static Set getOrderedModuleList(Set modules, File file) private static String filterModuleName(ModuleRevisionId rev) { if (rev != null && !"play".equals(rev.getName())) { File moduleDir = new File(Play.applicationPath, "modules"); - if(moduleDir != null && moduleDir.isDirectory()){ + if (moduleDir.isDirectory()) { // create new filename filter to check if it is a module (lib will // be skipped) - File[] filterFiles = moduleDir.listFiles(new ModuleFilter(rev)); + File[] filterFiles = moduleDir.listFiles((dir, name) -> { + // Accept module with the same name or with a version number + return name != null && ( + name.equals(rev.getName()) + || name.equals(rev.getName() + '-' + rev.getRevision()) + || name.startsWith(rev.getName() + '-') + ); + }); if (filterFiles != null && filterFiles.length > 0) { return filterFiles[0].getName(); - } + } } } return null; - - } - private static class ModuleFilter implements FilenameFilter { - - private final ModuleRevisionId moduleRevision; - - public ModuleFilter(ModuleRevisionId moduleRevision) { - this.moduleRevision = moduleRevision; - } - - @Override - public boolean accept(File dir, String name) { - // Accept module with the same name or with a version number - if (name != null && moduleRevision != null && - (name.equals(moduleRevision.getName()) - || name.equals(moduleRevision.getName() + "-" + moduleRevision.getRevision()) - || name.startsWith(moduleRevision.getName() + "-"))) { - return true; - } - return false; - } } } diff --git a/framework/src/play/inject/Injector.java b/framework/src/play/inject/Injector.java index 1d9a5a9960..2d41b4a79f 100644 --- a/framework/src/play/inject/Injector.java +++ b/framework/src/play/inject/Injector.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import java.util.List; -import javax.inject.Inject; +import jakarta.inject.Inject; import play.Play; import play.classloading.enhancers.ControllersEnhancer.ControllerSupport; diff --git a/framework/src/play/libs/Codec.java b/framework/src/play/libs/Codec.java index 6563f9d4a1..0387cf94e5 100644 --- a/framework/src/play/libs/Codec.java +++ b/framework/src/play/libs/Codec.java @@ -1,12 +1,10 @@ package play.libs; import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HexFormat; import java.util.UUID; -import org.apache.commons.codec.DecoderException; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.codec.binary.Hex; - import play.exceptions.UnexpectedException; import static java.nio.charset.StandardCharsets.UTF_8; @@ -33,18 +31,18 @@ public static String UUID() { * @return The base64 encoded String */ public static String encodeBASE64(String value) { - return new String(Base64.encodeBase64(value.getBytes(UTF_8))); + return java.util.Base64.getEncoder().encodeToString(value.getBytes(UTF_8)); } /** * Encode binary data to base64 - * + * * @param value * The binary data * @return The base64 encoded String */ public static String encodeBASE64(byte[] value) { - return new String(Base64.encodeBase64(value)); + return java.util.Base64.getEncoder().encodeToString(value); } /** @@ -55,70 +53,69 @@ public static String encodeBASE64(byte[] value) { * @return decoded binary data */ public static byte[] decodeBASE64(String value) { - return Base64.decodeBase64(value.getBytes(UTF_8)); + return java.util.Base64.getDecoder().decode(value); } /** - * Build an hexadecimal MD5 hash for a String + * Build a hexadecimal MD5 hash for a String * * @param value * The String to hash - * @return An hexadecimal Hash + * @return A hexadecimal Hash */ public static String hexMD5(String value) { - try { - MessageDigest messageDigest = MessageDigest.getInstance("MD5"); - messageDigest.reset(); - messageDigest.update(value.getBytes(UTF_8)); - byte[] digest = messageDigest.digest(); - return byteToHexString(digest); - } catch (Exception ex) { - throw new UnexpectedException(ex); - } + return hashToHexString("MD5", value); } /** - * Build an hexadecimal SHA1 hash for a String - * + * Build a hexadecimal SHA1 hash for a String + * * @param value * The String to hash - * @return An hexadecimal Hash + * @return A hexadecimal Hash */ public static String hexSHA1(String value) { - try { - MessageDigest md; - md = MessageDigest.getInstance("SHA-1"); - md.update(value.getBytes(UTF_8)); - byte[] digest = md.digest(); - return byteToHexString(digest); - } catch (Exception ex) { - throw new UnexpectedException(ex); - } + return hashToHexString("SHA-1", value); } /** * Write a byte array as hexadecimal String. - * + * * @param bytes * byte array * @return The hexadecimal String */ public static String byteToHexString(byte[] bytes) { - return String.valueOf(Hex.encodeHex(bytes)); + return HexFormat.of().formatHex(bytes); } /** - * Transform an hexadecimal String to a byte array. - * + * Transform a hexadecimal String to a byte array. + * * @param hexString * Hexadecimal string to transform * @return The byte array */ public static byte[] hexStringToByte(String hexString) { + return HexFormat.of().parseHex(hexString); + } + + /** + * Build a hexadecimal hash specified by {@code algorithm} for a given {@code value}. + * + * @param algorithm The hash name + * @param value The String to hash + * + * @return A hexadecimal hash + */ + private static String hashToHexString(String algorithm, String value) { try { - return Hex.decodeHex(hexString.toCharArray()); - } catch (DecoderException e) { - throw new UnexpectedException(e); + return byteToHexString( + MessageDigest.getInstance(algorithm) + .digest(value.getBytes(UTF_8)) + ); + } catch (NoSuchAlgorithmException ex) { + throw new UnexpectedException(ex); } } diff --git a/framework/src/play/libs/F.java b/framework/src/play/libs/F.java index 5431f22c05..21641e5201 100644 --- a/framework/src/play/libs/F.java +++ b/framework/src/play/libs/F.java @@ -17,6 +17,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Consumer; + import org.jboss.netty.channel.ChannelHandlerContext; import play.Logger; @@ -27,14 +29,14 @@ public class F { /** * A Function with no arguments. */ - public static interface Function0 { - public R apply() throws Throwable; + @FunctionalInterface + public interface Function0 { + R apply() throws Throwable; } public static class Promise implements Future, F.Action { protected final CountDownLatch taskLock = new CountDownLatch(1); - protected boolean cancelled = false; @Override public boolean cancel(boolean mayInterruptIfRunning) { @@ -739,14 +741,28 @@ public boolean trigger() { } } - public static interface Action0 { + @FunctionalInterface + public interface Action0 extends Runnable { void invoke(); + + @Override + default void run() { + invoke(); + } + } - public static interface Action { + @FunctionalInterface + public interface Action extends Consumer { void invoke(T result); + + @Override + default void accept(T result) { + invoke(result); + } + } public abstract static class Option implements Iterable { @@ -756,7 +772,7 @@ public abstract static class Option implements Iterable { public abstract T get(); public static None None() { - return (None) (Object) None; + return (None) None; } public static Some Some(T value) { @@ -782,7 +798,7 @@ public T get() { @Override public Iterator iterator() { - return Collections.emptyList().iterator(); + return Collections.emptyIterator(); } @Override diff --git a/framework/src/play/libs/Files.java b/framework/src/play/libs/Files.java index 76f76c9d8e..38b47df8c1 100644 --- a/framework/src/play/libs/Files.java +++ b/framework/src/play/libs/Files.java @@ -9,14 +9,12 @@ import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; - import play.Logger; import play.exceptions.UnexpectedException; @@ -74,7 +72,7 @@ public static void copy(File from, File to) { } try { - FileUtils.copyFile(from, to); + java.nio.file.Files.copy(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (Exception e) { throw new RuntimeException(e); } @@ -118,9 +116,9 @@ public static boolean deleteDirectory(File path) { public static boolean copyDir(File from, File to) { try { - FileUtils.copyDirectory(from, to); + IO.copyDirectory(from, to); return true; - } catch (IOException e) { + } catch (Exception e) { return false; } } @@ -151,10 +149,11 @@ public static void unzip(File from, File to) { public static void zip(File directory, File zipFile) { try { - try (FileOutputStream os = new FileOutputStream(zipFile)) { - try (ZipOutputStream zos = new ZipOutputStream(os)) { - zipDirectory(directory, directory, zos); - } + try ( + FileOutputStream os = new FileOutputStream(zipFile); + ZipOutputStream zos = new ZipOutputStream(os) + ) { + zipDirectory(directory, directory, zos); } } catch (Exception e) { throw new UnexpectedException(e); @@ -221,7 +220,7 @@ static void zipDirectory(File root, File directory, ZipOutputStream zos) throws String path = item.getAbsolutePath().substring(root.getAbsolutePath().length() + 1); ZipEntry anEntry = new ZipEntry(path); zos.putNextEntry(anEntry); - IOUtils.copyLarge(fis, zos); + fis.transferTo(zos); } } } diff --git a/framework/src/play/libs/IO.java b/framework/src/play/libs/IO.java index 5b7edcd8c2..37ac93d8d4 100644 --- a/framework/src/play/libs/IO.java +++ b/framework/src/play/libs/IO.java @@ -4,22 +4,16 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; import static org.apache.commons.io.Charsets.toCharset; -import static org.apache.commons.io.IOUtils.closeQuietly; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UncheckedIOException; +import java.io.*; +import java.nio.channels.Channels; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import java.util.Properties; +import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.commons.io.IOUtils; - import play.exceptions.UnexpectedException; import play.utils.OrderSafeProperties; @@ -37,13 +31,11 @@ public class IO { */ public static Properties readUtf8Properties(InputStream is) { Properties properties = new OrderSafeProperties(); - try { + try (is) { properties.load(is); return properties; } catch (Exception e) { throw new RuntimeException(e); - } finally { - closeQuietly(is); } } @@ -69,7 +61,7 @@ public static String readContentAsString(InputStream is) { */ public static String readContentAsString(InputStream is, String encoding) { try { - return IOUtils.toString(is, encoding); + return new String(is.readAllBytes(), toCharset(encoding)); } catch (Exception e) { throw new RuntimeException(e); } @@ -108,11 +100,7 @@ public static String readContentAsString(File file, String encoding) { } public static List readLines(InputStream is) { - try { - return IOUtils.readLines(is, defaultCharset()); - } catch (UncheckedIOException ex) { - throw new UnexpectedException(ex); - } + return new BufferedReader(new InputStreamReader(is, defaultCharset())).lines().collect(Collectors.toList()); } public static List readLines(File file, String encoding) { @@ -155,7 +143,7 @@ public static byte[] readContent(File file) { */ public static byte[] readContent(InputStream is) { try { - return IOUtils.toByteArray(is); + return is.readAllBytes(); } catch (IOException e) { throw new UnexpectedException(e); } @@ -170,12 +158,12 @@ public static byte[] readContent(InputStream is) { * The stream to write */ public static void writeContent(CharSequence content, OutputStream os) { - try { - IOUtils.write(content, os, UTF_8); + try (os) { + if (content != null) { + Channels.newChannel(os).write(UTF_8.encode(content.toString())); + } } catch (IOException e) { throw new UnexpectedException(e); - } finally { - closeQuietly(os); } } @@ -190,12 +178,12 @@ public static void writeContent(CharSequence content, OutputStream os) { * Encoding to used */ public static void writeContent(CharSequence content, OutputStream os, String encoding) { - try { - IOUtils.write(content, os, encoding); + try (os) { + if (content != null) { + Channels.newChannel(os).write(toCharset(encoding).encode(content.toString())); + } } catch (IOException e) { throw new UnexpectedException(e); - } finally { - closeQuietly(os); } } @@ -258,12 +246,10 @@ public static void write(byte[] data, File file) { * The destination stream */ public static void copy(InputStream is, OutputStream os) { - try { + try (is) { is.transferTo(os); } catch (IOException e) { throw new UnexpectedException(e); - } finally { - closeQuietly(is); } } @@ -276,13 +262,10 @@ public static void copy(InputStream is, OutputStream os) { * The destination stream */ public static void write(InputStream is, OutputStream os) { - try { + try (is; os) { is.transferTo(os); } catch (IOException e) { throw new UnexpectedException(e); - } finally { - closeQuietly(is); - closeQuietly(os); } } @@ -295,14 +278,8 @@ public static void write(InputStream is, OutputStream os) { * The destination file */ public static void write(InputStream is, File f) { - try { - OutputStream os = new FileOutputStream(f); - try { - is.transferTo(os); - } finally { - closeQuietly(is); - closeQuietly(os); - } + try (is; var os = new FileOutputStream(f)) { + is.transferTo(os); } catch (IOException e) { throw new UnexpectedException(e); } @@ -310,14 +287,25 @@ public static void write(InputStream is, File f) { // If targetLocation does not exist, it will be created. public static void copyDirectory(File source, File target) { - try (Stream dirs = Files.walk(source.toPath())) { - dirs.forEach(src -> { + var sourcePath = source.toPath(); + var targetPath = target.toPath(); + + try (var stream = Files.walk(sourcePath)) { + stream.forEach(src -> { try { - Files.copy(source.toPath(), target.toPath(), REPLACE_EXISTING); + Path dst = targetPath.resolve(sourcePath.relativize(src)); + + if (Files.isDirectory(src)) { + Files.createDirectories(dst); + } else { + Files.copy(src, dst, REPLACE_EXISTING); + } } catch (IOException e) { - throw new UnexpectedException(e); + throw new UncheckedIOException(e); } }); + } catch (UncheckedIOException e) { + throw new UnexpectedException(e.getCause()); } catch (IOException e) { throw new UnexpectedException(e); } diff --git a/framework/src/play/libs/Mail.java b/framework/src/play/libs/Mail.java index 88262f0e34..6d1fabff8f 100644 --- a/framework/src/play/libs/Mail.java +++ b/framework/src/play/libs/Mail.java @@ -8,13 +8,13 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import javax.mail.Authenticator; -import javax.mail.PasswordAuthentication; -import javax.mail.Session; +import jakarta.mail.Authenticator; +import jakarta.mail.PasswordAuthentication; +import jakarta.mail.Session; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.mail.Email; -import org.apache.commons.mail.EmailException; +import org.apache.commons.mail2.jakarta.Email; +import org.apache.commons.mail2.core.EmailException; import play.Logger; import play.Play; @@ -161,7 +161,7 @@ public static Session getSession() { if (authenticator != null) { props.put("mail.smtp.auth", "true"); try { - session = Session.getInstance(props, (Authenticator) Play.classloader.loadClass(authenticator).newInstance()); + session = Session.getInstance(props, (Authenticator) Play.classloader.loadClass(authenticator).getDeclaredConstructor().newInstance()); } catch (Exception e) { Logger.error(e, "Cannot instantiate custom SMTP authenticator (%s)", authenticator); } diff --git a/framework/src/play/libs/WS.java b/framework/src/play/libs/WS.java index 44870e8373..d003b92fb5 100644 --- a/framework/src/play/libs/WS.java +++ b/framework/src/play/libs/WS.java @@ -180,7 +180,7 @@ private static synchronized void init() { wsImpl = new WSAsync(); } else { try { - wsImpl = (WSImpl) Play.classloader.loadClass(implementation).newInstance(); + wsImpl = (WSImpl) Play.classloader.loadClass(implementation).getDeclaredConstructor().newInstance(); if (Logger.isTraceEnabled()) { Logger.trace("Using the class:" + implementation + " for web service"); } diff --git a/framework/src/play/libs/XML.java b/framework/src/play/libs/XML.java index 2709b21876..8c860a8bdf 100644 --- a/framework/src/play/libs/XML.java +++ b/framework/src/play/libs/XML.java @@ -211,7 +211,7 @@ public static boolean validSignature(Document document, Key publicKey) { try { String providerName = System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI"); - XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM", (Provider) Class.forName(providerName).newInstance()); + XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM", (Provider) Class.forName(providerName).getDeclaredConstructor().newInstance()); DOMValidateContext valContext = new DOMValidateContext(keySelector, signatureNode); XMLSignature signature = fac.unmarshalXMLSignature(valContext); diff --git a/framework/src/play/libs/mail/MailSystem.java b/framework/src/play/libs/mail/MailSystem.java index 85001ca540..f91bc515f8 100644 --- a/framework/src/play/libs/mail/MailSystem.java +++ b/framework/src/play/libs/mail/MailSystem.java @@ -2,7 +2,7 @@ import java.util.concurrent.Future; -import org.apache.commons.mail.Email; +import org.apache.commons.mail2.jakarta.Email; public interface MailSystem { diff --git a/framework/src/play/libs/mail/ProductionMailSystem.java b/framework/src/play/libs/mail/ProductionMailSystem.java index d58cf89978..d647f3b72f 100644 --- a/framework/src/play/libs/mail/ProductionMailSystem.java +++ b/framework/src/play/libs/mail/ProductionMailSystem.java @@ -2,7 +2,7 @@ import java.util.concurrent.Future; -import org.apache.commons.mail.Email; +import org.apache.commons.mail2.jakarta.Email; import play.libs.Mail; diff --git a/framework/src/play/libs/mail/test/LegacyMockMailSystem.java b/framework/src/play/libs/mail/test/LegacyMockMailSystem.java index 3cadbe9693..2735f04cc1 100644 --- a/framework/src/play/libs/mail/test/LegacyMockMailSystem.java +++ b/framework/src/play/libs/mail/test/LegacyMockMailSystem.java @@ -1,15 +1,15 @@ package play.libs.mail.test; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.mail.Email; +import org.apache.commons.mail2.jakarta.Email; import play.Logger; import play.libs.Mail; import play.libs.mail.MailSystem; import play.utils.ImmediateFuture; -import javax.mail.*; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMessage; +import jakarta.mail.*; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMessage; import java.io.IOException; import java.util.HashMap; import java.util.List; diff --git a/framework/src/play/mvc/ActionInvoker.java b/framework/src/play/mvc/ActionInvoker.java index a69dc463fe..31e5e9daed 100644 --- a/framework/src/play/mvc/ActionInvoker.java +++ b/framework/src/play/mvc/ActionInvoker.java @@ -123,14 +123,14 @@ public static void invoke(Http.Request request, Http.Response response) { // 2. Easy debugging ... if (Play.mode == Play.Mode.DEV) { - Controller.class.getDeclaredField("params").set(null, Scope.Params.current()); - Controller.class.getDeclaredField("request").set(null, Http.Request.current()); - Controller.class.getDeclaredField("response").set(null, Http.Response.current()); - Controller.class.getDeclaredField("session").set(null, Scope.Session.current()); - Controller.class.getDeclaredField("flash").set(null, Scope.Flash.current()); - Controller.class.getDeclaredField("renderArgs").set(null, Scope.RenderArgs.current()); - Controller.class.getDeclaredField("routeArgs").set(null, Scope.RouteArgs.current()); - Controller.class.getDeclaredField("validation").set(null, Validation.current()); + Controller.params = Scope.Params.current(); + Controller.request = Http.Request.current(); + Controller.response = Http.Response.current(); + Controller.session = Scope.Session.current(); + Controller.flash = Scope.Flash.current(); + Controller.renderArgs = Scope.RenderArgs.current(); + Controller.routeArgs = Scope.RouteArgs.current(); + Controller.validation = Validation.current(); } ControllerInstrumentation.stopActionCall(); @@ -155,9 +155,9 @@ public static void invoke(Http.Request request, Http.Response response) { cacheKey = cacheFor.id(); if ("".equals(cacheKey)) { // Generate a cache key for this request - cacheKey = cacheFor.generator().newInstance().generate(request); + cacheKey = cacheFor.generator().getDeclaredConstructor().newInstance().generate(request); } - if(cacheKey != null && !"".equals(cacheKey)) { + if(cacheKey != null && !cacheKey.isEmpty()) { actionResult = (Result) Cache.get(cacheKey); } } @@ -169,7 +169,7 @@ public static void invoke(Http.Request request, Http.Response response) { } catch (Result result) { actionResult = result; // Cache it if needed - if (cacheKey != null && !"".equals(cacheKey)) { + if (cacheKey != null && !cacheKey.isEmpty()) { Cache.set(cacheKey, actionResult, actionMethod.getAnnotation(CacheFor.class).value()); } } catch (JavaExecutionException e) { @@ -610,7 +610,7 @@ public static Object[] getActionMethod(String fullAction) { public static Object[] getActionMethodArgs(Method method, Object o) throws Exception { String[] paramsNames = Java.parameterNames(method); - if (paramsNames == null && method.getParameterTypes().length > 0) { + if (paramsNames.length == 0 && method.getParameterCount() > 0) { throw new UnexpectedException("Parameter names not found for method " + method); } @@ -622,9 +622,8 @@ public static Object[] getActionMethodArgs(Method method, Object o) throws Excep return rArgs; } - rArgs = new Object[method.getParameterTypes().length]; - for (int i = 0; i < method.getParameterTypes().length; i++) { - + rArgs = new Object[method.getParameterCount()]; + for (int i = 0; i < method.getParameterCount(); i++) { Class type = method.getParameterTypes()[i]; Map params = new HashMap<>(); diff --git a/framework/src/play/mvc/Mailer.java b/framework/src/play/mvc/Mailer.java index 33e5ad86ff..44dd0875bb 100644 --- a/framework/src/play/mvc/Mailer.java +++ b/framework/src/play/mvc/Mailer.java @@ -13,18 +13,18 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; -import javax.activation.DataSource; -import javax.activation.URLDataSource; -import javax.mail.internet.InternetAddress; +import jakarta.activation.DataSource; +import jakarta.activation.URLDataSource; +import jakarta.mail.internet.InternetAddress; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.mail.Email; -import org.apache.commons.mail.EmailAttachment; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; -import org.apache.commons.mail.MultiPartEmail; -import org.apache.commons.mail.SimpleEmail; +import org.apache.commons.mail2.jakarta.Email; +import org.apache.commons.mail2.jakarta.EmailAttachment; +import org.apache.commons.mail2.core.EmailException; +import org.apache.commons.mail2.jakarta.HtmlEmail; +import org.apache.commons.mail2.jakarta.MultiPartEmail; +import org.apache.commons.mail2.jakarta.SimpleEmail; import play.Logger; import play.Play; diff --git a/framework/src/play/mvc/results/RenderBinary.java b/framework/src/play/mvc/results/RenderBinary.java index 91d78b0e97..20d4f3302c 100644 --- a/framework/src/play/mvc/results/RenderBinary.java +++ b/framework/src/play/mvc/results/RenderBinary.java @@ -1,18 +1,14 @@ package play.mvc.results; -import static org.apache.commons.io.IOUtils.closeQuietly; +import static java.nio.charset.StandardCharsets.US_ASCII; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; -import java.nio.charset.CharsetEncoder; -import java.nio.charset.StandardCharsets; import org.apache.commons.codec.net.URLCodec; -import org.apache.commons.io.IOUtils; import play.exceptions.UnexpectedException; import play.libs.MimeTypes; @@ -204,16 +200,13 @@ private String dispositionType() { } private static void copyInputStreamAndClose(InputStream is, OutputStream out) throws IOException { - try { - IOUtils.copyLarge(is, out); - } finally { - closeQuietly(is); + try (is) { + is.transferTo(out); } } private boolean canAsciiEncode(String string) { - CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder(); - return asciiEncoder.canEncode(string); + return US_ASCII.newEncoder().canEncode(string); } public boolean isInline() { diff --git a/framework/src/play/server/HttpServerPipelineFactory.java b/framework/src/play/server/HttpServerPipelineFactory.java index 5e4af6e2d4..5c922f1131 100644 --- a/framework/src/play/server/HttpServerPipelineFactory.java +++ b/framework/src/play/server/HttpServerPipelineFactory.java @@ -67,7 +67,6 @@ protected String getName(String name) { } protected ChannelHandler getInstance(String name) throws Exception { - Class clazz = classes.computeIfAbsent(name, className -> { try { return Class.forName(className); @@ -76,8 +75,7 @@ protected ChannelHandler getInstance(String name) throws Exception { } }); if (ChannelHandler.class.isAssignableFrom(clazz)) - return (ChannelHandler)clazz.newInstance(); + return (ChannelHandler)clazz.getDeclaredConstructor().newInstance(); return null; } } - diff --git a/framework/src/play/server/PlayHandler.java b/framework/src/play/server/PlayHandler.java index 79df27c0be..d29f476a36 100644 --- a/framework/src/play/server/PlayHandler.java +++ b/framework/src/play/server/PlayHandler.java @@ -633,10 +633,7 @@ public Request parseRequest(ChannelHandlerContext ctx, HttpRequest nettyRequest, } } else { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - IOUtils.copy(new ChannelBufferInputStream(b), out); - byte[] n = out.toByteArray(); - body = new ByteArrayInputStream(n); + body = new ByteArrayInputStream(new ChannelBufferInputStream(b).readAllBytes()); } String host = nettyRequest.headers().get(HOST); diff --git a/framework/src/play/server/ServletWrapper.java b/framework/src/play/server/ServletWrapper.java index 708f390e23..6e5c779d9e 100644 --- a/framework/src/play/server/ServletWrapper.java +++ b/framework/src/play/server/ServletWrapper.java @@ -1,6 +1,5 @@ package play.server; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import play.Invoker; import play.Invoker.InvocationContext; @@ -24,14 +23,14 @@ import play.utils.Utils; import play.vfs.VirtualFile; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletException; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.*; import java.net.URI; import java.net.URISyntaxException; @@ -39,8 +38,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.apache.commons.io.IOUtils.closeQuietly; - /** * Servlet implementation. * Thanks to Lee Breisacher. @@ -321,9 +318,9 @@ protected static Map getHeaders(HttpServletRequest httpServ protected static Map getCookies(HttpServletRequest httpServletRequest) { Map cookies = new HashMap<>(16); - javax.servlet.http.Cookie[] cookiesViaServlet = httpServletRequest.getCookies(); + jakarta.servlet.http.Cookie[] cookiesViaServlet = httpServletRequest.getCookies(); if (cookiesViaServlet != null) { - for (javax.servlet.http.Cookie cookie : cookiesViaServlet) { + for (jakarta.servlet.http.Cookie cookie : cookiesViaServlet) { Http.Cookie playCookie = new Http.Cookie(); playCookie.name = cookie.getName(); playCookie.path = cookie.getPath(); @@ -474,7 +471,7 @@ public void copyResponse(Request request, Response response, HttpServletRequest // Content response.out.flush(); - if (response.direct != null && response.direct instanceof File) { + if (response.direct instanceof File) { File file = (File) response.direct; servletResponse.setHeader("Content-Length", String.valueOf(file.length())); if (!request.method.equals("HEAD")) { @@ -482,7 +479,7 @@ public void copyResponse(Request request, Response response, HttpServletRequest } else { copyStream(servletResponse, new ByteArrayInputStream(new byte[0])); } - } else if (response.direct != null && response.direct instanceof InputStream) { + } else if (response.direct instanceof InputStream) { copyStream(servletResponse, (InputStream) response.direct); } else { byte[] content = response.out.toByteArray(); @@ -498,12 +495,10 @@ public void copyResponse(Request request, Response response, HttpServletRequest private void copyStream(HttpServletResponse servletResponse, InputStream is) throws IOException { if (servletResponse != null && is != null) { - try { + try (is) { OutputStream os = servletResponse.getOutputStream(); - IOUtils.copyLarge(is, os); + is.transferTo(os); os.flush(); - } finally { - closeQuietly(is); } } } @@ -547,7 +542,6 @@ public void run() { super.run(); } catch (Exception e) { serve500(e, httpServletRequest, httpServletResponse); - return; } } diff --git a/framework/src/play/server/StreamChunkAggregator.java b/framework/src/play/server/StreamChunkAggregator.java index 98007dd04c..a814c2bc42 100644 --- a/framework/src/play/server/StreamChunkAggregator.java +++ b/framework/src/play/server/StreamChunkAggregator.java @@ -1,6 +1,5 @@ package play.server; -import org.apache.commons.io.IOUtils; import org.jboss.netty.buffer.ChannelBufferInputStream; import org.jboss.netty.channel.*; import org.jboss.netty.handler.codec.http.HttpChunk; @@ -59,7 +58,7 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Ex if (maxContentLength != -1 && (localFile.length() > (maxContentLength - chunk.getContent().readableBytes()))) { currentMessage.headers().set(HttpHeaders.Names.WARNING, "play.netty.content.length.exceeded"); } else { - IOUtils.copyLarge(new ChannelBufferInputStream(chunk.getContent()), this.out); + new ChannelBufferInputStream(chunk.getContent()).transferTo(this.out); if (chunk.isLast()) { this.out.flush(); diff --git a/framework/src/play/templates/TemplateLoader.java b/framework/src/play/templates/TemplateLoader.java index de7bddf7c1..376aabdd1f 100644 --- a/framework/src/play/templates/TemplateLoader.java +++ b/framework/src/play/templates/TemplateLoader.java @@ -1,5 +1,6 @@ package play.templates; +import java.io.File; import java.nio.file.InvalidPathException; import java.nio.file.Paths; import java.util.ArrayList; @@ -237,7 +238,7 @@ public static List