src/java.compiler/share/classes/javax/tools/DiagnosticCollector.java
changeset 58091 c0cc906cb29c
parent 47216 71c04702a3d5
equal deleted inserted replaced
58090:91bc4d6c4054 58091:c0cc906cb29c
     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