Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #446 from junkerm/fix/model-gen-in-library
Browse files Browse the repository at this point in the history
Bugfix: Error at modelgeneration in library
  • Loading branch information
wehrlean authored May 21, 2019
2 parents d959220 + b9ac5d6 commit 4d74a5d
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ public boolean canPost(Object object2, Object object) {
@Override
public RestResult<?> post(Object parent, Object child, String token) {
CEGModel model = (CEGModel) parent;
Requirement req = (Requirement) model.eContainer();
try {
model = generateModelFromDescription(model, req);
model = generateModelFromDescription(model);
} catch (SpecmateException e) {
return new RestResult<>(Response.Status.INTERNAL_SERVER_ERROR);
}
req.getContents().add(model);
return new RestResult<>(Response.Status.OK);
}

Expand All @@ -57,10 +55,9 @@ public RestResult<?> post(Object parent, Object child, String token) {
*
* @param model
* CEGModel
* @param requirement
* @return
*/
private CEGModel generateModelFromDescription(CEGModel model, Requirement requirement) throws SpecmateException {
private CEGModel generateModelFromDescription(CEGModel model) throws SpecmateException {
String text = model.getModelRequirements();
if (text == null || StringUtils.isEmpty(text)) {
return model;
Expand Down

0 comments on commit 4d74a5d

Please sign in to comment.