Source:
<code>public Mono<Lease> updateLease(Lease cachedLease, CosmosItem itemLink, CosmosItemRequestOptions requestOptions, Function<Lease, Lease> updateLease) { Lease arrayLease[] = {cachedLease}; arrayLease[0] = updateLease.apply(cachedLease); if (arrayLease[0] == null) { return Mono.empty(); } arrayLease[0].setTimestamp(ZonedDateTime.now(ZoneId.of("UTC"))); return this.tryReplaceLease(arrayLease[0], itemLink) .map(leaseDocument -> { arrayLease[0] = ServiceItemLease.fromDocument(leaseDocument); return arrayLease[0]; }) .hasElement() .flatMap(hasItems -> { if (hasItems) { return Mono.just(arrayLease[0]); } return this.client.readItem(itemLink, requestOptions) .onErrorResume(throwable -> { if (throwable instanceof CosmosClientException) { CosmosClientException ex = (CosmosClientException) throwable; if (ex.statusCode() == HTTP_STATUS_CODE_NOT_FOUND) { throw new LeaseLostException(arrayLease[0]); } } return Mono.error(throwable); }) .map(cosmosItemResponse -> { CosmosItemProperties document = cosmosItemResponse.properties(); ServiceItemLease serverLease = ServiceItemLease.fromDocument(document); logger.info( "Partition update failed because the lease with token '{}' was updated by host '{}' with token '{}'.", arrayLease[0].getLeaseToken(), arrayLease[0].getConcurrencyToken(), serverLease.getOwner(), serverLease.getConcurrencyToken()); arrayLease[0] = serverLease; <START> throw new RuntimeException(""); <END> }); }) .retry(RETRY_COUNT_ON_CONFLICT, throwable -> { if (throwable instanceof RuntimeException) { return throwable instanceof LeaseLostException; } return false; }); }</code><technical_language>please add a message RuntimeException</technical_language>

Target:
public Mono<Lease> updateLease(Lease cachedLease, CosmosItem itemLink, CosmosItemRequestOptions requestOptions, Function<Lease, Lease> updateLease) { Lease arrayLease[] = {cachedLease}; arrayLease[0] = updateLease.apply(cachedLease); if (arrayLease[0] == null) { return Mono.empty(); } arrayLease[0].setTimestamp(ZonedDateTime.now(ZoneId.of("UTC"))); return this.tryReplaceLease(arrayLease[0], itemLink) .map(leaseDocument -> { arrayLease[0] = ServiceItemLease.fromDocument(leaseDocument); return arrayLease[0]; }) .hasElement() .flatMap(hasItems -> { if (hasItems) { return Mono.just(arrayLease[0]); } return this.client.readItem(itemLink, requestOptions) .onErrorResume(throwable -> { if (throwable instanceof CosmosClientException) { CosmosClientException ex = (CosmosClientException) throwable; if (ex.statusCode() == HTTP_STATUS_CODE_NOT_FOUND) { throw new LeaseLostException(arrayLease[0]); } } return Mono.error(throwable); }) .map(cosmosItemResponse -> { CosmosItemProperties document = cosmosItemResponse.properties(); ServiceItemLease serverLease = ServiceItemLease.fromDocument(document); logger.info( "Partition update failed because the lease with token '{}' was updated by host '{}' with token '{}'.", arrayLease[0].getLeaseToken(), arrayLease[0].getConcurrencyToken(), serverLease.getOwner(), serverLease.getConcurrencyToken()); arrayLease[0] = serverLease; throw new RuntimeException("Partition update failed"); }); }) .retry(RETRY_COUNT_ON_CONFLICT, throwable -> { if (throwable instanceof RuntimeException) { return throwable instanceof LeaseLostException; } return false; }); }