Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

GUI unable to refresh Requirements #153

Closed
J0B10 opened this issue Nov 14, 2019 · 1 comment
Closed

GUI unable to refresh Requirements #153

J0B10 opened this issue Nov 14, 2019 · 1 comment
Assignees
Labels
bug Something isn't working urgent When something is more than just 'it's an open source project' important
Milestone

Comments

@J0B10
Copy link
Member

J0B10 commented Nov 14, 2019

Just want to document this so I don't forget about it.
I'll try to do some more investigations on what happens tomorrow.

Description

When setting the new IntegerRequirement from PR #148 to a noninteger it fails and displays the message Unable to set the requirement., just as intended.

But if you then try to refresh the Requirements using Show Requirements the get request fails without an error message.

To fix it use Delete for the IntegerRequirement that you previously set to an illegal value.
Then Show Requirements works again.

@J0B10 J0B10 added the bug Something isn't working label Nov 14, 2019
@J0B10 J0B10 added this to the pre-alpha 3 milestone Nov 14, 2019
@J0B10 J0B10 self-assigned this Nov 14, 2019
@J0B10 J0B10 added the urgent When something is more than just 'it's an open source project' important label Nov 14, 2019
@J0B10
Copy link
Member Author

J0B10 commented Nov 15, 2019

So here my results rom debugging:

When setting a Parameter to an invalid value deserializing it will throw an exception, jusat as intended.
The problem is that the requirement content is set before deserialzing the value:

try {
val reqContent = loadedRequirementType.get.newInstance().asInstanceOf[io.Serializable]
requirements.getAccess.setRequirementContent(requirementId, reqContent)
reqContent.deserialize(content)
logger info s"Created requirement content for '$requirementId' and deserialized its content."
true
} catch {
case e: Exception =>
logger error s"Unable to instantiate requirement content. Exception: ${e.getMessage}"
false
}

So if deserializing the value throws an exception the requirement content will be set to a parameter witch cannot be deserialized cause the value is null.

Fixing this should be as simple es moving the call of deserialize() before setRequirementContent().

J0B10 added a commit that referenced this issue Nov 15, 2019
@J0B10 J0B10 closed this as completed Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working urgent When something is more than just 'it's an open source project' important
Projects
None yet
Development

No branches or pull requests

1 participant