diff --git a/java8/src/main/java/org/jetbrains/annotations/BlockingExecutor.java b/java8/src/main/java/org/jetbrains/annotations/BlockingExecutor.java index 17c12e3..0560911 100644 --- a/java8/src/main/java/org/jetbrains/annotations/BlockingExecutor.java +++ b/java8/src/main/java/org/jetbrains/annotations/BlockingExecutor.java @@ -26,7 +26,7 @@ * *
* Example 1 (Kotlin coroutines): - *
{@code + ** *+ ** class BlockingExampleService { * val dispatcher: @BlockingExecutor CoroutineContext * get() { ... } @@ -37,26 +37,26 @@ * } * } * - * @Blocking fun blockingBuzz() { ... } + * @Blocking fun blockingBuzz() { ... } * } - * }
* Example 2 (Java with Reactor framework): - *
{@code + ** * @see Blocking * @see NonBlocking diff --git a/java8/src/main/java/org/jetbrains/annotations/NonBlockingExecutor.java b/java8/src/main/java/org/jetbrains/annotations/NonBlockingExecutor.java index 8381a3e..92a3717 100644 --- a/java8/src/main/java/org/jetbrains/annotations/NonBlockingExecutor.java +++ b/java8/src/main/java/org/jetbrains/annotations/NonBlockingExecutor.java @@ -27,7 +27,7 @@ * *+ ** class BlockingExampleService { * private static final @BlockingExecutor Scheduler blockingScheduler = * Schedulers.newBoundedElastic(4, 10, "executor"); * - * public Flux
foo(Flux urls) { + * public Flux<String> foo(Flux<String> urls) { * return urls.publishOn(blockingScheduler) - * .map(url -> blockingBuzz(url)); // no IDE warning + * .map(url -> blockingBuzz(url)); // no IDE warning * } * - * @Blocking + * @Blocking * private String blockingBuzz(String url) { ... } * } - * }
* Example 1 (Kotlin coroutines): - *
{@code + ** *+ ** class NonBlockingExampleService { * val dispatcher: @NonBlockingExecutor CoroutineContext * get() { ... } @@ -38,26 +38,26 @@ * } * } * - * @Blocking fun blockingBuzz() { ... } + * @Blocking fun blockingBuzz() { ... } * } - * }
* Example 2 (Java with Reactor framework): - *
{@code + ** @see Blocking * @see NonBlocking */+ ** class NonBlockingExampleService { * private static final @NonBlockingExecutor Scheduler operationsScheduler = * Schedulers.newParallel("parallel"); * - * public Flux
foo(Flux urls) { + * public Flux<String> foo(Flux<String> urls) { * return urls.publishOn(operationsScheduler) - * .filter(url -> blockingBuzz(url) != null); // IDE warning: `Possibly blocking call in non-blocking context` + * .filter(url -> blockingBuzz(url) != null); // IDE warning: `Possibly blocking call in non-blocking context` * } * - * @Blocking + * @Blocking * private String blockingBuzz(String url) { ... } * } - * }