equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2006, 2019, 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 |
41 */ |
41 */ |
42 public final class DiagnosticCollector<S> implements DiagnosticListener<S> { |
42 public final class DiagnosticCollector<S> implements DiagnosticListener<S> { |
43 private List<Diagnostic<? extends S>> diagnostics = |
43 private List<Diagnostic<? extends S>> diagnostics = |
44 Collections.synchronizedList(new ArrayList<Diagnostic<? extends S>>()); |
44 Collections.synchronizedList(new ArrayList<Diagnostic<? extends S>>()); |
45 |
45 |
|
46 /** |
|
47 * Creates a new instance of DiagnosticCollector. |
|
48 */ |
|
49 public DiagnosticCollector() {} |
|
50 |
46 public void report(Diagnostic<? extends S> diagnostic) { |
51 public void report(Diagnostic<? extends S> diagnostic) { |
47 Objects.requireNonNull(diagnostic); |
52 Objects.requireNonNull(diagnostic); |
48 diagnostics.add(diagnostic); |
53 diagnostics.add(diagnostic); |
49 } |
54 } |
50 |
55 |