Skip to content

Commit

Permalink
small fix to make json-tree actually show size of an array not max index
Browse files Browse the repository at this point in the history
  • Loading branch information
patschuh committed Apr 15, 2024
1 parent e3d8374 commit 34bbcea
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/at/esque/kafka/JsonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import com.google.common.base.Strings;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import com.google.protobuf.MessageOrBuilder;
import com.google.protobuf.Struct;
import com.google.protobuf.util.JsonFormat;
import io.netty.util.internal.StringUtil;
import javafx.scene.control.TreeItem;
import org.apache.kafka.common.header.Header;
import org.apache.kafka.common.header.internals.RecordHeader;
Expand Down Expand Up @@ -333,7 +331,7 @@ private static void recursivelyAddElements(ArrayNode jsonNode, JsonTreeItem tree
treeItem.setExpanded(true);
applyCorrectAdder(childNode, newItem);
});
treeItem.setPropertyName(treeItem.getPropertyName() + " (" + i.get() + ")");
treeItem.setPropertyName(treeItem.getPropertyName() + " (" + (i.get() + 1) + ")");
}

private static void recursivelyAddElements(TextNode val, JsonTreeItem treeItem) {
Expand Down

0 comments on commit 34bbcea

Please sign in to comment.