Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace HashMap with UnifiedMap #244

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions engine/orchestrator/score-orchestrator-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
<artifactId>querydsl-apt</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;

public class BranchContexts implements Serializable {
private boolean isBranchCancelled;
Expand All @@ -35,8 +35,8 @@ public BranchContexts(boolean isBranchCancelled, Map<String, Serializable> conte
Validate.notNull(systemContext);

this.isBranchCancelled = isBranchCancelled;
this.contexts = new HashMap<>(contexts);
this.systemContext = new HashMap<>(systemContext);
this.contexts = new UnifiedMap<>(contexts);
this.systemContext = new UnifiedMap<>(systemContext);
}

public boolean isBranchCancelled() {
Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<custom.nexus>overwriten_by_ci</custom.nexus>
<eclipse-collections.version>10.1.0</eclipse-collections.version>
</properties>

<distributionManagement>
Expand Down Expand Up @@ -213,6 +214,16 @@
<artifactId>javax.el-api</artifactId>
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
<version>${eclipse-collections.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
<version>${eclipse-collections.version}</version>
</dependency>
<!-- spring artifacts -->
<dependency>
<groupId>org.springframework</groupId>
Expand Down
8 changes: 8 additions & 0 deletions score-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import java.lang.Override;
import java.lang.String;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;

/**
* A POJO which serves as an holder for the contexts and exception (if exists) of a finished branch
Expand All @@ -40,8 +40,8 @@ public EndBranchDataContainer(Map<String, Serializable> contexts, Map<String, Se
Validate.notNull(contexts);
Validate.notNull(systemContext);

this.contexts = new HashMap<>(contexts);
this.systemContext = new HashMap<>(systemContext);
this.contexts = new UnifiedMap<>(contexts);
this.systemContext = new UnifiedMap<>(systemContext);
this.exception = exception;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;

/**
* A POJO containing all the data necessary to create a new branch
Expand All @@ -44,7 +44,7 @@ public StartBranchDataContainer(Long startPosition, Long executionPlanId, Map<St
this.startPosition = startPosition;
this.executionPlanId = executionPlanId;
this.systemContext = new SystemContext(systemContext);
this.contexts = new HashMap<>();
this.contexts = new UnifiedMap<>();

for (String name : contexts.keySet()) {
this.contexts.put(name, contexts.get(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.List;
import java.util.Map;
import java.util.Queue;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;

import static java.lang.Boolean.TRUE;

Expand Down Expand Up @@ -99,7 +100,7 @@ public class ExecutionRuntimeServices implements Serializable {

public static final String ENTERPRISE_MODE = "ENTERPRISE_MODE";

protected Map<String, Serializable> contextMap = new HashMap<>();
protected Map<String, Serializable> contextMap = new UnifiedMap<>();

public ExecutionRuntimeServices() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;

/**
* User:
Expand All @@ -34,7 +34,7 @@ public SystemContext() {
}

public SystemContext(Map<? extends String, ? extends Serializable> map) {
this.contextMap = new HashMap<>(map);
this.contextMap = new UnifiedMap<>(map);
}

@Override
Expand Down