From f6c198a9fc75d9f844cb2bd03b4a22f7618ef258 Mon Sep 17 00:00:00 2001 From: Timothy Neale Date: Fri, 27 Aug 2021 15:01:37 -0400 Subject: [PATCH] Cleanup TODOs and add comment to changelog --- CHANGELOG.md | 1 + java/com/grammatech/gtirb/ByteBlock.java | 2 -- java/com/grammatech/gtirb/ByteInterval.java | 9 --------- java/com/grammatech/gtirb/CodeBlock.java | 2 +- java/com/grammatech/gtirb/DataBlock.java | 2 +- java/com/grammatech/gtirb/Node.java | 7 +------ 6 files changed, 4 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb134f303..c0de2fbbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ # 1.10.5 * Added various symbolic expression attributes. +* Updated Java API # 1.10.4 diff --git a/java/com/grammatech/gtirb/ByteBlock.java b/java/com/grammatech/gtirb/ByteBlock.java index 50b755ff0..6501d5a0a 100644 --- a/java/com/grammatech/gtirb/ByteBlock.java +++ b/java/com/grammatech/gtirb/ByteBlock.java @@ -12,8 +12,6 @@ * */ -/* TODO Must be able to retrieve address, unless byte interval has no address */ - package com.grammatech.gtirb; import com.grammatech.gtirb.proto.ByteIntervalOuterClass; diff --git a/java/com/grammatech/gtirb/ByteInterval.java b/java/com/grammatech/gtirb/ByteInterval.java index c36330c37..1b95cd5e3 100644 --- a/java/com/grammatech/gtirb/ByteInterval.java +++ b/java/com/grammatech/gtirb/ByteInterval.java @@ -764,16 +764,7 @@ public ByteIntervalOuterClass.ByteInterval.Builder toProtobuf() { symbolicExpression.getOffset(), protoSymbolicExpression.build()); } - - // // Get bytes as byte array then convert to ByteString - // // !TODO Storing bytes as ArrayList is very inefficient, - // // find out why this is being done this way and fix it - // byte[] contents = new byte[this.bytes.size()]; - // for (int i = 0; i < this.bytes.size(); i++) { - // contents[i] = this.bytes.get(i).byteValue(); - // } protoByteInterval.setContents(ByteString.copyFrom(this.bytes)); - return protoByteInterval; } } diff --git a/java/com/grammatech/gtirb/CodeBlock.java b/java/com/grammatech/gtirb/CodeBlock.java index 39a8c7224..60e42c633 100644 --- a/java/com/grammatech/gtirb/CodeBlock.java +++ b/java/com/grammatech/gtirb/CodeBlock.java @@ -31,7 +31,7 @@ public class CodeBlock extends ByteBlock { */ public CodeBlock(ByteIntervalOuterClass.Block protoBlock, ByteInterval byteInterval) { - // TODO Could verify that this protoBlock IS code + // Could verify that this protoBlock is really Code. super(protoBlock, byteInterval); CodeBlockOuterClass.CodeBlock protoCodeBlock = protoBlock.getCode(); this.uuid = Util.byteStringToUuid(protoCodeBlock.getUuid()); diff --git a/java/com/grammatech/gtirb/DataBlock.java b/java/com/grammatech/gtirb/DataBlock.java index a876d075f..4158facb9 100644 --- a/java/com/grammatech/gtirb/DataBlock.java +++ b/java/com/grammatech/gtirb/DataBlock.java @@ -30,7 +30,7 @@ public class DataBlock extends ByteBlock { */ public DataBlock(ByteIntervalOuterClass.Block protoBlock, ByteInterval byteInterval) { - // Could verify that his protoBlock is really Data. + // Could verify that this protoBlock is really Data. super(protoBlock, byteInterval); DataBlockOuterClass.DataBlock protoDataBlock = protoBlock.getData(); this.uuid = Util.byteStringToUuid(protoDataBlock.getUuid()); diff --git a/java/com/grammatech/gtirb/Node.java b/java/com/grammatech/gtirb/Node.java index 7d28c8a99..4eef58b89 100644 --- a/java/com/grammatech/gtirb/Node.java +++ b/java/com/grammatech/gtirb/Node.java @@ -29,12 +29,7 @@ public class Node { /** * Default constructor */ - public Node() { - // TODO: Assign a new UUID here. - // (However, so far I am only working with objects that have already - // been created, - // so would only have to be replaced with the correct UUID.) - } + public Node() {} /** * Find a node using its UUID.