Skip to content

Commit 36fa8bd

Browse files
committed
Remove unused constructors in TestGenerationContext
1 parent 59c2f4c commit 36fa8bd

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

spring-core/src/testFixtures/java/org/springframework/core/testfixture/aot/generate/TestGenerationContext.java

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323

2424
/**
2525
* {@link GenerationContext} test implementation that uses
26-
* {@link InMemoryGeneratedFiles} by default.
26+
* {@link InMemoryGeneratedFiles} and provides a convenient
27+
* {@link TestTarget} by default.
2728
*
2829
* @author Stephane Nicoll
2930
* @author Sam Brannen
@@ -35,35 +36,17 @@ public class TestGenerationContext extends DefaultGenerationContext {
3536
* Create an instance using {@link TestTarget} as the default target class.
3637
*/
3738
public TestGenerationContext() {
38-
this(TestTarget.class);
39-
}
40-
41-
/**
42-
* Create an instance using the specified {@code target}.
43-
* @param target the default target class to use
44-
*/
45-
public TestGenerationContext(Class<?> target) {
46-
this(new ClassNameGenerator(target));
39+
this(new ClassNameGenerator(TestTarget.class));
4740
}
4841

4942
/**
5043
* Create an instance using the specified {@link ClassNameGenerator}.
5144
* @param classNameGenerator the class name generator to use
5245
*/
5346
public TestGenerationContext(ClassNameGenerator classNameGenerator) {
54-
this(classNameGenerator, new InMemoryGeneratedFiles());
47+
super(classNameGenerator, new InMemoryGeneratedFiles());
5548
}
5649

57-
/**
58-
* Create an instance using the specified {@link ClassNameGenerator} and
59-
* {@link InMemoryGeneratedFiles}.
60-
* @param classNameGenerator the class name generator to use
61-
* @param generatedFiles the generated files
62-
*/
63-
public TestGenerationContext(ClassNameGenerator classNameGenerator,
64-
InMemoryGeneratedFiles generatedFiles) {
65-
super(classNameGenerator, generatedFiles);
66-
}
6750

6851
@Override
6952
public InMemoryGeneratedFiles getGeneratedFiles() {

spring-core/src/testFixtures/java/org/springframework/core/testfixture/aot/generate/TestTarget.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* A <em>default target class</em> used by tests of code generation.
2121
*
2222
* @author Stephane Nicoll
23+
* @since 6.0
2324
*/
2425
public class TestTarget {
2526
}

spring-test/src/main/java/org/springframework/test/aot/generate/TestGenerationContext.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/**
2525
* {@link GenerationContext} test implementation that uses
26-
* {@link InMemoryGeneratedFiles} by default.
26+
* {@link InMemoryGeneratedFiles}.
2727
*
2828
* @author Stephane Nicoll
2929
* @author Sam Brannen
@@ -44,19 +44,9 @@ public TestGenerationContext(Class<?> target) {
4444
* @param classNameGenerator the class name generator to use
4545
*/
4646
public TestGenerationContext(ClassNameGenerator classNameGenerator) {
47-
this(classNameGenerator, new InMemoryGeneratedFiles());
47+
super(classNameGenerator, new InMemoryGeneratedFiles());
4848
}
4949

50-
/**
51-
* Create an instance using the specified {@link ClassNameGenerator} and
52-
* {@link InMemoryGeneratedFiles}.
53-
* @param classNameGenerator the class name generator to use
54-
* @param generatedFiles the generated files
55-
*/
56-
public TestGenerationContext(ClassNameGenerator classNameGenerator,
57-
InMemoryGeneratedFiles generatedFiles) {
58-
super(classNameGenerator, generatedFiles);
59-
}
6050

6151
@Override
6252
public InMemoryGeneratedFiles getGeneratedFiles() {

0 commit comments

Comments
 (0)