Skip to content

Commit

Permalink
clean code remove unused dependency javatuple
Browse files Browse the repository at this point in the history
  • Loading branch information
shalk committed Apr 23, 2024
1 parent 4d30b04 commit fadd52b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 26 deletions.
4 changes: 0 additions & 4 deletions consistency/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@
<groupId>${project.groupId}</groupId>
<artifactId>nacos-common</artifactId>
</dependency>
<dependency>
<groupId>org.javatuples</groupId>
<artifactId>javatuples</artifactId>
</dependency>
<dependency>
<groupId>com.caucho</groupId>
<artifactId>hessian</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import com.alibaba.nacos.common.utils.Observable;
import com.alibaba.nacos.common.utils.Observer;
import com.alibaba.nacos.common.utils.Pair;
import com.alibaba.nacos.common.utils.StringUtils;
import org.javatuples.Pair;

import java.util.Map;
import java.util.TreeMap;
Expand All @@ -37,13 +37,17 @@ public final class ProtocolMetaData {

private final Map<String, MetaData> metaDataMap = new ConcurrentHashMap<>(4);

/**
* used for jackson serialization.
*
* @return metaMap
*/
public Map<String, Map<Object, Object>> getMetaDataMap() {
return metaDataMap.entrySet().stream().map(entry -> Pair.with(entry.getKey(),
entry.getValue().getItemMap().entrySet().stream()
.collect(TreeMap::new, (m, e) -> m.put(e.getKey(), e.getValue().getData()), TreeMap::putAll)))
.collect(TreeMap::new, (m, e) -> m.put(e.getValue0(), e.getValue1()), TreeMap::putAll);
entry.getValue().getItemMap().entrySet().stream()
.collect(TreeMap::new, (m, e) -> m.put(e.getKey(), e.getValue().getData()), TreeMap::putAll)))
.collect(TreeMap::new, (m, e) -> m.put(e.getFirst(), e.getSecond()), TreeMap::putAll);
}

// Does not guarantee thread safety, there may be two updates of
// time-1 and time-2 (time-1 <time-2), but time-1 data overwrites time-2

Expand Down
5 changes: 0 additions & 5 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

<dependency>
<groupId>org.javatuples</groupId>
<artifactId>javatuples</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions naming/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@
<artifactId>logback-core</artifactId>
</dependency>

<dependency>
<groupId>org.javatuples</groupId>
<artifactId>javatuples</artifactId>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
Expand Down
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
<mysql-connector-java.version>8.0.33</mysql-connector-java.version>
<derby.version>10.14.2.0</derby.version>
<jjwt.version>0.11.2</jjwt.version>
<javatuples.version>1.2</javatuples.version>
<grpc-java.version>1.57.2</grpc-java.version>
<proto-google-common-protos.version>2.17.0</proto-google-common-protos.version>
<protobuf-java.version>3.22.3</protobuf-java.version>
Expand Down Expand Up @@ -942,12 +941,6 @@
<version>1.3.2</version>
</dependency>

<dependency>
<groupId>org.javatuples</groupId>
<artifactId>javatuples</artifactId>
<version>${javatuples.version}</version>
</dependency>

<!-- gRPC dependency start -->
<dependency>
<groupId>io.grpc</groupId>
Expand Down

0 comments on commit fadd52b

Please sign in to comment.