# HG changeset patch # User dholmes # Date 1506403560 14400 # Node ID fae0bf9e361f51d1e8c3e1c15793170b3e75b29a # Parent 8b5ed0358b3a69ff587a96aef6faeaf797b2140e# Parent 65640af28197a6f5b119d7b9731ee8b1fe146f45 Merge diff -r 8b5ed0358b3a -r fae0bf9e361f test/jdk/java/lang/invoke/VarHandles/VarHandleBaseTest.java --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleBaseTest.java Mon Sep 25 23:42:58 2017 -0400 +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleBaseTest.java Tue Sep 26 01:26:00 2017 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, 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 @@ -203,10 +203,8 @@ static List testAccessModesOfType(TestAccessType... ats) { Stream s = Stream.of(TestAccessMode.values()); - for (TestAccessType at : ats) { - s = s.filter(e -> e.isOfType(at)); - } - return s.collect(toList()); + return s.filter(e -> Stream.of(ats).anyMatch(e::isOfType)) + .collect(toList()); } static List accessModes() { @@ -215,10 +213,9 @@ static List accessModesOfType(TestAccessType... ats) { Stream s = Stream.of(TestAccessMode.values()); - for (TestAccessType at : ats) { - s = s.filter(e -> e.isOfType(at)); - } - return s.map(TestAccessMode::toAccessMode).collect(toList()); + return s.filter(e -> Stream.of(ats).anyMatch(e::isOfType)) + .map(TestAccessMode::toAccessMode) + .collect(toList()); } static MethodHandle toMethodHandle(VarHandle vh, TestAccessMode tam, MethodType mt) {