Skip to content

Commit 7b8d994

Browse files
committed
ArC: remove Gizmo 1 support from ResourceClassOutput
1 parent bd4f22c commit 7b8d994

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed
Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
package io.quarkus.arc.processor;
22

3-
import java.io.StringWriter;
4-
import java.io.Writer;
53
import java.util.ArrayList;
6-
import java.util.HashMap;
74
import java.util.List;
8-
import java.util.Map;
95
import java.util.function.Function;
106

117
import io.quarkus.arc.processor.ResourceOutput.Resource;
128
import io.quarkus.arc.processor.ResourceOutput.Resource.SpecialType;
9+
import io.quarkus.gizmo2.ClassOutput;
1310

14-
public class ResourceClassOutput implements io.quarkus.gizmo.ClassOutput, io.quarkus.gizmo2.ClassOutput {
11+
public class ResourceClassOutput implements ClassOutput {
1512

1613
private static final Function<String, SpecialType> NO_SPECIAL_TYPE = cn -> null;
1714

1815
private final List<Resource> resources = new ArrayList<>();
19-
private final Map<String, StringWriter> sources;
2016
private final boolean applicationClass;
2117
private final Function<String, SpecialType> specialTypeFunction;
2218

19+
// note that the `generateSource` parameters are unused for now,
20+
// until https://github.com/quarkusio/gizmo/issues/419 is implemented
21+
2322
/**
2423
* @param applicationClass whether the generated classes are application classes or not
2524
* @param generateSource whether to also generate textual representation of the code
@@ -39,7 +38,6 @@ public ResourceClassOutput(boolean applicationClass, Function<String, SpecialTyp
3938
this.applicationClass = applicationClass;
4039
this.specialTypeFunction = specialTypeFunction;
4140
// Note that ResourceClassOutput is never used concurrently
42-
this.sources = generateSource ? new HashMap<>() : null;
4341
}
4442

4543
@Override
@@ -50,28 +48,10 @@ public void write(String name, byte[] data) {
5048
}
5149
String className = name.replace('/', '.');
5250
resources.add(ResourceImpl.javaClass(name, data, specialTypeFunction.apply(className),
53-
applicationClass, getSource(name)));
54-
}
55-
56-
@Override
57-
public Writer getSourceWriter(String className) {
58-
if (sources != null) {
59-
StringWriter writer = new StringWriter();
60-
sources.put(className, writer);
61-
return writer;
62-
}
63-
return io.quarkus.gizmo.ClassOutput.super.getSourceWriter(className);
51+
applicationClass, null));
6452
}
6553

6654
List<Resource> getResources() {
6755
return resources;
6856
}
69-
70-
String getSource(String className) {
71-
if (sources == null) {
72-
return null;
73-
}
74-
StringWriter source = sources.get(className);
75-
return source != null ? source.toString() : null;
76-
}
7757
}

0 commit comments

Comments
 (0)