Class ScopedValuesSecondPreviewNotes

java.lang.Object
net.jrodolfo.java_evolution.java22.scoped_values.ScopedValuesSecondPreviewNotes

public class ScopedValuesSecondPreviewNotes extends Object
Explains scoped values as a Java 22 second preview feature.

Scoped values address the same problem as the Java 21 preview: sharing immutable contextual data through a bounded scope without the cleanup hazards of many ThreadLocal designs.

Java 22 kept the API in preview, so this repository keeps the version entry explanatory and points to the final Java 25 scoped-values module for runnable code.

  • Constructor Details

    • ScopedValuesSecondPreviewNotes

      public ScopedValuesSecondPreviewNotes()
  • Method Details

    • problemSolved

      public String problemSolved()
      Explains the goal of scoped values.
      Returns:
      a short explanation
    • threadLocalMotivation

      public String threadLocalMotivation()
      Compares scoped values with a common older approach.
      Returns:
      a short comparison
    • boundedDynamicScope

      public String boundedDynamicScope()
      Explains bounded dynamic scope in plain language.
      Returns:
      a short explanation
    • nextStep

      public String nextStep()
      Points learners to the final Java 25 module.
      Returns:
      a short next-step note
    • secondPreviewStatus

      public String secondPreviewStatus()
      Describes the Java 22 maturity level.
      Returns:
      a short status note