Category Archives: Java language

Using JsonPath safely with Jackson’s JsonNode tree model

When working with JSON in Java, Jackson’s JsonNode tree model is a popular choice — especially in framework code that processes or transforms data. But what if you want to query that tree using flexible JsonPath expressions?

Jayway JsonPath is a powerful tool, but using it with pre-parsed Jackson trees isn’t as obvious as you’d think — especially when you’re aiming for safe, predictable behavior in production.

In this post, I’ll share a few techniques I found helpful for reliably applying JsonPath to JsonNode trees, making your queries safer, clearer, and better suited to framework-level code.

Continue reading

Value Types & List<int> coming for Java 10 ?

Oracle, with lead engineer Brian Goetz, have launched an experimental OpenJDK project to bring long-awaited features to the Java platform.

Major enhancements to generics & new ‘value types’ are planned. Highlights include:

  • Value Types;  highly-efficient small ‘objects’ without inheritance.
  • Reified Generics;  retaining their actual type at runtime.
  • Generic Specialization;  List<int> would be valid & highly efficient.
  • ‘volatile’ enhancements.

The effort is named Project Valhalla. Here’s a preview: Continue reading