-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
name: Java CI | ||
|
||
on: [push, pull_request] | ||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java_version: ['17', '20'] | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
java_version: [ '17', '20', '21' ] | ||
os: [ ubuntu-latest, windows-latest, macOS-latest ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{ matrix.java_version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java_version }} | ||
distribution: 'adopt' | ||
- name: Build with Gradle | ||
run: ./gradlew check --stacktrace | ||
- name: Archive test results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: junit_report_${{ matrix.os }}_${{ matrix.java_version }} | ||
path: build/reports/tests/test | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{ matrix.java_version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java_version }} | ||
distribution: 'adopt' | ||
- name: Build with Gradle | ||
run: ./gradlew check --stacktrace | ||
- name: Archive test results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: junit_report_${{ matrix.os }}_${{ matrix.java_version }} | ||
path: build/reports/tests/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
/* | ||
* This file is a part of BSL Common library. | ||
* | ||
* Copyright (c) 2021 - 2024 | ||
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* BSL Common library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3.0 of the License, or (at your option) any later version. | ||
* | ||
* BSL Common library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with BSL Common library. | ||
*/ | ||
package com.github._1c_syntax.bsl.types; | ||
/* | ||
* This file is a part of BSL Common library. | ||
* | ||
* Copyright (c) 2021 - 2024 | ||
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* BSL Common library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3.0 of the License, or (at your option) any later version. | ||
* | ||
* BSL Common library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with BSL Common library. | ||
*/ | ||
package com.github._1c_syntax.bsl.types; | ||
|
||
import com.github._1c_syntax.utils.StringInterner; | ||
import lombok.EqualsAndHashCode; | ||
|
@@ -39,7 +39,7 @@ | |
@Value | ||
@EqualsAndHashCode(of = {"mdoRef"}) | ||
@ToString(of = {"mdoRef"}) | ||
public class MdoReference { | ||
public class MdoReference implements Comparable<MdoReference> { | ||
/** | ||
* Ссылка на пустую ссылку | ||
*/ | ||
|
@@ -182,6 +182,29 @@ public static Optional<MdoReference> find(@NonNull String mdoRef) { | |
return result; | ||
} | ||
|
||
@Override | ||
public int compareTo(@Nullable MdoReference mdoReference) { | ||
if (mdoReference == null) { | ||
return 1; | ||
} | ||
|
||
if (this.equals(mdoReference)) { | ||
return 0; | ||
} | ||
|
||
int typeComparison = this.type.compareTo(mdoReference.getType()); | ||
if (typeComparison != 0) { | ||
return typeComparison; | ||
} | ||
|
||
int mdoRefComparison = this.mdoRef.compareTo(mdoReference.getMdoRef()); | ||
if (mdoRefComparison != 0) { | ||
return mdoRefComparison; | ||
} | ||
|
||
return this.mdoRefRu.compareTo(mdoReference.getMdoRefRu()); | ||
} | ||
|
||
private static MdoReference getOrCompute(@NonNull MDOType mdoType, @NonNull String mdoRef, @NonNull String mdoRefRu) { | ||
if (REFERENCES.containsKey(mdoRef)) { | ||
return REFERENCES.get(mdoRef); | ||
|