From 4fa598240f44c4bdb88a30f52a27b2cf23cfcfdf Mon Sep 17 00:00:00 2001 From: Radith Samarakoon Date: Wed, 28 Feb 2024 11:23:36 +0530 Subject: [PATCH] Add license header and class comment --- .../cli/utils/AnnotateDiagnostics.java | 21 +++++++++++++++++++ .../cli/utils/DiagnosticAnnotation.java | 21 +++++++++++++++++++ .../diagnostics/StringDiagnosticProperty.java | 21 +++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/AnnotateDiagnostics.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/AnnotateDiagnostics.java index 0b7e272111a6..6ac21c292082 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/AnnotateDiagnostics.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/AnnotateDiagnostics.java @@ -1,3 +1,19 @@ +// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package io.ballerina.cli.utils; import io.ballerina.compiler.internal.diagnostics.StringDiagnosticProperty; @@ -12,6 +28,11 @@ import static io.ballerina.cli.utils.DiagnosticAnnotation.SEVERITY_COLORS; +/** + * This class is used to generate diagnostic annotations from diagnostics. + * + * @since 2201.9.0 + */ public class AnnotateDiagnostics { public static String renderDiagnostic(Diagnostic diagnostic, Document document, int terminalWidth) { diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/DiagnosticAnnotation.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/DiagnosticAnnotation.java index eb8435fc7399..7127a685652f 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/DiagnosticAnnotation.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/DiagnosticAnnotation.java @@ -1,3 +1,19 @@ +// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package io.ballerina.cli.utils; import io.ballerina.tools.diagnostics.DiagnosticSeverity; @@ -5,6 +21,11 @@ import java.util.ArrayList; import java.util.HashMap; +/** + * Represents a diagnostic annotation that is used to annotate the source code with diagnostics. + * + * @since 2201.9.0 + */ public class DiagnosticAnnotation { private final ArrayList lines; diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/diagnostics/StringDiagnosticProperty.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/diagnostics/StringDiagnosticProperty.java index 92367f498eb1..7cb1e2a8ea9a 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/diagnostics/StringDiagnosticProperty.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/diagnostics/StringDiagnosticProperty.java @@ -1,3 +1,19 @@ +// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package io.ballerina.compiler.internal.diagnostics; import io.ballerina.tools.diagnostics.DiagnosticProperty; @@ -5,6 +21,11 @@ import java.util.Arrays; +/** + * Represents a string diagnostic property. + * + * @since 2201.9.0 + */ public class StringDiagnosticProperty implements DiagnosticProperty { private final DiagnosticPropertyKind kind; private final String value;