diff --git a/xstream-distribution/src/content/changes.html b/xstream-distribution/src/content/changes.html index fd226029f..65e08e4a3 100644 --- a/xstream-distribution/src/content/changes.html +++ b/xstream-distribution/src/content/changes.html @@ -115,6 +115,7 @@

Minor changes

  • GHPR:#331, GHI:#326: Fix handling of empty java.util.concurrent.atomic.AtomicReference (by Alex Blekhman of Atlassian).
  • GHPR:#334: Fix remaining buffer size calculation in QuickWriter (by Higuchi Yuta).
  • GHI:#342: Optimize internal handling of children in DomReader avoiding O(n²) access times for siblings (by Shiang-Yun Yang).
  • +
  • GHPR:#349: Fix support of lambda objects for Java 21 and above (Tobias Gierke).
  • GHI:#359: Add KEYS file with public keys to verify signed artifacts.
  • Detect input manipulation in c.t.x.io.binary.BinaryStreamReader.
  • diff --git a/xstream/src/java/com/thoughtworks/xstream/core/util/Types.java b/xstream/src/java/com/thoughtworks/xstream/core/util/Types.java index 5168be7a3..ad1c7e4aa 100644 --- a/xstream/src/java/com/thoughtworks/xstream/core/util/Types.java +++ b/xstream/src/java/com/thoughtworks/xstream/core/util/Types.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 XStream Committers. + * Copyright (C) 2015, 2024 XStream Committers. * All rights reserved. * * Created on 17. January 2015 by Joerg Schaible @@ -16,10 +16,13 @@ * @since 1.4.8 */ public class Types { - private static final Pattern lambdaPattern = Pattern.compile(".*\\$\\$Lambda\\$[0-9]+/.*"); + private static final Pattern lambdaPattern = Pattern.compile(".*\\$\\$Lambda(?:\\$[0-9]+|)/.*"); public static final boolean isLambdaType(final Class type) { - return type != null && type.isSynthetic() && lambdaPattern.matcher(type.getSimpleName()).matches(); + if (type != null && type.isSynthetic()) { + final String typeName = type.getSimpleName(); + return lambdaPattern.matcher(typeName).matches(); + } + return false; } - }