@@ -215,23 +215,7 @@ public static void write(PrintWriter out, String packageName) {
215
215
+ " if (buildPluginAvailable() || moduleElement.isUnnamed() || APContext.isTestCompilation()) {\n "
216
216
+ " return;\n "
217
217
+ " }\n "
218
- + " var implSet = new TreeSet<>(implementations);\n "
219
- + " try (final var file =\n "
220
- + " APContext.filer()\n "
221
- + " .getResource(StandardLocation.CLASS_OUTPUT, \" \" , \" META-INF/services/\" + providesType)\n "
222
- + " .toUri()\n "
223
- + " .toURL()\n "
224
- + " .openStream();\n "
225
- + " final var buffer = new BufferedReader(new InputStreamReader(file)); ) {\n "
226
- + "\n "
227
- + " String line;\n "
228
- + " while ((line = buffer.readLine()) != null) {\n "
229
- + " line.replaceAll(\" \\ \\ s\" , \" \" ).replace(\" ,\" , \" \\ n\" ).lines().forEach(implSet::add);\n "
230
- + " }\n "
231
- + " } catch (Exception e) {\n "
232
- + " // not a critical error\n "
233
- + " }\n "
234
- + " final var missingImpls = implSet.stream().map(this::replace$).filter(this::isSameModule).collect(toSet());\n "
218
+ + " final var missingImpls = new TreeSet<>(implementations).stream().map(this::replace$).collect(toSet());\n "
235
219
+ "\n "
236
220
+ " provides()\n "
237
221
+ " .forEach(\n "
@@ -254,15 +238,6 @@ public static void write(PrintWriter out, String packageName) {
254
238
+ " }\n "
255
239
+ " }\n "
256
240
+ "\n "
257
- + " private boolean isSameModule(String type) {\n "
258
- + " var element = APContext.typeElement(type);\n "
259
- + " return element != null\n "
260
- + " && APContext.elements()\n "
261
- + " .getModuleOf(element)\n "
262
- + " .getSimpleName()\n "
263
- + " .contentEquals(moduleElement.getSimpleName());\n "
264
- + " }\n "
265
- + "\n "
266
241
+ " private static boolean buildPluginAvailable() {\n "
267
242
+ " return isPresent(\" avaje-plugin-exists.txt\" );\n "
268
243
+ " }\n "
0 commit comments