Skip to content

Commit 123f40a

Browse files
authored
Merge pull request #90 from 1c-syntax/feature/issue81
Unknown MDO check
2 parents c7b112d + 6b4e953 commit 123f40a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/github/_1c_syntax/mdclasses/utils/MDOUtils.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,16 @@ private void computeChildren(ConfigurationSource configurationSource, Subsystem
328328
var folder = Paths.get(rootFolder.toString(), subsystem.getName(), MDOType.SUBSYSTEM.getGroupName());
329329

330330
children.forEach(child -> {
331+
if (subsystem.getMdoRef().equals(child.getLeft())) {
332+
return;
333+
}
331334
if (child.isLeft()) {
332335
var partNames = child.getLeft().split("\\.");
333336
if (partNames.length == 2 && partNames[0].startsWith(MDOType.SUBSYSTEM.getName())) {
334337
var mdoPath = MDOPathUtils.getMDOPath(configurationSource, folder, partNames[1]);
335338
Subsystem childSubsystem = (Subsystem) getMDObject(configurationSource, MDOType.SUBSYSTEM, mdoPath);
336339
// FIXME: нужен рефакторинг
337-
if(childSubsystem != null) {
340+
if (childSubsystem != null) {
338341
childSubsystem.setParent(subsystem);
339342
childSubsystem.computeMdoRef();
340343
newChildren.add(Either.right(childSubsystem));
@@ -346,7 +349,7 @@ private void computeChildren(ConfigurationSource configurationSource, Subsystem
346349
newChildren.add(Either.right(mdo));
347350
mdo.addIncludedSubsystems(subsystem);
348351
} else {
349-
LOGGER.error("Unknown MDO {}", child.getLeft());
352+
LOGGER.error("Broken link {} - {}", subsystem.getName(), child.getLeft());
350353
}
351354
}
352355
} else {

0 commit comments

Comments
 (0)