-
Notifications
You must be signed in to change notification settings - Fork 121
Upgrade to Spring Boot 4 + automatic refactoring #3735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughReplaces 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
Sequence Diagram(s)(omitted) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
Test Results 2 817 files ±0 2 817 suites ±0 57m 25s ⏱️ +48s 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.♻️ This comment has been updated with latest results. |
There was a problem hiding this 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..jacksontotools.jacksonnamespace - Replace
Paths.get()calls withPath.of()and remove unusedjava.nio.file.Pathsimports - Refactor code to use pattern matching for instanceof checks and other Java language improvements
- Convert
AnalysisInfoclass 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
@JacksonXmlRootElementwith@JsonRootNameprovides the same XML serialization behavior.@JsonRootNameis 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
IOExceptionto 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
IOExceptionto 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
@Dataclass to a record changes the getter method names fromgetFileinfos()tofileinfos(). 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}.
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/DocumentContext.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/DocumentContext.java
Outdated
Show resolved
Hide resolved
...github/_1c_syntax/bsl/languageserver/configuration/semantictokens/SemanticTokensOptions.java
Outdated
Show resolved
Hide resolved
...ava/com/github/_1c_syntax/bsl/languageserver/configuration/references/ReferencesOptions.java
Outdated
Show resolved
Hide resolved
...java/com/github/_1c_syntax/bsl/languageserver/configuration/inlayhints/InlayHintOptions.java
Outdated
Show resolved
Hide resolved
...in/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/CodeLensOptions.java
Outdated
Show resolved
Hide resolved
...java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/aop/SentryAspect.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/aop/SentryAspect.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/aop/MeasuresAspect.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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@SpringBootTestand simplify to unit testing approach.
ParentProcessWatcheris a Spring component, but this test doesn't require the Spring application context. The combination of@ExtendWith(MockitoExtension.class)with@SpringBootTestis inappropriate here:@SpringBootTestadds unnecessary overhead while@InjectMocksand@Mockcreate 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
@SpringBootTestto 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: CatchIOExceptioninstead ofJacksonExceptionfor 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, whereJacksonExceptionextendsIOException. However, narrowing the catch fromIOExceptiontoJacksonExceptiononly catches the child class, not the parent. Ifmapper.writeValue()throwsIOExceptiondirectly (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 toCollection<?>to callsize(). If the input is anIterablethat isn't aCollection, this will throw aClassCastException.🔎 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 usingPath.resolve()for joining path segments.Since
CONFIGURATION_PATHis already aPathobject, using.toString()and then constructing a new path is redundant. The idiomatic approach is to usePath.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 usingresolve().Converting
tempDirto string and back toPathis unnecessary. UsePath.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 usingresolve().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})toonMethod_ = {@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:
context1forModuleVarDeclarationContextandcontextforSubVarDeclarationContext. Consider using consistent naming likemoduleVarCtxandsubVarCtxfor 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 thefileinfoslist.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 usingList.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()whileGenericIssueReporterusesmapper.writeValue()directly. Both work, but the extrawriter()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
IOExceptionimport is no longer needed sinceValueDeserializer.deserialize()throws uncheckedJacksonExceptioninstead.🔎 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
IOExceptionimport is no longer needed after switching toJacksonExceptionfor 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.IOExceptionThe
IOExceptionimport is no longer needed since thedeserializemethod no longer declaresthrows 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.IOExceptionThe
IOExceptionimport is no longer needed since thedeserializemethod no longer declaresthrows IOException.🔎 Proposed fix
-import java.io.IOException;
src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CommandProvider.java
Outdated
Show resolved
Hide resolved
...java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericIssueReporter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporter.java
Outdated
Show resolved
Hide resolved
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java
Outdated
Show resolved
Hide resolved
|
@copilot отработай замечания по ревью от copilot и coderabbitai. Плюс поправь сборку проекта |
|
@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. |
There was a problem hiding this 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
📒 Files selected for processing (3)
src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.javasrc/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()toreport.fileinfos()correctly reflects the migration ofAnalysisInfoto a Java record, which uses field-name accessors without the "get" prefix.
24-24: No action required. The importtools.jackson.databind.ObjectMapperis the correct package namespace for Jackson 3 in Spring Boot 4. This is the standard migration path from Jackson 2'scom.fasterxml.jacksonpackage.
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java
Show resolved
Hide resolved
- 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]>
There was a problem hiding this 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 inheritedreadTreemethods or other specific operations, consider:
- Whether the suppression is still necessary after the Jackson 3.x migration
- If the warnings can be addressed through proper type parameterization instead of suppression
- 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
📒 Files selected for processing (4)
build.gradle.ktslicense/HEADER.txtsrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoObjectMapper.javasrc/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
$YEARplaceholder 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.Buildertosuper()without calling.build(), using the protectedObjectMapper(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 fromcom.fasterxml.jacksontotools.jacksonfor databind and core modules. The package nametools.jacksonon lines 24 and 27 follows the proper Jackson 3.x naming convention and is consistent with the rest of the codebase. The constructor pattern usingJsonMapper.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.jacksonnamespace, 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
afterEvaluateblock 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 oftasks.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.
There was a problem hiding this 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
📒 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.jacksonand extendingValueDeserializerinstead ofJsonDeserializerare 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.
...com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
Show resolved
Hide resolved
There was a problem hiding this 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@SuppressWarningsannotation is present.Line 31 contains a comment about suppressing
uncheckedwarnings forreadTree(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
JsonMapperinstance is created on every deserialization call. SinceJsonMapperinstances 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
📒 Files selected for processing (18)
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CodeLensProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CommandProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericIssueReporter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporter.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JUnitReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.javasrc/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.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.javasrc/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.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializerTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/databind/JsonMapperConfiguration.javasrc/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.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticMixIn.javasrc/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.javasrc/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.jacksontotools.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
JsonMapperandJsonMapper.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 incom.fasterxml.jackson.annotationfor backward compatibility, while databind annotations (@JsonSerialize,@JsonDeserialize) moved totools.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
ObjectMappertoAnalysisInfoJsonMapper(which extendsJsonMapper) and fromIOExceptiontoJacksonExceptionis correct for Jackson 3.x. The pattern aligns with other reporters in the codebase that useJsonMapper.src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/JsonReporterTest.java (2)
86-86: LGTM!The accessor change from
getFileinfos()tofileinfos()is consistent withAnalysisInfobeing 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),JacksonExceptionis an unchecked exception that extendsRuntimeException. The method signature correctly omits thethrows IOExceptionclause, and exception handling is not required at lines 82-84 sincemapper.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.Buildertosuper()without calling.build(), which is the proper pattern for Jackson 3.x subclassing. The mix-in configuration forDiagnostic.classis 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 catchJacksonExceptioninstead ofIOException(line 82) are consistent with the tools.jackson migration pattern. The error handling behavior is preserved correctly.However, correctness depends on verifying that
tools.jacksonis 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 ofthrows IOExceptionis correct for Jackson 3.x.In Jackson 3.x,
JacksonExceptionis an uncheckedRuntimeException, soreadValue()(line 106) no longer requires a checked exception declaration. The test will still fail properly if deserialization errors occur.
91-94: Good modernization usingPath.of()instead ofPaths.get().
Path.of()is the preferred factory method since Java 11, delegating directly to the same implementation asPaths.get()but with a cleaner API.
105-106: LGTM!The
XmlMapperinstantiation and usage is consistent with the newtools.jacksonimport and correctly parses the generated JUnit XML report.
35-35: Jackson 3.x XmlMapper import is correct.The import from
tools.jackson.dataformat.xml.XmlMapperaligns with the Jackson 3.x package migration from the previouscom.fasterxml.jackson.dataformat.xmlnamespace. 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
ObjectMapperwithJsonMapper()is appropriate for Jackson 3.x when working with JSON data.JsonMapperis the JSON-specific implementation and provides the same API for basic operations likereadValue.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
ObjectMappertoJsonMapperaligns 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. ThejsonMapper.readValuecall is consistent with the Jackson 3.x API migration.
42-42: The migration to Jackson 3.x (usingtools.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
JsonMapperBuilderCustomizerand tools.jackson'sNamedType. 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
ObjectMapperConfigurationtoJsonMapperConfigurationand the method signature change to returnJsonMapperBuilderCustomizeralign 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 theJsonMapperBuilderCustomizercontract. The capturednamedTypescollection is local and fully populated before the customizer is returned, ensuring correct registration of all CodeLens and Command subtypes.
47-60: No issues identified. TheJsonMapperBuilderCustomizerapproach 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
JsonDeserializertoValueDeserializeris 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. TheobjectReadContext()API usage is correct and follows the intended tools.jackson API pattern. This is the proper replacement for the oldergetCodec()method and is used consistently throughout the codebase for deserializers.
51-54: No action required.The deserialize method signature correctly omits
throws IOExceptionto 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
JsonMapperfrom the start. There was no previousObjectMapperwithParameterNamesModuleto remove. Additionally,ParameterNamesModuleis not used anywhere in the codebase, and the deserialization here uses field-based binding (the publicmetadatafield), which does not require constructor parameter name resolution.Likely an incorrect or invalid review comment.
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.java
Show resolved
Hide resolved
…ext and add utility method for converting JsonNode to Map
There was a problem hiding this 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
convertNodeToMapmethod correctly handles basic types and arrays of primitives, which appears sufficient for the currentDiagnosticMetadatastructure. However, consider the following improvements:
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);Type safety: Line 112 uses a raw
ArrayList. Consider usingArrayList<Object>for clarity:var list = new ArrayList<Object>();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
📒 Files selected for processing (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/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.jacksontotools.jackson, and theArrayListimport added for the new helper method is appropriate.
48-48: LGTM: Base class correctly updated to ValueDeserializer.The migration from
JsonDeserializertoValueDeserializeris consistent with the Tools Jackson API changes across the codebase.
70-70: LGTM: Migration to new conversion helper.The replacement of
mapper.convertValue()withconvertNodeToMap()is appropriate for the Tools Jackson migration, assuming the helper method correctly implements the required conversion logic.
.../_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
Show resolved
Hide resolved
|
/buildJar |
|
✅ Собраны JAR-файлы для этого PR по команде Артефакт: 5048931943 Файлы внутри:
|
…ring-boot-4 # Conflicts: # build.gradle.kts
There was a problem hiding this 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
📒 Files selected for processing (10)
build.gradle.ktssrc/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/SymbolTree.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IsInRoleMethodDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsageWriteLogEventDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ConditionalVertex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.javasrc/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.javasrc/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.javasrc/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 variableterminalNodeis 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
instanceofis idiomatic Java 17 and improves readability by eliminating explicit casts. The logic remains correct—both branches return the appropriate expression, and the fallbackIllegalStateExceptionis 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 usedasText()andtextValue()).src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java (1)
101-127: TheconvertNodeToMapimplementation correctly handles the expected JSON structure forDiagnosticMetadataannotations. 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 viaconvertStringArrayToEnumArray(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 genericObjectMapper, and the constructor properly configures the mixin using the builder pattern. The pattern of passing the builder directly tosuper()is correct for Jackson 3.x, as confirmed in the previous review.
...com/github/_1c_syntax/bsl/languageserver/configuration/databind/AnnotationsDeserializer.java
Show resolved
Hide resolved
.../_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.java
Show resolved
Hide resolved
...java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.java
Show resolved
Hide resolved
|
/buildJar |
|
✅ Собраны JAR-файлы для этого PR по команде Артефакт: 5053384840 Файлы внутри:
|
There was a problem hiding this 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
ObjectMappertoJsonMapperwith the builder pattern is correct for Jackson 3.x. The@Serialannotation andserialVersionUIDare appropriate for serializable classes.However, the
@SuppressWarnings("unchecked")comment mentionsreadTree(JsonParser), but this class doesn't directly callreadTree. 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 toCollection<?>to call.size(). This creates a potentialClassCastExceptionif anIterablethat's not aCollectionis provided.Since you need
Collectionmethods, consider checking forCollectiondirectly:♻️ 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
📒 Files selected for processing (10)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codeactions/GenerateStandardRegionsSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/AnalysisInfoJsonMapper.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeSerializer.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/GenericReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/databind/DiagnosticCodeDeserializer.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/SarifReporterTest.javasrc/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.javasrc/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.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/DiagnosticMetadataMapDeserializer.javasrc/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 allgetLocation()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 allgetSignature()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()toPARAMETER_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()andtypesMapToString(). Notably, line 340 uses the method reference"%s | %s"::formattedas aBiFunctionforMap.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 requireddeserialize()method implemented. Per Jackson 3.x API,deserialize()is the sole mandatory abstract method; other methods likedeserializeWithType(),createContextual(), andgetEmptyValue()are optional extension hooks with default implementations, so no additional overrides are needed. The removal ofIOExceptionfrom 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.jacksontotools.jackson, consistent with the Spring Boot 4 upgrade objectives. The addition ofjava.lang.reflect.Arraysupports the refactored array handling logic below.
49-49: LGTM! Class signature properly migrated to tools.jackson.The class now extends
ValueDeserializerand throwsJacksonException, 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.newInstanceandArray.setis the correct approach for creating and populating generic enum arrays at runtime when the enum type is only known through theClass<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
DeserializationContextmethods:
context.readTree(p)correctly reads the JSON tree from the parsercontext.constructType(Map.class)properly constructs the JavaTypecontext.readTreeAsValue(valueNode, mapType)correctly deserializes using the JavaType overloadAll method signatures match the Jackson Databind API.
src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/TSLintReporterTest.java (3)
64-64: Removal ofthrows IOExceptionis valid for Jackson 3.x.In Jackson 3.x,
JacksonExceptionwas refactored to extendRuntimeExceptioninstead ofIOException, making it an unchecked exception. The test will still fail appropriately if deserialization fails.
86-91: JsonMapper usage is correct for Jackson 3.x.
JsonMapperis the appropriate replacement forObjectMapperin Jackson 3.x. ThereadValuecall withTypeReferencefollows 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.jacksonpackage namespace for Jackson 3.x:tools.jackson.core.type.TypeReferenceandtools.jackson.databind.json.JsonMapperare 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 fromcom.fasterxml.jacksontotools.jacksonto 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.JsonMapperis part of the Spring Boot 4 upgrade, which uses Jackson 3. Unlike the previous Jackson versions that threw checkedIOException, Jackson 3 uses unchecked exceptions (JacksonException). Therefore, removing thethrows IOExceptiondeclaration from the test method (line 80) is correct and necessary. The call tomapper.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.
|



Описание
Связанные задачи
Closes
Чеклист
Общие
gradlew precommit)Для диагностик
Дополнительно
Summary by CodeRabbit
Dependencies
Code Quality
Chores
Tests
✏️ Tip: You can customize this high-level summary in your review settings.