Skip to content

Commit

Permalink
Everything tests for converter now captures which pairs have been tes…
Browse files Browse the repository at this point in the history
…ted (forward or reverse) and outputs which tests have not been run at all, in deterministic (alphabetical) order.

Fixed the CharSequence issues of StringUtilities. Method signatures changed to CharSequence break existing users, as method signatures are statically bound, not dynamically bound, which means changing String parameters to CharSequence paramerters after the fact is a breaking API change.
  • Loading branch information
jdereg committed Feb 27, 2024
1 parent d1d89bb commit 46a05b1
Show file tree
Hide file tree
Showing 4 changed files with 634 additions and 849 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ private void grow(int minCapacity) {
buf = Arrays.copyOf(buf, newCapacity);
}

@Override
public void write(int b) {
ensureCapacity(count + 1);
buf[count] = (byte) b;
count += 1;
}

@Override
public void write(byte[] b, int off, int len) {
if ((b == null) || (off < 0) || (len < 0) ||
(off > b.length) || (off + len > b.length) || (off + len < 0)) {
Expand All @@ -86,6 +84,11 @@ public byte[] toByteArray() {
return Arrays.copyOf(buf, count);
}

// Backwards compatibility
public byte[] getBuffer() {
return Arrays.copyOf(buf, count);
}

public int size() {
return count;
}
Expand All @@ -98,7 +101,6 @@ public void writeTo(OutputStream out) throws IOException {
out.write(buf, 0, count);
}

@Override
public void close() throws IOException {
// No resources to close
}
Expand Down
Loading

0 comments on commit 46a05b1

Please sign in to comment.