gnodet commented on PR #23021: URL: https://github.com/apache/camel/pull/23021#issuecomment-4398755092
> most of (all?) requireNonNullMessage are not giving any information. Either remove them or provide a useful message. > > To be honest, I feel like this is the kind of changes that shouldn't be done in a bulk change and reviewed carefully at each place. I checked only few files and found inconsistencies This PR does not modify current semantics. So most fields are annotated with `@Nullable` because there's a no-arg constructor, even though it's not _supposed_ to be `null` at runtime. This is a design flaw in the API, but cannot be fixed by annotations. This PR also adds a profile which uses static byte code analysis to make sure the whole code actually follows the annotations. I could improve the `requireNonNull` messages, but beyond the name of the field, anything else is just noise imho, but I can do some "xxx must be non null` instead of just "xxx". Though the JDK itself is using just the field name, save for Guava. Spring is different and uses `Assert.notNull(obj, "'obj' must not be null")`. -- 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]
