Skip to content

Commit

Permalink
refactor(reasoning): fix Sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kris7t committed Jun 28, 2024
1 parent cad018d commit 4efec69
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
*/
package tools.refinery.store.reasoning.internal;

import tools.refinery.logic.dnf.Dnf;
import tools.refinery.logic.dnf.FunctionalQuery;
import tools.refinery.logic.dnf.Query;
import tools.refinery.logic.dnf.RelationalQuery;
import tools.refinery.store.adapter.AbstractModelAdapterBuilder;
import tools.refinery.store.dse.transition.DesignSpaceExplorationBuilder;
import tools.refinery.store.dse.transition.objectives.Objective;
import tools.refinery.store.dse.transition.objectives.Objectives;
import tools.refinery.store.model.ModelStore;
import tools.refinery.store.model.ModelStoreBuilder;
import tools.refinery.store.query.ModelQueryBuilder;
import tools.refinery.logic.dnf.Dnf;
import tools.refinery.logic.dnf.FunctionalQuery;
import tools.refinery.logic.dnf.Query;
import tools.refinery.logic.dnf.RelationalQuery;
import tools.refinery.store.reasoning.ReasoningBuilder;
import tools.refinery.store.reasoning.ReasoningStoreAdapter;
import tools.refinery.store.reasoning.interpretation.PartialInterpretation;
import tools.refinery.store.reasoning.lifting.DnfLifter;
import tools.refinery.store.reasoning.literal.Concreteness;
Expand All @@ -34,7 +35,7 @@

import java.util.*;

public class ReasoningBuilderImpl extends AbstractModelAdapterBuilder<ReasoningStoreAdapterImpl>
public class ReasoningBuilderImpl extends AbstractModelAdapterBuilder<ReasoningStoreAdapter>
implements ReasoningBuilder {
private final DnfLifter lifter = new DnfLifter();
private final PartialQueryRewriter queryRewriter = new PartialQueryRewriter(lifter);
Expand Down Expand Up @@ -143,15 +144,15 @@ private void doConfigure(ModelStoreBuilder storeBuilder, PartialRelationTranslat
}

@Override
public ReasoningStoreAdapterImpl doBuild(ModelStore store) {
public ReasoningStoreAdapter doBuild(ModelStore store) {
return new ReasoningStoreAdapterImpl(store, requiredInterpretations,
Collections.unmodifiableMap(symbolInterpreters), Collections.unmodifiableMap(symbolRefiners),
getStorageRefiners(store), Collections.unmodifiableList(initializers));
}

private Map<AnySymbol, StorageRefiner.Factory<?>> getStorageRefiners(ModelStore store) {
var symbols = store.getSymbols();
var storageRefiners = new LinkedHashMap<AnySymbol, StorageRefiner.Factory<?>>(symbols.size());
var storageRefiners = HashMap.<AnySymbol, StorageRefiner.Factory<?>>newHashMap(symbols.size());
for (var symbol : symbols) {
var refiner = registeredStorageRefiners.remove(symbol);
if (refiner == null) {
Expand Down

0 comments on commit 4efec69

Please sign in to comment.