Skip to content

Commit

Permalink
Remove deep copy of Data Repository, since states are not all seriali…
Browse files Browse the repository at this point in the history
…zable
  • Loading branch information
dfuchss committed Dec 5, 2024
1 parent 7fefa1a commit b3f7b3b
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.kit.kastel.mcse.ardoco.core.common.util.DataRepositoryHelper;

/**
* This class represents a data repository that can be used to store and fetch certain data ({@link PipelineStepData}. Data can be added and fetched with the
* help of a data identifier (as string). Fetching also needs the necessary class of data that is expected.
Expand Down Expand Up @@ -41,7 +39,7 @@ public <T extends PipelineStepData> Optional<T> getData(String identifier, Class
if (possibleData != null) {
return possibleData.asPipelineStepData(clazz);
}
logger.warn("Could not find data for id '{}'", identifier);
DataRepository.logger.warn("Could not find data for id '{}'", identifier);
return Optional.empty();
}

Expand All @@ -53,7 +51,7 @@ public <T extends PipelineStepData> Optional<T> getData(String identifier, Class
*/
public void addData(String identifier, PipelineStepData pipelineStepData) {
if (this.data.put(identifier, pipelineStepData) != null) {
logger.warn("Overriding data with identifier '{}'", identifier);
DataRepository.logger.warn("Overriding data with identifier '{}'", identifier);
}
}

Expand All @@ -65,13 +63,4 @@ public void addData(String identifier, PipelineStepData pipelineStepData) {
public void addAllData(DataRepository dataRepository) {
this.data.putAll(dataRepository.data);
}

/**
* Creates a deep copy of the data repository using serialization.
*
* @return deep copy of the data repository
*/
public DataRepository deepCopy() {
return DataRepositoryHelper.deepCopy(this);
}
}

0 comments on commit b3f7b3b

Please sign in to comment.