Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-17782 Add deprecation warning to findUnconsumedStatesByType #1300

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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