|
1 | | -/* |
2 | | - * Licensed to the Apache Software Foundation (ASF) under one or more |
3 | | - * contributor license agreements. See the NOTICE file distributed with |
4 | | - * this work for additional information regarding copyright ownership. |
5 | | - * The ASF licenses this file to You under the Apache License, Version 2.0 |
6 | | - * (the "License"); you may not use this file except in compliance with |
7 | | - * the License. You may obtain a copy of the License at |
| 1 | +/** |
| 2 | + * Copyright 2015 Stijn de Gouw |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
8 | 7 | * |
9 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
10 | 9 | * |
11 | 10 | * Unless required by applicable law or agreed to in writing, software |
12 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | 13 | * See the License for the specific language governing permissions and |
15 | 14 | * limitations under the License. |
| 15 | + * |
16 | 16 | */ |
17 | 17 | package org.apache.spark.util.collection; |
18 | 18 |
|
|
24 | 24 | * The blog that reported the bug |
25 | 25 | * http://www.envisage-project.eu/timsort-specification-and-verification/ |
26 | 26 | * |
27 | | - * The algorithms to reproduce the bug is obtained from the reporter of the bug |
28 | | - * https://github.com/abstools/java-timsort-bug |
| 27 | + * This codes was originally wrote by Stijn de Gouw, modified by Evan Yu to adapt to |
| 28 | + * our test suite. |
29 | 29 | * |
30 | | - * Licensed under Apache License 2.0 |
| 30 | + * https://github.com/abstools/java-timsort-bug |
31 | 31 | * https://github.com/abstools/java-timsort-bug/blob/master/LICENSE |
32 | 32 | */ |
33 | 33 | public class TestTimSort { |
@@ -56,8 +56,9 @@ private static int[] createArray(List<Long> runs, int length) { |
56 | 56 | int[] a = new int[length]; |
57 | 57 | Arrays.fill(a, 0); |
58 | 58 | int endRun = -1; |
59 | | - for (long len : runs) |
| 59 | + for (long len : runs) { |
60 | 60 | a[endRun += len] = 1; |
| 61 | + } |
61 | 62 | a[length - 1] = 0; |
62 | 63 | return a; |
63 | 64 | } |
|
0 commit comments