Make warnings in Java code fatal (#28402)

This commit is contained in:
Arnout Engelen 2020-08-04 13:47:38 +02:00 committed by GitHub
parent 58fa1e3604
commit 327e16980d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 480 additions and 213 deletions

View file

@ -4,6 +4,7 @@
package jdocs.stream;
import akka.Done;
import akka.NotUsed;
import akka.actor.*;
import akka.stream.*;
@ -773,7 +774,15 @@ public class IntegrationDocTest extends AbstractJavaTest {
Source<Integer, ActorRef> source =
Source.actorRef(
bufferSize, OverflowStrategy.dropHead()); // note: backpressure is not supported
elem -> {
// complete stream immediately if we send it Done
if (elem == Done.done()) return Optional.of(CompletionStrategy.immediately());
else return Optional.empty();
},
// never fail the stream because of a message
elem -> Optional.empty(),
bufferSize,
OverflowStrategy.dropHead()); // note: backpressure is not supported
ActorRef actorRef =
source
.map(x -> x * x)