# HG changeset patch # User clanger # Date 1558680989 -3600 # Node ID 9785b9fb328e7a1978a88d622e7b35e832e1091b # Parent d84176dd57b00adb583929091892131e59a23c44 8223553: Fix code constructs that do not compile with the Eclipse Java Compiler Reviewed-by: smarks, dfuchs diff -r d84176dd57b0 -r 9785b9fb328e src/java.base/share/classes/java/lang/invoke/MethodHandles.java --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Thu May 23 18:47:24 2019 -0700 +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Fri May 24 07:56:29 2019 +0100 @@ -4980,8 +4980,10 @@ // Step 1C: determine loop return type. // Step 1D: check other types. - final Class loopReturnType = fini.stream().filter(Objects::nonNull).map(MethodHandle::type). - map(MethodType::returnType).findFirst().orElse(void.class); + // local variable required here; see JDK-8223553 + Stream> cstream = fini.stream().filter(Objects::nonNull).map(MethodHandle::type) + .map(MethodType::returnType); + final Class loopReturnType = cstream.findFirst().orElse(void.class); loopChecks1cd(pred, fini, loopReturnType); // Step 2: determine parameter lists. diff -r d84176dd57b0 -r 9785b9fb328e src/java.management/share/classes/java/lang/management/ManagementFactory.java --- a/src/java.management/share/classes/java/lang/management/ManagementFactory.java Thu May 23 18:47:24 2019 -0700 +++ b/src/java.management/share/classes/java/lang/management/ManagementFactory.java Fri May 24 07:56:29 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -872,12 +872,13 @@ public static Set> getPlatformManagementInterfaces() { - return platformComponents() + // local variable required here; see JDK-8223553 + Stream> pmos = platformComponents() .stream() .flatMap(pc -> pc.mbeanInterfaces().stream()) .filter(clazz -> PlatformManagedObject.class.isAssignableFrom(clazz)) - .map(clazz -> clazz.asSubclass(PlatformManagedObject.class)) - .collect(Collectors.toSet()); + .map(clazz -> clazz.asSubclass(PlatformManagedObject.class)); + return pmos.collect(Collectors.toSet()); } private static final String NOTIF_EMITTER = diff -r d84176dd57b0 -r 9785b9fb328e src/java.net.http/share/classes/jdk/internal/net/http/ExchangeImpl.java --- a/src/java.net.http/share/classes/jdk/internal/net/http/ExchangeImpl.java Thu May 23 18:47:24 2019 -0700 +++ b/src/java.net.http/share/classes/jdk/internal/net/http/ExchangeImpl.java Fri May 24 07:56:29 2019 +0100 @@ -26,14 +26,15 @@ package jdk.internal.net.http; import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpResponse; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; -import java.util.function.Function; -import java.net.http.HttpClient; -import java.net.http.HttpResponse; + import jdk.internal.net.http.common.Logger; import jdk.internal.net.http.common.MinimalFuture; import jdk.internal.net.http.common.Utils; + import static java.net.http.HttpClient.Version.HTTP_1_1; /** @@ -92,8 +93,10 @@ CompletableFuture c2f = c2.getConnectionFor(request, exchange); if (debug.on()) debug.log("get: Trying to get HTTP/2 connection"); - return c2f.handle((h2c, t) -> createExchangeImpl(h2c, t, exchange, connection)) - .thenCompose(Function.identity()); + // local variable required here; see JDK-8223553 + CompletableFuture>> fxi = + c2f.handle((h2c, t) -> createExchangeImpl(h2c, t, exchange, connection)); + return fxi.thenCompose(x->x); } }