NIFI-13156 Replaced JsonParser deprecated getCurrentName() with currentName()

This closes #8807

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
dan-s1 2024-05-10 14:36:25 +00:00 committed by exceptionfactory
parent 6b48e61295
commit 811a491ba5
No known key found for this signature in database
5 changed files with 8 additions and 8 deletions

View File

@ -144,7 +144,7 @@ public abstract class AbstractJsonRowRecordReader implements RecordReader {
if (strategy == StartingFieldStrategy.NESTED_FIELD) {
while (jsonParser.nextToken() != null) {
if (nestedFieldName.equals(jsonParser.getCurrentName())) {
if (nestedFieldName.equals(jsonParser.currentName())) {
logger.debug("Parsing starting at nested field [{}]", nestedFieldName);
break;
}
@ -306,7 +306,7 @@ public abstract class AbstractJsonRowRecordReader implements RecordReader {
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME) {
jsonParser.nextToken();
final String fieldName = jsonParser.getCurrentName();
final String fieldName = jsonParser.currentName();
final String fieldValue = jsonParser.getValueAsString();
if (captureFieldPredicate.test(fieldName, fieldValue)) {

View File

@ -271,17 +271,17 @@ public class GetHubSpot extends AbstractProcessor {
final JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(out, JsonEncoding.UTF8)) {
boolean isCursorAvailable = false;
while (jsonParser.nextToken() != null) {
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
.equals("total")) {
jsonParser.nextToken();
total.set(jsonParser.getIntValue());
}
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
.equals("results")) {
jsonParser.nextToken();
jsonGenerator.copyCurrentStructure(jsonParser);
}
final String fieldName = jsonParser.getCurrentName();
final String fieldName = jsonParser.currentName();
if (PAGING_CURSOR.equals(fieldName)) {
isCursorAvailable = true;
jsonParser.nextToken();

View File

@ -570,7 +570,7 @@ public class QuerySalesforceObject extends AbstractProcessor {
}
private boolean nextTokenIs(JsonParser jsonParser, String value) throws IOException {
return jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
return jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
.equals(value) && jsonParser.nextToken() != null;
}

View File

@ -376,7 +376,7 @@ public class GetShopify extends AbstractProcessor {
try (JsonParser jsonParser = JSON_FACTORY.createParser(response.body());
final JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(out, JsonEncoding.UTF8)) {
while (jsonParser.nextToken() != null) {
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
.equals(resourceName)) {
jsonParser.nextToken();
jsonGenerator.writeStartArray();

View File

@ -217,7 +217,7 @@ public class GetZendesk extends AbstractZendesk {
JsonGenerator generator = JSON_FACTORY.createGenerator(out, UTF8)) {
while (parser.nextToken() != null) {
if (parser.getCurrentToken() == FIELD_NAME) {
String fieldName = parser.getCurrentName();
String fieldName = parser.currentName();
parser.nextToken();
if (zendeskResource.getResponseFieldName().equals(fieldName)) {
int numberOfExtractedRecords = extractZendeskResourceData(parser, generator);