Skip to content

Чтение форм по умолчанию#632

Merged
theshadowco merged 2 commits into
developfrom
feature/readDefaultForms
Jul 1, 2026
Merged

Чтение форм по умолчанию#632
theshadowco merged 2 commits into
developfrom
feature/readDefaultForms

Conversation

@theshadowco

@theshadowco theshadowco commented Jul 1, 2026

Copy link
Copy Markdown
Member

Описание

  1. Реализовано чтение полей со ссылками на дефолтные формы
  2. Добавлено перечисление с типами дефолтных форм
  3. Реализованы методы получения ссылок на формы по типу, а также самих форм по типу
  4. Реализован метод получения формы по ссылке

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

Closes: #19

Чеклист

Общие

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

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

Summary by CodeRabbit

  • New Features

    • Added broader support for default and auxiliary form mappings across many metadata objects.
    • Improved form lookup so default forms can be resolved consistently by form kind.
    • Expanded support for additional form types, including object, list, choice, folder, record, save/load, and related variants.
  • Bug Fixes

    • Default form references now resolve more reliably when a matching form exists.
    • Missing or unknown form links are handled more safely, returning empty results instead of failing.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@theshadowco, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8602a48e-1e8a-482a-934c-5118e52eb2b3

📥 Commits

Reviewing files that changed from the base of the PR and between 7025a8d and 48076d1.

📒 Files selected for processing (1)
  • src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java
📝 Walkthrough

Walkthrough

Introduces a DefaultFormKind enum and extends the FormOwner interface with default methods to resolve default/auxiliary form references. Nearly all metadata object classes (registers, catalogs, documents, charts, reports, etc.) gain new form-reference fields and a lazily-computed defaultFormMap. Test suites are expanded and split accordingly, and JSON serialization excludes the new map.

Changes

Default Form Mapping Feature

Layer / File(s) Summary
Contract: DefaultFormKind and FormOwner
src/main/java/com/github/_1c_syntax/bsl/mdo/support/DefaultFormKind.java, src/main/java/com/github/_1c_syntax/bsl/mdo/FormOwner.java
New DefaultFormKind enum (with localized names and case-insensitive lookup) and new default methods on FormOwner for resolving default form links, forms, and lookup by reference.
Single/dual-form owners
src/main/java/.../mdclasses/ExternalDataProcessor.java, ExternalReport.java, src/main/java/.../mdo/DocumentJournal.java, FilterCriterion.java, DataProcessor.java, SettingsStorage.java, src/main/java/.../mdo/children/ExternalDataSourceCube*.java, ExternalDataSourceTable.java, and matching tests
Adds default/auxiliary form reference fields and createDefaultFormMap() helpers for simpler form owners with one or two form kinds; tests validate map size, link resolution, and unknown-link lookups.
Register types
src/main/java/.../mdo/AccountingRegister.java, AccumulationRegister.java, CalculationRegister.java, InformationRegister.java, and matching tests
Adds list/record default and auxiliary form fields plus defaultFormMap to register classes; tests confirm mapping size, empty defaults, and resolved record-form links where applicable.
Multi-form object types
src/main/java/.../mdo/Catalog.java, ChartOfAccounts.java, ChartOfCalculationTypes.java, ChartOfCharacteristicTypes.java, Document.java, BusinessProcess.java, Task.java, Enum.java, ExchangePlan.java, Report.java, and matching tests
Adds multiple default/auxiliary object/list/choice/folder form fields and defaultFormMap to complex object types; tests cover form presence, correct names, and lookups across mdclasses/SSL fixtures.
Test utility exclusion
src/test/java/.../test_utils/MDTestUtils.java
createJson now excludes defaultFormMap during XStream serialization for MD-derived classes.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Test as Test/Client
  participant FormOwner as MD Object (FormOwner)
  participant Map as defaultFormMap
  participant Forms as getForms()

  Test->>FormOwner: getDefaultFormLink(DefaultFormKind.OBJECT_FORM)
  FormOwner->>Map: lookup(kind)
  Map-->>FormOwner: MdoReference or empty
  FormOwner-->>Test: MdoReference

  Test->>FormOwner: getDefaultForm(DefaultFormKind.OBJECT_FORM)
  FormOwner->>Map: lookup(kind)
  Map-->>FormOwner: link
  FormOwner->>Forms: search by link
  Forms-->>FormOwner: matching ObjectForm or none
  FormOwner-->>Test: Optional<ObjectForm>
Loading

Estimated code review effort: 4 (Complex) | ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main change: adding default-form reading support.
Linked Issues check ✅ Passed The changes implement default form metadata, type mapping, and form lookup behavior aligned with issue #19’s form-support scope.
Out of Scope Changes check ✅ Passed No clearly unrelated code changes are evident; the test and serialization updates support the new default-form feature.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/readDefaultForms

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.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Test Results

  402 files  ±0    402 suites  ±0   8m 54s ⏱️ -24s
  374 tests ±0    374 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 328 runs  ±0  2 328 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 48076d1. ± Comparison against base commit 8db75f0.

This pull request removes 30 and adds 30 tests. Note that renamed tests count towards both.
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [3] "true", "ssl_3_1", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения", "_edt"
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [4] "false", "ssl_3_1", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения"
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [5] "true", "ssl_3_2", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения", "_edt"
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [6] "false", "ssl_3_2", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения"
com.github._1c_syntax.bsl.mdo.DataProcessorTest ‑ [3] "true", "ssl_3_2", "DataProcessors.ЗагрузкаКурсовВалют", "_edt"
com.github._1c_syntax.bsl.mdo.DataProcessorTest ‑ [4] "false", "ssl_3_2", "DataProcessors.ЗагрузкаКурсовВалют"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [3] "true", "ssl_3_1", "DocumentJournals.Взаимодействия", "_edt"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [4] "false", "ssl_3_1", "DocumentJournals.Взаимодействия"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [5] "true", "ssl_3_2", "DocumentJournals.Взаимодействия", "_edt"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [6] "false", "ssl_3_2", "DocumentJournals.Взаимодействия"
…
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [1] "true", "ssl_3_1", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения", "_edt"
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [2] "false", "ssl_3_1", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения"
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [3] "true", "ssl_3_2", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения", "_edt"
com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypesTest ‑ [4] "false", "ssl_3_2", "ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения"
com.github._1c_syntax.bsl.mdo.DataProcessorTest ‑ [1] "true", "ssl_3_2", "DataProcessors.ЗагрузкаКурсовВалют", "_edt"
com.github._1c_syntax.bsl.mdo.DataProcessorTest ‑ [2] "false", "ssl_3_2", "DataProcessors.ЗагрузкаКурсовВалют"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [1] "true", "ssl_3_1", "DocumentJournals.Взаимодействия", "_edt"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [1] "true", "ssl_3_2", "DocumentJournals.Взаимодействия", "_edt"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [2] "false", "ssl_3_1", "DocumentJournals.Взаимодействия"
com.github._1c_syntax.bsl.mdo.DocumentJournalTest ‑ [2] "false", "ssl_3_2", "DocumentJournals.Взаимодействия"
…

♻️ This comment has been updated with latest results.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (1)
src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java (1)

100-107: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Omit defaultFormMap for ExternalSource too. ExternalDataProcessor and ExternalReport implement com.github._1c_syntax.bsl.mdclasses.ExternalSource, not MD, so this guard skips them and their lazy defaultFormMap will still end up in generated fixtures. Extend the omission to ExternalSource as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java` around
lines 100 - 107, The fixture serialization in MDTestUtils currently omits lazy
fields only for MD subclasses, so ExternalSource implementations like
ExternalDataProcessor and ExternalReport still keep defaultFormMap. Update the
omit-field logic in the existing XStream setup to also handle ExternalSource
(using the same class-check block or an additional one) and ensure
defaultFormMap is omitted for those classes as well.
🧹 Nitpick comments (5)
src/main/java/com/github/_1c_syntax/bsl/mdo/support/DefaultFormKind.java (1)

80-82: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

No null-guard in valueByName.

string.toLowerCase(Locale.ROOT) will NPE if string is null. EnumConverter.fromString already guards against null upstream, but since valueByName is a public static API, other direct callers won't get that protection.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/support/DefaultFormKind.java`
around lines 80 - 82, The public static DefaultFormKind.valueByName method
currently dereferences string without a null check, so add a null-guard before
calling toLowerCase(Locale.ROOT) and return null for null input. Keep the lookup
logic in KEYS intact, and ensure any direct callers of valueByName are safe even
when EnumConverter.fromString is not involved.
src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java (1)

137-152: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Repeated createDefaultFormMap() boilerplate across ~15 files.

This identical pattern (fields + lazy map + Map.ofEntries helper) is duplicated near-verbatim across ExternalDataProcessor, ExternalReport, DocumentJournal, FilterCriterion, DataProcessor, the ExternalDataSourceCube/Table children, ChartOfCalculationTypes, and other register/chart types in this cohort. Consider extracting a shared static helper (e.g., on FormOwner or a utility class) that accepts varargs Map.Entry<DefaultFormKind, MdoReference> and builds the immutable map, to reduce copy-paste risk (as evidenced by the Settings/Variant form inconsistency flagged above).

♻️ Example shared helper
// e.g. in FormOwner.java
static Map<DefaultFormKind, MdoReference> buildDefaultFormMap(Map.Entry<DefaultFormKind, MdoReference>... entries) {
  return Map.ofEntries(entries);
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java`
around lines 137 - 152, The default-form map construction is duplicated across
multiple form-owning classes, including ExternalDataProcessor and the related
processors/reports/register types. Extract the repeated createDefaultFormMap
pattern into a shared helper on FormOwner or a small utility method that accepts
varargs of Map.Entry<DefaultFormKind, MdoReference> and returns the immutable
map, then update each class’s defaultFormMap/createDefaultFormMap usage to call
that helper instead of inlining Map.ofEntries. Make sure the shared helper
preserves the same entry ordering and existing lazy field behavior.
src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java (1)

247-262: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Repeated createDefaultFormMap() boilerplate across many MDO classes.

The same Map.ofEntries(...) wiring (differing only by which DefaultFormKind entries apply) is duplicated verbatim across Catalog, ChartOfAccounts, ExchangePlan, ChartOfCalculationTypes, ChartOfCharacteristicTypes, BusinessProcess, register types, and ExternalDataSource children. This mirrors the existing computePossibleRights() duplication convention already in the codebase, so it's consistent with current practice rather than a new problem, but a shared varargs helper (e.g. FormOwnerSupport.buildDefaultFormMap(Map.entry(...), ...)) could reduce the copy-paste surface for future DefaultFormKind additions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java` around lines 247 -
262, The repeated createDefaultFormMap() Map.ofEntries wiring in Catalog and the
other MDO classes should be centralized to reduce copy-paste maintenance.
Introduce a shared helper in the common form-owner support area (for example, a
varargs builder that accepts Map.entry(DefaultFormKind, MdoReference) pairs) and
update createDefaultFormMap() to delegate to it. Keep the per-class selection of
DefaultFormKind entries intact, but remove the duplicated Map.ofEntries
boilerplate from Catalog and the other affected MDO types.
src/test/java/com/github/_1c_syntax/bsl/mdo/InformationRegisterTest.java (1)

41-84: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Asymmetric assertions and duplicated test bodies for test/testSSL.

getDefaultFormMap() is asserted to have 4 entries (RECORD_FORM, LIST_FORM, AUX_RECORD_FORM, AUX_LIST_FORM), but neither test nor testSSL asserts AUX_LIST_FORM link/form, and LIST_FORM's getDefaultForm(...) result is never checked (only getDefaultFormLink). Also, test (lines 41-58) and testSSL (lines 67-84) are near-identical bodies differing only in the @CsvSource fixtures — consider merging them into a single @CsvSource-parameterized method (as done in AccountingRegisterTest/AccumulationRegisterTest).

✅ Missing assertions to add
     assertThat(ir.getDefaultFormLink(DefaultFormKind.LIST_FORM)).isEqualTo(MdoReference.EMPTY);
+    assertThat(ir.getDefaultForm(DefaultFormKind.LIST_FORM)).isEmpty();
+    assertThat(ir.getDefaultFormLink(DefaultFormKind.AUX_LIST_FORM)).isEqualTo(MdoReference.EMPTY);
+    assertThat(ir.getDefaultForm(DefaultFormKind.AUX_LIST_FORM)).isEmpty();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/java/com/github/_1c_syntax/bsl/mdo/InformationRegisterTest.java`
around lines 41 - 84, The InformationRegisterTest methods are duplicating the
same assertions and also missing coverage for the full default form map. Update
the shared test body in test/testSSL (or merge them into one
CsvSource-parameterized method like other register tests) and add assertions for
AUX_LIST_FORM plus the missing getDefaultForm/getDefaultFormLink checks so all 4
expected entries from getDefaultFormMap are verified consistently.
src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java (1)

217-240: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

createDefaultFormMap() body is duplicated verbatim across multiple classes.

This exact 10-entry mapping (OBJECT_FORM/LIST_FORM/CHOICE_FORM/FOLDER_FORM/FOLDER_CHOICE_FORM + their AUX_ variants, built from identically-named getters) is repeated byte-for-byte in Catalog, ChartOfAccounts, and ChartOfCalculationTypes (per graph evidence). Since all four classes expose the same field names (defaultObjectForm, defaultListForm, etc.), this is a strong candidate for a shared default method (e.g. on a marker interface with these getters) instead of copy-pasting the map builder in every class. A similar pattern repeats for smaller 4-entry (Enum, registers, ExternalDataProcessor/ExternalReport) and 5-entry (Report, DataProcessor) variants.

Given the number of files involved, this is a larger structural change; flagging once here as the representative case (see similar note on Enum.java and Report.java).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java`
around lines 217 - 240, The createDefaultFormMap() implementation is duplicated
across several MDO classes, so replace the repeated Map.ofEntries builder with a
shared default method or helper on the common abstraction used by
ChartOfCharacteristicTypes, Catalog, ChartOfAccounts, and
ChartOfCalculationTypes. Preserve the existing DefaultFormKind-to-getter
mapping, but centralize the logic using the identically named getters
(getDefaultObjectForm, getDefaultListForm, getDefaultChoiceForm,
getDefaultFolderForm, getDefaultFolderChoiceForm, and the AUX_* variants) so
each class only supplies its form references. Apply the same consolidation
pattern to the smaller Enum/registers/ExternalDataProcessor/ExternalReport and
Report/DataProcessor variants where the same map-building code is repeated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java`:
- Around line 100-152: Remove the report-only form kinds from
ExternalDataProcessor by updating the default form fields and mapping in
ExternalDataProcessor and createDefaultFormMap. Keep only the forms actually
exposed by this metadata object, and delete the defaultSettingsForm,
defaultVariantForm, auxiliarySettingsForm, and auxiliaryVariantForm references
from the schema and the DefaultFormKind map entries.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java`:
- Around line 98-138: The createDefaultFormMap() implementation in
AccountingRegister duplicates the same two-entry Map.ofEntries logic used across
many MD classes. Extract this repeated mapping into a shared helper or default
method (for example on FormOwner or a small utility that accepts
DefaultFormKind/MdoReference entries), then update createDefaultFormMap() in
each affected class like AccountingRegister to delegate to that shared builder
while keeping only the class-specific getter calls.

---

Outside diff comments:
In `@src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java`:
- Around line 100-107: The fixture serialization in MDTestUtils currently omits
lazy fields only for MD subclasses, so ExternalSource implementations like
ExternalDataProcessor and ExternalReport still keep defaultFormMap. Update the
omit-field logic in the existing XStream setup to also handle ExternalSource
(using the same class-check block or an additional one) and ensure
defaultFormMap is omitted for those classes as well.

---

Nitpick comments:
In
`@src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java`:
- Around line 137-152: The default-form map construction is duplicated across
multiple form-owning classes, including ExternalDataProcessor and the related
processors/reports/register types. Extract the repeated createDefaultFormMap
pattern into a shared helper on FormOwner or a small utility method that accepts
varargs of Map.Entry<DefaultFormKind, MdoReference> and returns the immutable
map, then update each class’s defaultFormMap/createDefaultFormMap usage to call
that helper instead of inlining Map.ofEntries. Make sure the shared helper
preserves the same entry ordering and existing lazy field behavior.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java`:
- Around line 247-262: The repeated createDefaultFormMap() Map.ofEntries wiring
in Catalog and the other MDO classes should be centralized to reduce copy-paste
maintenance. Introduce a shared helper in the common form-owner support area
(for example, a varargs builder that accepts Map.entry(DefaultFormKind,
MdoReference) pairs) and update createDefaultFormMap() to delegate to it. Keep
the per-class selection of DefaultFormKind entries intact, but remove the
duplicated Map.ofEntries boilerplate from Catalog and the other affected MDO
types.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java`:
- Around line 217-240: The createDefaultFormMap() implementation is duplicated
across several MDO classes, so replace the repeated Map.ofEntries builder with a
shared default method or helper on the common abstraction used by
ChartOfCharacteristicTypes, Catalog, ChartOfAccounts, and
ChartOfCalculationTypes. Preserve the existing DefaultFormKind-to-getter
mapping, but centralize the logic using the identically named getters
(getDefaultObjectForm, getDefaultListForm, getDefaultChoiceForm,
getDefaultFolderForm, getDefaultFolderChoiceForm, and the AUX_* variants) so
each class only supplies its form references. Apply the same consolidation
pattern to the smaller Enum/registers/ExternalDataProcessor/ExternalReport and
Report/DataProcessor variants where the same map-building code is repeated.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/support/DefaultFormKind.java`:
- Around line 80-82: The public static DefaultFormKind.valueByName method
currently dereferences string without a null check, so add a null-guard before
calling toLowerCase(Locale.ROOT) and return null for null input. Keep the lookup
logic in KEYS intact, and ensure any direct callers of valueByName are safe even
when EnumConverter.fromString is not involved.

In `@src/test/java/com/github/_1c_syntax/bsl/mdo/InformationRegisterTest.java`:
- Around line 41-84: The InformationRegisterTest methods are duplicating the
same assertions and also missing coverage for the full default form map. Update
the shared test body in test/testSSL (or merge them into one
CsvSource-parameterized method like other register tests) and add assertions for
AUX_LIST_FORM plus the missing getDefaultForm/getDefaultFormLink checks so all 4
expected entries from getDefaultFormMap are verified consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 871d542e-70e0-4f40-9b33-55dc261feb61

📥 Commits

Reviewing files that changed from the base of the PR and between 8db75f0 and 7025a8d.

⛔ Files ignored due to path filters (120)
  • src/test/resources/fixtures/external/ТестоваяВнешняяОбработка.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/external/ТестоваяВнешняяОбработка_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/external/ТестовыйВнешнийОтчет.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/external/ТестовыйВнешнийОтчет_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/AccountingRegisters.РегистрБухгалтерии1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/AccumulationRegisters.РегистрНакопления1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/BusinessProcesses.БизнесПроцесс1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/BusinessProcesses.БизнесПроцесс1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCalculationTypes.ПланВидовРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/CommonAttributes.ОбщийРеквизит1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Constants.Константа1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Constants.Константа1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/DataProcessors.Обработка1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/DataProcessors.Обработка1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/DefinedTypes.ОпределяемыйТип1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/DocumentJournals.ЖурналДокументов1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/DocumentJournals.ЖурналДокументов1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Documents.Документ1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Documents.Документ1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Enums.Перечисление1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Enums.Перечисление1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExternalDataSources.ТекущаяСУБД.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExternalDataSources.ТекущаяСУБД_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/FilterCriteria.КритерийОтбора1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/FilterCriteria.КритерийОтбора1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/InformationRegisters.РегистрСведений1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/InformationRegisters.РегистрСведений1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Reports.Отчет1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Reports.Отчет1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Tasks.Задача1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_18/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_18/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_24/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_25/CalculationRegisters.РегистрРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_25/CalculationRegisters.РегистрРасчета1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_27/ExternalDataSources.ВнешнийИсточникДанных1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_27/ExternalDataSources.ВнешнийИсточникДанных1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_5_1/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_ext/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_ext/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/BusinessProcesses.Задание.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/BusinessProcesses.Задание_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/CommonAttributes.ОбластьДанныхВспомогательныеДанные.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/CommonForms.Вопрос.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/CommonForms.Вопрос_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Constants.ЗаголовокСистемы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/DataProcessors.ЗагрузкаКурсовВалют.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/DataProcessors.ЗагрузкаКурсовВалют_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/DocumentJournals.Взаимодействия.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/DocumentJournals.Взаимодействия_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Documents.Анкета.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Documents.Анкета_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Enums.СтатусыОбработчиковОбновления.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Enums.СтатусыОбработчиковОбновления_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/FilterCriteria.СвязанныеДокументы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/FilterCriteria.СвязанныеДокументы_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/InformationRegisters.СклоненияПредставленийОбъектов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/InformationRegisters.СклоненияПредставленийОбъектов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/InformationRegisters.ЭлектронныеПодписи.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/InformationRegisters.ЭлектронныеПодписи_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Reports.АнализВерсийОбъектов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Reports.АнализВерсийОбъектов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/SettingsStorages.ХранилищеВариантовОтчетов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/SettingsStorages.ХранилищеВариантовОтчетов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Tasks.ЗадачаИсполнителя.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Tasks.ЗадачаИсполнителя_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/BusinessProcesses.Задание.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/BusinessProcesses.Задание_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.ВерсииФайлов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.ВерсииФайлов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.Заметки.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.Заметки_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonAttributes.ОбластьДанныхВспомогательныеДанные.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonForms.Вопрос.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonForms.Вопрос_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Constants.ЗаголовокСистемы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DataProcessors.ЗагрузкаКурсовВалют.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DataProcessors.ЗагрузкаКурсовВалют_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DocumentJournals.Взаимодействия.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DocumentJournals.Взаимодействия_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Documents.Анкета.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Documents.Анкета_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Enums.СтатусыОбработчиковОбновления.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Enums.СтатусыОбработчиковОбновления_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ExchangePlans.ОбновлениеИнформационнойБазы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ExchangePlans.ОбновлениеИнформационнойБазы_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/FilterCriteria.СвязанныеДокументы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/FilterCriteria.СвязанныеДокументы_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.СклоненияПредставленийОбъектов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.СклоненияПредставленийОбъектов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.ЭлектронныеПодписи.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.ЭлектронныеПодписи_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Reports.АнализВерсийОбъектов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Reports.АнализВерсийОбъектов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/SettingsStorages.ХранилищеВариантовОтчетов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/SettingsStorages.ХранилищеВариантовОтчетов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Tasks.ЗадачаИсполнителя.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Tasks.ЗадачаИсполнителя_edt.json is excluded by !src/test/resources/**
📒 Files selected for processing (43)
  • src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java
  • src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalReport.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/BusinessProcess.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/CalculationRegister.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/DataProcessor.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Document.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/DocumentJournal.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Enum.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/FilterCriterion.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/FormOwner.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/InformationRegister.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Report.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/SettingsStorage.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Task.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/ExternalDataSourceCube.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/ExternalDataSourceCubeDimensionTable.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/ExternalDataSourceTable.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/support/DefaultFormKind.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/AccountingRegisterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegisterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/BusinessProcessTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CalculationRegisterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccountsTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypesTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DataProcessorTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DocumentJournalTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DocumentTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/EnumTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ExchangePlanTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/FilterCriterionTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/InformationRegisterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ReportTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/SettingsStorageTest.java
  • src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java

Comment thread src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@theshadowco theshadowco merged commit b55ee1f into develop Jul 1, 2026
19 checks passed
@theshadowco theshadowco deleted the feature/readDefaultForms branch July 1, 2026 12:05
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.

[EPIC] Метаданные формы объекта метаданных

1 participant