Skip to content
Snippets Groups Projects
Commit e51d8275 authored by Nikolaus Huber's avatar Nikolaus Huber
Browse files

problem setting new currentSystemState when there is no further observation in...

problem setting new currentSystemState when there is no further observation in repository. this has been fixed

git-svn-id: https://se1.informatik.uni-wuerzburg.de/usvn/svn/code/DMM/trunk@16156 9e42b895-fcda-4063-8a3b-11be15eb1bbd
parent ba779c25
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ import edu.kit.ipd.descartes.perfdatarepo.Impact;
import edu.kit.ipd.descartes.perfdatarepo.Result;
import edu.kit.ipd.descartes.ql.models.repository.Observation;
import edu.kit.ipd.descartes.ql.models.repository.ObservationRepository;
import edu.kit.ipd.descartes.ql.models.repository.RepositoryFactory;
//import edu.kit.ipd.descartes.adaptation.model.repository.dmm.AdaptationProcessModelLoader;
public class ObservationRepositoryHandler implements IPerformanceDataRepositoryHandler {
......@@ -62,7 +63,13 @@ public class ObservationRepositoryHandler implements IPerformanceDataRepositoryH
for (Iterator<Observation> iterator = observations.iterator(); iterator.hasNext();) {
Observation observ = (Observation) iterator.next();
if (EcoreUtil.equals(observ, currentObservation)) {
newObservation = iterator.next();
if (iterator.hasNext()) {
newObservation = iterator.next();
} else {
// Just in case there is no remaining observation in the repository
newObservation = RepositoryFactory.eINSTANCE.createObservation();
newObservation.setIdentifier("EMPTY");
}
break;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment