gnodet opened a new pull request, #23194: URL: https://github.com/apache/camel/pull/23194
[CAMEL-22640](https://issues.apache.org/jira/browse/CAMEL-22640) ## Summary Follow-up to #23021 — removes `@Nullable` from fields and parameters that are already enforced as non-null or are never null in practice. The previous PR documented *current reality*; this PR tightens the contract where *intentionality* is clear. ## Changes - **`InvalidPayloadException.type`** / **`InvalidPayloadRuntimeException.type`**: Remove `@Nullable` from field and getter — all constructors enforce non-null via `requireNonNull`. The `@Nullable` was only there because the field is `transient`. - **`ExpectedBodyTypeException.exchange`** + **`expectedBodyType`**: Same — single constructor enforces non-null via `requireNonNull`. - **`ResolveEndpointFailedException.uri`**: Remove `@Nullable` from field, constructors, and getter — zero callers across the entire codebase pass null. Add `requireNonNull` enforcement. - **`LifecycleStrategy.onThreadPoolAdd()` `id` param**: Remove `@Nullable` — `BaseExecutorServiceManager.onThreadPoolCreated()` always computes a non-null id (with `StringHelper.notEmpty()` enforcement at line 584). - **`DataType(String urn)` constructor**: Remove `@Nullable` and the null-to-`ANY` fallback. Callers should use `DataType.ANY` explicitly. No callers pass null. ## Verification - `mvn install -B -pl core/camel-api -DskipTests -am` — BUILD SUCCESS - `mvn install -B -pl core/camel-core -DskipTests` — BUILD SUCCESS (downstream compilation) - `mvn formatter:format impsort:sort -B -pl core/camel-api` — no formatting changes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
