You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/08/09 12:57:27 UTC

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

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] 02/02: removed obsolete supported datatype checking code

Posted by sr...@apache.org.
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 <sr...@apache.org>
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<ModbusTcpPayload, PlcRequestContainer<PlcRequest, PlcResponse>> {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(Plc4XModbusProtocol.class);
@@ -75,7 +76,6 @@ public class Plc4XModbusProtocol extends MessageToMessageCodec<ModbusTcpPayload,
         // TODO: for higher datatypes float, double etc we might need to split the bytes into chunks
         int quantity = writeRequestItem.getSize();
         short unitId = 0;
-        checkSupportedDataType(writeRequestItem.getValues());
 
         ModbusAddress address = (ModbusAddress) writeRequestItem.getAddress();
         ModbusPdu modbusRequest;
@@ -248,27 +248,6 @@ public class Plc4XModbusProtocol extends MessageToMessageCodec<ModbusTcpPayload,
         super.exceptionCaught(ctx, cause);
     }
 
-    private void checkSupportedDataType(List<?> 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] 01/02: manage commons-collections dependency

Posted by sr...@apache.org.
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 <sr...@apache.org>
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 @@
 
     <commons-io.version>2.6</commons-io.version>
     <commons-codec.version>1.11</commons-codec.version>
+    <commons-collections4.version>4.1</commons-collections4.version>
     <commons-lang.version>2.6</commons-lang.version>
     <hamcrest.version>1.3</hamcrest.version>
     <gson.version>2.8.0</gson.version>
@@ -147,6 +148,11 @@
         <version>${commons-io.version}</version>
       </dependency>
       <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-collections4</artifactId>
+        <version>${commons-collections4.version}</version>
+      </dependency>
+      <dependency>
         <groupId>commons-codec</groupId>
         <artifactId>commons-codec</artifactId>
         <version>${commons-codec.version}</version>