From eccb841c127c14a1aeee2ab3d1fc34a080919233 Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Mon, 18 Dec 2023 18:11:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=8B=D0=B4=D0=B5=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D1=83=20MAX=5F?= =?UTF-8?q?YEAR=5FBY=5F1C=203999?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bsl/languageserver/diagnostics/MagicDateDiagnostic.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicDateDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicDateDiagnostic.java index eb8df9b7e00..fa0cb641566 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicDateDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicDateDiagnostic.java @@ -65,6 +65,7 @@ public class MagicDateDiagnostic extends AbstractVisitorDiagnostic { private static final Pattern nonNumberPattern = CaseInsensitivePattern.compile( "\\D" ); + public static final int MAX_YEAR_BY_1C = 3999; @DiagnosticParameter( type = String.class, @@ -112,7 +113,7 @@ private static boolean isValidDate(BSLParser.StringContext ctx) { private static boolean isValidDate(String strDate) { var year = parseInt(strDate.substring(0, 4)); - if (year < 1 || year > 3999) { + if (year < 1 || year > MAX_YEAR_BY_1C) { return false; } var month = parseInt(strDate.substring(4, 6));