From 7fd8e081bb5854abbd5af996056b44e24bacf6dc Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 30 Sep 2022 11:18:43 -0700 Subject: [PATCH] Allow TestCompiler SourceFile to work with records Update `SourceFile` to try a regex replace to make `record` files look like regular classes. Closes gh-29236 --- framework-platform/framework-platform.gradle | 2 +- .../core/test/tools/SourceFile.java | 9 +++++++ .../core/test/tools/SourceFileTests.java | 27 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/framework-platform/framework-platform.gradle b/framework-platform/framework-platform.gradle index 903790ba5cf..64ab2a5faf3 100644 --- a/framework-platform/framework-platform.gradle +++ b/framework-platform/framework-platform.gradle @@ -41,7 +41,7 @@ dependencies { api("com.sun.xml.bind:jaxb-core:3.0.2") api("com.sun.xml.bind:jaxb-impl:3.0.2") api("com.sun.xml.bind:jaxb-xjc:3.0.2") - api("com.thoughtworks.qdox:qdox:2.0.1") + api("com.thoughtworks.qdox:qdox:2.0.2") api("com.thoughtworks.xstream:xstream:1.4.19") api("commons-io:commons-io:2.11.0") api("de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1") diff --git a/spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java b/spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java index ca0848d3a4c..edf7191df35 100644 --- a/spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java +++ b/spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java @@ -171,6 +171,11 @@ public final class SourceFile extends DynamicFile implements AssertProvider