<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc" -->

---
title: New Java Features Are Not Just for Interviews. Two...
description: Axelix, an open-source tool for debugging Spring Boot apps, uses Java's ScopedValue and sealed interfaces to enforce real invariants in production code....
canonical: https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: New Java Features Are Not Just for Interviews. Two Real-World Use Cases from Axelix | daily.dev
og:description: Axelix, an open-source tool for debugging Spring Boot apps, uses Java's ScopedValue and sealed interfaces to enforce real invariants in production code....
og:url: https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc
og:image: https://api.daily.dev/og/posts/ifwLZgLcC.png
og:image:alt: New Java Features Are Not Just for Interviews. Two Real-World Use Cases from Axelix
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# New Java Features Are Not Just for Interviews. Two Real-World Use Cases from Axelix

**[Foojay.io](https://daily.dev/sources/foojayio)** · 20 min read · 7 upvotes · 0 comments

## Summary

Axelix, an open-source tool for debugging Spring Boot apps, uses Java's ScopedValue and sealed interfaces to enforce real invariants in production code. ScopedValue (finalized in Java 25) carries a security token from an HTTP filter down to the transport layer without polluting method signatures, and unlike ThreadLocal, it has no set() method so callees can't overwrite the binding. Sealed interfaces (Java 17) restrict McpEndpoint to a single record implementation, guaranteeing stable equals/hashCode for safe use as a HashMap key, since a mutable implementation could corrupt lookups after a rename. Both features convert a developer agreement into a platform-enforced constraint.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://foojay.io/today/java-new-features-in-production>

## Questions this post answers

### What is the difference between Java's ScopedValue and ThreadLocal?

ScopedValue binds a value only within a bounded dynamic execution scope on the same thread, with no set() method, so code further down the call stack can read it but cannot overwrite it; when the callback ends, the binding is automatically removed even on exception. ThreadLocal is mutable shared state that any code with a reference can set or remove, and its lifetime depends on manually calling remove(), often in a finally block.

_Developers choosing between context-propagation patterns can compare real tradeoffs like this on daily.dev._

### Why is it risky to use a mutable object as a Java HashMap key?

Because HashMap selects a bucket based on the hashCode at insertion time; if the key's hashCode changes after insertion (for example, after renaming a mutable field), the object stays in its original bucket and later lookups using the new hashCode can fail to find it, even though the entry is still physically present in the map. This can cause security authority checks keyed on such objects to silently fail.

_Anyone debugging mysterious map lookup failures can find patterns like this on daily.dev._

### When was Java's ScopedValue feature finalized and what version introduced sealed interfaces?

ScopedValue was finalized in Java 25. Sealed classes and interfaces were finalized earlier, in Java 17. ScopedValue also has a related feature, StructuredTaskScope, which lets child tasks inherit a binding, but that remains a Preview API in Java 25.

_Teams planning a Java upgrade path can track which features are stable versus preview on daily.dev._

## Similar posts on daily.dev

- [Scoped Values: Why I Banned ThreadLocal in Exeris](https://daily.dev/posts/scoped-values-why-i-banned-threadlocal-in-exeris-hook5lrg1) · Foojay.io · 5 upvotes · 0 comments
- [Java Weekly, Issue 659](https://daily.dev/posts/java-weekly-issue-659-peioe1xl3) · Baeldung · 4 upvotes · 0 comments
- [Value Classes Still Need Compiler Sympathy](https://daily.dev/posts/value-classes-still-need-compiler-sympathy-6gmnyemca) · Inside Java · 0 upvotes · 0 comments
- [Java’s biggest language change in a decade is finally landing. It took 197,000 lines of code.](https://daily.dev/posts/java-s-biggest-language-change-in-a-decade-is-finally-landing-it-took-197-000-lines-of-code--8eeespmnb) · The Next Web · 39 upvotes · 1 comments

---

Tags: [#java](https://daily.dev/tags/java), [#spring-boot](https://daily.dev/tags/spring-boot)

[View this post on daily.dev](https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"New Java Features Are Not Just for Interviews. Two Real-World Use Cases from Axelix","url":"https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc"},"datePublished":"2026-10-27T01:06:43.728Z","dateModified":"2026-10-27T01:11:51.845Z","description":"Axelix, an open-source tool for debugging Spring Boot apps, uses Java's ScopedValue and sealed interfaces to enforce real invariants in production code....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9094d2cdf2a83fe1a9db7ffc49213d7f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9094d2cdf2a83fe1a9db7ffc49213d7f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Foojay.io","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Foojay.io","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1820f6a6ae944760aa322b67ed85f848","url":"https://daily.dev/sources/foojayio"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,spring-boot","timeRequired":"PT20M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Foojay.io","item":"https://daily.dev/sources/foojayio"},{"@type":"ListItem","position":3,"name":"New Java Features Are Not Just for Interviews. Two Real-World Use Cases from Axelix"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/new-java-features-are-not-just-for-interviews-two-real-world-use-cases-from-axelix-ifwlzglcc#faq","mainEntity":[{"@type":"Question","name":"What is the difference between Java's ScopedValue and ThreadLocal?","acceptedAnswer":{"@type":"Answer","text":"ScopedValue binds a value only within a bounded dynamic execution scope on the same thread, with no set() method, so code further down the call stack can read it but cannot overwrite it; when the callback ends, the binding is automatically removed even on exception. ThreadLocal is mutable shared state that any code with a reference can set or remove, and its lifetime depends on manually calling remove(), often in a finally block. Developers choosing between context-propagation patterns can compare real tradeoffs like this on daily.dev."}},{"@type":"Question","name":"Why is it risky to use a mutable object as a Java HashMap key?","acceptedAnswer":{"@type":"Answer","text":"Because HashMap selects a bucket based on the hashCode at insertion time; if the key's hashCode changes after insertion (for example, after renaming a mutable field), the object stays in its original bucket and later lookups using the new hashCode can fail to find it, even though the entry is still physically present in the map. This can cause security authority checks keyed on such objects to silently fail. Anyone debugging mysterious map lookup failures can find patterns like this on daily.dev."}},{"@type":"Question","name":"When was Java's ScopedValue feature finalized and what version introduced sealed interfaces?","acceptedAnswer":{"@type":"Answer","text":"ScopedValue was finalized in Java 25. Sealed classes and interfaces were finalized earlier, in Java 17. ScopedValue also has a related feature, StructuredTaskScope, which lets child tasks inherit a binding, but that remains a Preview API in Java 25. Teams planning a Java upgrade path can track which features are stable versus preview on daily.dev."}}]}
```

