Skip to content

Commit da2275a

Browse files
authored
Merge pull request quarkusio#41621 from holly-cummins/remove-cloning-config
Remove deprecated cloning pattern config which isn't really useful anymore
2 parents dc9c143 + dc82c01 commit da2275a

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestConfig.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,6 @@ public interface TestConfig {
221221
@WithDefault("all")
222222
TestType type();
223223

224-
/**
225-
* If a class matches this pattern then it will be cloned into the Quarkus ClassLoader even if it
226-
* is in a parent first artifact.
227-
* <p>
228-
* This is important for collections which can contain objects from the Quarkus ClassLoader, but for
229-
* most parent first classes it will just cause problems.
230-
*/
231-
@WithDefault("java\\..*")
232-
@Deprecated(forRemoval = true)
233-
String classClonePattern();
234-
235224
/**
236225
* If this is true then only the tests from the main application module will be run (i.e. the module that is currently
237226
* running mvn quarkus:dev).

integration-tests/main/src/test/java/io/quarkus/it/main/ParameterResolverTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void testSerializableParameterResolver(SomeSerializable someSerializable)
4545

4646
@Test
4747
@ExtendWith(ParameterResolverTest.ListWithNonSerializableParameterResolver.class)
48-
public void testSerializableParameterResolverFallbackToXStream(List<NonSerializable> list) {
48+
public void testSerializableParameterResolverFallback(List<NonSerializable> list) {
4949
assertEquals("foo", list.get(0).value);
5050
assertEquals("bar", list.get(1).value);
5151
}

test-framework/junit5/src/main/java/io/quarkus/test/junit/internal/NewSerializingDeepClone.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.io.UncheckedIOException;
66
import java.lang.reflect.Method;
77
import java.util.function.Supplier;
8-
import java.util.regex.Pattern;
98

109
import org.jboss.marshalling.cloner.ClassCloner;
1110
import org.jboss.marshalling.cloner.ClonerConfiguration;
@@ -20,7 +19,6 @@
2019
*/
2120
public final class NewSerializingDeepClone implements DeepClone {
2221
private final ObjectCloner cloner;
23-
private static Pattern clonePattern;
2422
private RunningQuarkusApplication runningQuarkusApplication;
2523

2624
public NewSerializingDeepClone(final ClassLoader sourceLoader, final ClassLoader targetLoader) {
@@ -56,7 +54,7 @@ public Class<?> cloneProxy(final Class<?> proxyClass) {
5654
Class<?> theClassWeCareAbout = original.getClass();
5755

5856
// Short-circuit the checks if we've been configured to clone this
59-
if (!clonePattern.matcher(theClassWeCareAbout.getName()).matches()) {
57+
if (!theClassWeCareAbout.getName().startsWith("java.")) {
6058

6159
if (theClassWeCareAbout.isPrimitive()) {
6260
// avoid copying things that do not need to be copied
@@ -140,9 +138,6 @@ public Object clone(final Object objectToClone) {
140138
@Override
141139
public void setRunningQuarkusApplication(RunningQuarkusApplication runningQuarkusApplication) {
142140
this.runningQuarkusApplication = runningQuarkusApplication;
143-
String patternString = runningQuarkusApplication.getConfigValue("quarkus.test.class-clone-pattern", String.class)
144-
.orElse("java\\..*");
145-
clonePattern = Pattern.compile(patternString);
146141
}
147142

148143
}

0 commit comments

Comments
 (0)