From b58a6cc2fcdc33aef2fe586eaa34ba57dfda9f47 Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Tue, 31 Mar 2026 16:24:47 +0200 Subject: [PATCH 1/2] Update migration.md with ServiceExceptionUtils removals for CAP Java 5.0 Adds OpenRewrite recipes for ServiceExceptionUtils method removals to the recipes table, and documents the removed methods and their replacements in the Removed Java APIs section, keeping existing placeholder sections intact. --- java/migration.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/java/migration.md b/java/migration.md index d020241fb..1ef984cb0 100644 --- a/java/migration.md +++ b/java/migration.md @@ -48,6 +48,11 @@ Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` from C |Name |Description|Available since| |--------|-----------|---------------| |[com.sap.cds.services.migrations.MigrateStatements](../releases/2025/aug25#typed-query-results)|Migrates CQN statements to comply with typed Query API changes in 4.3.0.|4.3.0| +|[com.sap.cds.services.recipes.GetLocalizedMessage](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getLocalizedMessage(String, Object[], Locale)` with the overload that passes `true` as `errorStatusFallback`.|5.0.0| +|[com.sap.cds.services.recipes.GetMessageTarget](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getMessageTarget(String)` with `MessageTarget#create(String)`.|5.0.0| +|[com.sap.cds.services.recipes.GetMessageTargetWithPath](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getMessageTarget(String, Function)` with `MessageTarget#create(String, Function)`.|5.0.0| +|[com.sap.cds.services.recipes.GetMessageTargetWithTypedPath](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getMessageTarget(String, Class, Function)` with `MessageTarget#create(String, Class, Function)`.|5.0.0| +|[com.sap.cds.services.recipes.GetMessageTargetWithElement](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getMessageTarget(Path, CdsElement)` with `MessageTarget#create(Path, CdsElement)`.|5.0.0| ## CAP Java 4.9 to CAP Java 5.0 (TBA) { #four-to-five } @@ -90,13 +95,16 @@ The following table gives an overview about the removed properties: | --- | --- | | `abc` | Any description about replacement | -### Removed Java APIs +### Removed Java APIs { #service-exception-utils-removals } -- Removed deprecated classes: - - `com.sap.cds.A`, use `B` instead +The following deprecated methods on [`ServiceExceptionUtils`](https://www.javadoc.io/doc/com.sap.cds/cds-services-api/latest/com/sap/cds/services/ServiceExceptionUtils.html) have been removed (they were marked `forRemoval` in previous releases). Use the `MessageTarget` factories or the four-argument `getLocalizedMessage` overload instead. - Removed deprecated methods: - - `com.sap.cds.ql.cqn.A.search(String term)`, use `searchTerm(CqnSearchTermPredicate)` instead + - `getLocalizedMessage(String code, Object[] args, Locale locale)` → `getLocalizedMessage(code, args, locale, true)` (pass `true` for `errorStatusFallback` to keep the previous behavior) + - `getMessageTarget(String target)` → `MessageTarget.create(target)` + - `getMessageTarget(String parameter, Function, Object> path)` → `MessageTarget.create(parameter, path)` + - `getMessageTarget(String parameter, Class type, Function path)` → `MessageTarget.create(parameter, type, path)` + - `getMessageTarget(Path path, CdsElement element)` → `MessageTarget.create(path, element)` ## CAP Java 3.10 to CAP Java 4.0 { #three-to-four } From eb6aad9d511a9fcba5f5f2f9709599089e2b601f Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Thu, 2 Apr 2026 11:58:44 +0200 Subject: [PATCH 2/2] Update migration.md with SaasRegistryDependency removals for CAP Java 5.0 --- java/migration.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java/migration.md b/java/migration.md index 1ef984cb0..8e76a3054 100644 --- a/java/migration.md +++ b/java/migration.md @@ -53,6 +53,7 @@ Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` from C |[com.sap.cds.services.recipes.GetMessageTargetWithPath](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getMessageTarget(String, Function)` with `MessageTarget#create(String, Function)`.|5.0.0| |[com.sap.cds.services.recipes.GetMessageTargetWithTypedPath](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getMessageTarget(String, Class, Function)` with `MessageTarget#create(String, Class, Function)`.|5.0.0| |[com.sap.cds.services.recipes.GetMessageTargetWithElement](#service-exception-utils-removals)|Replaces `ServiceExceptionUtils#getMessageTarget(Path, CdsElement)` with `MessageTarget#create(Path, CdsElement)`.|5.0.0| +|[com.sap.cds.services.migrations.MigrateSaasRegistryDependency](#saas-registry-dependency-removals)|Replaces deprecated `SaasRegistryDependency` methods `setAppId`/`setAppName`/`getAppId`/`getAppName` with their `xsappname`-based replacements.|5.0.0| ## CAP Java 4.9 to CAP Java 5.0 (TBA) { #four-to-five } @@ -106,6 +107,16 @@ The following deprecated methods on [`ServiceExceptionUtils`](https://www.javado - `getMessageTarget(String parameter, Class type, Function path)` → `MessageTarget.create(parameter, type, path)` - `getMessageTarget(Path path, CdsElement element)` → `MessageTarget.create(path, element)` +### Removed Java APIs { #saas-registry-dependency-removals } + +The following deprecated methods on [`SaasRegistryDependency`](https://www.javadoc.io/doc/com.sap.cds/cds-feature-mt/latest/com/sap/cds/services/mt/SaasRegistryDependency.html) have been removed. Use `getXsappname()` / `setXsappname(String)` instead. + +- Removed deprecated methods: + - `getAppId()` → `getXsappname()` + - `setAppId(String appId)` → `setXsappname(appId)` + - `getAppName()` → `getXsappname()` + - `setAppName(String appName)` → `setXsappname(appName)` + ## CAP Java 3.10 to CAP Java 4.0 { #three-to-four } ### New License