Skip to content

[Bug]: a spec hierarchy takes the IS-TABLE-INTERNAL of its child #105

Open

Description

@samatstariongroup

What type of issue is this?

  • Bug report
  • Feature request

Description

When a SpecHierarchy reads its CHILDREN, DeserializeSpecHierarchy and DeserializeSpecHierarchyAsync read IS-TABLE-INTERNAL from each child SPEC-HIERARCHY element and assign it to the parent:

if (bool.TryParse(reader.GetAttribute("IS-TABLE-INTERNAL"), out var isTableInternal))
{
    this.IsTableInternal = isTableInternal;
}

(ReqIFSharp/SpecElementWithAttributes/SpecHierarchy.cs, in both the sync and async DeserializeSpecHierarchy.)

The child reads its own IS-TABLE-INTERNAL again in its ReadXml, so the child is right, but the parent ends up with the value of its last child that has the attribute:

  • a parent without IS-TABLE-INTERNAL whose child has IS-TABLE-INTERNAL="true" becomes table-internal, and is written back with IS-TABLE-INTERNAL="true";
  • a parent with IS-TABLE-INTERNAL="true" whose last child has IS-TABLE-INTERNAL="false" loses its value.

Proposal

  • Remove the two blocks; IS-TABLE-INTERNAL is read by each hierarchy for itself.

Acceptance criteria

  • A spec hierarchy keeps its own IS-TABLE-INTERNAL when read and written again, whatever its children have, in the sync and async readers.

Steps to Reproduce

  1. Take a ReqIF file with a SPEC-HIERARCHY that has no IS-TABLE-INTERNAL and a child SPEC-HIERARCHY with IS-TABLE-INTERNAL="true".
  2. var reqifs = new ReqIFDeserializer().Deserialize("in.reqif");
  3. The parent's IsTableInternal is true; new ReqIFSerializer().Serialize(reqifs, "out.reqif") writes IS-TABLE-INTERNAL="true" on the parent.

System Configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions