@Test(expected = UnsupportedOperationException.class) public void testEmptyStaticArray() { assertThat(TypeDecoder.decodeStaticArray( "0000000000000000000000000000000000000000000000000000000000000000", 0, new TypeReference.StaticArrayTypeReference<StaticArray<Uint256>>(0) {}, 0), is("invalid")); }
@SuppressWarnings("unchecked") static <T extends Type> T decodeStaticArray( String input, int offset, TypeReference<T> typeReference, int length) { BiFunction<List<T>, String, T> function = (elements, typeName) -> { if (elements.isEmpty()) { throw new UnsupportedOperationException("Zero length fixed array is invalid type"); } else { return instantiateStaticArray(typeReference, elements); } }; return decodeArrayElements(input, offset, typeReference, length, function); }
TypeDecoder { @SuppressWarnings("unchecked") static <T extends Type> T decodeStaticArray( String input, int offset, TypeReference<T> typeReference, int length) { BiFunction<List<T>, String, T> function = (elements, typeName) -> { if (elements.isEmpty()) { throw new UnsupportedOperationException("Zero length fixed array is invalid type"); } else { return instantiateStaticArray(typeReference, elements); } }; return decodeArrayElements(input, offset, typeReference, length, function); } }
TypeDecoder { @SuppressWarnings("unchecked") static <T extends Type> T decodeStaticArray( String input, int offset, TypeReference<T> typeReference, int length) { BiFunction<List<T>, String, T> function = (elements, typeName) -> { if (elements.isEmpty()) { throw new UnsupportedOperationException("Zero length fixed array is invalid type"); } else { return instantiateStaticArray(typeReference, elements); } }; return decodeArrayElements(input, offset, typeReference, length, function); }  }
TypeDecoder { @SuppressWarnings("unchecked") static <T extends Type> T decodeStaticArray( String input, int offset, TypeReference<T> typeReference, int length) { BiFunction<List<T>, String, T> function = (elements, typeName) -> { if (elements.isEmpty()) { throw new UnsupportedOperationException("Zero length fixed array is invalid type"); } else { return instantiateStaticArray(typeReference, elements); } }; return decodeArrayElements(input, offset, typeReference, length, function); }  static T decode(
            String input, int offset, TypeReference<T> typeReference); }
TypeDecoder { @SuppressWarnings("unchecked") static <T extends Type> T decodeStaticArray( String input, int offset, TypeReference<T> typeReference, int length) { BiFunction<List<T>, String, T> function = (elements, typeName) -> { if (elements.isEmpty()) { throw new UnsupportedOperationException("Zero length fixed array is invalid type"); } else { return instantiateStaticArray(typeReference, elements); } }; return decodeArrayElements(input, offset, typeReference, length, function); }  static T decode(
            String input, int offset, TypeReference<T> typeReference);  }