asfgit closed pull request #3226: NIFI-5908 Inject locale info into
JsonInjector object to make sure we…
URL: https://github.com/apache/nifi/pull/3226
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
index c5ecb114b0..8cbc74aa99 100644
---
a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
+++
b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
@@ -57,6 +57,7 @@
private final Reader reader;
private final ObjectMapper om;
+ private List<String> locales;
private DatabaseReader(final Builder builder) throws IOException {
if (builder.stream != null) {
@@ -74,6 +75,8 @@ private DatabaseReader(final Builder builder) throws
IOException {
this.om.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL,
true);
InjectableValues inject = new
InjectableValues.Std().addValue("locales", builder.locales);
this.om.setInjectableValues(inject);
+
+ this.locales = builder.locales;
}
/**
@@ -259,6 +262,8 @@ public Object findInjectableValue(final Object valueId,
final DeserializationCon
return ip;
} else if ("traits".equals(valueId)) {
return new Traits(ip);
+ } else if ("locales".equals(valueId)) {
+ return locales;
}
return null;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services