You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by hu...@apache.org on 2023/11/13 06:26:10 UTC

(plc4x) branch feat/plc4py_code_gen updated: chore(plc4j): Accidentally pushed a change to the Java driver

This is an automated email from the ASF dual-hosted git repository.

hutcheb pushed a commit to branch feat/plc4py_code_gen
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/feat/plc4py_code_gen by this push:
     new 1e05d3e8eb chore(plc4j): Accidentally pushed a change to the Java driver
1e05d3e8eb is described below

commit 1e05d3e8ebc18b7c1625e3d5da13bcd2944da205
Author: Ben Hutcheson <be...@gmail.com>
AuthorDate: Mon Nov 13 07:26:02 2023 +0100

    chore(plc4j): Accidentally pushed a change to the Java driver
---
 .../org/apache/plc4x/java/modbus/base/tag/ModbusTagCoil.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/base/tag/ModbusTagCoil.java b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/base/tag/ModbusTagCoil.java
index b86612d609..95e4e7c409 100644
--- a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/base/tag/ModbusTagCoil.java
+++ b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/base/tag/ModbusTagCoil.java
@@ -76,11 +76,11 @@ public class ModbusTagCoil extends ModbusTag {
             throw new IllegalArgumentException("Address must be less than or equal to " + REGISTER_MAXADDRESS + ". Was " + (address + PROTOCOL_ADDRESS_OFFSET));
         }
 
-            String quantityString = matcher.group("quantity");
-            int quantity = quantityString != null ? Integer.parseInt(quantityString) : 1;
-            if ((address + quantity) > REGISTER_MAXADDRESS) {
-                throw new IllegalArgumentException("Last requested address is out of range, should be between " + PROTOCOL_ADDRESS_OFFSET + " and " + REGISTER_MAXADDRESS + ". Was " + (address + PROTOCOL_ADDRESS_OFFSET + (quantity - 1)));
-            }
+        String quantityString = matcher.group("quantity");
+        int quantity = quantityString != null ? Integer.parseInt(quantityString) : 1;
+        if ((address + quantity) > REGISTER_MAXADDRESS) {
+            throw new IllegalArgumentException("Last requested address is out of range, should be between " + PROTOCOL_ADDRESS_OFFSET + " and " + REGISTER_MAXADDRESS + ". Was " + (address + PROTOCOL_ADDRESS_OFFSET + (quantity - 1)));
+        }
 
         if (quantity > 2000) {
             throw new IllegalArgumentException("quantity may not be larger than 2000. Was " + quantity);