This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/master by this push:
new 6fa5dea NIFI-5908 Inject locale info into JsonInjector object to make
sure we don't lose that information.
6fa5dea is described below
commit 6fa5deafc26139a13720b05b0b25d2a5055fc55b
Author: Mike Thomsen <[email protected]>
AuthorDate: Tue Dec 18 12:53:29 2018 -0500
NIFI-5908 Inject locale info into JsonInjector object to make sure we don't
lose that information.
Signed-off-by: Pierre Villard <[email protected]>
This closes #3226.
---
.../main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java | 5 +++++
1 file changed, 5 insertions(+)
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 c5ecb11..8cbc74a 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 @@ public class DatabaseReader implements GeoIp2Provider,
Closeable {
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 @@ public class DatabaseReader implements GeoIp2Provider,
Closeable {
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 class DatabaseReader implements GeoIp2Provider,
Closeable {
return ip;
} else if ("traits".equals(valueId)) {
return new Traits(ip);
+ } else if ("locales".equals(valueId)) {
+ return locales;
}
return null;