Since log4j 3.x is based on Java 11, that adds several new features
that we can use. In particular, I've found two syntax additions that
may be useful (besides the various API updates in the standard class
library):

* var keyword for local variables (annoyingly requires the use of "final var")
* private methods on interfaces (static or instance)

So far, I've only found myself using the var keyword in some fairly
limited situations to avoid extra long lines, but not very often. The
private methods on interfaces makes it easier to break up interface
default methods and such without util classes or other workarounds.
There are possibly more features that I'm missing (besides the beta
features that were released in later versions like text blocks),
though most of the Java syntax changes since v8 seem to be in versions
between 12 and 17 (switch expressions, records, pattern matching,
etc.).

Reply via email to