[incubator-plc4x] branch master updated (7a38a36 -> 07b6007)

2018-08-09 Thread sruehl
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git.


from 7a38a36  fixed some sonar bugs
 new 4d5bf28  manage commons-collections dependency
 new 07b6007  removed obsolete supported datatype checking code

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/modbus/netty/Plc4XModbusProtocol.java | 23 +-
 pom.xml|  6 ++
 2 files changed, 7 insertions(+), 22 deletions(-)



[incubator-plc4x] 01/02: manage commons-collections dependency

2018-08-09 Thread sruehl
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git

commit 4d5bf28ee179bbc7ff05796fd6200e9102923a33
Author: Sebastian Rühl 
AuthorDate: Thu Aug 9 14:56:57 2018 +0200

manage commons-collections dependency
---
 pom.xml | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/pom.xml b/pom.xml
index d9ef98a..d8fee49 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,6 +91,7 @@
 
 2.6
 1.11
+4.1
 2.6
 1.3
 2.8.0
@@ -147,6 +148,11 @@
 ${commons-io.version}
   
   
+org.apache.commons
+commons-collections4
+${commons-collections4.version}
+  
+  
 commons-codec
 commons-codec
 ${commons-codec.version}



[incubator-plc4x] 02/02: removed obsolete supported datatype checking code

2018-08-09 Thread sruehl
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git

commit 07b60074675da67a8cc92f00df2a4459254eabea
Author: Sebastian Rühl 
AuthorDate: Thu Aug 9 14:57:22 2018 +0200

removed obsolete supported datatype checking code
---
 .../java/modbus/netty/Plc4XModbusProtocol.java | 23 +-
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git 
a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
 
b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
index cfdb168..5a42e6b 100644
--- 
a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
+++ 
b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
@@ -46,6 +46,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicInteger;
 
+
 public class Plc4XModbusProtocol extends 
MessageToMessageCodec> {
 
 private static final Logger LOGGER = 
LoggerFactory.getLogger(Plc4XModbusProtocol.class);
@@ -75,7 +76,6 @@ public class Plc4XModbusProtocol extends 
MessageToMessageCodec values) {
-if (values == null || values.size() == 0) {
-return;
-}
-for (Object value : values) {
-if (
-!(value instanceof Boolean)
-&& !(value instanceof Byte)
-&& !(value instanceof byte[])
-&& !(value instanceof Byte[])
-&& !(value instanceof Short)
-&& !(value instanceof Integer)
-&& !(value instanceof BigInteger)
-&& !(value instanceof Float)
-&& !(value instanceof Double)
-) {
-throw new PlcRuntimeException("Unsupported datatype detected " 
+ value.getClass());
-}
-}
-}
-
 

 // Encoding helpers.
 




[incubator-plc4x] branch master updated: fixed some sonar bugs

2018-08-09 Thread sruehl
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git


The following commit(s) were added to refs/heads/master by this push:
 new 4f38a3f  fixed some sonar bugs
4f38a3f is described below

commit 4f38a3fae4cd4bc481ee6b1514fb95625fd20587
Author: Sebastian Rühl 
AuthorDate: Thu Aug 9 13:48:49 2018 +0200

fixed some sonar bugs
---
 .../items/SubscriptionRequestCyclicItem.java   | 29 +
 .../messages/items/SubscriptionRequestItem.java| 29 +
 .../messages/items/SubscriptionResponseItem.java   | 30 +-
 .../java/base/connection/tcp/TcpHexDumper.java | 14 +++---
 .../org/apache/plc4x/java/base/util/Assert.java|  5 ++--
 .../plc4x/java/modbus/model/CoilModbusAddress.java |  2 +-
 .../model/MaskWriteRegisterModbusAddress.java  |  6 ++---
 .../model/ReadDiscreteInputsModbusAddress.java |  2 +-
 .../model/ReadHoldingRegistersModbusAddress.java   |  2 +-
 .../model/ReadInputRegistersModbusAddress.java |  2 +-
 .../java/modbus/model/RegisterModbusAddress.java   |  2 +-
 .../java/modbus/netty/Plc4XModbusProtocol.java |  3 ---
 12 files changed, 108 insertions(+), 18 deletions(-)

diff --git 
a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestCyclicItem.java
 
b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestCyclicItem.java
index b1a491b..22793b2 100644
--- 
a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestCyclicItem.java
+++ 
b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestCyclicItem.java
@@ -21,6 +21,7 @@ package org.apache.plc4x.java.api.messages.items;
 import org.apache.plc4x.java.api.model.Address;
 import org.apache.plc4x.java.api.model.SubscriptionType;
 
+import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Consumer;
 
@@ -43,4 +44,32 @@ public class SubscriptionRequestCyclicItem extends 
SubscriptionRequestItem {
 return period;
 }
 
+@Override
+public String toString() {
+return "SubscriptionRequestCyclicItem{" +
+"timeUnit=" + timeUnit +
+", period=" + period +
+"} " + super.toString();
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) {
+return true;
+}
+if (!(o instanceof SubscriptionRequestCyclicItem)) {
+return false;
+}
+if (!super.equals(o)) {
+return false;
+}
+SubscriptionRequestCyclicItem that = (SubscriptionRequestCyclicItem) o;
+return period == that.period &&
+timeUnit == that.timeUnit;
+}
+
+@Override
+public int hashCode() {
+return Objects.hash(super.hashCode(), timeUnit, period);
+}
 }
diff --git 
a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestItem.java
 
b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestItem.java
index 7591e09..0667073 100644
--- 
a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestItem.java
+++ 
b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionRequestItem.java
@@ -21,6 +21,7 @@ package org.apache.plc4x.java.api.messages.items;
 import org.apache.plc4x.java.api.model.Address;
 import org.apache.plc4x.java.api.model.SubscriptionType;
 
+import java.util.Objects;
 import java.util.function.Consumer;
 
 public abstract class SubscriptionRequestItem extends RequestItem {
@@ -42,4 +43,32 @@ public abstract class SubscriptionRequestItem extends 
RequestItem {
 return consumer;
 }
 
+@Override
+public String toString() {
+return "SubscriptionRequestItem{" +
+"subscriptionType=" + subscriptionType +
+", consumer=" + consumer +
+"} " + super.toString();
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) {
+return true;
+}
+if (!(o instanceof SubscriptionRequestItem)) {
+return false;
+}
+if (!super.equals(o)) {
+return false;
+}
+SubscriptionRequestItem that = (SubscriptionRequestItem) o;
+return subscriptionType == that.subscriptionType &&
+Objects.equals(consumer, that.consumer);
+}
+
+@Override
+public int hashCode() {
+return Objects.hash(super.hashCode(), subscriptionType, consumer);
+}
 }
diff --git 
a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionResponseItem.java
 
b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/items/SubscriptionResponseItem.java
index c38e28b..731a9ee 100644
---