Abstract

As Java 8 introduced functional interfaces and lambda expressions to the Java programming language, the JDK API was changed to introduce support for lambda expressions, thus allowing consumers to define lambda functions when using Java’s collections. While the JDK API allows for a functional paradigm, for API consumers to be able to completely embrace Java’s new functional features, third-party APIs must also support lambda expressions. To understand the current state of the Java ecosystem, we investigate (i) the extent to which third-party Java APIs have changed their interfaces, (ii) why or why not they introduce functional interface support and (iii) in the case the API has changed its interface how it does so. We also investigate the consumers’ perspective, particularly their ease in using lambda expressions in Java with APIs. We perform our investigation by manually analyzing the top 50 popular Java APIs, conducting in-person and email interviews with 23 API producers, and surveying 110 developers. We find that only a minority of the top 50 APIs support functional interfaces, the rest does not support them, predominantly in the interest of backward compatibility. Java 7 support is still greatly desirable due to enterprise projects not migrating to newer versions of Java. This suggests that the Java ecosystem is stagnant and that the introduction of new language features will not be enough to save it from the advent of new languages such as Kotlin (JVM based) and Rust (non-JVM based).

Highlights

  • Java 8 introduced one of the most eagerly anticipated and controversial features, i.e., support for functional interfaces and lambda expressions (Goetz 2013)

  • There is limited empirical evidence on how and to what extent the larger Java ecosystem has adapted to support the use of lambda expressions. We focus on this area by studying how and why third-party APIs have adapted to Java 8 or higher1 by investigating—from the API producer’s perspective—as to what their decision making process is and how changes are implemented

  • We seek their motivations to introduce functional interface support and how far they are willing to go to change their API. This seeks to explore whether there are any motivations beyond what an earlier phase of our study uncovers. We investigate how they perceive these changes in the ecosystem and whether they perceive the importance of adopting versions of APIs that support functional interfaces such that they can develop end-to-end using the functional paradigm

Read more

Summary

Introduction

Java 8 (released in 2014) introduced one of the most eagerly anticipated and controversial features, i.e., support for functional interfaces and lambda expressions (Goetz 2013). Since this introduction, researchers have analyzed how and to what extent lambda expressions have been adopted by the Java development community. Mazinanian et al investigated the usage of lambda expressions in 241 Java open-source software projects (Mazinanian et al 2017) They observed an increasing trend in such usage and found that the primary reasons for developers to adopt lambda expressions were improved readability, reduced code duplication, and lazy evaluation of expressions. This can only happen if third-party APIs (in addition to the Java JDK API) do support lambda expressions

Objectives
Methods
Findings
Discussion
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call