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

@ -524,14 +524,17 @@ public class ActorDocTest extends AbstractJavaTest {
// #creating-props-deprecated
}
@Test(expected = IllegalArgumentException.class)
// Commented out because this 'Props.create' overload is now deprecated
// @Test(expected = IllegalArgumentException.class)
public void creatingPropsIllegal() {
/*
// #creating-props-illegal
// This will throw an IllegalArgumentException since some runtime
// type information of the lambda is erased.
// Use Props.create(actorClass, Creator) instead.
Props props = Props.create(() -> new ActorWithArgs("arg"));
// #creating-props-illegal
*/
}
public

View file

@ -24,14 +24,27 @@ public class DnsCompileOnlyDocTest {
final Duration timeout = Duration.ofMillis(1000L);
// #resolve
Option<Dns.Resolved> initial = Dns.get(system).cache().resolve("google.com", system, actorRef);
Option<Dns.Resolved> cached = Dns.get(system).cache().cached("google.com");
Option<DnsProtocol.Resolved> initial =
Dns.get(system)
.cache()
.resolve(
new DnsProtocol.Resolve("google.com", DnsProtocol.ipRequestType()),
system,
actorRef);
Option<DnsProtocol.Resolved> cached =
Dns.get(system)
.cache()
.cached(new DnsProtocol.Resolve("google.com", DnsProtocol.ipRequestType()));
// #resolve
{
// #actor-api-inet-address
final ActorRef dnsManager = Dns.get(system).manager();
CompletionStage<Object> resolved = ask(dnsManager, new Dns.Resolve("google.com"), timeout);
CompletionStage<Object> resolved =
ask(
dnsManager,
new DnsProtocol.Resolve("google.com", DnsProtocol.ipRequestType()),
timeout);
// #actor-api-inet-address
}