version of the Kata using Java 8 features
-
JEP 269 introduces convenient factory methods to create unmodifiable lists and maps. Rewrite
ExprTest
to useList.of(...)
andMap.of(...)
and remove the classTestHelper
which is not needed anymore. -
Java 11 adds a method String.lines() to the API. In
ExprTests.parseAll()
, the code can be simplified leveragingString.lines()
instead of creating aStringReader
and aBufferedReader
. -
JEP 213 allow private methods to be declared in interface. The class
Expressions
is not necessary anymore because the code ofExpressions.parse(Iterator)
can be moved intoExpr
. -
JEP 286 introduces local variable type inference using 'var' so all local variable declarations can be rewritten using 'var'.
Once all these refactoring are done, you can continue with the migration to Java 17.