提交 93ae3106 编写于 作者: D dholmes

Merge

/*
* 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 @@ abstract class VarHandleBaseTest {
static List<TestAccessMode> testAccessModesOfType(TestAccessType... ats) {
Stream<TestAccessMode> 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<VarHandle.AccessMode> accessModes() {
......@@ -215,10 +213,9 @@ abstract class VarHandleBaseTest {
static List<VarHandle.AccessMode> accessModesOfType(TestAccessType... ats) {
Stream<TestAccessMode> 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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册