Paul Krill
Editor at Large

Kotlin gains Java coding enhancements

news
Jun 29, 20212 mins

Kotlin 1.5.20 adds experimental support for Java libraries that help to reduce boilerplate coding and to maintain null safety when interoperating with Java code.

Coffee with cream and sugar.
Credit: TheCulinaryGeek

With the Kotlin 1.5.20 update, the JetBrains-developed Kotlin language gets preliminary backing for the Lombok Java library, which is intended to make coding easier, along with JSpecify Java nullness capabilities.

Released June 23, Kotlin 1.5.20 has experimental support for calling Lombok-generated methods. The addition of the Lombok compiler plug-in allows generation of Lombok declarations in Java by Kotlin code in the same mixed Java/Kotlin module. The Lombok library plugs into an editor and build tools and works to reduce the need to write boilerplate code with capabilities such as automation of logging variables.

Kotlin 1.5.20 also has experimental support for JSpecify, which provides standard Java annotations for static analysis. A unified set of Java nullness annotations is featured in JSpecify, providing more nullability information to help Kotlin maintain null safety when interoperating with Java.

Instructions on installing Kotlin 1.5.20 can be found at blog.jetbrains.com. Other capabilities in Kotlin 1.5.20 include:

  • For Gradle, parallel execution of Kotlin tasks is now fully controlled by the Gradle parallel execution mechanism while the kotlin.parallel.tasks.in.project property has been deprecated. Also for Gradle, Kotlin 1.5.20 implements experimental caching of annotation processors’ classloaders in kapt, to speed up kapt for consecutive Gradle runs in some cases.
  • The Kotlin/Native compiler now can export documentation comments from Kotlin code to Objective-C frameworks. This experimental support also works for the Swift language.
  • Work continues on stabilizing the Kotlin/JS IR back end. A migration guide is offered to assist with migrating to the new JavaScript back end.
  • For the standard library, <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/is-lower-case.html" rel="nofollow">isLowerCase()</a> and isUpperCase() now provide the same result on all platforms by checking all characters, not just letters. Also, digitToInt() now supports all Unicode digit characters for all Kotlin platforms, including the JVM, native, and JavaScript.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author