Async Naming Suffix (ARCH4026)
Esta página aún no está disponible en tu idioma.
Key java.async.async-method-suffix · Severity info · Category async
Methods returning a CompletableFuture should be named per the language idiom (e.g. an Async suffix) so callers see at the call site that the result must be awaited.
Incorrect
Section titled “Incorrect”public CompletableFuture<User> load(long id) { // no suffix return repository.findById(id);}Correct
Section titled “Correct”public CompletableFuture<User> loadAsync(long id) { return repository.findById(id);}Add an Async suffix to methods returning a CompletableFuture so the asynchronous contract is visible at the call site.