Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
run format (airbytehq#10445)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhizor authored Feb 17, 2022
1 parent 9d546d3 commit a85c02a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public static int getIntOrZero(final JsonNode json, final List<String> keys) {
public static Map<String, Object> flatten(final JsonNode node) {
if (node.isObject()) {
final Map<String, Object> output = new HashMap<>();
for (final Iterator<Entry<String, JsonNode>> it = node.fields(); it.hasNext(); ) {
for (final Iterator<Entry<String, JsonNode>> it = node.fields(); it.hasNext();) {
final Entry<String, JsonNode> entry = it.next();
final String field = entry.getKey();
final JsonNode value = entry.getValue();
Expand Down Expand Up @@ -239,8 +239,8 @@ public static Map<String, Object> flatten(final JsonNode node) {
/**
* Prepend all keys in subMap with prefix, then merge that map into originalMap.
* <p>
* If subMap contains a null key, then instead it is replaced with prefix. I.e. {null: value} is treated as {prefix: value} when merging into
* originalMap.
* If subMap contains a null key, then instead it is replaced with prefix. I.e. {null: value} is
* treated as {prefix: value} when merging into originalMap.
*/
public static void mergeMaps(final Map<String, Object> originalMap, final String prefix, final Map<String, Object> subMap) {
originalMap.putAll(subMap.entrySet().stream().collect(toMap(
Expand All @@ -256,7 +256,8 @@ public static void mergeMaps(final Map<String, Object> originalMap, final String
}

/**
* By the Jackson DefaultPrettyPrinter prints objects with an extra space as follows: {"name" : "airbyte"}. We prefer {"name": "airbyte"}.
* By the Jackson DefaultPrettyPrinter prints objects with an extra space as follows: {"name" :
* "airbyte"}. We prefer {"name": "airbyte"}.
*/
private static class JsonPrettyPrinter extends DefaultPrettyPrinter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ private static Map<String, Object> configToMetadata(final JsonNode config, final
final Map<String, Object> output = new HashMap<>();
final JsonNode maybeProperties = schema.get("properties");

// If additionalProperties is not set, or it's a boolean, then there's no schema for additional properties. Use the accept-all schema.
// If additionalProperties is not set, or it's a boolean, then there's no schema for additional
// properties. Use the accept-all schema.
// Otherwise, it's an actual schema.
final JsonNode maybeAdditionalProperties = schema.get("additionalProperties");
final JsonNode additionalPropertiesSchema;
Expand All @@ -244,7 +245,7 @@ private static Map<String, Object> configToMetadata(final JsonNode config, final
additionalPropertiesSchema = maybeAdditionalProperties;
}

for (final Iterator<Entry<String, JsonNode>> it = config.fields(); it.hasNext(); ) {
for (final Iterator<Entry<String, JsonNode>> it = config.fields(); it.hasNext();) {
final Entry<String, JsonNode> entry = it.next();
final String field = entry.getKey();
final JsonNode value = entry.getValue();
Expand Down

0 comments on commit a85c02a

Please sign in to comment.