1 |
|
/* |
2 |
< |
* Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. |
2 |
> |
* Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. |
3 |
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
|
* |
5 |
|
* This code is free software; you can redistribute it and/or modify it |
16 |
|
* 2 along with this work; if not, write to the Free Software Foundation, |
17 |
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 |
|
* |
19 |
< |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
20 |
< |
* CA 95054 USA or visit www.sun.com if you need additional information or |
21 |
< |
* have any questions. |
19 |
> |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
> |
* or visit www.oracle.com if you need additional information or have any |
21 |
> |
* questions. |
22 |
|
*/ |
23 |
|
|
24 |
< |
/** |
24 |
> |
/* |
25 |
|
* @test |
26 |
|
* @bug 4323074 |
27 |
|
* @summary Basic test for Collections.indexOfSubList/lastIndexOfSubList |
33 |
|
public static void main(String[] args) throws Exception { |
34 |
|
int N = 500; |
35 |
|
List source = new ArrayList(3 * N); |
36 |
< |
List target[]= new List[N+1]; |
37 |
< |
int index[] = new int[N+1]; |
36 |
> |
List[] target = new List[N+1]; |
37 |
> |
int[] index = new int[N+1]; |
38 |
|
for (int i=0; i<=N; i++) { |
39 |
|
List t = new ArrayList(); |
40 |
|
String s = Integer.toString(i, 2); |
50 |
|
} |
51 |
|
} |
52 |
|
|
53 |
< |
List src[] = {source, new LinkedList(source), new Vector(source), |
54 |
< |
Arrays.asList(source.toArray())}; |
53 |
> |
List[] src = { |
54 |
> |
source, |
55 |
> |
new LinkedList(source), |
56 |
> |
new Vector(source), |
57 |
> |
Arrays.asList(source.toArray()) |
58 |
> |
}; |
59 |
|
for (int j=0; j<src.length; j++) { |
60 |
|
List s = src[j]; |
61 |
|
|
79 |
|
if (i != N) |
80 |
|
index[i] = srcSize - index[i] - target[i].size(); |
81 |
|
} |
82 |
< |
List src2[] = {source, new LinkedList(source), new Vector(source), |
83 |
< |
Arrays.asList(source.toArray())}; |
82 |
> |
List[] src2 = { |
83 |
> |
source, |
84 |
> |
new LinkedList(source), |
85 |
> |
new Vector(source), |
86 |
> |
Arrays.asList(source.toArray()) |
87 |
> |
}; |
88 |
|
for (int j=0; j<src2.length; j++) { |
89 |
|
List s = src2[j]; |
90 |
|
|