nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeGuardingDynamicLinker.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
110 public CompositeGuardingDynamicLinker(final Iterable<? extends GuardingDynamicLinker> linkers) { |
110 public CompositeGuardingDynamicLinker(final Iterable<? extends GuardingDynamicLinker> linkers) { |
111 final List<GuardingDynamicLinker> l = new LinkedList<>(); |
111 final List<GuardingDynamicLinker> l = new LinkedList<>(); |
112 for(final GuardingDynamicLinker linker: linkers) { |
112 for(final GuardingDynamicLinker linker: linkers) { |
113 l.add(Objects.requireNonNull(linker)); |
113 l.add(Objects.requireNonNull(linker)); |
114 } |
114 } |
115 this.linkers = l.toArray(new GuardingDynamicLinker[l.size()]); |
115 this.linkers = l.toArray(new GuardingDynamicLinker[0]); |
116 } |
116 } |
117 |
117 |
118 /** |
118 /** |
119 * Delegates the call to its component linkers. The first non-null value |
119 * Delegates the call to its component linkers. The first non-null value |
120 * returned from a component linker is returned. If no component linker |
120 * returned from a component linker is returned. If no component linker |