Fix compiler crash when service enumerated in META-INF/service does not exist
@@ -62,10 +62,12 @@ public class ServiceLoaderSupport extends AbstractDependencyListener implements
writer.append(", ");
}
String implName = implementations.get(i);
+ if (context.getClassSource().getClassNames().contains(implName)) {
writer.append("[").appendClass(implName).append(", ").appendMethodBody(
new MethodReference(implName, new MethodDescriptor("<init>", ValueType.VOID)))
.append("]");
}
+ }
writer.append("];").softNewLine();
}
writer.outdent().append("}").softNewLine();
