Skip to content

Commit

Permalink
fixes #236, crash after enabling discarded alternative
Browse files Browse the repository at this point in the history
* when importing a plan links from values to scales have been established only for enabled alternatives. But alternatives can be discarded when they are (partially) evaluated. therefore the links for all values have to be established.
  • Loading branch information
kraxner committed Sep 3, 2014
1 parent 98cb2c3 commit 2092972
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -274,9 +274,11 @@ public List<Plan> importProjects(final InputStream in) throws PlatoException {
String projectName = plan.getPlanProperties().getName();
if ((projectName != null) && (!"".equals(projectName))) {
/*
* establish links from values to scales
* establish links from values to scales. For all(!)
* alternatives: An alternative could have be discarded
* after some measurements have already been added.
*/
plan.getTree().initValues(plan.getAlternativesDefinition().getConsideredAlternatives(),
plan.getTree().initValues(plan.getAlternativesDefinition().getAlternatives(),
plan.getSampleRecordsDefinition().getRecords().size(), true);
/*
* establish references of Experiment.uploads
Expand Down Expand Up @@ -520,7 +522,7 @@ private static void addRules(Digester digester) throws ParserConfigurationExcept
digester.addSetNext("*/experiment", "setExperiment");
digester.addCallMethod("*/experiment/description", "setDescription", 0);
digester.addCallMethod("*/experiment/settings", "setSettings", 0);
PlanParser.addCreateUpload(digester, "*/experiment/workflow", "setWorkflow", DigitalObject.class);
PlanParser.addCreateUpload(digester, "*/experiment/workflow", "setWorkflow", DigitalObject.class);

PlanParser.addCreateUpload(digester, "*/experiment/results/result", null, DigitalObject.class);
PlanParser.addCreateUpload(digester, "*/result/xcdlDescription", "setXcdlDescription", XcdlDescription.class);
Expand Down

1 comment on commit 2092972

@kraxner
Copy link
Contributor Author

@kraxner kraxner commented on 2092972 Sep 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this commit is related to an other issue: fixes #238!

Please sign in to comment.