Skip to content

Conversation

@nixel2007
Copy link
Member

@nixel2007 nixel2007 commented Jan 6, 2026

Описание

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

Closes

Чеклист

Общие

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

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

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

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

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error logging to include exception details, providing more informative error messages for improved troubleshooting and debugging.

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

Copilot AI review requested due to automatic review settings January 6, 2026 12:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

The DocumentChangeExecutor Java class was modified to enhance error logging. Three error log statements were updated to include exception messages alongside stack traces when errors occur in worker operations, task accumulation, and change application processes.

Changes

Cohort / File(s) Summary
Logging Enhancement
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/DocumentChangeExecutor.java
Updated three error logging statements in runWorker(), accumulate(), and flushPendingChanges() methods to include exception messages via e.getMessage() in the log output. No control-flow or API changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Our logs now speak with crystal clarity,
Three warnings dressed in proper care,
Each exception message bright and fair,
Debugging becomes less scary,
When error tales are told with flair! 📝✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: improving error logging by including exception messages in three error log statements across the DocumentChangeExecutor class.
✨ Finishing touches
  • 📝 Generate docstrings

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

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/DocumentChangeExecutor.java (1)

185-185: Redundant exception message concatenation in error logs.

SLF4J's error(String, Throwable) method automatically includes the exception message and stack trace in the log output. Concatenating e.getMessage() to the log message results in:

  • Duplicate exception messages in logs
  • Unnecessary string concatenation overhead
  • Potential "null" text if getMessage() returns null

The standard SLF4J pattern is sufficient:

LOGGER.error("Context message", e);
🔎 Proposed fix to follow SLF4J best practices
-      LOGGER.error("Unexpected error in document executor worker: " + e.getMessage(), e);
+      LOGGER.error("Unexpected error in document executor worker", e);
-      LOGGER.error("Error while accumulating document change task: " + e.getMessage(), e);
+      LOGGER.error("Error while accumulating document change task", e);
-      LOGGER.error("Error while applying accumulated document changes: " + e.getMessage(), e);
+      LOGGER.error("Error while applying accumulated document changes", e);

Also applies to: 228-228, 252-252

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fdc747 and 755d8f0.

📒 Files selected for processing (1)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/DocumentChangeExecutor.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/context/DocumentChangeExecutor.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/context/DocumentChangeExecutor.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: CodeQL analysis (java)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: Analyse
  • GitHub Check: build

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request modifies error logging statements in the DocumentChangeExecutor class to append exception messages directly to the log text. However, this approach deviates from logging best practices and introduces unnecessary string concatenation overhead.

Key Changes

  • Modified three LOGGER.error() calls to concatenate exception messages using the '+' operator
  • Changes affect error handling in the document change executor's worker thread, accumulation phase, and flush phase

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Test Results

1 872 files  +  936  1 872 suites  +936   27m 20s ⏱️ + 10m 15s
1 158 tests ±    0  1 158 ✅ ±    0  0 💤 ±0  0 ❌ ±0 
6 948 runs  +3 474  6 948 ✅ +3 474  0 💤 ±0  0 ❌ ±0 

Results for commit 755d8f0. ± Comparison against base commit 4fdc747.

This pull request removes 8 and adds 4 tests. Note that renamed tests count towards both.
#, count=1
, count=0
, count=1
A, count=1
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [2] content=
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [6] content=
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [7] content=#
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [8] content=
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [2] content=
, count=0
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [6] content=
A, count=1
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [7] content=#
, count=1
com.github._1c_syntax.bsl.languageserver.diagnostics.MetadataObjectNameLengthDiagnosticTest ‑ [8] content=
#, count=1

♻️ This comment has been updated with latest results.

@nixel2007 nixel2007 merged commit ca31f7d into develop Jan 6, 2026
74 of 84 checks passed
@nixel2007 nixel2007 deleted the nixel2007-patch-1 branch January 6, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants