|
32 | 32 | import java.nio.file.Path; |
33 | 33 | import java.time.LocalDateTime; |
34 | 34 | import java.time.format.DateTimeFormatter; |
35 | | -import java.util.ArrayList; |
36 | 35 | import java.util.Comparator; |
37 | 36 | import java.util.List; |
38 | 37 | import java.util.Map.Entry; |
39 | 38 | import java.util.Objects; |
40 | 39 | import java.util.concurrent.ConcurrentHashMap; |
| 40 | +import java.util.concurrent.CopyOnWriteArrayList; |
41 | 41 | import java.util.concurrent.atomic.AtomicInteger; |
42 | 42 | import java.util.function.Consumer; |
43 | 43 | import java.util.function.Function; |
@@ -139,7 +139,7 @@ private static void doReport(Path dir, String reportNameRoot, String whatIsRepor |
139 | 139 |
|
140 | 140 | } |
141 | 141 |
|
142 | | - private static List<TypeFlowBuilder<?>> typeFlowBuilders = new ArrayList<>(); |
| 142 | + private static List<TypeFlowBuilder<?>> typeFlowBuilders = new CopyOnWriteArrayList<>(); |
143 | 143 |
|
144 | 144 | public static void registerTypeFlowBuilder(BigBang bb, TypeFlowBuilder<?> builder) { |
145 | 145 | if (!bb.reportAnalysisStatistics()) { |
@@ -190,15 +190,15 @@ static class TypeFlowStats { |
190 | 190 |
|
191 | 191 | final TypeFlow<?> flow; |
192 | 192 |
|
193 | | - final ArrayList<TypeState> allUpdates; |
194 | | - final ArrayList<TypeState> successfulUpdates; |
| 193 | + final List<TypeState> allUpdates; |
| 194 | + final List<TypeState> successfulUpdates; |
195 | 195 | final AtomicInteger queuedUpdates; |
196 | 196 |
|
197 | 197 | TypeFlowStats(TypeFlow<?> flow) { |
198 | 198 | this.retainReason = ""; |
199 | 199 | this.flow = flow; |
200 | | - this.allUpdates = new ArrayList<>(); |
201 | | - this.successfulUpdates = new ArrayList<>(); |
| 200 | + this.allUpdates = new CopyOnWriteArrayList<>(); |
| 201 | + this.successfulUpdates = new CopyOnWriteArrayList<>(); |
202 | 202 | this.queuedUpdates = new AtomicInteger(0); |
203 | 203 | } |
204 | 204 |
|
@@ -586,7 +586,7 @@ private static String asString(TypeFlow<?> flow) { |
586 | 586 | } else if (flow instanceof ActualReturnTypeFlow) { |
587 | 587 | ActualReturnTypeFlow ret = (ActualReturnTypeFlow) flow; |
588 | 588 | InvokeTypeFlow invoke = ret.invokeFlow(); |
589 | | - return "ActualReturn(" + formatMethod(invoke.getTargetMethod()) + ")@ " + formatSource(flow); |
| 589 | + return "ActualReturn(" + (invoke == null ? "null" : formatMethod(invoke.getTargetMethod())) + ")@ " + formatSource(flow); |
590 | 590 | } else if (flow instanceof MergeTypeFlow) { |
591 | 591 | return "Merge @ " + formatSource(flow); |
592 | 592 | } else if (flow instanceof SourceTypeFlow) { |
|
0 commit comments