From 56f2972e7bddd9059026e880cc9f6d0fa7a7a135 Mon Sep 17 00:00:00 2001 From: Jacopo Cappellato Date: Thu, 9 Apr 2026 11:54:32 +0200 Subject: [PATCH 1/3] Fixed: Update Gradle wrapper to version 8.14.4 --- gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 39 +++++++++------- gradlew.bat | 58 ++++++++++-------------- 3 files changed, 49 insertions(+), 51 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b3715553af5..aaaabb3cb9f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 3b31112c3f2..23d15a93670 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,10 +85,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -133,10 +133,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,16 +200,20 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. @@ -241,4 +248,4 @@ eval "set -- $( tr '\n' ' ' )" '"$@"' -exec "$JAVACMD" "$@" \ No newline at end of file +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 5093609d512..db3a6ac207e 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -54,49 +57,36 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal From 6ab4783a9547498b3787f4bdde47d88a9a17bf4d Mon Sep 17 00:00:00 2001 From: Jacopo Cappellato Date: Thu, 9 Apr 2026 14:07:07 +0200 Subject: [PATCH 2/3] Backported: Refactor boolean assignments to comply with codestyle rules --- .../ofbiz/accounting/payment/GiftCertificateServices.java | 4 ++-- .../ofbiz/accounting/thirdparty/gosoftware/RitaServices.java | 2 +- .../accounting/thirdparty/valuelink/ValueLinkServices.java | 4 ++-- .../org/apache/ofbiz/content/ContentManagementServices.java | 2 +- .../apache/ofbiz/content/webapp/ftl/RenderContentAsText.java | 2 +- .../ofbiz/content/webapp/ftl/RenderSubContentAsText.java | 2 +- .../content/webapp/ftl/RenderSubContentCacheTransform.java | 2 +- .../apache/ofbiz/manufacturing/techdata/TechDataServices.java | 2 +- .../org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java | 2 +- .../apache/ofbiz/order/shoppinglist/ShoppingListEvents.java | 2 +- .../org/apache/ofbiz/party/contact/ContactMechServices.java | 2 +- .../main/java/org/apache/ofbiz/party/party/PartyServices.java | 4 ++-- .../org/apache/ofbiz/product/product/ProductServices.java | 4 ++-- .../org/apache/ofbiz/base/conversion/BooleanConverters.java | 2 +- .../java/org/apache/ofbiz/common/email/EmailServices.java | 3 +-- .../src/main/java/org/apache/ofbiz/entity/GenericEntity.java | 2 +- .../java/org/apache/ofbiz/widget/model/ModelFormField.java | 4 ++-- 17 files changed, 22 insertions(+), 23 deletions(-) diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java index 81050d6f452..fd8f7754267 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java @@ -827,8 +827,8 @@ public static Map giftCertificatePurchase(DispatchContext dctx, String orderEmails = orh.getOrderEmailString(); String copyMeField = giftCertSettings.getString("purchSurveyCopyMe"); String copyMeResp = copyMeField != null ? (String) answerMap.get(copyMeField) : null; - boolean copyMe = (UtilValidate.isNotEmpty(copyMeField) - && UtilValidate.isNotEmpty(copyMeResp) && "true".equalsIgnoreCase(copyMeResp)) ? true : false; + boolean copyMe = UtilValidate.isNotEmpty(copyMeField) + && UtilValidate.isNotEmpty(copyMeResp) && "true".equalsIgnoreCase(copyMeResp); int qtyLoop = quantity.intValue(); for (int i = 0; i < qtyLoop; i++) { diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java index a6ae5278e6c..c49475d78b9 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java @@ -454,7 +454,7 @@ private static RitaApi getApi(Properties props) { } catch (RuntimeException e) { Debug.logError(e, MODULE); } - boolean ssl = "Y".equals(props.getProperty("ssl", "N")) ? true : false; + boolean ssl = "Y".equals(props.getProperty("ssl", "N")); RitaApi api = null; if (port > 0 && host != null) { diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java index 1bf44d749d7..7d33fc57026 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java @@ -1111,8 +1111,8 @@ public static Map giftCardPurchase(DispatchContext dctx, Map updateOrRemove(DispatchContext dctx, Map checkRoutingTaskAssoc(DispatchContext ctx, Map Timestamp thruDate = (Timestamp) context.get("thruDate"); String create = (String) context.get("create"); - boolean createProcess = (create != null && "Y".equals(create)) ? true : false; + boolean createProcess = "Y".equals(create); List listRoutingTaskAssoc = null; try { diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java index d51273f19aa..b7a0864b6f2 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java @@ -1050,7 +1050,7 @@ public static String determineNextFinalizeStep(HttpServletRequest request, HttpS requireTerm = requireTermStr == null || "true".equalsIgnoreCase(requireTermStr); } requireAdditionalParty = requireAdditionalPartyStr == null || "true".equalsIgnoreCase(requireAdditionalPartyStr); - isSingleUsePayment = singleUsePaymentStr != null && "Y".equalsIgnoreCase(singleUsePaymentStr) ? true : false; + isSingleUsePayment = "Y".equalsIgnoreCase(singleUsePaymentStr); } boolean shippingAddressSet = true; diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java index dbc98caa17c..94cdc374c32 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java @@ -535,7 +535,7 @@ public static String restoreAutoSaveList(HttpServletRequest request, HttpServlet // check to see if we are okay to load this list java.sql.Timestamp lastLoad = cart.getLastListRestore(); - boolean okayToLoad = autoSaveListId == null ? false : (lastLoad == null ? true : false); + boolean okayToLoad = autoSaveListId != null && lastLoad == null; if (!okayToLoad && lastLoad != null) { GenericValue shoppingList = null; try { diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java index 836ed25cf6c..6ca63efdf6c 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java @@ -903,7 +903,7 @@ public static Map getPartyContactMechValueMaps(DispatchContext c } } Boolean bShowOld = (Boolean) context.get("showOld"); - boolean showOld = (bShowOld != null && bShowOld) ? true : false; + boolean showOld = Boolean.TRUE.equals(bShowOld); String contactMechTypeId = (String) context.get("contactMechTypeId"); List> valueMaps = ContactMechWorker.getPartyContactMechValueMaps(delegator, partyId, showOld, contactMechTypeId); result.put("valueMaps", valueMaps); diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java index 929a41368fc..5b2ea3147e6 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java @@ -2262,8 +2262,8 @@ public static Map findPartyById(DispatchContext ctx, Map partiesFound = null; diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java index 47c9f596f79..3a934199289 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java @@ -1319,8 +1319,8 @@ public static Map findProductById(DispatchContext ctx, Map productsFound = null; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java index 163d7b7a3ee..16568997e33 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java @@ -63,7 +63,7 @@ public IntegerToBoolean() { @Override public Boolean convert(Integer obj) throws ConversionException { - return obj == 0 ? false : true; + return obj != 0; } } diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java index 7b92eb97102..3f01063faa4 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java @@ -206,8 +206,7 @@ public static Map sendMail(DispatchContext ctx, Map Date: Thu, 9 Apr 2026 14:08:29 +0200 Subject: [PATCH 3/3] Fixed: Increase memory for checkstyleMain to support Gradle 8+ --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 7a4447594b1..78a20460af9 100644 --- a/build.gradle +++ b/build.gradle @@ -268,6 +268,8 @@ checkstyle { // 'checkstyle' tool present in the framework and in the official // plugins. tasks.checkstyleMain.maxErrors = 0 + // Increase memory for checkstyleMain required for Gradle 8+. + tasks.checkstyleMain.maxHeapSize = '1g' // Currently there are no errors so we can show new one when they appear showViolations = true }