Skip to content

Commit

Permalink
Add deprecation warning to findUnconsumedStatesByType (#1300)
Browse files Browse the repository at this point in the history
  • Loading branch information
relyafi authored Oct 16, 2023
1 parent c09ddb6 commit b003f7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cordaProductVersion = 5.1.0
# NOTE: update this each time this module contains a breaking change
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
## a per module property in which case module versions can change independently.
cordaApiRevision = 36
cordaApiRevision = 37

# Main
kotlinVersion = 1.8.21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,19 @@ public interface UtxoLedgerService {

/**
* Finds unconsumed states that are concrete implementations or subclasses of {@code type}.
* <p>
* Only use this method if subclasses of {@code type} must be returned.
* <p>
* Use {@link #findUnconsumedStatesByExactType(Class<T>)} to return exact instances of the input {@code type}.
* This method is more performant than {@link #findUnconsumedStatesByExactType(Class, Integer, Instant)}.
* <p>
* Use {@link #query(String, Class)} for a more performant method of retrieving subclasses of a specified type.
*
* @deprecated This method should no longer be used due to its lack of paging support, which can result in
* serious performance issues and / or out of memory errors if the query returns many states.
* {@link #findUnconsumedStatesByExactType(Class, Integer, Instant)} should be used instead. Note
* that this will not return subclasses of the specified class. If this functionality is required,
* it is recommended to write a custom query and invoke this via the {@link #query(String, Class)}
* API instead.
*
* @param <T> The underlying {@link ContractState} type.
* @param type The {@link ContractState} type to find in the vault.
* @return Returns a {@link List} of {@link StateAndRef} of unconsumed states of the specified type, or an empty list if no states could be found.
*/
@Deprecated(since = "5.1", forRemoval = true)
@NotNull
@Suspendable
<T extends ContractState> List<StateAndRef<T>> findUnconsumedStatesByType(@NotNull Class<T> type);
Expand Down

0 comments on commit b003f7d

Please sign in to comment.