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
privatestaticfinalJavaClassesMODULE_CLASSES=newClassFileImporter().importPath("build/classes/java")
def"should mappers be public"() {
given: "a rule"ArchRule rule = classes()
.should()
.bePublic()
expect: "rule is not broken"
rule.check(MODULE_CLASSES)
}
I'm getting this error:
java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'classes should be public' was violated (1 times):
Class <com.example.ExampleEnumMapper$1> does not have modifier PUBLIC in (ExampleEnumMapper.java:0)
The text was updated successfully, but these errors were encountered:
The problem is that I'm not sure if there is a general rule to deal with synthetic code. And once excluded there will be no way anymore for users to interact with it at all. I'm just thinking about dependency cases, where the source code actually results in a synthetic class (or method) being created where the compiled source code then lives. If the synthetic code is just ignored we suddenly don't have any traces more of the dependencies that were in the original source code.
I once experimented quite a lot to remove all synthetic members in #87 and I couldn't figure out a way to make it work without losing information in some place.
If we talk about dependencies, then it's still better to see Class <a.b.Magic$synthetic$123> calls method <a.b.Foo.bar()>... than not having any trace anymore at all even though it's in the source code 🤔 In particular, if things like the Kotlin compiler are also taken into consideration.
Hi,
I'm using
ArchUnit 1.0.1
withJava 17
and have a similar problem as described in #570 resolved by PR #895I have this enum:
and mapper
When I'm executing this test:
I'm getting this error:
The text was updated successfully, but these errors were encountered: