Skip to content

Commit 08a95a7

Browse files
Artem LabazinArtem Labazin
authored andcommitted
Add using unsigned numbers where they are needed
1 parent 5bf7369 commit 08a95a7

File tree

15 files changed

+26
-28
lines changed

15 files changed

+26
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- Add more unit and integration tests.
1313

14+
## [0.3.3](https://github.com/appulse-projects/epmd-java/releases/tag/0.3.3) - 2018-02-09
15+
16+
Minor fix, using unsigned numbers where they are needed
17+
1418
## [0.3.2](https://github.com/appulse-projects/epmd-java/releases/tag/0.3.2) - 2018-01-31
1519

1620
### Added

client/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Include the dependency to your project's pom.xml file:
1414
<dependency>
1515
<groupId>io.appulse.epmd.java</groupId>
1616
<artifactId>client</artifactId>
17-
<version>0.3.2</version>
17+
<version>0.3.3</version>
1818
</dependency>
1919
...
2020
</dependencies>
@@ -23,7 +23,7 @@ Include the dependency to your project's pom.xml file:
2323
or Gradle:
2424

2525
```groovy
26-
compile 'io.appulse.epmd.java:client:0.3.2'
26+
compile 'io.appulse.epmd.java:client:0.3.3'
2727
```
2828

2929
### Create client

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse</groupId>
2727
<artifactId>epmd-java</artifactId>
28-
<version>0.3.2</version>
28+
<version>0.3.3</version>
2929
</parent>
3030

3131
<groupId>io.appulse.epmd.java</groupId>

client/src/test/java/io/appulse/epmd/java/client/LocalEpmdClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void twoRegisters () throws Exception {
8484

8585
@Test
8686
public void register () throws Exception {
87-
val creation = client.register("register", 8971, R3_ERLANG, TCP, R6, R6);
87+
val creation = client.register("register", 61_123, R3_ERLANG, TCP, R6, R6);
8888
assertThat(creation).isNotEqualTo(0);
8989

9090
val optional = client.lookup("register");
@@ -94,7 +94,7 @@ public void register () throws Exception {
9494
SoftAssertions.assertSoftly(softly -> {
9595
softly.assertThat(nodeInfo.getPort())
9696
.isPresent()
97-
.hasValue(8971);
97+
.hasValue(61_123);
9898

9999
softly.assertThat(nodeInfo.getType())
100100
.isPresent()

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse</groupId>
2727
<artifactId>epmd-java</artifactId>
28-
<version>0.3.2</version>
28+
<version>0.3.3</version>
2929
</parent>
3030

3131
<groupId>io.appulse.epmd.java</groupId>

core/src/main/java/io/appulse/epmd/java/core/model/request/Registration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void write (@NonNull Bytes bytes) {
8585

8686
@Override
8787
public void read (@NonNull Bytes bytes) {
88-
port = bytes.getShort();
88+
port = bytes.getUnsignedShort();
8989
type = NodeType.of(bytes.getByte());
9090
protocol = Protocol.of(bytes.getByte());
9191
high = Version.of(bytes.getShort());

core/src/main/java/io/appulse/epmd/java/core/model/response/EpmdDump.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class EpmdDump implements DataSerializable {
6262

6363
@Override
6464
public void write (@NonNull Bytes bytes) {
65-
bytes.put(port);
65+
bytes.put4B(port);
6666

6767
if (nodes.isEmpty()) {
6868
bytes.put(new byte[0]);

core/src/main/java/io/appulse/epmd/java/core/model/response/EpmdInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class EpmdInfo implements DataSerializable {
6262

6363
@Override
6464
public void write (@NonNull Bytes bytes) {
65-
bytes.put(port);
65+
bytes.put4B(port);
6666

6767
if (nodes.isEmpty()) {
6868
bytes.put(new byte[0]);

core/src/main/java/io/appulse/epmd/java/core/model/response/NodeInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void read (@NonNull Bytes bytes) {
111111
}
112112

113113
ok = true;
114-
port = of((int) bytes.getShort());
114+
port = of(bytes.getUnsignedShort());
115115
type = of(bytes.getByte()).map(NodeType::of);
116116
protocol = of(bytes.getByte()).map(Protocol::of);
117117
high = of(bytes.getShort()).map(Version::of);

core/src/main/java/io/appulse/epmd/java/core/model/response/RegistrationResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void write (@NonNull Bytes bytes) {
6363
public void read (@NonNull Bytes bytes) {
6464
ok = bytes.getByte() == 0;
6565
if (ok) {
66-
creation = bytes.getShort();
66+
creation = bytes.getUnsignedShort();
6767
}
6868
}
6969
}

0 commit comments

Comments
 (0)