Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-3341

Behavior of empty reference arrays is inconsistent

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: P1
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Windows 7 Enterprise 64-bit
      2012-11-28 build

      Description

      The syntax "field = {}" behaves differently for each resource:

      • Barycenter.BodyNames: resets to default
      • ForceModel.PointMasses: nothing
      • ForceModel.PrimaryBodies: resets to default
      • Formation.Add: not allowed
      • GroundTrackPlot.Add: empties list
      • ImpulsiveBurn.Tank: not allowed
      • ReportFile.Add: not allowed
      • Spacecraft.Tanks: not allowed
      • Spacecraft.Thrusters: not allowed
      • Thruster.Tank: not allowed
      • XYPlot.YVariables: not allowed

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              jjkparker Joel Parker added a comment -

              Proposal for R2013a:

              • Document in Script Language: "The behavior when specifying an empty list is resource-dependent."
              • Document on each resource.

              Proposal for Someday:

              • Empty list should mean "make the list contain nothing".
              • If the field cannot accept an empty list, throw an invalid input exception.

              This is consistent with other languages that accept object lists. We should see how close we can get to this behavior without causing huge backward-compatibility problems.

              Show
              jjkparker Joel Parker added a comment - Proposal for R2013a: Document in Script Language: "The behavior when specifying an empty list is resource-dependent." Document on each resource. Proposal for Someday: Empty list should mean "make the list contain nothing". If the field cannot accept an empty list, throw an invalid input exception. This is consistent with other languages that accept object lists. We should see how close we can get to this behavior without causing huge backward-compatibility problems.
              Hide
              shughes Steven Hughes added a comment -

              CCB: P1 R2013a.

              + We need a policy describing what should happen. If across the board consistency is most important we should disallow in all cases. It may be better to have some simple rules depending upon whether or not an empty list is allowed. For example, an empty array on Barycenter should not mean that it has no bodies which leads to an undefined barycenter (same with libaration point). In other cases an empty list is acceptable (Thrusters for example).

              Once behavior is described, CCB will retriage.

              Show
              shughes Steven Hughes added a comment - CCB: P1 R2013a. + We need a policy describing what should happen. If across the board consistency is most important we should disallow in all cases. It may be better to have some simple rules depending upon whether or not an empty list is allowed. For example, an empty array on Barycenter should not mean that it has no bodies which leads to an undefined barycenter (same with libaration point). In other cases an empty list is acceptable (Thrusters for example). Once behavior is described, CCB will retriage.

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: