You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it a static final String or primitive constant? Those are not referenced as dependencies in the byte code, but just inlined in the constant pool of the class that uses it, cf. #298 (comment), which is why ArchUnit unfortunately currently cannot detect them. But as these are actually no runtime dependencies, cf. #298 (comment), it might be okayish to not have a violation for them?
It indeed is a String... thanks for the response and I guess sorry for not finding the answer myself.
In regards to this behavior being okayish - it is not a tragedy, but mostly because static final fields are easy to move around.
We aim to have those packages to simulate completely separate "modules" and slowly push the architecture in that direction over time - so even compile-time dependencies mean that at some point in future we will have to eliminate them (we hoped that arch unit will help us make sure that, at least, no new violations will be introduced).
Given actual example from our codebase:
I would expect that if I reference public static variable from one of the slices in the other slice - that would cause a rule violation.
It doesn't.
Detecting other dependencies (like method calls) works.
Is it intentional?
The text was updated successfully, but these errors were encountered: