-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rule not to use ASM from (most) domain classes
It was a conscious decision to allow the access from `JavaClassDescriptor`, because using the ASM infrastructure there is just very convenient and duplicating the logic into ArchUnit seems like more pain than gain for now (since this one isolated place would also be easy to fix in the future if need arises). However, there are also some conceptual dependencies from `JavaModifier` to ASM which were accidental, because it was just a convenient design to code those opcodes into the enum constants. Furthermore, we can't easily fix this anymore now, because there is public API in `JavaModifier` that allows creating modifiers from "ASM access" (which already shows the design flaw here). Likely the idea was that this would allow to create `JavaModifier`s from Reflection class objects, etc., but in hindsight I think this makes no sense. I would also suspect that actually no user ever uses this API. And it breaks the principle that users never create ArchUnit domain objects (which is a guideline for all other places). Thus, we deprecate these methods for now so we can remove them at some point in the future. Signed-off-by: Peter Gafert <[email protected]>
- Loading branch information
1 parent
7d41549
commit 165dbbd
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters