diff --git a/src/main/java/com/esaulpaugh/headlong/abi/ABIType.java b/src/main/java/com/esaulpaugh/headlong/abi/ABIType.java index bd6ab22f..e40d5edc 100644 --- a/src/main/java/com/esaulpaugh/headlong/abi/ABIType.java +++ b/src/main/java/com/esaulpaugh/headlong/abi/ABIType.java @@ -109,8 +109,8 @@ public int getFlags() { return FLAGS_UNSET; } - public final ArrayType asArrayType() { - return (ArrayType) this; + public final > ArrayType asArrayType() { + return (ArrayType) this; } public final TupleType asTupleType() { diff --git a/src/main/java/com/esaulpaugh/headlong/abi/PackedDecoder.java b/src/main/java/com/esaulpaugh/headlong/abi/PackedDecoder.java index 180f3f41..694c05ca 100644 --- a/src/main/java/com/esaulpaugh/headlong/abi/PackedDecoder.java +++ b/src/main/java/com/esaulpaugh/headlong/abi/PackedDecoder.java @@ -74,7 +74,7 @@ private static Tuple decodeTuple(TupleType tupleType, ByteBuffer bb, int end) break; } if (type instanceof ArrayType) { - final ArrayType arrayType = type.asArrayType(); + final ArrayType, ?, ?> arrayType = type.asArrayType(); final int elementByteLength = arrayType.getElementType() instanceof UnitType ? UNIT_LENGTH_BYTES : arrayType.getElementType().byteLengthPacked(null); @@ -159,9 +159,8 @@ private static BigInteger getSignedBigInt(ByteBuffer bb, int elementLen) { return new BigInteger(temp); } - @SuppressWarnings("unchecked") - private static Object decodeArray(ArrayType arrayType, ByteBuffer bb, int end) { - final ABIType elementType = (ABIType) arrayType.getElementType(); + private static Object decodeArray(ArrayType, ?, ?> arrayType, ByteBuffer bb, int end) { + final ABIType elementType = arrayType.getElementType(); final int elementByteLen = elementType instanceof UnitType ? UNIT_LENGTH_BYTES : elementType.byteLengthPacked(null); final int typeLen = arrayType.getLength(); final int arrayLen;