Skip to content

Commit

Permalink
Add a warning about missing -parameters flag for javac
Browse files Browse the repository at this point in the history
Without this warning, users can end up with only an
 error complaining about a duplicate null key
  • Loading branch information
geoand committed Jul 2, 2024
1 parent cd0ada4 commit 9b858d4
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
Expand Down Expand Up @@ -946,6 +947,11 @@ private List<TemplateParameterInfo> gatherTemplateParamInfo(List<MethodParameter
templateParams.add(new TemplateParameterInfo(0, "it"));
}

if (templateParams.stream().map(TemplateParameterInfo::name).allMatch(Objects::isNull)) {
log.warn(
"The application has been compiled without the '-parameters' being set flag on javac. Make sure your build tool is configured to pass this flag to javac, otherwise Quarkus LangChain4j is unlikely to work properly without it.");
}

return templateParams;
}

Expand Down

0 comments on commit 9b858d4

Please sign in to comment.