Skip to content

Conversation

@nixel2007
Copy link
Member

@nixel2007 nixel2007 commented Jan 5, 2026

Описание

Связанные задачи

Closes

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

Summary by CodeRabbit

  • Dependencies

    • Spring Boot upgraded to 4.0.1; Gradle wrapper bumped to 9.2.1; JSON tooling switched to a vendored Jackson distribution; Sentry DSL enhanced to include source context.
  • Code Quality

    • Modernized Java APIs (pattern matching, formatted strings, Path.of), migrated to Jakarta annotations, and streamlined data/model representations for clarity and maintainability.
  • Chores

    • Replaced legacy license tooling with Spotless and simplified header/license handling.
  • Tests

    • Test suite updated to new APIs and testing extensions for more reliable execution.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings January 5, 2026 08:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

Replaces com.fasterxml.jackson with tools.jackson and ObjectMapper→JsonMapper, updates build plugins and Gradle wrapper, migrates license handling to Spotless, modernizes Java idioms (pattern matching, String.formatted, Path.of), converts AnalysisInfo to a record, and updates Jackson (de)serializers and Lombok annotation usages across code and tests.

Changes

Cohort / File(s) Summary
Build & Tooling
build.gradle.kts, gradle/wrapper/gradle-wrapper.properties
Plugin/version bumps (Spring Boot, Sentry, JReleaser), removed cloud.rio.license → added com.diffplug.spotless, Gradle wrapper bumped to 9.2.1, moved Spotless wiring into afterEvaluate, updateLicenses now wraps spotlessApply.
Jackson → tools.jackson migration
src/main/java/.../databind/*, src/main/java/.../reporters/*, src/test/java/.../reporters/*, src/main/java/.../databind/JsonMapperConfiguration.java, src/main/java/.../reporters/databind/AnalysisInfoJsonMapper.java
Replaced com.fasterxml.jackson imports with tools.jackson equivalents; ObjectMapper→JsonMapper (and builders/customizers); many serializers/deserializers now extend ValueSerializer/ValueDeserializer and adjust throws/signatures; mixin/mapper construction updated—review (de)serializer signatures and bean API change (ObjectMapper → JsonMapperBuilderCustomizer).
Analysis data model & reporters
src/main/java/.../reporters/data/AnalysisInfo.java, src/main/java/.../reporters/*, src/test/java/.../reporters/*
AnalysisInfo converted to a Java record (accessors renamed to component methods like fileinfos()); reporter mappers/clients updated to use JsonMapper/XmlMapper.builder and record accessors—check all call sites and tests.
License header & Spotless
license/HEADER.txt, build.gradle.kts
Replaced templated LGPL header with concrete header; migrated license task handling into Spotless configuration and exclusions; removed legacy license tasks.
Language modernizations
many files under src/main/java/... (cfg, diagnostics, utils, codeactions, hover, reporters, context, etc.)
Wide refactor: pattern-matching instanceof, replace String.format(...)String.formatted(...), Optional filter+get → flatMap(Optional::stream); mostly syntactic changes—spot-check areas where casts or overload resolution mattered.
Path API updates
many production & test files e.g. src/main/java/.../codelenses/*, .../testrunner/*, src/test/java/...
Replaced Paths.get(...) with Path.of(...) and updated imports; verify platform/path expectations and any code that relied on Paths specifics.
Lombok / annotation syntax updates
various src/main/java/.../aop/*, .../context/*, .../configuration/*
Changed onMethod/onConstructor usages to newer onMethod_/onConstructor_ forms for @Autowired, @Locked, @JsonCreator; some javax→jakarta PostConstruct in tests — confirm Lombok compatibility.
Schema / resources
src/main/resources/.../configuration/schema.json
Replaced Russian literals with Unicode escape sequences in defaults.
Tests & test infra
src/test/java/... (many files)
Tests updated to use tools.jackson mappers, Path.of, removed some throws IOException, added Mockito JUnit5 extension in one test; ensure test mappers and assertions align with record accessors and new mapper types.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰
I hopped through strings and mapper streams,
Replaced old casts with modern dreams,
Records sprung and headers bright,
Paths found home with Path.of light,
A bunny’s patch: the code now beams.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: upgrading to Spring Boot 4 and performing automatic refactoring. It is concise, clear, and directly reflects the substantial modifications across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

Test Results

 2 817 files  ±0   2 817 suites  ±0   57m 25s ⏱️ +48s
 1 162 tests ±0   1 162 ✅ ±0  0 💤 ±0  0 ❌ ±0 
10 458 runs  ±0  10 458 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 14f8809. ± Comparison against base commit eea2945.

This pull request removes 54 and adds 50 tests. Note that renamed tests count towards both.
#, count=1
, count=0
, count=1
A, count=1
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [1] filePath=./src/test/resources/codelenses/AbstractRunTestCodeLensSupplier.os, clientName=unknown, expected=false
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [2] filePath=./src/test/resources/codelenses/tests/AbstractRunTestCodeLensSupplier.os, clientName=unknown, expected=false
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [3] filePath=./src/test/resources/codelenses/AbstractRunTestCodeLensSupplier.os, clientName=Visual Studio Code, expected=false
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [4] filePath=./src/test/resources/codelenses/tests/AbstractRunTestCodeLensSupplier.os, clientName=Visual Studio Code, expected=true
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [1] content=, count=0
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [1] modulePath=Catalogs/Справочник1/Ext/ManagerModule.bsl
…
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [1] filePath = "./src/test/resources/codelenses/AbstractRunTestCodeLensSupplier.os", clientName = "unknown", expected = "false"
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [2] filePath = "./src/test/resources/codelenses/tests/AbstractRunTestCodeLensSupplier.os", clientName = "unknown", expected = "false"
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [3] filePath = "./src/test/resources/codelenses/AbstractRunTestCodeLensSupplier.os", clientName = "Visual Studio Code", expected = "false"
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractRunTestsCodeLensSupplierTest ‑ [4] filePath = "./src/test/resources/codelenses/tests/AbstractRunTestCodeLensSupplier.os", clientName = "Visual Studio Code", expected = "true"
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [1] content = "", count = 0
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [1] modulePath = "Catalogs/Справочник1/Ext/ManagerModule.bsl"
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [2] content = "\n", count = 0
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [2] modulePath = "Catalogs/Справочник1/Forms/ФормаВыбора/Ext/Form/Module.bsl"
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [3] content = "//", count = 1
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [3] modulePath = "CommonModules/ПервыйОбщийМодуль/Ext/Module.bsl"
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the project from Spring Boot 3 to Spring Boot 4 and performs automatic refactorings to align with the new framework version. The changes involve migrating Jackson dependencies to the new tools.jackson namespace, replacing deprecated Lombok annotations, and modernizing Java code with pattern matching and other language improvements.

Key changes:

  • Upgrade Spring Boot from 3.5.9 to 4.0.1 with accompanying dependency updates (AspectJ, Sentry, JReleaser, Gradle)
  • Migrate all Jackson imports from com.fasterxml..jackson to tools.jackson namespace
  • Replace Paths.get() calls with Path.of() and remove unused java.nio.file.Paths imports
  • Refactor code to use pattern matching for instanceof checks and other Java language improvements
  • Convert AnalysisInfo class to a record

Reviewed changes

Copilot reviewed 121 out of 123 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
build.gradle.kts Updates Spring Boot to 4.0.1, AspectJ, Sentry, JReleaser versions, and migrates Jackson dependencies
gradle/wrapper/gradle-wrapper.properties Upgrades Gradle wrapper from 9.2.0 to 9.2.1
Various reporter and databind classes Migrates Jackson imports to tools.jackson namespace and updates API usage
AnalysisInfo.java Converts from Lombok @Data class to Java record
Multiple test files Replaces Paths.get() with Path.of() and removes unused imports
Various diagnostic and utility classes Applies pattern matching for instanceof, replaces String.format() with formatted(), and updates Lombok annotations
Configuration classes Updates Lombok onConstructor syntax from @__ to onConstructor_
Comments suppressed due to low confidence (8)

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporter.java:1

  • Remove the extra semicolon at the end of the build() statement.
    src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporter.java:1
  • Remove the extra semicolon at the end of the build() statement.
    src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitTestSuites.java:1
  • Verify that replacing @JacksonXmlRootElement with @JsonRootName provides the same XML serialization behavior. @JsonRootName is typically for JSON, while XML serialization may require additional configuration or different annotations.
    src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeSerializer.java:1
  • The method signature changed from throwing IOException to not declaring any checked exceptions. Verify that downstream error handling is still appropriate if serialization errors occur.
    src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.java:1
  • The method signature changed from throwing IOException to not declaring any checked exceptions. Verify that downstream error handling is still appropriate if deserialization errors occur.
    src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/data/AnalysisInfo.java:1
  • Converting from a Lombok @Data class to a record changes the getter method names from getFileinfos() to fileinfos(). Ensure all call sites have been updated accordingly, or consider whether this is a breaking change for external consumers of this API.
    src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/CyclomaticComplexityComputer.java:1
  • Add a space after the equals sign in onMethod_ for consistency: onMethod_ = {@Autowired}.
    src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/CognitiveComplexityComputer.java:1
  • Add a space after the equals sign in onMethod_ for consistency: onMethod_ = {@Autowired}.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Fix all issues with AI Agents 🤖
In @build.gradle.kts:
- Line 64: The declared variable sentryVersion is unused; either remove the line
defining sentryVersion or wire it into the Sentry Gradle plugin configuration by
setting autoInstallation.sentryVersion to that value (e.g., inside the sentry {
autoInstallation { sentryVersion.set("8.29.0") } } block) so the plugin uses the
intended SDK version instead of its bundled default.
- Around line 136-137: Update the Jackson XML import in the test to match the
migrated 3.x coordinates: in JUnitReporterTest.java replace the old
com.fasterxml.jackson.dataformat.xml.XmlMapper import with
tools.jackson.dataformat.xml.XmlMapper (ensure any other references to
com.fasterxml.jackson.dataformat.xml are likewise updated to
tools.jackson.dataformat.xml so the test compiles against the new dependencies).
- Around line 18-20: The Sentry Gradle plugin entry using
id("io.sentry.jvm.gradle") version "6.0.0-rc.1" should not be used in
production; change that version string to the latest stable release (e.g.,
"5.9.0") or revert to it until 6.0.0 is officially released, then re-run your
Gradle build and test suite to ensure compatibility and update any
lockfiles/dependency metadata accordingly.

In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CommandProvider.java:
- Line 24: Update the XmlMapper import in JUnitReporterTest to the Jackson 3.x
namespace to match the change in CommandProvider: replace the old
com.fasterxml.jackson.dataformat.xml.XmlMapper import with
tools.jackson.dataformat.xml.XmlMapper in
src/test/java/.../reporters/JUnitReporterTest.java so the test uses the same
tools.jackson.* package as ObjectMapper; leave other
com.fasterxml.jackson.annotation imports unchanged.

In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoObjectMapper.java:
- Around line 34-35: The constructor in AnalysisInfoObjectMapper currently
passes a JsonMapperBuilder to super by calling
JsonMapper.builder().addMixIn(...); change it to pass a built JsonMapper
instance by appending .build() to the builder chain so super receives a
JsonMapper (i.e., update the call in AnalysisInfoObjectMapper's constructor from
JsonMapper.builder().addMixIn(Diagnostic.class, DiagnosticMixIn.class) to
JsonMapper.builder().addMixIn(...).build()).

In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericIssueReporter.java:
- Around line 24-25: GenericIssueReport and any related model classes still use
Jackson 2.x annotations (com.fasterxml.jackson.annotation.*) while
GenericIssueReporter and ObjectMapper were migrated to Jackson 3.x
(tools.jackson.*), causing serialization to fail; update GenericIssueReport.java
(and any affected DTOs) to import and use tools.jackson.annotation annotations
(e.g., tools.jackson.annotation.JsonProperty, JsonIgnore, JsonCreator, etc.),
remove or replace com.fasterxml imports, ensure constructor/factory annotations
and field names match existing serialized names, recompile to find remaining
classes referencing com.fasterxml and migrate them similarly, and run
unit/integration tests to verify GenericIssueReporter.serialize/deserialize
works with the Jackson 3.x mapper.

In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporter.java:
- Around line 109-111: In SarifReporter, remove the stray extra semicolon after
building the JsonMapper instance: locate the JsonMapper creation (var mapper =
JsonMapper.builder().enable(SerializationFeature.INDENT_OUTPUT).build();;) and
delete the duplicate semicolon so the statement ends with a single semicolon;
ensure the resulting line compiles and preserves the INDENT_OUTPUT setting.

In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporter.java:
- Around line 59-61: Remove the stray double semicolon after the ObjectMapper
construction in TSLintReporter: locate the ObjectMapper mapper =
JsonMapper.builder().enable(SerializationFeature.INDENT_OUTPUT).build();;
statement and delete the extra trailing semicolon so the statement ends with a
single semicolon.

In
@src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java:
- Around line 24-25: Remove the unused import of ObjectMapper from
tools.jackson.databind; the test only uses XmlMapper
(com.fasterxml.jackson.dataformat.xml.XmlMapper) so delete the line importing
tools.jackson.databind.ObjectMapper to avoid an unused-import and clarify
dependencies.

In
@src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java:
- Around line 24-25: The test TSLintReporterTest uses
tools.jackson.databind.ObjectMapper (Jackson 3) but domain classes like
TSLintReportEntry, AnalysisInfo, FileInfo still use com.fasterxml.jackson
annotations; update all Jackson annotation imports in those classes (and any
other classes referenced by tests) from com.fasterxml.jackson.* to
tools.jackson.annotation.* (e.g., JsonProperty, JsonFormat, JsonInclude,
JsonCreator, JsonIgnoreProperties) so the ObjectMapper can recognize them at
runtime; search for classes referenced by TSLintReporterTest (TSLintReportEntry,
AnalysisInfo, FileInfo, etc.) and replace their annotation imports accordingly
to complete the Jackson 3.x migration.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/test/java/com/github/_1c_syntax/bsl/languageserver/ParentProcessWatcherTest.java (1)

38-46: Remove @SpringBootTest and simplify to unit testing approach.

ParentProcessWatcher is a Spring component, but this test doesn't require the Spring application context. The combination of @ExtendWith(MockitoExtension.class) with @SpringBootTest is inappropriate here: @SpringBootTest adds unnecessary overhead while @InjectMocks and @Mock create instances outside of Spring's management.

Since the test methods manually construct test data and call methods directly without accessing any Spring-managed beans, remove @SpringBootTest to keep the test lightweight and focused as a unit test with Mockito.

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.java (1)

48-54: Catch IOException instead of JacksonException for safer file I/O exception handling.

The mapper.writeValue(reportFile, analysisInfo) operation performs both file I/O and JSON serialization. Spring Boot 4.0.1 uses Jackson 3 by default, where JacksonException extends IOException. However, narrowing the catch from IOException to JacksonException only catches the child class, not the parent. If mapper.writeValue() throws IOException directly (from low-level file operations), it will not be caught and will propagate as an unhandled exception.

Proposed fix
-    } catch (JacksonException e) {
+    } catch (IOException e) {
       throw new RuntimeException(e);
     }
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (1)

103-123: Potential ClassCastException when Iterable is not a Collection.

Line 108 checks for Iterable, but line 111 casts to Collection<?> to call size(). If the input is an Iterable that isn't a Collection, this will throw a ClassCastException.

🔎 Proposed fix - check for Collection directly
   private static <E extends Enum<E>> void convertStringArrayToEnumArray(
     Map<String, Object> params,
     String key,
     Class<E> enumClass
   ) {
-    if (params.containsKey(key) && params.get(key) instanceof Iterable) {
-      @SuppressWarnings("unchecked")
-      var list = (Iterable<Object>) params.get(key);
-      var array = java.lang.reflect.Array.newInstance(enumClass, ((Collection<?>) list).size());
+    if (params.containsKey(key) && params.get(key) instanceof Collection<?> collection) {
+      var array = java.lang.reflect.Array.newInstance(enumClass, collection.size());
       var i = 0;
-      for (Object item : list) {
+      for (Object item : collection) {
         if (item instanceof String stringItem) {
           java.lang.reflect.Array.set(array, i, Enum.valueOf(enumClass, stringItem));
         } else {
           java.lang.reflect.Array.set(array, i, item);
         }
         i++;
       }
       params.put(key, array);
     }
   }
🧹 Nitpick comments (13)
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/NonStandardRegionDiagnosticTest.java (1)

242-244: Consider using Path.resolve() for joining path segments.

Since CONFIGURATION_PATH is already a Path object, using .toString() and then constructing a new path is redundant. The idiomatic approach is to use Path.resolve() which directly joins path segments.

🔎 Proposed refactor
-    Path tempFile = Path.of(CONFIGURATION_PATH.toString(),
-      pathByModuleType.getOrDefault(moduleType, "Module.bsl")
-    );
+    Path tempFile = CONFIGURATION_PATH.resolve(
+      pathByModuleType.getOrDefault(moduleType, "Module.bsl")
+    );
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TimeoutsInExternalResourcesDiagnosticTest.java (2)

135-135: Simplify path construction using resolve().

Converting tempDir to string and back to Path is unnecessary. Use Path.resolve() for cleaner and more efficient path concatenation.

🔎 Proposed refactor
-      Path.of(tempDir.toAbsolutePath().toString(), "Configuration.xml").toFile(),
+      tempDir.toAbsolutePath().resolve("Configuration.xml").toFile(),

179-179: Simplify path construction using resolve().

Same issue as line 135 - use Path.resolve() instead of converting to string and back.

🔎 Proposed refactor
-      Path.of(tempDir.toAbsolutePath().toString(), "Configuration.xml").toFile(),
+      tempDir.toAbsolutePath().resolve("Configuration.xml").toFile(),
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/EmptyRegionDiagnostic.java (1)

74-74: Optional: Apply pattern matching for consistency.

For consistency with the refactoring on line 60, consider applying pattern matching here as well:

-if (ctx instanceof BSLParser.RegionEndContext && !regions.isEmpty()) {
+if (ctx instanceof BSLParser.RegionEndContext regionEnd && !regions.isEmpty()) {

Note: Since the bound variable wouldn't be used in the block, this change is purely cosmetic and optional.

src/main/java/com/github/_1c_syntax/bsl/languageserver/aop/SentryAspect.java (1)

53-53: LGTM! Modern Lombok syntax correctly applied.

The update from onMethod = @__({@Autowired}) to onMethod_ = {@Autowired} correctly adopts the modern Lombok annotation syntax for setter generation with autowiring. This change is functionally equivalent and aligns with current Lombok best practices.

Optional: Minor formatting consistency

Consider adding a space before = for consistency with Java formatting conventions:

-  @Setter(onMethod_ ={@Autowired})
+  @Setter(onMethod_ = {@Autowired})

Apply to both lines 53 and 57.

Also applies to: 57-57

src/main/java/com/github/_1c_syntax/bsl/languageserver/aop/MeasuresAspect.java (1)

53-53: LGTM! Lombok annotation syntax modernized.

The Lombok setter annotation has been correctly updated to use the modern onMethod_ syntax instead of the deprecated @__ pattern, maintaining the autowiring behavior.

Optional: Consistent spacing

For formatting consistency:

-  @Setter(onMethod_ ={@Autowired})
+  @Setter(onMethod_ = {@Autowired})
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/SymbolTree.java (1)

174-180: Consider consistent variable naming in pattern matching.

The pattern matching is correct, but the bound variable names are inconsistent: context1 for ModuleVarDeclarationContext and context for SubVarDeclarationContext. Consider using consistent naming like moduleVarCtx and subVarCtx for clarity.

🔎 Suggested naming improvement
-    } else if (ctx instanceof BSLParser.ModuleVarDeclarationContext context1) {
-      varNameNode = context1.var_name();
-    } else if (ctx instanceof BSLParser.SubVarDeclarationContext context) {
-      varNameNode = context.var_name();
+    } else if (ctx instanceof BSLParser.ModuleVarDeclarationContext moduleVarCtx) {
+      varNameNode = moduleVarCtx.var_name();
+    } else if (ctx instanceof BSLParser.SubVarDeclarationContext subVarCtx) {
+      varNameNode = subVarCtx.var_name();
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/data/AnalysisInfo.java (1)

40-40: Consider defensive copy for the fileinfos list.

Records don't automatically create defensive copies of mutable fields. The List<FileInfo> passed to the constructor could be modified externally. If immutability is important, consider using List.copyOf() in a compact constructor.

🔎 Optional: Add compact constructor for defensive copy
 public record AnalysisInfo(
   @JsonFormat(
     pattern = "yyyy-MM-dd HH:mm:ss",
     shape = JsonFormat.Shape.STRING)
   @JsonDeserialize(using = LocalDateTimeDeserializer.class)
   @JsonSerialize(using = LocalDateTimeSerializer.class)
   LocalDateTime date,
   List<FileInfo> fileinfos,
   String sourceDir) {
+
+  public AnalysisInfo {
+    fileinfos = List.copyOf(fileinfos);
+  }
 }
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporter.java (1)

79-79: Consider consistent mapper usage across reporters.

Line 79 uses mapper.writer().writeValue() while GenericIssueReporter uses mapper.writeValue() directly. Both work, but the extra writer() call is unnecessary here and creates an inconsistency. Consider using the direct approach for consistency unless writer-specific configuration is needed.

🔎 Proposed simplification
-    mapper.writer().writeValue(reportFile, report);
+    mapper.writeValue(reportFile, report);
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.java (1)

30-30: Consider removing unused IOException import.

The IOException import is no longer needed since ValueDeserializer.deserialize() throws unchecked JacksonException instead.

🔎 Proposed fix
 import tools.jackson.databind.ValueDeserializer;
-
-import java.io.IOException;
 
 /**

As per coding guidelines, optimize imports before committing.

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java (1)

35-35: Consider removing unused IOException import.

The IOException import is no longer needed after switching to JacksonException for error handling in tools.jackson.

🔎 Proposed fix
 import tools.jackson.databind.ValueDeserializer;
 
-import java.io.IOException;
 import java.util.Collections;

As per coding guidelines, optimize imports before committing.

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java (1)

31-31: Unused import: java.io.IOException

The IOException import is no longer needed since the deserialize method no longer declares throws IOException.

🔎 Proposed fix
-import java.io.IOException;
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (1)

39-39: Unused import: java.io.IOException

The IOException import is no longer needed since the deserialize method no longer declares throws IOException.

🔎 Proposed fix
-import java.io.IOException;

@nixel2007
Copy link
Member Author

@copilot отработай замечания по ревью от copilot и coderabbitai. Плюс поправь сборку проекта

Copy link
Contributor

Copilot AI commented Jan 5, 2026

@nixel2007 I've opened a new pull request, #3736, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In
@src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java:
- Line 61: The test method JsonReporterTest.report() currently calls
mapper.readValue(file, AnalysisInfo.class) which throws a checked IOException;
update the method signature to "void report() throws IOException" to match other
tests (TSLintReporterTest.report(), SarifReporterTest.report(),
GenericReporterTest.report(), CodeQualityReporterTest.report()) and do the same
for JUnitReporterTest.report(), or alternatively wrap the mapper.readValue(...)
call in a try-catch that handles/logs the IOException—prefer adding "throws
IOException" to the report() signatures for consistency.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10c8c1b and 15dafd9.

📒 Files selected for processing (3)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
🧰 Additional context used
📓 Path-based instructions (2)
src/test/java/**/*Test.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
🧠 Learnings (2)
📓 Common learnings
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:46:37.552Z
Learning: When using Sentry Gradle plugin, it dynamically resolves the latest compatible SDK version from Maven Central during project configuration, rather than using hardcoded versions. This allows the plugin to work with newer SDK versions without requiring plugin updates.
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/main/java/**/diagnostics/**/*.java : Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: Analyse
  • GitHub Check: Benchmark
  • GitHub Check: build
🔇 Additional comments (2)
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java (2)

87-87: LGTM! Record accessor correctly updated.

The change from report.getFileinfos() to report.fileinfos() correctly reflects the migration of AnalysisInfo to a Java record, which uses field-name accessors without the "get" prefix.


24-24: No action required. The import tools.jackson.databind.ObjectMapper is the correct package namespace for Jackson 3 in Spring Boot 4. This is the standard migration path from Jackson 2's com.fasterxml.jackson package.

Copilot AI and others added 4 commits January 6, 2026 17:56
- Fix Lombok annotation spacing (add space after = in onMethod_ and onConstructor_)
- Fix Javadoc reference in DiagnosticMixIn
- Switch to hierynomus license plugin and disable license tasks (Spring Boot 4 incompatibility)
- Fix Jackson imports in test files
- Remove deprecated findAndRegisterModules() call from test

Co-authored-by: nixel2007 <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json (1)

1144-1150: Consider using direct UTF-8 Cyrillic characters instead of Unicode escapes for improved maintainability.

The Russian Cyrillic strings in the default values are encoded as Unicode escape sequences. While functionally correct, this significantly reduces readability and makes maintenance harder. Since modern JSON processors natively support UTF-8, consider replacing the Unicode escapes with direct Cyrillic characters (e.g., "ОбщийМодуль" instead of "\u041e\u0431\u0449\u0438\u0439\u041c\u043e\u0434\u0443\u043b\u044c").

Also applies to: 1172-1174

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoObjectMapper.java (1)

32-33: Consider narrowing the scope of @SuppressWarnings.

The class-level @SuppressWarnings("unchecked") suppresses warnings for the entire class. If the unchecked warnings are specific to inherited readTree methods or other specific operations, consider:

  1. Whether the suppression is still necessary after the Jackson 3.x migration
  2. If the warnings can be addressed through proper type parameterization instead of suppression
  3. Adding a more detailed comment explaining which inherited methods trigger the warnings

Class-level suppressions can mask future issues in new code added to this class.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3113c9b and 31ec75e.

📒 Files selected for processing (4)
  • build.gradle.kts
  • license/HEADER.txt
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoObjectMapper.java
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json
🧰 Additional context used
📓 Path-based instructions (2)
src/main/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoObjectMapper.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoObjectMapper.java
🧠 Learnings (12)
📚 Learning: 2025-11-19T09:02:03.154Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3610
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/folding/QueryPackageFoldingRangeSupplier.java:26-26
Timestamp: 2025-11-19T09:02:03.154Z
Learning: В проекте bsl-language-server используется кастомная версия ANTLR4 от 1c-syntax (io.github.1c-syntax:antlr4), которая включает базовый класс org.antlr.v4.runtime.Tokenizer с методами getAst() и getTokens(). SDBLTokenizer и BSLTokenizer наследуются от этого базового класса.

Applied to files:

  • license/HEADER.txt
📚 Learning: 2024-07-04T19:35:26.747Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3308
File: src/test/resources/diagnostics/DoubleNegativesDiagnostic.bsl:20-21
Timestamp: 2024-07-04T19:35:26.747Z
Learning: The file `DoubleNegativesDiagnostic.bsl` is a test resource intended to demonstrate the functionality of the DoubleNegatives diagnostic.

Applied to files:

  • license/HEADER.txt
📚 Learning: 2025-02-13T16:46:37.552Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:46:37.552Z
Learning: When using Sentry Gradle plugin, it dynamically resolves the latest compatible SDK version from Maven Central during project configuration, rather than using hardcoded versions. This allows the plugin to work with newer SDK versions without requiring plugin updates.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-02-13T16:46:37.552Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:46:37.552Z
Learning: The Sentry Gradle plugin uses a hierarchical version resolution strategy: first checking explicit project dependencies, then autoInstallation.sentryVersion configuration, and finally falling back to the bundled default version. It relies on Gradle's dependency resolution mechanism rather than dynamically querying Maven Central.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-02-13T16:35:06.289Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:35:06.289Z
Learning: When using `io.sentry.jvm.gradle` plugin in a Java project, the `io.sentry:sentry-bom` dependency management import is redundant as the plugin handles all Sentry dependencies automatically.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-02-13T16:46:37.552Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:46:37.552Z
Learning: The Sentry Gradle plugin first checks for existing Sentry dependencies (including BOM) in the project. If none found, it uses the version from autoInstallation.sentryVersion property, which defaults to SENTRY_SDK_VERSION constant defined in the plugin.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-02-13T16:46:37.552Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:46:37.552Z
Learning: The Sentry Gradle plugin uses Gradle's dependency constraints system to manage SDK versions. It adds constraints for all Sentry modules, allowing the use of newer SDK versions without plugin updates while maintaining version consistency across all Sentry dependencies.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-02-13T16:39:55.505Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:39:55.505Z
Learning: When using Sentry Gradle plugin without BOM, the plugin uses its own version of Sentry SDK and integrations by default, which can be overridden using `sentryVersion` in the plugin configuration.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-02-13T16:35:06.289Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:35:06.289Z
Learning: When using Sentry Gradle plugin, the `io.sentry:sentry-bom` dependency is not required as the plugin automatically manages all necessary Sentry dependencies and their versions.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-02-13T16:39:55.505Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-02-13T16:39:55.505Z
Learning: When using Sentry JVM Gradle plugin, the SDK version can be explicitly set using `sentryVersion.set("x.y.z")` in the plugin's `autoInstallation` configuration block to override the default version selection.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-08-25T09:16:23.946Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3506
File: build.gradle.kts:43-47
Timestamp: 2025-08-25T09:16:23.946Z
Learning: В git versioning плагине плейсхолдер ${dirty} добавляет суффикс только при наличии незафиксированных изменений в рабочем дереве. При чистом состоянии репозитория (во время публикации) ${dirty} пустой, поэтому версии корректно заканчиваются на -SNAPSHOT для распознавания Maven/JReleaser.

Applied to files:

  • build.gradle.kts
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to docs/{en/,}diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes

Applied to files:

  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: Analyse
  • GitHub Check: build
  • GitHub Check: Benchmark
  • GitHub Check: Sentry
🔇 Additional comments (12)
license/HEADER.txt (1)

1-21: License header properly formatted for Spotless processing.

The header follows C-style block comment conventions with correct SPDX identifier (LGPL-3.0-or-later), complete license text, and proper copyright attribution. The $YEAR placeholder is appropriately used for runtime substitution by Spotless during the build process, consistent with the license header management migration mentioned in the PR.

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoObjectMapper.java (2)

36-37: Constructor implementation is correct.

The constructor correctly passes the JsonMapper.Builder to super() without calling .build(), using the protected ObjectMapper(MapperBuilder<?,?> builder) constructor pattern for Jackson 3.x subclassing. This was confirmed in the previous review discussion.


24-24: The imports are correct. Jackson 3.x (used in Spring Boot 4) migrated from com.fasterxml.jackson to tools.jackson for databind and core modules. The package name tools.jackson on lines 24 and 27 follows the proper Jackson 3.x naming convention and is consistent with the rest of the codebase. The constructor pattern using JsonMapper.builder() is the recommended approach for Jackson 3.x.

build.gradle.kts (9)

10-10: LGTM: Spotless plugin addition.

The addition of the Spotless plugin for license header management is a good modernization. The version (7.0.4) is appropriate, and the plugin is properly configured in the spotless block below (lines 311-316).


23-23: LGTM: JReleaser version bump.

The JReleaser upgrade from 1.21.0 to 1.22.0 is a minor version bump and should be safe.


41-56: LGTM: Correct git-versioning DSL syntax.

The $$ prefix is the correct syntax for the git-versioning plugin's DSL to reference version properties. The version configuration properly handles tags, branches, and raw commits with appropriate versioning schemes.


92-92: LGTM: Dependency version bumps.

The version bumps for bsl-common-library (0.9.0 → 0.9.1) and aspectjrt (1.9.25 → 1.9.25.1) are minor/patch updates and should be safe.

Also applies to: 116-116


132-133: LGTM: Jackson 3.x migration complete.

The Jackson dependencies have been correctly migrated to the tools.jackson namespace, which is required for Spring Boot 4. The corresponding Java import statements were already updated in commit 15dafd9.


196-206: LGTM: Proper task coordination for Sentry and Spotless.

The afterEvaluate block correctly establishes dependencies between Spotless formatting tasks and dynamically generated Sentry tasks. This ensures that Sentry's metadata files are generated before Spotless processes Java sources. The use of tasks.named() is the appropriate pattern for referencing tasks created by plugins during configuration.


269-271: LGTM: Sentry configuration.

The Sentry configuration appropriately enables source context inclusion for error reports. The plugin will use its bundled default SDK version, which is acceptable. If a specific Sentry SDK version is needed, it can be set via autoInstallation { sentryVersion.set("x.y.z") }.

Based on learnings, the Sentry Gradle plugin automatically manages SDK dependencies and versions when not explicitly configured.


311-316: LGTM: Proper Spotless license header configuration.

The Spotless configuration correctly sets up license header management with:

  • Appropriate exclusion of AbstractObjectPool.java
  • License header file reference using rootProject.file()
  • Automatic copyright year updates via updateYearWithLatest(true)

This properly replaces the previous license plugin functionality.


444-448: LGTM: updateLicenses task migrated to Spotless.

The updateLicenses task has been correctly updated to delegate to spotlessApply, maintaining the same task name for backward compatibility while using the new Spotless-based license management.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java:
- Around line 47-51: The deserializer currently only checks for Java null but
Jackson 3 returns a NullNode for explicit JSON nulls; update the null-check in
AnnotationsDeserializer (the local variable annotations returned by
context.readTree(p)) to also detect JSON nulls (e.g., annotations == null ||
annotations.isNull() or annotations instanceof
com.fasterxml.jackson.databind.node.NullNode) and return DEFAULT_ANNOTATIONS in
that case so downstream iteration won't break.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31ec75e and 26306f0.

📒 Files selected for processing (1)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
🧰 Additional context used
📓 Path-based instructions (2)
src/main/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
🧠 Learnings (2)
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
📚 Learning: 2025-01-19T21:34:39.797Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T21:34:39.797Z
Learning: In BSL Language Server configuration classes, immutable collections (Set.of, List.of) should be used for default values, while mutability is achieved through setters generated by Data annotation.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build
  • GitHub Check: Benchmark
  • GitHub Check: Analyse
🔇 Additional comments (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java (2)

25-39: Migration to Jackson 3.x looks correct.

The import changes to tools.jackson and extending ValueDeserializer instead of JsonDeserializer are the correct patterns for Jackson 3.x.


53-58: Code is correct for Jackson 3.x.

The use of stringValue() is the appropriate Jackson 3.x API for extracting string values from JsonNode. The TreeSet with case-insensitive ordering is suitable for annotation names.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
@src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java:
- Around line 36-37: The production reporter classes are still using Jackson 2.x
annotations, causing Jackson 3.x deserialization to fail; update all Jackson
annotation imports in the reporters package (e.g., CodeQualityReportEntry and
any other classes under reporters referenced by tests) from
com.fasterxml.jackson.annotation.* (and related com.fasterxml.jackson.*
annotation packages) to the Jackson 3.x equivalents under tools.jackson (e.g.,
the appropriate tools.jackson.annotation.* or
tools.jackson.databind.annotation.* types), ensure imported annotation symbols
like JsonProperty/JsonCreator/JsonIgnore/etc. match the tools.jackson package,
and re-run tests to verify deserialization succeeds.
🧹 Nitpick comments (3)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java (1)

31-36: Comment references suppression but no @SuppressWarnings annotation is present.

Line 31 contains a comment about suppressing unchecked warnings for readTree(JsonParser), but there is no corresponding @SuppressWarnings("unchecked") annotation on the class. Either add the annotation or remove the comment if it's no longer needed.

♻️ Suggested fix
-// Подавление предупреждений о несовместимости типов [unchecked] readTree(JsonParser)
+@SuppressWarnings("unchecked")
 public class AnalysisInfoJsonMapper extends JsonMapper {

Or remove the comment if no suppression is needed.

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java (2)

57-57: Consider reusing JsonMapper instance for better performance.

A new JsonMapper instance is created on every deserialization call. Since JsonMapper instances are thread-safe and reusable, consider making it a static final field to avoid repeated instantiation overhead.

♻️ Proposed refactor to reuse JsonMapper
 @Slf4j
 public class ParametersDeserializer extends ValueDeserializer<Map<String, Either<Boolean, Map<String, Object>>>> {
+
+  private static final JsonMapper MAPPER = new JsonMapper();

   @Override
   public Map<String, Either<Boolean, Map<String, Object>>> deserialize(
     JsonParser p,
     DeserializationContext context
   ) {

     JsonNode parameters = p.objectReadContext().readTree(p);

     if (parameters == null) {
       return Collections.emptyMap();
     }

-    var mapper = new JsonMapper();
     Map<String, Either<Boolean, Map<String, Object>>> parametersMap = new HashMap<>();

     for (var entry : parameters.properties()) {
       JsonNode parameterConfig = entry.getValue();
       if (parameterConfig.isBoolean()) {
         parametersMap.put(entry.getKey(), Either.forLeft(parameterConfig.asBoolean()));
       } else {
-        Map<String, Object> parameterConfiguration = getParameterConfiguration(mapper, entry.getValue());
+        Map<String, Object> parameterConfiguration = getParameterConfiguration(MAPPER, entry.getValue());
         parametersMap.put(entry.getKey(), Either.forRight(parameterConfiguration));
       }
     }

     return parametersMap;
   }

   private static Map<String, Object> getParameterConfiguration(
-    JsonMapper mapper,
     JsonNode parameterConfig
   ) {
     Map<String, Object> parameterConfiguration;
     try {
-      JavaType type = mapper.getTypeFactory().constructType(new TypeReference<Map<String, Object>>() {
+      JavaType type = MAPPER.getTypeFactory().constructType(new TypeReference<Map<String, Object>>() {
       });
-      parameterConfiguration = mapper.readValue(mapper.treeAsTokens(parameterConfig), type);
+      parameterConfiguration = MAPPER.readValue(MAPPER.treeAsTokens(parameterConfig), type);
     } catch (JacksonException e) {
       LOGGER.error("Can't deserialize parameter configuration", e);
       return Collections.emptyMap();
     }
     return parameterConfiguration;
   }

45-49: Add JavaDoc for public deserialize method.

The coding guidelines require JavaDoc for public APIs. Please add documentation describing the deserialization behavior, parameters, and return value.

As per coding guidelines, "Write JavaDoc for public APIs."

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 26306f0 and 6ad63db.

📒 Files selected for processing (18)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CommandProvider.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericIssueReporter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CommandProvider.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericReporterTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericIssueReporter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporter.java
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
src/test/java/**/*Test.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
🧠 Learnings (5)
📚 Learning: 2025-01-20T19:30:29.060Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/AbstractRunTestsCodeLensSupplierTest.java:98-102
Timestamp: 2025-01-20T19:30:29.060Z
Learning: In BSL Language Server, CodeLensProvider handles the isApplicable check before calling getCodeLenses on CodeLensSupplier implementations, so there's no need to add isApplicable check inside getCodeLenses method.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.java
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/test/java/**/*Test.java : Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/main/java/**/diagnostics/**/*.java : Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/test/java/**/diagnostics/**/*Test.java : Write comprehensive unit tests for each diagnostic including edge cases, following existing test patterns

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.java
🧬 Code graph analysis (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.java (6)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java (1)
  • AnalysisInfoJsonMapper (32-37)
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java (1)
  • Slf4j (42-89)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericIssueReporter.java (1)
  • Slf4j (37-63)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporter.java (1)
  • Slf4j (38-66)
src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.java (1)
  • Component (57-160)
src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CommandProvider.java (1)
  • Component (42-118)
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java (1)
  • AnalysisInfoJsonMapper (32-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Analyse
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: Benchmark
  • GitHub Check: build
🔇 Additional comments (26)
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java (1)

35-36: LGTM! Import statements correctly migrated to Jackson 3.x.

The imports have been properly updated from com.fasterxml.jackson to tools.jackson, consistent with the Jackson 3.x API.

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.java (2)

31-38: LGTM!

The Javadoc correctly references JsonMapper and JsonMapper.Builder#addMixIn, aligning with the Jackson 3 API migration. The mix-in field and method annotations are properly configured.


24-27: The mixed import pattern is correct for Jackson 3.x. Core annotations (@JsonIgnore, @JsonProperty) remain in com.fasterxml.jackson.annotation for backward compatibility, while databind annotations (@JsonSerialize, @JsonDeserialize) moved to tools.jackson.databind.annotation. No changes needed.

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.java (1)

43-54: LGTM!

The migration from ObjectMapper to AnalysisInfoJsonMapper (which extends JsonMapper) and from IOException to JacksonException is correct for Jackson 3.x. The pattern aligns with other reporters in the codebase that use JsonMapper.

src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java (2)

86-86: LGTM!

The accessor change from getFileinfos() to fileinfos() is consistent with AnalysisInfo being converted to a Java record, which uses the field name directly as the accessor method.


59-60: No changes needed. In Jackson 3 (tools.jackson), JacksonException is an unchecked exception that extends RuntimeException. The method signature correctly omits the throws IOException clause, and exception handling is not required at lines 82-84 since mapper.readValue() does not throw checked exceptions.

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java (1)

33-35: LGTM!

The constructor correctly passes the JsonMapper.Builder to super() without calling .build(), which is the proper pattern for Jackson 3.x subclassing. The mix-in configuration for Diagnostic.class is correctly applied.

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java (1)

51-51: API migration appears logically consistent.

The changes to use p.objectReadContext().readTree(p) (line 51) and catch JacksonException instead of IOException (line 82) are consistent with the tools.jackson migration pattern. The error handling behavior is preserved correctly.

However, correctness depends on verifying that tools.jackson is the intended library for this project.

Also applies to: 82-82

src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java (4)

63-63: Removal of throws IOException is correct for Jackson 3.x.

In Jackson 3.x, JacksonException is an unchecked RuntimeException, so readValue() (line 106) no longer requires a checked exception declaration. The test will still fail properly if deserialization errors occur.


91-94: Good modernization using Path.of() instead of Paths.get().

Path.of() is the preferred factory method since Java 11, delegating directly to the same implementation as Paths.get() but with a cleaner API.


105-106: LGTM!

The XmlMapper instantiation and usage is consistent with the new tools.jackson import and correctly parses the generated JUnit XML report.


35-35: Jackson 3.x XmlMapper import is correct.

The import from tools.jackson.dataformat.xml.XmlMapper aligns with the Jackson 3.x package migration from the previous com.fasterxml.jackson.dataformat.xml namespace. The import is properly used at line 105 and resolves the previously flagged unused import issue.

src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java (1)

89-89: Correct use of JsonMapper for Jackson 3.x.

The replacement of ObjectMapper with JsonMapper() is appropriate for Jackson 3.x when working with JSON data. JsonMapper is the JSON-specific implementation and provides the same API for basic operations like readValue.

src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.java (3)

42-42: LGTM: Clean migration to Jackson 3.x JsonMapper.

The migration from ObjectMapper to JsonMapper aligns with Jackson 3.x (tools.jackson package) used in Spring Boot 4. The field rename maintains consistency.

Also applies to: 64-64


137-141: LGTM: Excellent use of pattern matching.

The pattern matching instanceof (line 137) is a clean Java 16+ feature that eliminates the explicit cast. The jsonMapper.readValue call is consistent with the Jackson 3.x API migration.


42-42: The migration to Jackson 3.x (using tools.jackson.databind.json.JsonMapper) is correctly implemented. Spring Boot 4.0.1 is stable and fully supports Jackson 3; no breaking changes affecting this code are evident from static analysis. The import, injection, and usage patterns are all valid.

src/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.java (4)

28-28: LGTM: Imports and documentation updated for Jackson 3.x.

The imports correctly reference Spring Boot's JsonMapperBuilderCustomizer and tools.jackson's NamedType. JavaDoc appropriately updated to reflect JsonMapper terminology.

Also applies to: 31-31, 38-41


44-44: LGTM: Configuration pattern updated for Spring Boot 4.

The rename from ObjectMapperConfiguration to JsonMapperConfiguration and the method signature change to return JsonMapperBuilderCustomizer align with Spring Boot 4's customizer-based configuration approach. The method references are correctly updated.

Also applies to: 47-47, 54-54, 57-57


60-60: LGTM: Customizer lambda correctly registers subtypes.

The lambda builder -> namedTypes.forEach(builder::registerSubtypes) correctly implements the JsonMapperBuilderCustomizer contract. The captured namedTypes collection is local and fully populated before the customizer is returned, ensuring correct registration of all CodeLens and Command subtypes.


47-60: No issues identified. The JsonMapperBuilderCustomizer approach correctly follows Spring Boot 4's recommended pattern for Jackson customization, and Spring Boot 4.0.1 is stable and production-ready.

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (4)

48-48: LGTM - API migration to ValueDeserializer.

The change from JsonDeserializer to ValueDeserializer is consistent with the tools.jackson API migration.


33-37: The imports correctly reflect the Jackson 3.x migration with Spring Boot 4.0.1, which uses the tools.jackson package namespace as expected. No action required.


56-56: No changes required. The objectReadContext() API usage is correct and follows the intended tools.jackson API pattern. This is the proper replacement for the older getCodec() method and is used consistently throughout the codebase for deserializers.


51-54: No action required.

The deserialize method signature correctly omits throws IOException to align with the tools.jackson ValueDeserializer contract and the established pattern used throughout this codebase. All custom deserializers in the same package (AnnotationsDeserializer, ParametersDeserializer) follow this same design: they catch exceptions internally and return safe defaults rather than propagating checked exceptions. Exception handling is properly implemented via try-catch blocks with appropriate logging.

Likely an incorrect or invalid review comment.

src/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.java (2)

32-33: LGTM - Imports aligned with tools.jackson migration.

The import changes are consistent with the API migration in the main deserializer class.


248-248: No action required.

This is a newly created test file, not a modification of existing code. The git commit shows this file was added in its entirety with JsonMapper from the start. There was no previous ObjectMapper with ParameterNamesModule to remove. Additionally, ParameterNamesModule is not used anywhere in the codebase, and the deserialization here uses field-based binding (the public metadata field), which does not require constructor parameter name resolution.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java:
- Around line 51-56: The deserialize method in DiagnosticMetadataMapDeserializer
currently calls context.readTree(p) without handling its checked IOException;
update the method to either declare "throws IOException" on the deserialize
signature or wrap the context.readTree(p) call in a try-catch that catches
IOException (or JsonProcessingException) and handles or rethrows it as a
suitable JsonMappingException/IOException so callers are properly informed;
adjust error handling/logging within the catch to preserve the original
exception and include context about the failure to parse the JsonNode.
🧹 Nitpick comments (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (1)

100-126: Consider handling null values and improving type safety.

The convertNodeToMap method correctly handles basic types and arrays of primitives, which appears sufficient for the current DiagnosticMetadata structure. However, consider the following improvements:

  1. Null values: The method silently ignores null JSON values. If null is a valid value in the metadata, it should be explicitly handled:

    } else if (value.isNull()) {
      result.put(key, null);
  2. Type safety: Line 112 uses a raw ArrayList. Consider using ArrayList<Object> for clarity:

    var list = new ArrayList<Object>();
  3. Documentation: Consider adding a JavaDoc comment documenting that this method only handles flat structures with primitive types and primitive arrays, as nested objects are not supported.

♻️ Suggested improvements
+  /**
+   * Converts a JsonNode to a Map supporting primitive types and arrays of primitives.
+   * Nested objects and null values are not supported and will be silently ignored.
+   */
   private static Map<String, Object> convertNodeToMap(JsonNode node) {
     Map<String, Object> result = new HashMap<>();
     for (var entry : node.properties()) {
       String key = entry.getKey();
       JsonNode value = entry.getValue();
-      if (value.isString()) {
+      if (value.isNull()) {
+        result.put(key, null);
+      } else if (value.isString()) {
         result.put(key, value.stringValue());
       } else if (value.isNumber()) {
         result.put(key, value.numberValue());
       } else if (value.isBoolean()) {
         result.put(key, value.booleanValue());
       } else if (value.isArray()) {
-        var list = new ArrayList<>();
+        var list = new ArrayList<Object>();
         for (JsonNode item : value) {
           if (item.isString()) {
             list.add(item.stringValue());
           } else if (item.isNumber()) {
             list.add(item.numberValue());
           } else if (item.isBoolean()) {
             list.add(item.booleanValue());
           }
         }
         result.put(key, list);
       }
     }
     return result;
   }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ad63db and 0ff64b6.

📒 Files selected for processing (2)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitTestSuites.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitTestSuites.java
🧰 Additional context used
📓 Path-based instructions (2)
src/main/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
🧠 Learnings (1)
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: Analyse
  • GitHub Check: build
🔇 Additional comments (3)
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (3)

33-38: LGTM: Imports migrated correctly to Tools Jackson.

The imports have been properly updated from com.fasterxml.jackson to tools.jackson, and the ArrayList import added for the new helper method is appropriate.


48-48: LGTM: Base class correctly updated to ValueDeserializer.

The migration from JsonDeserializer to ValueDeserializer is consistent with the Tools Jackson API changes across the codebase.


70-70: LGTM: Migration to new conversion helper.

The replacement of mapper.convertValue() with convertNodeToMap() is appropriate for the Tools Jackson migration, assuming the helper method correctly implements the required conversion logic.

@nixel2007
Copy link
Member Author

/buildJar

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

✅ Собраны JAR-файлы для этого PR по команде /buildJar.

Артефакт: 5048931943

Файлы внутри:

  • bsl-language-server-feature-upgrade-spring-boot-4-0ff64b6-exec.jar

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java:
- Around line 42-45: The AnnotationsDeserializer.deserialize method lacks a
throws declaration while DiagnosticMetadataMapDeserializer.deserialize declares
throws JacksonException; make them consistent by updating
AnnotationsDeserializer.deserialize in class AnnotationsDeserializer to declare
"throws JacksonException" on its method signature so both deserializers follow
the same exception contract (alternatively remove the throws from
DiagnosticMetadataMapDeserializer if you prefer the no-throws style, but prefer
adding the throws to AnnotationsDeserializer for minimal changes).

In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java:
- Around line 57-60: The null check in DiagnosticMetadataMapDeserializer uses
only a Java null check for the JsonNode returned by context.readTree(p); update
the guard in the deserializer to also check for JSON null by including
node.isNull() (i.e., change the condition around the JsonNode named "node"
produced by context.readTree(p) to node == null || node.isNull() ||
!node.isObject()) so explicit JSON null values are handled consistently with
AnnotationsDeserializer.

In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java:
- Around line 31-32: The class-level @SuppressWarnings("unchecked") on
AnalysisInfoJsonMapper is too broad—either remove it entirely or move it to the
constructor where the unchecked operation actually occurs; inspect the
AnalysisInfoJsonMapper constructor (the method that calls JsonMapper.builder()
and configures the mapper) and if any unchecked generics warnings arise from the
builder calls, annotate only that constructor with
@SuppressWarnings("unchecked") and delete the misleading comment about
readTree(JsonParser).
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ff64b6 and 1e4b8dd.

📒 Files selected for processing (10)
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/SymbolTree.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IsInRoleMethodDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsageWriteLogEventDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/ParentProcessWatcherTest.java
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IsInRoleMethodDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/SymbolTree.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/ParentProcessWatcherTest.java
  • build.gradle.kts
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsageWriteLogEventDiagnostic.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsageWriteLogEventDiagnostic.java
src/main/java/**/diagnostics/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsageWriteLogEventDiagnostic.java
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/main/java/**/*.java : Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/**/*.java : Use Java 17 for language and follow Java naming conventions
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
📚 Learning: 2025-01-19T21:34:39.797Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T21:34:39.797Z
Learning: In BSL Language Server configuration classes, immutable collections (Set.of, List.of) should be used for default values, while mutability is achieved through setters generated by Data annotation.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
📚 Learning: 2025-04-18T22:46:43.245Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3449
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/expressiontree/ExpressionTreeBuildingVisitor.java:192-203
Timestamp: 2025-04-18T22:46:43.245Z
Learning: В проекте bsl-language-server класс BSLParser.ExpressionContext наследуется от BSLParserRuleContext, а не напрямую от ParserRuleContext. При работе с ним нужно учитывать специфичные методы BSLParserRuleContext.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build
  • GitHub Check: Analyse
  • GitHub Check: Sentry
🔇 Additional comments (7)
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.java (1)

157-159: LGTM! Clean modernization to Java 17 pattern matching.

The refactor correctly uses pattern matching for instanceof, eliminating the explicit cast while preserving the exact same logic. The pattern variable terminalNode is descriptive and properly scoped.

src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.java (1)

42-50: LGTM! Clean modernization with pattern matching.

The refactor to pattern matching for instanceof is idiomatic Java 17 and improves readability by eliminating explicit casts. The logic remains correct—both branches return the appropriate expression, and the fallback IllegalStateException is preserved for invalid states.

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsageWriteLogEventDiagnostic.java (2)

222-228: LGTM! Clean refactoring with pattern-matching instanceof.

The pattern-matching instanceof eliminates the explicit cast while preserving the exact logic. This is idiomatic modern Java 17.


264-269: LGTM! Consistent pattern-matching refactoring.

This change mirrors the refactoring at line 226, maintaining consistency across similar methods. The pattern-matching instanceof is clean and correct.

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java (1)

54-56: No issue found — stringValue() is the correct method in tools.jackson JsonNode API.

The code correctly uses stringValue() to extract string values from JsonNode in the tools.jackson library (Jackson 3.x). This is the proper API for the migration from com.fasterxml.jackson (which used asText() and textValue()).

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (1)

101-127: The convertNodeToMap implementation correctly handles the expected JSON structure for DiagnosticMetadata annotations. The method processes strings, numbers, booleans, and arrays of these types as required by the annotation fields. Array elements in actual configurations only contain enum values (as strings), which are subsequently converted via convertStringArrayToEnumArray (lines 80-81). Exception handling at the deserializer level (lines 86-88) ensures failures are logged appropriately. No changes needed.

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java (1)

33-37: Migration to JsonMapper and builder pattern looks good.

The class correctly extends JsonMapper (Jackson 3.x JSON-specific mapper) instead of the generic ObjectMapper, and the constructor properly configures the mixin using the builder pattern. The pattern of passing the builder directly to super() is correct for Jackson 3.x, as confirmed in the previous review.

@nixel2007
Copy link
Member Author

/buildJar

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

✅ Собраны JAR-файлы для этого PR по команде /buildJar.

Артефакт: 5053384840

Файлы внутри:

  • bsl-language-server-feature-upgrade-spring-boot-4-d233ff8-exec.jar

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java (1)

33-43: Migration to JsonMapper looks correct, with a minor clarification needed.

The migration from ObjectMapper to JsonMapper with the builder pattern is correct for Jackson 3.x. The @Serial annotation and serialVersionUID are appropriate for serializable classes.

However, the @SuppressWarnings("unchecked") comment mentions readTree(JsonParser), but this class doesn't directly call readTree. If the suppression is for inherited method behavior in downstream usage, consider updating the comment to clarify this (e.g., "for inherited unchecked calls in parent class").

📝 Optional: Clarify the suppression annotation comment
-// Подавление предупреждений о несовместимости типов [unchecked] readTree(JsonParser)
+// Подавление предупреждений о несовместимости типов [unchecked] в унаследованных методах JsonMapper
 @SuppressWarnings("unchecked")
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (1)

107-108: Consider checking for Collection directly instead of Iterable.

Line 107 checks for instanceof Iterable<?> but line 108 immediately casts to Collection<?> to call .size(). This creates a potential ClassCastException if an Iterable that's not a Collection is provided.

Since you need Collection methods, consider checking for Collection directly:

♻️ Proposed refactor for type safety
-    if (params.containsKey(key) && params.get(key) instanceof Iterable<?> list) {
-      var array = Array.newInstance(enumClass, ((Collection<?>) list).size());
+    if (params.containsKey(key) && params.get(key) instanceof Collection<?> list) {
+      var array = Array.newInstance(enumClass, list.size());
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1e9447 and 14f8809.

📒 Files selected for processing (10)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/codeactions/GenerateStandardRegionsSupplier.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeSerializer.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericReporterTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/codeactions/GenerateStandardRegionsSupplier.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeSerializer.java
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
src/test/java/**/*Test.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.java
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/main/java/**/*.java : Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/main/java/**/diagnostics/**/*.java : Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: Analyse
  • GitHub Check: Benchmark
  • GitHub Check: build
🔇 Additional comments (13)
src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java (4)

151-154: LGTM! Modern Java idiom applied correctly.

The migration from String.format(...) to .formatted(...) in all getLocation() methods is correct and improves readability with the fluent API style. All format placeholders match their arguments.

Also applies to: 162-166, 179-183


201-207: LGTM! Signature formatting modernized consistently.

The refactoring to .formatted(...) across all getSignature() overloads is correct. The argument counts match the format placeholders in each template.

Also applies to: 218-222, 232-236


305-310: LGTM! Parameter formatting refactored correctly.

The parameterToString() methods correctly apply .formatted() to PARAMETER_TEMPLATE. The lambda expression at lines 320-323 maintains proper formatting with the method reference style.

Also applies to: 320-323


335-335: LGTM! Type mapping refactored with elegant method reference.

The modernization is correctly applied throughout typesToMap() and typesMapToString(). Notably, line 340 uses the method reference "%s | %s"::formatted as a BiFunction for Map.merge(), which is both correct and idiomatic Java.

Also applies to: 337-337, 340-340, 352-352

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.java (1)

24-42: Migration to Jackson 3.x (tools.jackson) is complete and correct.

The class extends ValueDeserializer<Either<String, Number>> with only the required deserialize() method implemented. Per Jackson 3.x API, deserialize() is the sole mandatory abstract method; other methods like deserializeWithType(), createContextual(), and getEmptyValue() are optional extension hooks with default implementations, so no additional overrides are needed. The removal of IOException from the throws clause aligns with the Jackson 3.x contract.

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (4)

33-39: LGTM! Migration to tools.jackson is correct.

The import changes properly migrate from com.fasterxml.jackson to tools.jackson, consistent with the Spring Boot 4 upgrade objectives. The addition of java.lang.reflect.Array supports the refactored array handling logic below.


49-49: LGTM! Class signature properly migrated to tools.jackson.

The class now extends ValueDeserializer and throws JacksonException, which are the correct tools.jackson equivalents of the previous Jackson API types.

Also applies to: 52-55


108-118: LGTM! Appropriate use of reflection for generic enum array handling.

The use of Array.newInstance and Array.set is the correct approach for creating and populating generic enum arrays at runtime when the enum type is only known through the Class<E> parameter. This handles the type-safe conversion of JSON arrays to strongly-typed enum arrays.


57-58: No action needed — tools.jackson API usage is correct.

The API migration properly uses the available DeserializationContext methods:

  • context.readTree(p) correctly reads the JSON tree from the parser
  • context.constructType(Map.class) properly constructs the JavaType
  • context.readTreeAsValue(valueNode, mapType) correctly deserializes using the JavaType overload

All method signatures match the Jackson Databind API.

src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java (3)

64-64: Removal of throws IOException is valid for Jackson 3.x.

In Jackson 3.x, JacksonException was refactored to extend RuntimeException instead of IOException, making it an unchecked exception. The test will still fail appropriately if deserialization fails.


86-91: JsonMapper usage is correct for Jackson 3.x.

JsonMapper is the appropriate replacement for ObjectMapper in Jackson 3.x. The readValue call with TypeReference follows the same pattern as before, maintaining test functionality.


35-36: Jackson 3.x import migration is correct.

The imports are properly updated to the tools.jackson package namespace for Jackson 3.x: tools.jackson.core.type.TypeReference and tools.jackson.databind.json.JsonMapper are both valid imports for the current Jackson 3.x artifact structure. This aligns with the Jackson 3.x migration where the package namespace was renamed from com.fasterxml.jackson to tools.jackson to allow coexistence with Jackson 2.x.

src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.java (1)

44-44: No action required—the code is correct for Jackson 3.

The migration to tools.jackson.databind.json.JsonMapper is part of the Spring Boot 4 upgrade, which uses Jackson 3. Unlike the previous Jackson versions that threw checked IOException, Jackson 3 uses unchecked exceptions (JacksonException). Therefore, removing the throws IOException declaration from the test method (line 80) is correct and necessary. The call to mapper.readValue(file, SarifSchema210.class) (line 105) does not require exception handling or a throws clause because it now throws an unchecked exception. This pattern is consistently applied across all test files in the reporters module.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2026

@nixel2007 nixel2007 merged commit 4bb6681 into develop Jan 8, 2026
42 checks passed
@nixel2007 nixel2007 deleted the feature/upgrade-spring-boot-4 branch January 8, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants