Skip to content

Commit

Permalink
Format only changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Jun 25, 2024
1 parent 6e8c77d commit 7a04020
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ final class ComponentReader {

void read() {
ProcessingContext.readExistingMetaInfServices().stream()
.map(APContext::typeElement)
.filter(Objects::nonNull)
.filter(
t -> "io.avaje.validation.spi.GeneratedComponent".equals(t.getSuperclass().toString()))
.findFirst()
.ifPresent(
moduleType -> {
if (moduleType != null) {
componentMetaData.setFullName(moduleType.getQualifiedName().toString());
readMetaData(moduleType);
}
});
.map(APContext::typeElement)
.filter(Objects::nonNull)
.filter(t -> "io.avaje.validation.spi.GeneratedComponent".equals(t.getSuperclass().toString()))
.findFirst()
.ifPresent(moduleType -> {
componentMetaData.setFullName(moduleType.getQualifiedName().toString());
readMetaData(moduleType);
});
}

/** Read the existing adapters from the MetaData annotation of the generated component. */
Expand All @@ -45,8 +41,8 @@ private void readMetaData(TypeElement moduleType) {

} else if (metaDataAnnotationFactory != null) {
metaDataAnnotationFactory.value().stream()
.map(APContext::asTypeElement)
.forEach(componentMetaData::addAnnotationAdapter);
.map(APContext::asTypeElement)
.forEach(componentMetaData::addAnnotationAdapter);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,9 @@ static void validateModule() {
&& !moduleInfo.containsOnModulePath("io.avaje.validation.plugin");

if (noHttpPlugin) {
logWarn(
module,
"`requires io.avaje.validation.http` must be explicity added or else avaje-inject may fail to detect the default http validator, validator, and method AOP validator");
logWarn(module, "`requires io.avaje.validation.http` must be explicity added or else avaje-inject may fail to detect the default http validator, validator, and method AOP validator");
} else if (noInjectPlugin) {
logWarn(
module,
"`requires io.avaje.validation.plugin` must be explicity added or else avaje-inject may fail to detect the default validator and method AOP validator");
logWarn(module, "`requires io.avaje.validation.plugin` must be explicity added or else avaje-inject may fail to detect the default validator and method AOP validator");
}

} catch (Exception e) {
Expand Down Expand Up @@ -126,15 +122,14 @@ private static boolean resource(String relativeName, String replace) {
}

static Set<String> readExistingMetaInfServices() {
System.out.println("GET GOIT" );
var services = CTX.get().serviceSet;
try (final var file =
APContext.filer()
.getResource(StandardLocation.CLASS_OUTPUT, "", Constants.META_INF_COMPONENT)
.toUri()
.toURL()
.openStream();
final var buffer = new BufferedReader(new InputStreamReader(file)); ) {
APContext.filer()
.getResource(StandardLocation.CLASS_OUTPUT, "", Constants.META_INF_COMPONENT)
.toUri()
.toURL()
.openStream();
final var buffer = new BufferedReader(new InputStreamReader(file));) {

String line;
while ((line = buffer.readLine()) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ private void writeParamProvider(ExecutableElement typeElement) {

private void registerSPI(Set<? extends Element> beans) {
ElementFilter.typesIn(beans).stream()
.filter(this::isExtension)
.map(TypeElement::getQualifiedName)
.map(Object::toString)
.forEach(ProcessingContext::addValidatorSpi);
.filter(this::isExtension)
.map(TypeElement::getQualifiedName)
.map(Object::toString)
.forEach(ProcessingContext::addValidatorSpi);
}

private boolean isExtension(TypeElement te) {
Expand Down

0 comments on commit 7a04020

Please sign in to comment.