Email Icon   Forward to a friend
Oracle Logo
Java Magazine
Say goodbye to pesky null pointer exceptions forever!

Week of July 20, 2020
Do you like null pointer exceptions? If so, good for you, and please skip the rest of this paragraph. Otherwise, keep reading: Most developers detest those exceptions, because it can be tricky to distinguish between null as a value versus null as an indicator that data is missing. That’s why Java 8 introduced the Optional class, and that’s why Optional has been enhanced and extended ever since.

A few weeks ago, Java Magazine published a dozen recipes for using the Optional class, written by Java Champion Mohamed Taman. In his continuation of that discussion, we now present “The Java Optional class: 11 more recipes for preventing null pointer exceptions.” This time, you’ll read all about Mohamed’s favorite antipatterns and design smells around Optional, gleaned from tons of coding and design reviews.

Another continuation: Last year, Java Magazine began an exploration of Java Card 3.1, the latest iteration of the platform designed to deliver new functions for communications and IoT applications. Check out Nicolas Ponsini’s new article, “Java Card 3.1 explored.”

Some work in progress: Don’t know if you caught the release of Oracle Coherence Community Edition. Here’s a blog on the launch by my colleague Randy Stafford, who knows the platform better than anyone, IMHO. Randy’s team is working on a deep-dive article for Java Magazine, which should be out shortly. In the meantime, if you are interested in Coherence’s in-memory data grid, watch the launch video here.

New quizzes! We post one each Tuesday. Visit Java Magazine or follow us on social media to try the latest challenges from Simon Roberts and Mikalai Zaikin.

Finally, did you know that Java Magazine has an RSS feed? Subscribe today to see the latest articles as soon as they appear.

Take care,
Alan Zeichick
Editor in Chief, Java Magazine
@zeichick
The newest articles
The Java Optional class: 11 more recipes for preventing null pointer exceptions
Building on his previous article, Mohamed Taman shares 11 more recipes, antipatterns, and design smells to help everyone use the Optional class more effectively. Not only do these recipes help make code more readable, but they also eliminate unpleasant (and disastrous) side effects.

Java Card 3.1 explored
Java Card 3.1 is a major update of the Java Card SDK. A key goal of this release is to ensure the availability of security services on a large range of heterogeneous secure hardware, including smartcards, embedded chips, secure enclaves, and removable SIM cards. Last year, Nicolas Ponsini described many of the services available in the new release. In this article, Nicolas digs deeper into the deployment model, core features, and cryptography extensions.
Still new, but not as new
Get started with JavaFX on Raspberry Pi
The inexpensive Raspberry Pi single-board computer is the ideal starting point for experimenting with electronic components—and you can combine that affordable hardware with the software tools you use every day. This article by Frank Delporte walks through the steps needed to build a running JavaFX application on the device.

Streaming analytics with Java and Apache Flink
Eric Bruno explains that with IoT and edge applications, some analytics approaches and frameworks use minibatch processing to approximate real-time analytics. This article explores the use of Apache Flink with a built-in complex event processing engine for a low-latency, real-time streaming analytics solution.
Java Cookbook, 4th Edition
Java Cookbook, 4th Edition
Andrew Binstock critiques the latest Java recipe book by Ian Darwin. While impressed by the number of topics that are covered—including many less-common problems—the reviewer does point out a few minor flaws in an otherwise exemplary tome.
Concurrent programming with Concurnas
Let’s explore Concurnas, a new programming language targeting the JVM. With tour guide Jason Tatton—the language’s creator—we’ll see how to build concurrent and parallel systems that take advantage of today’s multicore CPU and GPU hardware architectures.

Get started with concurrency in Jakarta EE
Speaking of concurrency: One of the cornerstones of any well-written application is good performance, and on the Jakarta EE platform, that means using the Jakarta Concurrency API. Josh Juneau, a Java Champion and Jakarta EE Ambassador, walks us through the API and its differences from Java SE’s java.util.concurrent.

The 25 greatest Java apps ever written
From space exploration to genomics, from reverse compilers to robotic controllers, Java is at the heart of today’s world. Alexa Weber Morales highlights a few of the countless Java apps that stand out from the crowd.
Complimentary subscription to Java Magazine
Java Magazine is a deep dive into Java and the JVM. Find detailed explanations about the language and the platform written by experts and members of the Java development team.

Join a quarter of a million subscribers in getting useful, authoritative programming information delivered directly to your inbox.
Stay connected
Facebook Twitter RSSfeed