01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: /*
20: * Written by Dawid Kurzyniec, based on public domain code written by Doug Lea
21: * and publictly available documentation, and released to the public domain, as
22: * explained at http://creativecommons.org/licenses/publicdomain
23: */
24: package org.apache.openjpa.lib.util.concurrent;
25:
26: /**
27: * Overrides toArray() and toArray(Object[]) in AbstractCollection to provide
28: * implementations valid for concurrent collections.
29: *
30: * @author Doug Lea
31: * @author Dawid Kurzyniec
32: */
33: abstract class AbstractCollection extends java.util.AbstractCollection {
34:
35: /**
36: * Sole constructor. (For invocation by subclass constructors, typically
37: * implicit.)
38: */
39: protected AbstractCollection() {
40: super ();
41: }
42:
43: public Object[] toArray() {
44: return Utils.collectionToArray(this );
45: }
46:
47: public Object[] toArray(Object[] a) {
48: return Utils.collectionToArray(this, a);
49: }
50: }
|