Skip to content

Commit

Permalink
skip update version on same value
Browse files Browse the repository at this point in the history
  • Loading branch information
昱恒 committed Aug 11, 2021
1 parent f4f4562 commit 3d44c26
Show file tree
Hide file tree
Showing 40 changed files with 291 additions and 57 deletions.
2 changes: 1 addition & 1 deletion client/all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-all</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>

<name>${project.groupId}:${project.artifactId}</name>
<url>http://github.com/alipay/sofa-registry</url>
Expand Down
2 changes: 1 addition & 1 deletion client/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client/log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<packaging>pom</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
2 changes: 1 addition & 1 deletion server/common/model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-common</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Arrays;

/**
* @author zhuoyu.sjw
Expand Down Expand Up @@ -212,4 +213,16 @@ public int getSerialization() {
public void setSerialization(int serial) {
this.serialization = serial;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ServerDataBox that = (ServerDataBox) o;
return Arrays.equals(bytes, that.bytes);
}
}
2 changes: 1 addition & 1 deletion server/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-server-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/common/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-common</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package com.alipay.sofa.registry.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -51,4 +53,27 @@ public static <K, V> Map<K, V> toSingletonMap(Map<K, V> m) {
Map.Entry<K, V> one = m.entrySet().iterator().next();
return Collections.singletonMap(one.getKey(), one.getValue());
}

/**
* compare each item in two List
*
* @return
*/
public static <T> boolean equals(List<T> coll1, List<T> coll2) {
if (coll1 == null) {
return coll2 == null;
}

if (coll2 == null || (coll1.size() != coll2.size())) {
return false;
}

Collection<T> source = new ArrayList<>(coll1);
Collection<T> destination = new ArrayList<>(coll2);

source.removeAll(coll2);
destination.removeAll(coll1);

return source.isEmpty() && destination.isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package com.alipay.sofa.registry.util;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.*;
import org.junit.Assert;
Expand Down Expand Up @@ -71,4 +72,52 @@ public void testSingleMap() {
} catch (UnsupportedOperationException exception) {
}
}

@Test
public void testEquals() {
// false
List<String> a = null;
List<String> b = Lists.newArrayList();
Assert.assertFalse(CollectionUtils.equals(a, b));

// false
a = Lists.newArrayList();
b = null;
Assert.assertFalse(CollectionUtils.equals(a, b));

// true
a = null;
b = null;
Assert.assertTrue(CollectionUtils.equals(a, b));

// true
a = Lists.newArrayList();
b = Lists.newArrayList();
Assert.assertTrue(CollectionUtils.equals(a, b));

// false
a = Lists.newArrayList("a", "b", "c", null, "a");
b = Lists.newArrayList("a", "b", "c", null);
Assert.assertFalse(CollectionUtils.equals(a, b));

// true
a = Lists.newArrayList(null, "a", "b", "c");
b = Lists.newArrayList("a", "b", "c", null);
Assert.assertTrue(CollectionUtils.equals(a, b));

// false
a = Lists.newArrayList(null, "a", "b", "c", null);
b = Lists.newArrayList("a", "b", "c", null);
Assert.assertFalse(CollectionUtils.equals(a, b));

// false
a = Lists.newArrayList("a", "b", "c", "a");
b = Lists.newArrayList("a", "b", "c");
Assert.assertFalse(CollectionUtils.equals(a, b));

// true
a = Lists.newArrayList("b", null, "a", "c");
b = Lists.newArrayList("a", "b", "c", null);
Assert.assertTrue(CollectionUtils.equals(a, b));
}
}
2 changes: 1 addition & 1 deletion server/distribution/data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-distribution</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/distribution/integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-distribution</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/distribution/meta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-distribution</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-server-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/distribution/session/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-distribution</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion server/remoting/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-remoting</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/remoting/bolt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-remoting</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/remoting/http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-remoting</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/remoting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-server-parent</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/server/data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-server</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Loading

0 comments on commit 3d44c26

Please sign in to comment.