allthingssecurity commented on PR #28787:
URL: https://github.com/apache/camel/pull/28787#issuecomment-6555811384
Thanks @davsclaus, both points are in 0da13d8bbdbd.
1. Two or more wildcard imports: `isDstWorld` takes your rule and is used in
both places. It accepts `DstWorld` resolved to the file's own package when the
file has a non-static on-demand import of `org.apache.camel.test.dst`.
Following the "never drop silently" principle, an annotation named `DstWorld`
that resolves to the file's own package *without* that import, in a file that
refers to camel-test-dst, now fails the build. It used to be skipped.
A file that does not refer to camel-test-dst at all (no import, full name
or package) is still not parsed. Its `DstWorld` can only be another annotation,
so failing there would break unrelated code. That is why the "other package via
wildcard" case is "not found" rather than an error.
New `DstWorldsHelperTest` cases:
- `java.util.*` + `org.apache.camel.test.dst.*` (in both orders, and with
a static wildcard): found.
- `java.util.*` + `org.other.*`: not found.
- The dst wildcard next to `import org.other.DstWorld;`: not found,
because the import by name wins.
- The unresolved case: fails.
On the previous head, the two-imports and unresolved tests fail. If the
package check is dropped from the new rule, the import-by-name test fails.
2. The top-level check now compares the annotated class with the class named
after the file, not with `getGoverningType()`. A package-private helper
declared before `public final class FooWorld` is now found. A world on another
class of the file still fails, with a message that names the file's class. The
`DstWorld` Javadoc and guide step 10 say "the top-level class named after the
file".
The JSON of the 5 components, their catalog copies and the generated
`test-dst.adoc` table are unchanged. `DstWorldsHelperTest` passes 12/12 (20
runs), and so do `CamelCatalogDstWorldsTest` and the 5 worlds. The branch still
merges cleanly with #28782 and main.
_Claude Code on behalf of allthingssecurity_
--
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]