7
7
import static io .avaje .prism .internal .APContext .logNote ;
8
8
import static io .avaje .prism .internal .APContext .logWarn ;
9
9
10
- import java .io .BufferedReader ;
11
- import java .io .FileNotFoundException ;
12
10
import java .io .IOException ;
13
- import java .io .InputStreamReader ;
14
11
import java .io .OutputStreamWriter ;
15
12
import java .io .PrintWriter ;
16
- import java .nio .charset .StandardCharsets ;
17
13
import java .util .HashSet ;
18
14
import java .util .Set ;
19
15
@@ -34,27 +30,8 @@ static void addProcessor(TypeElement e) {
34
30
static void write () {
35
31
36
32
if (services .isEmpty ()) return ;
37
-
38
33
// Read the existing service files
39
34
final Filer filer = filer ();
40
- try (final var f =
41
- filer
42
- .getResource (StandardLocation .CLASS_OUTPUT , "" , "META-INF/services/" + PROCESSOR )
43
- .openInputStream ();
44
- final BufferedReader r =
45
- new BufferedReader (new InputStreamReader (f , StandardCharsets .UTF_8 )); ) {
46
-
47
- String line ;
48
- while ((line = r .readLine ()) != null ) services .add (line );
49
- } catch (final FileNotFoundException | java .nio .file .NoSuchFileException x ) {
50
- // missing and thus not created yet
51
- } catch (final IOException x ) {
52
- logError (
53
- "Failed to load existing service definition file. SPI: "
54
- + PROCESSOR
55
- + " exception: "
56
- + x );
57
- }
58
35
try {
59
36
logNote ("Writing META-INF/services/%s" , PROCESSOR );
60
37
final FileObject f =
@@ -89,7 +66,6 @@ private static void validateModules() {
89
66
if (line .contains ("io.avaje.prism.core" )) {
90
67
logWarn (module , "io.avaje.prism.core should be not be used directly" );
91
68
}
92
- continue ;
93
69
}
94
70
}
95
71
0 commit comments