Skip to content

Commit

Permalink
make flags private
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Sep 13, 2024
1 parent 2492f65 commit d655bd9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/esaulpaugh/headlong/abi/ArrayType.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class ArrayType<ET extends ABIType<E>, E, A> extends ABIType<A> {
private final Class<?> arrayClass;
private final int length;
private final int headLength;
final int flags;
private final int flags;

ArrayType(String canonicalType, Class<A> clazz, ET elementType, int length, Class<?> arrayClass, int flags) {
super(canonicalType, clazz, DYNAMIC_LENGTH == length || elementType.dynamic);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/esaulpaugh/headlong/abi/TupleType.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class TupleType<J extends Tuple> extends ABIType<J> implements Iter
final String[] elementInternalTypes;
private final int[] elementHeadOffsets;
final int headLengthSum;
final int flags;
private final int flags;

TupleType(String canonicalType, boolean dynamic, ABIType<?>[] elementTypes, String[] elementNames, String[] elementInternalTypes, int flags) {
super(canonicalType, Tuple.classFor(elementTypes.length), dynamic);
Expand Down
3 changes: 0 additions & 3 deletions src/test/java/com/esaulpaugh/headlong/abi/DecodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -977,16 +977,13 @@ public void testLegacyDecode() {
private void checkLegacyFlags(ABIType<?> t) {
if (t instanceof TupleType) {
assertEquals(ABIType.FLAG_LEGACY_DECODE, t.getFlags());
assertEquals(((TupleType<?>) t).flags, t.getFlags());
for (ABIType<?> e : (TupleType<?>) t) {
checkLegacyFlags(e);
}
} else if (t instanceof ArrayType) {
final ArrayType<?, ?, ?> at = t.asArrayType();
assertTrue((at.flags & ABIType.FLAG_LEGACY_DECODE) != 0);
assertTrue((at.getFlags() & ABIType.FLAG_LEGACY_DECODE) != 0);
assertEquals(ABIType.FLAG_LEGACY_DECODE, t.getFlags());
assertEquals(at.flags, t.getFlags());
checkLegacyFlags(at.getElementType());
} else {
assertEquals(ABIType.FLAGS_UNSET, t.getFlags());
Expand Down

0 comments on commit d655bd9

Please sign in to comment.