Breaking Changes
- So far ArchUnit's terminology has been a little sloppy with respect to the naming of inner and nested classes. By the JLS "inner classes" are those classes that are nested and not static. ArchUnit's API now reflects this via
JavaClass.isNestedClass()
versusJavaClass.isInnerClass()
. Unfortunately this means that the method formerly calledJavaClass.isInnerClass()
will now return a different result, i.e. it will only returntrue
, if the class is non-static. On the other hand, the methodJavaClass.isNestedClass()
will behave exactly likeisInnerClass()
did in ArchUnit 0.11.0 (see #224; thanks a lot to @rweisleder for the clarification and PR) JavaAccessCondition
does not filter self-accesses anymore. This was confusing behavior that did not solve the issue it was originally intended for. However, this might lead to additional violations showing up (see #209)
Bug Fixes
- Fixed bug where simple name of local classes was incorrect (see #216; thanks a lot to @rweisleder)
static
modifier was missing from nested classes (see #219; thanks a lot to @rweisleder)
Enhancements
Core
- Support for Java 14 (see #230; thanks a lot to @hankem)
JavaModifier
now containsSYNTHETIC
andBRIDGE
allowing more introspection and filtering of synthetic members (see #243; thanks a lot to @alexfedorenchik)- Every property in
archunit.properties
can now be overwritten by passing a system property. This can be valuable in CI environments, e.g. to specify theViolationStore
path forFreezingArchRule
. Compare the user guide (see #252) - A
JavaClass
representing an array can now be queried for its component type (see #187; thanks a lot to @alexfedorenchik) JavaClass
now offers a classpath independent version ofgetMethod(..)
andgetConstructor(..)
(see #236; thanks a lot to @rweisleder)
Lang
- Extended syntax for
classes().thatAreEnums()
andclasses()...should().beEnums()
(see #172; thanks a lot to @rweisleder)
Library
LayeredArchitecture
now also checks that no layer is empty. While originally with good intentions, the ability to define empty layers turned out to do more harm than good (see #177; thanks a lot to @mikomatic)LayeredArchitecture
now allows layers to be defined by predicate. This allows for a way more flexible definition than simple package patterns (see #228; thanks a lot to @mikomatic)FreezingArchRule
can now be configured to be more strict, when checking rules. In particular it is possible to forbid updates of theViolationStore
or the creation of a newViolationStore
. This can serve as a safeguard in CI environments, where a missingViolationStore
is typically a misconfiguration. Compare the user guide (see #211; thanks a lot to @hankem for reviewing and providing valuable improvements)