From 6d8e55751c68055d05995f285d9408e98f22954d Mon Sep 17 00:00:00 2001 From: csowada Date: Mon, 20 Mar 2023 20:15:05 +0100 Subject: [PATCH 01/10] Update for next development version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 512e987..113c931 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ eBUS core library - This library handles the communication with heating engineering via the BUS specification. This protocol is used by many heating manufacturers in Europe. de.cs-dev.ebus ebus-core - 1.1.9 + 1.1.10-SNAPSHOT https://github.com/csowada/ebus bundle From 487b0e32ccacd87e7fdecdcad1443a2f1f23008e Mon Sep 17 00:00:00 2001 From: csowada Date: Tue, 21 Mar 2023 21:12:27 +0100 Subject: [PATCH 02/10] Update gitflow-maven-plugin plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 113c931..177091d 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ com.amashchenko.maven.plugin gitflow-maven-plugin - 1.15.0 + 1.19.0 master From fafd4ef5e97869a4bddcc40c6e457f1a5ada5bde Mon Sep 17 00:00:00 2001 From: csowada Date: Tue, 21 Mar 2023 21:14:34 +0100 Subject: [PATCH 03/10] Update versions for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 177091d..d2de30b 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ eBUS core library - This library handles the communication with heating engineering via the BUS specification. This protocol is used by many heating manufacturers in Europe. de.cs-dev.ebus ebus-core - 1.1.10-SNAPSHOT + 1.1.10 https://github.com/csowada/ebus bundle From b8f95edea37c7446a5095cfb77fbf6658688809d Mon Sep 17 00:00:00 2001 From: csowada Date: Tue, 21 Mar 2023 21:37:55 +0100 Subject: [PATCH 04/10] Update licence header and pom.xml --- pom.xml | 6 +++--- .../de/csdev/ebus/cfg/EBusConfigurationReaderException.java | 2 +- .../java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java | 2 +- .../java/de/csdev/ebus/cfg/IEBusConfigurationReader.java | 2 +- .../java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java | 2 +- .../de/csdev/ebus/cfg/std/EBusValueJsonDeserializer.java | 2 +- .../java/de/csdev/ebus/cfg/std/dto/EBusCollectionDTO.java | 2 +- src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandDTO.java | 2 +- .../de/csdev/ebus/cfg/std/dto/EBusCommandMethodDTO.java | 2 +- .../de/csdev/ebus/cfg/std/dto/EBusCommandTemplatesDTO.java | 2 +- src/main/java/de/csdev/ebus/cfg/std/dto/EBusValueDTO.java | 2 +- src/main/java/de/csdev/ebus/client/EBusClient.java | 2 +- src/main/java/de/csdev/ebus/command/EBusCommand.java | 2 +- .../java/de/csdev/ebus/command/EBusCommandCollection.java | 2 +- .../java/de/csdev/ebus/command/EBusCommandException.java | 2 +- src/main/java/de/csdev/ebus/command/EBusCommandMethod.java | 2 +- .../java/de/csdev/ebus/command/EBusCommandNestedValue.java | 2 +- .../java/de/csdev/ebus/command/EBusCommandRegistry.java | 2 +- src/main/java/de/csdev/ebus/command/EBusCommandUtils.java | 2 +- src/main/java/de/csdev/ebus/command/EBusCommandValue.java | 2 +- src/main/java/de/csdev/ebus/command/IEBusCommand.java | 2 +- .../java/de/csdev/ebus/command/IEBusCommandCollection.java | 2 +- src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java | 2 +- src/main/java/de/csdev/ebus/command/IEBusNestedValue.java | 2 +- src/main/java/de/csdev/ebus/command/IEBusValue.java | 2 +- .../de/csdev/ebus/command/datatypes/EBusAbstractType.java | 2 +- .../de/csdev/ebus/command/datatypes/EBusTypeException.java | 2 +- .../de/csdev/ebus/command/datatypes/EBusTypeRegistry.java | 2 +- .../de/csdev/ebus/command/datatypes/IEBusComplexType.java | 2 +- .../java/de/csdev/ebus/command/datatypes/IEBusType.java | 2 +- .../de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java | 2 +- .../de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java | 2 +- .../csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java | 2 +- .../de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java | 2 +- .../csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java | 2 +- .../de/csdev/ebus/command/datatypes/ext/EBusTypeString.java | 2 +- .../de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java | 2 +- .../csdev/ebus/command/datatypes/ext/EBusTypeVersion.java | 2 +- .../ebus/command/datatypes/std/AbstractEBusTypeNumber.java | 2 +- .../datatypes/std/AbstractEBusTypeUnsignedNumber.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeBit.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeByte.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeChar.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java | 2 +- .../csdev/ebus/command/datatypes/std/EBusTypeInteger.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java | 2 +- .../ebus/command/datatypes/std/EBusTypeUnsignedNumber.java | 2 +- .../de/csdev/ebus/command/datatypes/std/EBusTypeWord.java | 2 +- .../java/de/csdev/ebus/core/EBusConnectorEventListener.java | 2 +- src/main/java/de/csdev/ebus/core/EBusConsts.java | 2 +- src/main/java/de/csdev/ebus/core/EBusControllerBase.java | 2 +- .../java/de/csdev/ebus/core/EBusControllerException.java | 2 +- src/main/java/de/csdev/ebus/core/EBusDataException.java | 2 +- src/main/java/de/csdev/ebus/core/EBusEbusdController.java | 2 +- .../java/de/csdev/ebus/core/EBusLowLevelController.java | 2 +- src/main/java/de/csdev/ebus/core/EBusQueue.java | 2 +- .../java/de/csdev/ebus/core/EBusReceiveStateMachine.java | 2 +- src/main/java/de/csdev/ebus/core/EBusVersion.java | 2 +- .../java/de/csdev/ebus/core/EBusWorkerThreadFactory.java | 2 +- .../de/csdev/ebus/core/IEBusConnectorEventListener.java | 2 +- src/main/java/de/csdev/ebus/core/IEBusController.java | 2 +- .../csdev/ebus/core/connection/AbstractEBusConnection.java | 2 +- .../ebus/core/connection/EBusCaptureProxyConnection.java | 2 +- .../csdev/ebus/core/connection/EBusEmulatorConnection.java | 2 +- .../ebus/core/connection/EBusJSerialCommConnection.java | 2 +- .../core/connection/EBusSerialNRJavaSerialConnection.java | 2 +- .../de/csdev/ebus/core/connection/EBusTCPConnection.java | 2 +- .../java/de/csdev/ebus/core/connection/IEBusConnection.java | 2 +- src/main/java/de/csdev/ebus/service/device/EBusDevice.java | 2 +- .../java/de/csdev/ebus/service/device/EBusDeviceTable.java | 2 +- .../csdev/ebus/service/device/EBusDeviceTableService.java | 2 +- src/main/java/de/csdev/ebus/service/device/IEBusDevice.java | 2 +- .../csdev/ebus/service/device/IEBusDeviceTableListener.java | 2 +- .../de/csdev/ebus/service/metrics/EBusMetricsService.java | 2 +- .../de/csdev/ebus/service/parser/EBusParserService.java | 2 +- .../de/csdev/ebus/service/parser/IEBusParserListener.java | 2 +- src/main/java/de/csdev/ebus/utils/CollectionUtils.java | 2 +- src/main/java/de/csdev/ebus/utils/CommonsUtils.java | 2 +- src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java | 2 +- src/main/java/de/csdev/ebus/utils/EBusDateTime.java | 2 +- src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java | 2 +- src/main/java/de/csdev/ebus/utils/EBusUtils.java | 2 +- src/main/java/de/csdev/ebus/utils/Emulator.java | 2 +- src/main/java/de/csdev/ebus/utils/EmulatorCapture.java | 2 +- src/main/java/de/csdev/ebus/utils/NumberUtils.java | 2 +- src/test/java/de/csdev/ebus/StaticTestTelegrams.java | 2 +- src/test/java/de/csdev/ebus/TestUtils.java | 2 +- src/test/java/de/csdev/ebus/basic/EBusUtilsTest.java | 2 +- src/test/java/de/csdev/ebus/cfg/BuildTelegramTest.java | 2 +- src/test/java/de/csdev/ebus/cfg/EBusBitTypeTest.java | 2 +- src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java | 2 +- .../java/de/csdev/ebus/cfg/EBusConfigurationBundleTest.java | 2 +- src/test/java/de/csdev/ebus/cfg/EBusConfigurationHash.java | 2 +- src/test/java/de/csdev/ebus/cfg/EBusConfigurationTest.java | 2 +- src/test/java/de/csdev/ebus/cfg/EBusConsoleTest.java | 2 +- .../java/de/csdev/ebus/cfg/EBusNestedTemplatesTest.java | 2 +- .../de/csdev/ebus/command/datatype/ReplaceValueTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/ext/CrcKWTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/ext/DateTest.java | 2 +- .../de/csdev/ebus/command/datatype/ext/DateTimeTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/ext/FloatTest.java | 2 +- .../de/csdev/ebus/command/datatype/ext/MultiWordTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/ext/StringTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/ext/TimeTest.java | 2 +- .../de/csdev/ebus/command/datatype/ext/VersionTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/BCDTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/BitTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/ByteTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/CharTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/Data1bTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/Data1cTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/Data2bTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/Data2cTest.java | 2 +- .../de/csdev/ebus/command/datatype/std/IntegerTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/UCharTest.java | 2 +- .../java/de/csdev/ebus/command/datatype/std/WordTest.java | 2 +- src/test/java/de/csdev/ebus/core/EBusControllerTest.java | 2 +- src/test/java/de/csdev/ebus/core/EBusStateMachineTest.java | 2 +- src/test/java/de/csdev/ebus/core/EBusVersionTest.java | 2 +- .../java/de/csdev/ebus/service/device/DeviceTableTests.java | 2 +- .../java/de/csdev/ebus/service/metrics/MetricsTest.java | 2 +- src/test/java/de/csdev/ebus/wip/ClientTest.java | 2 +- src/test/java/de/csdev/ebus/wip/ClientTest2.java | 2 +- src/test/java/de/csdev/ebus/wip/ClientTest3.java | 2 +- .../java/de/csdev/ebus/wip/ConfigurationReaderTest.java | 2 +- .../de/csdev/ebus/wip/EBusConfigurationTemplateTest.java | 2 +- src/test/java/de/csdev/ebus/wip/EBusCustomParserTest.java | 2 +- .../de/csdev/ebus/wip/EBusVaillantBAI00TelegramTest.java | 2 +- .../java/de/csdev/ebus/wip/EBusWolfSM1TelegramTest2XXX.java | 2 +- src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java | 2 +- src/test/java/de/csdev/ebus/wip/EmulatorTest.java | 2 +- 136 files changed, 138 insertions(+), 138 deletions(-) diff --git a/pom.xml b/pom.xml index d2de30b..1095d7e 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ 1.8 1.8 8 - 2021 + 2023 ${project.version} csowada_ebus csowada @@ -102,7 +102,7 @@ org.apache.felix maven-bundle-plugin - 3.0.1 + 3.5.1 true @@ -336,7 +336,7 @@ com.fazecast jSerialComm - 2.7.0 + 2.9.3 provided true diff --git a/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java b/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java index 9de8112..c90dba3 100644 --- a/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java +++ b/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java index b23ea6b..0ac4894 100644 --- a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java +++ b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java index dbd6067..ae59baa 100644 --- a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java +++ b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java b/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java index 7c6e51f..65457ea 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java +++ b/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/std/EBusValueJsonDeserializer.java b/src/main/java/de/csdev/ebus/cfg/std/EBusValueJsonDeserializer.java index a5c20fd..5ae0f04 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/EBusValueJsonDeserializer.java +++ b/src/main/java/de/csdev/ebus/cfg/std/EBusValueJsonDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCollectionDTO.java b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCollectionDTO.java index d8a3726..4679a40 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCollectionDTO.java +++ b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCollectionDTO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandDTO.java b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandDTO.java index 219b2f0..9d9b48e 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandDTO.java +++ b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandDTO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandMethodDTO.java b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandMethodDTO.java index 63912a1..5801f7a 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandMethodDTO.java +++ b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandMethodDTO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandTemplatesDTO.java b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandTemplatesDTO.java index fbf3dc4..53e4023 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandTemplatesDTO.java +++ b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusCommandTemplatesDTO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusValueDTO.java b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusValueDTO.java index 55e7433..ae35f67 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/dto/EBusValueDTO.java +++ b/src/main/java/de/csdev/ebus/cfg/std/dto/EBusValueDTO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/client/EBusClient.java b/src/main/java/de/csdev/ebus/client/EBusClient.java index 18f2a7b..190f314 100644 --- a/src/main/java/de/csdev/ebus/client/EBusClient.java +++ b/src/main/java/de/csdev/ebus/client/EBusClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommand.java b/src/main/java/de/csdev/ebus/command/EBusCommand.java index c76a67a..8a8aad4 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommand.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java b/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java index 06ea76b..fb31246 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandException.java b/src/main/java/de/csdev/ebus/command/EBusCommandException.java index 4eeb8d0..21717c5 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandException.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java b/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java index c58daff..03b63a1 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandNestedValue.java b/src/main/java/de/csdev/ebus/command/EBusCommandNestedValue.java index def487f..0cf35cd 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandNestedValue.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandNestedValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java b/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java index aae554d..e6e4b26 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java b/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java index aef0307..ed2928d 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandValue.java b/src/main/java/de/csdev/ebus/command/EBusCommandValue.java index 79f5cac..b3fffe5 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandValue.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/IEBusCommand.java b/src/main/java/de/csdev/ebus/command/IEBusCommand.java index 2eff688..819078b 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusCommand.java +++ b/src/main/java/de/csdev/ebus/command/IEBusCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java b/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java index cdb48c2..8061334 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java +++ b/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java b/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java index 6c2ca11..5ca6c25 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java +++ b/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java b/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java index 50009fd..a8dd971 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java +++ b/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/IEBusValue.java b/src/main/java/de/csdev/ebus/command/IEBusValue.java index 46fd17d..8f46549 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusValue.java +++ b/src/main/java/de/csdev/ebus/command/IEBusValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java index fa292ab..033983b 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeException.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeException.java index 38f719a..5dde879 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeException.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java index 6b63e50..00fa7ed 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java b/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java index fb7cedd..f55f6a6 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java b/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java index 9aa51d7..f29f6c2 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java index 485bbbc..6e29574 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java index 35666c6..9e7d004 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java index a5a5229..4b7bba4 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java index 9b6e6ed..5a70560 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java index cccc56d..7e64fc8 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java index 1b52fdc..aefd574 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java index 72f7e42..dd1447e 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java index 4b8f994..6cdc69d 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java index 915c77b..6d12625 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java index e3d1671..76db7b8 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java index 916ec36..f31939e 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java index 3849fd5..976c869 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java index 107c620..fae831a 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java index 3ad6133..7ba3858 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java index 4aa7cc2..383f666 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java index bc56e8e..2c1da96 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java index 1ee7842..14b645d 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java index 9ba1e4a..c92e7c5 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java index 72a4b06..ec04187 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java index 0382ce1..1605382 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java index 50c8d72..21531d0 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java index 1d6dad1..d01fc34 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java index 763f6be..d48a014 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusConnectorEventListener.java b/src/main/java/de/csdev/ebus/core/EBusConnectorEventListener.java index ddd3d32..607372b 100644 --- a/src/main/java/de/csdev/ebus/core/EBusConnectorEventListener.java +++ b/src/main/java/de/csdev/ebus/core/EBusConnectorEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusConsts.java b/src/main/java/de/csdev/ebus/core/EBusConsts.java index 631b673..b6b983a 100644 --- a/src/main/java/de/csdev/ebus/core/EBusConsts.java +++ b/src/main/java/de/csdev/ebus/core/EBusConsts.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusControllerBase.java b/src/main/java/de/csdev/ebus/core/EBusControllerBase.java index 2c37f16..b2a24be 100644 --- a/src/main/java/de/csdev/ebus/core/EBusControllerBase.java +++ b/src/main/java/de/csdev/ebus/core/EBusControllerBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusControllerException.java b/src/main/java/de/csdev/ebus/core/EBusControllerException.java index 95ab9ba..de0e52c 100644 --- a/src/main/java/de/csdev/ebus/core/EBusControllerException.java +++ b/src/main/java/de/csdev/ebus/core/EBusControllerException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusDataException.java b/src/main/java/de/csdev/ebus/core/EBusDataException.java index e9a55c0..097ea94 100644 --- a/src/main/java/de/csdev/ebus/core/EBusDataException.java +++ b/src/main/java/de/csdev/ebus/core/EBusDataException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusEbusdController.java b/src/main/java/de/csdev/ebus/core/EBusEbusdController.java index 4e8a083..6b8ccb0 100644 --- a/src/main/java/de/csdev/ebus/core/EBusEbusdController.java +++ b/src/main/java/de/csdev/ebus/core/EBusEbusdController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java b/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java index 0b5f7c1..3e40633 100644 --- a/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java +++ b/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusQueue.java b/src/main/java/de/csdev/ebus/core/EBusQueue.java index 506ee8d..6bdf0f9 100644 --- a/src/main/java/de/csdev/ebus/core/EBusQueue.java +++ b/src/main/java/de/csdev/ebus/core/EBusQueue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java b/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java index 9800638..df22aa0 100644 --- a/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java +++ b/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusVersion.java b/src/main/java/de/csdev/ebus/core/EBusVersion.java index 949777d..0aa6382 100644 --- a/src/main/java/de/csdev/ebus/core/EBusVersion.java +++ b/src/main/java/de/csdev/ebus/core/EBusVersion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/EBusWorkerThreadFactory.java b/src/main/java/de/csdev/ebus/core/EBusWorkerThreadFactory.java index 7dd647e..705881f 100644 --- a/src/main/java/de/csdev/ebus/core/EBusWorkerThreadFactory.java +++ b/src/main/java/de/csdev/ebus/core/EBusWorkerThreadFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/IEBusConnectorEventListener.java b/src/main/java/de/csdev/ebus/core/IEBusConnectorEventListener.java index 7b1e574..c1b4f89 100644 --- a/src/main/java/de/csdev/ebus/core/IEBusConnectorEventListener.java +++ b/src/main/java/de/csdev/ebus/core/IEBusConnectorEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/IEBusController.java b/src/main/java/de/csdev/ebus/core/IEBusController.java index 3db4dfe..6adeda4 100644 --- a/src/main/java/de/csdev/ebus/core/IEBusController.java +++ b/src/main/java/de/csdev/ebus/core/IEBusController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java b/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java index 75886ca..250ecc3 100644 --- a/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java b/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java index 0350fb2..e65ec95 100644 --- a/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/connection/EBusEmulatorConnection.java b/src/main/java/de/csdev/ebus/core/connection/EBusEmulatorConnection.java index 3018ce9..71922bd 100644 --- a/src/main/java/de/csdev/ebus/core/connection/EBusEmulatorConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/EBusEmulatorConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/connection/EBusJSerialCommConnection.java b/src/main/java/de/csdev/ebus/core/connection/EBusJSerialCommConnection.java index 9d096b0..7439883 100644 --- a/src/main/java/de/csdev/ebus/core/connection/EBusJSerialCommConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/EBusJSerialCommConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/connection/EBusSerialNRJavaSerialConnection.java b/src/main/java/de/csdev/ebus/core/connection/EBusSerialNRJavaSerialConnection.java index a9867c1..91e50f1 100644 --- a/src/main/java/de/csdev/ebus/core/connection/EBusSerialNRJavaSerialConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/EBusSerialNRJavaSerialConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/connection/EBusTCPConnection.java b/src/main/java/de/csdev/ebus/core/connection/EBusTCPConnection.java index 2d98b1a..97cf0e7 100644 --- a/src/main/java/de/csdev/ebus/core/connection/EBusTCPConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/EBusTCPConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java b/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java index 6634b7f..5e18a64 100644 --- a/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/device/EBusDevice.java b/src/main/java/de/csdev/ebus/service/device/EBusDevice.java index b9df9a9..8dc4486 100644 --- a/src/main/java/de/csdev/ebus/service/device/EBusDevice.java +++ b/src/main/java/de/csdev/ebus/service/device/EBusDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java index 5623114..292b3bb 100644 --- a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java +++ b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java index 091be75..2f8101a 100644 --- a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java +++ b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/device/IEBusDevice.java b/src/main/java/de/csdev/ebus/service/device/IEBusDevice.java index 247ec9a..9c9314c 100644 --- a/src/main/java/de/csdev/ebus/service/device/IEBusDevice.java +++ b/src/main/java/de/csdev/ebus/service/device/IEBusDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/device/IEBusDeviceTableListener.java b/src/main/java/de/csdev/ebus/service/device/IEBusDeviceTableListener.java index 2072e57..5dbf2d2 100644 --- a/src/main/java/de/csdev/ebus/service/device/IEBusDeviceTableListener.java +++ b/src/main/java/de/csdev/ebus/service/device/IEBusDeviceTableListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java b/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java index b55fa71..164c5c7 100644 --- a/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java +++ b/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/parser/EBusParserService.java b/src/main/java/de/csdev/ebus/service/parser/EBusParserService.java index b1b0d32..df0518a 100644 --- a/src/main/java/de/csdev/ebus/service/parser/EBusParserService.java +++ b/src/main/java/de/csdev/ebus/service/parser/EBusParserService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/service/parser/IEBusParserListener.java b/src/main/java/de/csdev/ebus/service/parser/IEBusParserListener.java index d78584c..a17b770 100644 --- a/src/main/java/de/csdev/ebus/service/parser/IEBusParserListener.java +++ b/src/main/java/de/csdev/ebus/service/parser/IEBusParserListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java index 9381856..8fe0013 100644 --- a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java +++ b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/CommonsUtils.java b/src/main/java/de/csdev/ebus/utils/CommonsUtils.java index 134207b..c01375d 100644 --- a/src/main/java/de/csdev/ebus/utils/CommonsUtils.java +++ b/src/main/java/de/csdev/ebus/utils/CommonsUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java index 10fadae..baa66e2 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java +++ b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/EBusDateTime.java b/src/main/java/de/csdev/ebus/utils/EBusDateTime.java index 1d0dd85..41ae3cf 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusDateTime.java +++ b/src/main/java/de/csdev/ebus/utils/EBusDateTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java b/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java index 1154a5b..e5dd835 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java +++ b/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/EBusUtils.java b/src/main/java/de/csdev/ebus/utils/EBusUtils.java index 7d1d0eb..7af7ed5 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusUtils.java +++ b/src/main/java/de/csdev/ebus/utils/EBusUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/Emulator.java b/src/main/java/de/csdev/ebus/utils/Emulator.java index 594059a..a6b6b39 100644 --- a/src/main/java/de/csdev/ebus/utils/Emulator.java +++ b/src/main/java/de/csdev/ebus/utils/Emulator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/EmulatorCapture.java b/src/main/java/de/csdev/ebus/utils/EmulatorCapture.java index 033747b..4ed4b90 100644 --- a/src/main/java/de/csdev/ebus/utils/EmulatorCapture.java +++ b/src/main/java/de/csdev/ebus/utils/EmulatorCapture.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/utils/NumberUtils.java b/src/main/java/de/csdev/ebus/utils/NumberUtils.java index c1dc3a2..e32c60f 100644 --- a/src/main/java/de/csdev/ebus/utils/NumberUtils.java +++ b/src/main/java/de/csdev/ebus/utils/NumberUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/StaticTestTelegrams.java b/src/test/java/de/csdev/ebus/StaticTestTelegrams.java index 85f652c..8346f1b 100644 --- a/src/test/java/de/csdev/ebus/StaticTestTelegrams.java +++ b/src/test/java/de/csdev/ebus/StaticTestTelegrams.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/TestUtils.java b/src/test/java/de/csdev/ebus/TestUtils.java index eee535d..fc964ed 100644 --- a/src/test/java/de/csdev/ebus/TestUtils.java +++ b/src/test/java/de/csdev/ebus/TestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/basic/EBusUtilsTest.java b/src/test/java/de/csdev/ebus/basic/EBusUtilsTest.java index c3f32c1..0897280 100644 --- a/src/test/java/de/csdev/ebus/basic/EBusUtilsTest.java +++ b/src/test/java/de/csdev/ebus/basic/EBusUtilsTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/BuildTelegramTest.java b/src/test/java/de/csdev/ebus/cfg/BuildTelegramTest.java index fded3c6..f8bab15 100644 --- a/src/test/java/de/csdev/ebus/cfg/BuildTelegramTest.java +++ b/src/test/java/de/csdev/ebus/cfg/BuildTelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusBitTypeTest.java b/src/test/java/de/csdev/ebus/cfg/EBusBitTypeTest.java index 716814d..a76af5f 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusBitTypeTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusBitTypeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java b/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java index 77a039c..70cfd24 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusConfigurationBundleTest.java b/src/test/java/de/csdev/ebus/cfg/EBusConfigurationBundleTest.java index cf0471c..07a86df 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusConfigurationBundleTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusConfigurationBundleTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusConfigurationHash.java b/src/test/java/de/csdev/ebus/cfg/EBusConfigurationHash.java index 47d5403..584e25a 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusConfigurationHash.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusConfigurationHash.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusConfigurationTest.java b/src/test/java/de/csdev/ebus/cfg/EBusConfigurationTest.java index 3199428..f598cb6 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusConfigurationTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusConfigurationTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusConsoleTest.java b/src/test/java/de/csdev/ebus/cfg/EBusConsoleTest.java index 1194a3e..bcab26e 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusConsoleTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusConsoleTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusNestedTemplatesTest.java b/src/test/java/de/csdev/ebus/cfg/EBusNestedTemplatesTest.java index e6307f8..6f9b552 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusNestedTemplatesTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusNestedTemplatesTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ReplaceValueTest.java b/src/test/java/de/csdev/ebus/command/datatype/ReplaceValueTest.java index f92586d..5694af8 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ReplaceValueTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ReplaceValueTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/CrcKWTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/CrcKWTest.java index 3310697..7fa1529 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/CrcKWTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/CrcKWTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/DateTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/DateTest.java index 7a55390..b253087 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/DateTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/DateTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/DateTimeTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/DateTimeTest.java index 6e9d26c..e9bb832 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/DateTimeTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/DateTimeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/FloatTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/FloatTest.java index c91379d..95cfddf 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/FloatTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/FloatTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/MultiWordTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/MultiWordTest.java index e5157f8..e40e0b8 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/MultiWordTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/MultiWordTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/StringTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/StringTest.java index b8d9e44..54cf247 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/StringTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/StringTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/TimeTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/TimeTest.java index 71635e7..7814beb 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/TimeTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/TimeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/ext/VersionTest.java b/src/test/java/de/csdev/ebus/command/datatype/ext/VersionTest.java index 01bf38a..7643280 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/ext/VersionTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/ext/VersionTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/BCDTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/BCDTest.java index ca0b2a4..067db13 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/BCDTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/BCDTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/BitTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/BitTest.java index 3fa9011..02ac0c4 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/BitTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/BitTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/ByteTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/ByteTest.java index 059065d..3644987 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/ByteTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/ByteTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/CharTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/CharTest.java index 667e474..4c3ae9f 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/CharTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/CharTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/Data1bTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/Data1bTest.java index 7769680..6d3df13 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/Data1bTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/Data1bTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/Data1cTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/Data1cTest.java index 181f82f..e3e53b7 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/Data1cTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/Data1cTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/Data2bTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/Data2bTest.java index d6a2084..8a28d34 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/Data2bTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/Data2bTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/Data2cTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/Data2cTest.java index 33098cb..d9405d8 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/Data2cTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/Data2cTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/IntegerTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/IntegerTest.java index 26d5ef2..9a48882 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/IntegerTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/IntegerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/UCharTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/UCharTest.java index e8045dc..9f4754e 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/UCharTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/UCharTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/command/datatype/std/WordTest.java b/src/test/java/de/csdev/ebus/command/datatype/std/WordTest.java index d8b25f7..b08985a 100644 --- a/src/test/java/de/csdev/ebus/command/datatype/std/WordTest.java +++ b/src/test/java/de/csdev/ebus/command/datatype/std/WordTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/core/EBusControllerTest.java b/src/test/java/de/csdev/ebus/core/EBusControllerTest.java index 352fb38..7ad486b 100644 --- a/src/test/java/de/csdev/ebus/core/EBusControllerTest.java +++ b/src/test/java/de/csdev/ebus/core/EBusControllerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/core/EBusStateMachineTest.java b/src/test/java/de/csdev/ebus/core/EBusStateMachineTest.java index 2e0475e..35c30a2 100644 --- a/src/test/java/de/csdev/ebus/core/EBusStateMachineTest.java +++ b/src/test/java/de/csdev/ebus/core/EBusStateMachineTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/core/EBusVersionTest.java b/src/test/java/de/csdev/ebus/core/EBusVersionTest.java index ddcb244..690e91f 100644 --- a/src/test/java/de/csdev/ebus/core/EBusVersionTest.java +++ b/src/test/java/de/csdev/ebus/core/EBusVersionTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/service/device/DeviceTableTests.java b/src/test/java/de/csdev/ebus/service/device/DeviceTableTests.java index f192082..bc45183 100644 --- a/src/test/java/de/csdev/ebus/service/device/DeviceTableTests.java +++ b/src/test/java/de/csdev/ebus/service/device/DeviceTableTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/service/metrics/MetricsTest.java b/src/test/java/de/csdev/ebus/service/metrics/MetricsTest.java index 5665605..8951714 100644 --- a/src/test/java/de/csdev/ebus/service/metrics/MetricsTest.java +++ b/src/test/java/de/csdev/ebus/service/metrics/MetricsTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/ClientTest.java b/src/test/java/de/csdev/ebus/wip/ClientTest.java index 6f7dba2..2560d38 100644 --- a/src/test/java/de/csdev/ebus/wip/ClientTest.java +++ b/src/test/java/de/csdev/ebus/wip/ClientTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/ClientTest2.java b/src/test/java/de/csdev/ebus/wip/ClientTest2.java index 08f29ab..4099115 100644 --- a/src/test/java/de/csdev/ebus/wip/ClientTest2.java +++ b/src/test/java/de/csdev/ebus/wip/ClientTest2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/ClientTest3.java b/src/test/java/de/csdev/ebus/wip/ClientTest3.java index b42a567..2b4151a 100644 --- a/src/test/java/de/csdev/ebus/wip/ClientTest3.java +++ b/src/test/java/de/csdev/ebus/wip/ClientTest3.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/ConfigurationReaderTest.java b/src/test/java/de/csdev/ebus/wip/ConfigurationReaderTest.java index f740b3e..bdd5aa8 100644 --- a/src/test/java/de/csdev/ebus/wip/ConfigurationReaderTest.java +++ b/src/test/java/de/csdev/ebus/wip/ConfigurationReaderTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EBusConfigurationTemplateTest.java b/src/test/java/de/csdev/ebus/wip/EBusConfigurationTemplateTest.java index a5ba737..f5ecf30 100644 --- a/src/test/java/de/csdev/ebus/wip/EBusConfigurationTemplateTest.java +++ b/src/test/java/de/csdev/ebus/wip/EBusConfigurationTemplateTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EBusCustomParserTest.java b/src/test/java/de/csdev/ebus/wip/EBusCustomParserTest.java index c5d3178..29002d6 100644 --- a/src/test/java/de/csdev/ebus/wip/EBusCustomParserTest.java +++ b/src/test/java/de/csdev/ebus/wip/EBusCustomParserTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EBusVaillantBAI00TelegramTest.java b/src/test/java/de/csdev/ebus/wip/EBusVaillantBAI00TelegramTest.java index 7a27d0a..2320dc4 100644 --- a/src/test/java/de/csdev/ebus/wip/EBusVaillantBAI00TelegramTest.java +++ b/src/test/java/de/csdev/ebus/wip/EBusVaillantBAI00TelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EBusWolfSM1TelegramTest2XXX.java b/src/test/java/de/csdev/ebus/wip/EBusWolfSM1TelegramTest2XXX.java index c72e6e2..04ff510 100644 --- a/src/test/java/de/csdev/ebus/wip/EBusWolfSM1TelegramTest2XXX.java +++ b/src/test/java/de/csdev/ebus/wip/EBusWolfSM1TelegramTest2XXX.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java b/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java index 95c6f3d..e931bc1 100644 --- a/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java +++ b/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EmulatorTest.java b/src/test/java/de/csdev/ebus/wip/EmulatorTest.java index 8acafbd..cdcea3e 100644 --- a/src/test/java/de/csdev/ebus/wip/EmulatorTest.java +++ b/src/test/java/de/csdev/ebus/wip/EmulatorTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 by the respective copyright holders. + * Copyright (c) 2017-2023 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 From 9763f752e79fa74ee5cba027964e12998234f5bd Mon Sep 17 00:00:00 2001 From: csowada Date: Thu, 23 Mar 2023 19:55:42 +0100 Subject: [PATCH 05/10] Add Null-Checks, minor changes --- .../cfg/EBusConfigurationReaderException.java | 3 + .../ebus/cfg/std/EBusConfigurationReader.java | 14 ++-- .../java/de/csdev/ebus/client/EBusClient.java | 48 +++++++---- .../de/csdev/ebus/command/EBusCommand.java | 17 ++-- .../ebus/command/EBusCommandCollection.java | 17 ++-- .../ebus/command/EBusCommandException.java | 3 + .../csdev/ebus/command/EBusCommandMethod.java | 5 +- .../ebus/command/EBusCommandRegistry.java | 20 +++-- .../csdev/ebus/command/EBusCommandUtils.java | 4 +- .../de/csdev/ebus/command/IEBusCommand.java | 15 ++-- .../ebus/command/IEBusCommandCollection.java | 11 +-- .../ebus/command/IEBusCommandMethod.java | 17 ++-- .../csdev/ebus/command/IEBusNestedValue.java | 5 +- .../de/csdev/ebus/command/IEBusValue.java | 7 +- .../command/datatypes/EBusAbstractType.java | 2 +- .../command/datatypes/EBusTypeRegistry.java | 8 +- .../command/datatypes/IEBusComplexType.java | 6 +- .../ebus/command/datatypes/IEBusType.java | 2 + .../command/datatypes/ext/EBusTypeBytes.java | 2 +- .../command/datatypes/ext/EBusTypeDate.java | 64 ++++++++------- .../datatypes/ext/EBusTypeDateTime.java | 16 +++- .../command/datatypes/ext/EBusTypeKWCrc.java | 8 +- .../command/datatypes/ext/EBusTypeTime.java | 82 +++++++++++-------- .../command/datatypes/std/EBusTypeBCD.java | 8 +- .../java/de/csdev/ebus/core/EBusVersion.java | 2 +- .../de/csdev/ebus/core/IEBusController.java | 8 +- .../ebus/core/connection/IEBusConnection.java | 3 + .../device/EBusDeviceTableService.java | 1 - .../de/csdev/ebus/utils/CollectionUtils.java | 5 ++ .../de/csdev/ebus/utils/EBusConsoleUtils.java | 28 +++---- .../de/csdev/ebus/utils/EBusDateTime.java | 6 +- .../csdev/ebus/utils/EBusTelegramWriter.java | 1 + .../java/de/csdev/ebus/utils/EBusUtils.java | 24 +++--- .../java/de/csdev/ebus/utils/NumberUtils.java | 2 + 34 files changed, 278 insertions(+), 186 deletions(-) diff --git a/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java b/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java index c90dba3..01d61f4 100644 --- a/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java +++ b/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java @@ -8,10 +8,13 @@ */ package de.csdev.ebus.cfg; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusConfigurationReaderException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java b/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java index 65457ea..79d8687 100644 --- a/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java +++ b/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java @@ -358,7 +358,7 @@ protected EBusCommand parseTelegramConfiguration(@NonNull IEBusCommandCollection * @return */ protected @NonNull List<@NonNull EBusValueDTO> checkedList(List master) { - List templates = new ArrayList<>(); + List<@NonNull EBusValueDTO> templates = new ArrayList<>(); if (master != null) { for (EBusValueDTO template : master) { if (template != null) { @@ -570,12 +570,16 @@ protected EBusCommand parseTelegramConfiguration(@NonNull IEBusCommandCollection } private void overwritePropertiesFromTemplate(@NonNull EBusCommandValue clone, @NonNull EBusValueDTO template) { + + String templateLabel = template.getLabel(); + String cloneLabel = clone.getLabel(); + // allow placeholders in template-block mode - if (StringUtils.isNotEmpty(template.getLabel())) { - if (StringUtils.isNotEmpty(clone.getLabel()) && clone.getLabel().contains("%s")) { - clone.setLabel(String.format(clone.getLabel(), template.getLabel())); + if (StringUtils.isNotEmpty(templateLabel)) { + if (StringUtils.isNotEmpty(cloneLabel) && cloneLabel.contains("%s")) { + clone.setLabel(String.format(cloneLabel, templateLabel)); } else { - clone.setLabel(template.getLabel()); + clone.setLabel(templateLabel); } } } diff --git a/src/main/java/de/csdev/ebus/client/EBusClient.java b/src/main/java/de/csdev/ebus/client/EBusClient.java index 190f314..9a59ad4 100644 --- a/src/main/java/de/csdev/ebus/client/EBusClient.java +++ b/src/main/java/de/csdev/ebus/client/EBusClient.java @@ -91,8 +91,10 @@ public void addEBusDeviceTableListener(final @NonNull IEBusDeviceTableListener l */ public void addEBusEventListener(final @NonNull IEBusConnectorEventListener listener) { Objects.requireNonNull(listener, LABEL_LISTENER); - if (controller != null) { - controller.addEBusEventListener(listener); + IEBusController ctrl = this.controller; + + if (ctrl != null) { + ctrl.addEBusEventListener(listener); } else { throw new IllegalStateException("Controller is not initialized!"); } @@ -120,12 +122,13 @@ public void addEBusParserListener(final @NonNull IEBusParserListener listener) { public @NonNull Integer addToSendQueue(final byte @NonNull [] buffer) throws EBusControllerException { Objects.requireNonNull(buffer, "buffer"); + IEBusController ctrl = this.controller; - if (controller == null) { + if (ctrl == null) { throw new EBusControllerException("Controller not set!"); } - return controller.addToSendQueue(buffer); + return ctrl.addToSendQueue(buffer); } /** @@ -139,11 +142,13 @@ public void addEBusParserListener(final @NonNull IEBusParserListener listener) { */ public @NonNull Integer addToSendQueue(final byte @NonNull [] buffer, final int maxAttemps) throws EBusControllerException { - if (this.controller == null) { + IEBusController ctrl = this.controller; + + if (ctrl == null) { throw new EBusControllerException("Controller not set!"); } - return this.controller.addToSendQueue(buffer, maxAttemps); + return ctrl.addToSendQueue(buffer, maxAttemps); } /** @@ -179,31 +184,35 @@ public void connect(final @NonNull IEBusController controller, final byte master controller.addEBusEventListener(resolverService); deviceTable.setOwnAddress(masterAddress); - deviceTableService = new EBusDeviceTableService(controller, commandRegistry, deviceTable); - + // add device table service - resolverService.addEBusParserListener(deviceTableService); - deviceTable.addEBusDeviceTableListener(deviceTableService); + EBusDeviceTableService lDeviceTableService = new EBusDeviceTableService(controller, commandRegistry, deviceTable); + resolverService.addEBusParserListener(lDeviceTableService); + deviceTable.addEBusDeviceTableListener(lDeviceTableService); // add metrics service controller.addEBusEventListener(metricsService); resolverService.addEBusParserListener(metricsService); this.controller = controller; + this.deviceTableService = lDeviceTableService; } /** * Disposes the eBUS client with all depended services */ public void dispose() { - if (controller != null) { - controller.interrupt(); - controller = null; + + IEBusController ctrl = this.controller; + if (ctrl != null) { + ctrl.interrupt(); + this.controller = null; } - if (deviceTableService != null) { - deviceTableService.dispose(); - deviceTableService = null; + EBusDeviceTableService lDeviceTableService = this.deviceTableService; + if (lDeviceTableService != null) { + lDeviceTableService.dispose(); + this.deviceTableService = null; } if (deviceTable != null) { @@ -307,9 +316,12 @@ public boolean removeEBusDeviceTableListener(final @NonNull IEBusDeviceTableList public boolean removeEBusEventListener(final @NonNull IEBusConnectorEventListener listener) { Objects.requireNonNull(listener); - if (controller != null) { - return controller.removeEBusEventListener(listener); + IEBusController ctrl = this.controller; + + if (ctrl != null) { + return ctrl.removeEBusEventListener(listener); } + return false; } diff --git a/src/main/java/de/csdev/ebus/command/EBusCommand.java b/src/main/java/de/csdev/ebus/command/EBusCommand.java index 8a8aad4..a0cd367 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommand.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommand.java @@ -28,7 +28,7 @@ @NonNullByDefault public class EBusCommand implements IEBusCommand { - private Map channels = new EnumMap<>(IEBusCommandMethod.Method.class); + private Map channels = new EnumMap<>(IEBusCommandMethod.Method.class); private @Nullable String configurationSource; @@ -48,18 +48,18 @@ public void addCommandChannel(IEBusCommandMethod channel) { } @Override - public @NonNull Collection getCommandChannelMethods() { + public Collection getCommandChannelMethods() { return Objects.requireNonNull(Collections.unmodifiableCollection(channels.keySet())); } @Override - public @Nullable IEBusCommandMethod getCommandMethod(IEBusCommandMethod.@NonNull Method channel) { + public @Nullable IEBusCommandMethod getCommandMethod(IEBusCommandMethod.Method channel) { Objects.requireNonNull(channel); return CollectionUtils.get(channels, channel); } @Override - public @NonNull Collection<@NonNull IEBusCommandMethod> getCommandMethods() { + public @NonNull Collection getCommandMethods() { return Objects.requireNonNull(Collections.unmodifiableCollection(channels.values())); } @@ -89,7 +89,7 @@ public void addCommandChannel(IEBusCommandMethod channel) { * @see de.csdev.ebus.command.IEBusCommand#getId() */ @Override - public @NonNull String getId() { + public String getId() { return Objects.requireNonNull(id); } @@ -109,7 +109,7 @@ public IEBusCommandCollection getParentCollection() { } @Override - public Map<@NonNull String, @NonNull Object> getProperties() { + public Map getProperties() { return Objects.requireNonNull(CollectionUtils.unmodifiableNotNullMap(properties)); } @@ -138,8 +138,9 @@ public void setParentCollection(IEBusCommandCollection parentCollection) { public void setProperties(Map properties) { Objects.requireNonNull(properties, "properties"); - this.properties = new HashMap<>(); - this.properties.putAll(properties); + HashMap props = new HashMap<>(); + props.putAll(properties); + this.properties = props; } public void setProperty(String key, String value) { diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java b/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java index fb31246..371e543 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandCollection.java @@ -29,17 +29,17 @@ @NonNullByDefault public class EBusCommandCollection implements IEBusCommandCollection { - private @NonNull Map commands = new HashMap<>(); + private Map commands = new HashMap<>(); - private @NonNull String description; + private String description; - private @NonNull String id; + private String id; - private @NonNull List identification = new ArrayList<>(); + private List identification = new ArrayList<>(); - private @NonNull String label; + private String label; - private @NonNull Map properties = new HashMap<>(); + private Map properties = new HashMap<>(); private byte[] sourceHash; @@ -54,6 +54,7 @@ public EBusCommandCollection(final String id, final String label, final String d this.label = label; this.description = description; this.properties.putAll(properties); + this.sourceHash = new byte[]{}; } public void addCommand(final IEBusCommand command) { @@ -133,7 +134,7 @@ public String getLabel() { * @see de.csdev.ebus.command.IEBusCommandCollection#getProperty(java.lang.String) */ @Override - public Object getProperty(final String key) { + public @Nullable Object getProperty(final String key) { return CollectionUtils.get(properties, key); } @@ -155,7 +156,7 @@ public String toString() { } @Override - public IEBusCommand getCommand(final String id) { + public @Nullable IEBusCommand getCommand(final String id) { return commands.get(id); } diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandException.java b/src/main/java/de/csdev/ebus/command/EBusCommandException.java index 21717c5..9c085e7 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandException.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandException.java @@ -10,10 +10,13 @@ import java.text.MessageFormat; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusCommandException extends Exception { private static final long serialVersionUID = 7105215995176921667L; diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java b/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java index 03b63a1..2b9117a 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandMethod.java @@ -176,8 +176,9 @@ public Byte getSourceAddress() { @Override public @NonNull Type getType() { - if (type != null) { - return type; + Type type0 = this.type; + if (type0 != null) { + return type0; } if (method.equals(Method.BROADCAST)) { diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java b/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java index e6e4b26..6df3c75 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java @@ -31,6 +31,7 @@ import de.csdev.ebus.command.datatypes.EBusTypeException; import de.csdev.ebus.command.datatypes.EBusTypeRegistry; import de.csdev.ebus.core.EBusConsts; +import de.csdev.ebus.utils.CollectionUtils; import de.csdev.ebus.utils.EBusUtils; /** @@ -67,9 +68,13 @@ public EBusCommandRegistry(Class readerClass try { this.typeRegistry = new EBusTypeRegistry(); - this.reader = readerClass.getDeclaredConstructor().newInstance(); - reader.setEBusTypes(this.typeRegistry); - + IEBusConfigurationReader lReader = readerClass.getDeclaredConstructor().newInstance(); + if (lReader == null) { + throw new IllegalStateException("Unable to create a new eBUS Configuration Reader instance!"); + } + lReader.setEBusTypes(this.typeRegistry); + this.reader = lReader; + if (loadBuildInCommands) { loadBuildInCommandCollections(); } @@ -140,6 +145,11 @@ public void addCommandCollection(IEBusCommandCollection collection) { Objects.requireNonNull(data); ByteBuffer buffer = ByteBuffer.wrap(data); + + if (buffer == null) { + return CollectionUtils.emptyList(); + } + return find(buffer); } @@ -244,9 +254,9 @@ public EBusTypeRegistry getTypeRegistry() { */ public boolean matchesCommand(@NonNull IEBusCommandMethod command, @NonNull ByteBuffer data) { - Byte sourceAddress = (Byte) ObjectUtils.defaultIfNull(command.getSourceAddress(), Byte.valueOf((byte) 0x00)); + Byte sourceAddress = ObjectUtils.defaultIfNull(command.getSourceAddress(), Byte.valueOf((byte) 0x00)); - Byte targetAddress = (Byte) ObjectUtils.defaultIfNull(command.getDestinationAddress(), + Byte targetAddress = ObjectUtils.defaultIfNull(command.getDestinationAddress(), Byte.valueOf((byte) 0x00)); // fast check - is this the right telegram type? diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java b/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java index ed2928d..413e0d4 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java @@ -206,7 +206,7 @@ public static byte unescapeSymbol(byte reversedByte) { for (byte b : masterData) { // disable escaping the special characters as vaillant and wolf // generates AA and A9 bytes! - // buf.put(escapeSymbol(b)); + // buf.put(escapeSymbol(b)) buf.put(b); } @@ -215,7 +215,7 @@ public static byte unescapeSymbol(byte reversedByte) { // disable escaping the special characters as vaillant and wolf // generates AA and A9 bytes! - // buf.put(escapeSymbol(b)); + // buf.put(escapeSymbol(b)) buf.put(crc8); // set limit and reset position diff --git a/src/main/java/de/csdev/ebus/command/IEBusCommand.java b/src/main/java/de/csdev/ebus/command/IEBusCommand.java index 819078b..f483194 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusCommand.java +++ b/src/main/java/de/csdev/ebus/command/IEBusCommand.java @@ -11,7 +11,7 @@ import java.util.Collection; import java.util.Map; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; /** @@ -20,6 +20,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusCommand { /** @@ -27,7 +28,7 @@ public interface IEBusCommand { * * @return */ - public @NonNull Collection<@NonNull IEBusCommandMethod> getCommandMethods(); + public Collection getCommandMethods(); /** * Returns the command method if available. Returns null if not availble. @@ -35,14 +36,14 @@ public interface IEBusCommand { * @param method * @return */ - public @Nullable IEBusCommandMethod getCommandMethod(final IEBusCommandMethod.@NonNull Method method); + public @Nullable IEBusCommandMethod getCommandMethod(final IEBusCommandMethod.Method method); /** * Returns the available command method enums. * * @return */ - public @NonNull Collection getCommandChannelMethods(); + public Collection getCommandChannelMethods(); /** * Returns device information from database @@ -70,19 +71,19 @@ public interface IEBusCommand { * * @return */ - public @NonNull String getId(); + public String getId(); /** * Returns a map of additional properties * * @return */ - public @NonNull Map<@NonNull String, @NonNull Object> getProperties(); + public Map getProperties(); /** * Returns the parent collection * * @return */ - public @NonNull IEBusCommandCollection getParentCollection(); + public IEBusCommandCollection getParentCollection(); } diff --git a/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java b/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java index 8061334..2ced40b 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java +++ b/src/main/java/de/csdev/ebus/command/IEBusCommandCollection.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Map; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; /** @@ -21,6 +21,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusCommandCollection { /** @@ -28,7 +29,7 @@ public interface IEBusCommandCollection { * * @return */ - public @NonNull List getIdentification(); + public List getIdentification(); /** * Returns the long description @@ -42,7 +43,7 @@ public interface IEBusCommandCollection { * * @return */ - public @NonNull String getId(); + public String getId(); /** * Returns the label of this collection @@ -56,7 +57,7 @@ public interface IEBusCommandCollection { * * @return */ - public @NonNull Collection getCommands(); + public Collection getCommands(); /** * Returns the requested command or null @@ -71,7 +72,7 @@ public interface IEBusCommandCollection { * * @return */ - public @NonNull Map getProperties(); + public Map getProperties(); /** * Returns a property value or null diff --git a/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java b/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java index 5ca6c25..705ec1a 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java +++ b/src/main/java/de/csdev/ebus/command/IEBusCommandMethod.java @@ -11,13 +11,14 @@ import java.nio.ByteBuffer; import java.util.List; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusCommandMethod { /** @@ -56,21 +57,21 @@ public enum Method { * * @return */ - public IEBusCommandMethod.@NonNull Type getType(); + public IEBusCommandMethod.Type getType(); /** * Returns the parent command * * @return */ - public @NonNull IEBusCommand getParent(); + public IEBusCommand getParent(); /** * Returns the type of this command * * @return */ - public IEBusCommandMethod.@NonNull Method getMethod(); + public IEBusCommandMethod.Method getMethod(); /** * Returns defined destination address or null if not defined @@ -91,27 +92,27 @@ public enum Method { * * @return */ - public @NonNull ByteBuffer getMasterTelegramMask(); + public ByteBuffer getMasterTelegramMask(); /** * Get ordered list of eBus data types for the master part * * @return */ - public @Nullable List<@NonNull IEBusValue> getMasterTypes(); + public @Nullable List getMasterTypes(); /** * Get ordered list of eBus data types for the slave part * * @return */ - public @Nullable List<@NonNull IEBusValue> getSlaveTypes(); + public @Nullable List getSlaveTypes(); /** * Returns the eBus command bytes * * @return */ - public byte @NonNull [] getCommand(); + public byte[] getCommand(); } diff --git a/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java b/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java index a8dd971..1c43263 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java +++ b/src/main/java/de/csdev/ebus/command/IEBusNestedValue.java @@ -10,7 +10,7 @@ import java.util.List; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; /** * A marker of a value with child values @@ -18,6 +18,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusNestedValue { /** @@ -32,6 +33,6 @@ public interface IEBusNestedValue { * * @return */ - public @NonNull List<@NonNull IEBusValue> getChildren(); + public List getChildren(); } diff --git a/src/main/java/de/csdev/ebus/command/IEBusValue.java b/src/main/java/de/csdev/ebus/command/IEBusValue.java index 8f46549..567c256 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusValue.java +++ b/src/main/java/de/csdev/ebus/command/IEBusValue.java @@ -11,7 +11,7 @@ import java.math.BigDecimal; import java.util.Map; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.IEBusType; @@ -22,6 +22,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusValue { /** @@ -30,7 +31,7 @@ public interface IEBusValue { * @return */ - public @NonNull IEBusType getType(); + public IEBusType getType(); /** * Returns the default value if set, can be null @@ -115,5 +116,5 @@ public interface IEBusValue { * * @return */ - public @NonNull IEBusValue getClonedInstance(); + public IEBusValue getClonedInstance(); } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java index 033983b..62fb4fa 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java @@ -161,7 +161,7 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { * @return */ protected boolean equalsReplaceValue(byte[] data) { - return ArrayUtils.isEquals(data, getReplaceValue()); + return Objects.deepEquals(data, getReplaceValue()); } /* diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java index 00fa7ed..9cd8cb3 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java @@ -64,7 +64,7 @@ public EBusTypeRegistry() throws EBusTypeException { * @throws EBusTypeException */ protected void init() throws EBusTypeException { - types = new HashMap>(); + types = new HashMap<>(); // primary types add(EBusTypeBit.class); @@ -102,7 +102,7 @@ protected void init() throws EBusTypeException { * @param properties * @return */ - public IEBusType getType(String type, Map properties) { + public @Nullable IEBusType getType(String type, Map properties) { IEBusType ebusType = getType(type); if (ebusType != null) { @@ -117,7 +117,7 @@ public IEBusType getType(String type, Map properties) { * @param propertiesArguments * @return */ - public IEBusType getType(String type, Object... propertiesArguments) { + public @Nullable IEBusType getType(String type, Object... propertiesArguments) { Map properties = CollectionUtils.createProperties(propertiesArguments); return this.getType(type, properties); } @@ -128,7 +128,7 @@ public IEBusType getType(String type, Object... propertiesArguments) { * @param type * @return */ - public IEBusType getType(String type) { + public @Nullable IEBusType getType(String type) { @SuppressWarnings("unchecked") IEBusType eBusType = (IEBusType) types.get(type); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java b/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java index f55f6a6..d9309c1 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/IEBusComplexType.java @@ -8,10 +8,14 @@ */ package de.csdev.ebus.command.datatypes; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusComplexType { /** @@ -22,7 +26,7 @@ public interface IEBusComplexType { * @return * @throws EBusTypeException */ - public T decodeComplex(byte[] rawData, int pos) throws EBusTypeException; + public @Nullable T decodeComplex(byte[] rawData, int pos) throws EBusTypeException; /** * ??? diff --git a/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java b/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java index f29f6c2..367b049 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java @@ -10,12 +10,14 @@ import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusType { public static final String LENGTH = "length"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java index 6e29574..784a54d 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java @@ -43,7 +43,7 @@ public byte[] encodeInt(@Nullable Object data) { byte[] b = new byte[length]; - if (data != null && data instanceof byte[]) { + if (data instanceof byte[]) { System.arraycopy(data, 0, b, 0, b.length); } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java index 9e7d004..47e92b0 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java @@ -159,6 +159,10 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { IEBusType wordType = types.getType(EBusTypeWord.TYPE_WORD); IEBusType charType = types.getType(EBusTypeChar.TYPE_CHAR); + if (bcdType == null || wordType == null || charType == null) { + throw new EBusTypeException("Unable to get all required EBusTyp's type!"); + } + Calendar calendar = null; byte[] result = new byte[this.getTypeLength()]; @@ -180,51 +184,51 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); - if (calendar != null) { - if (StringUtils.equals(variant, DEFAULT)) { - int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); - dayOfWeek = dayOfWeek == 1 ? 7 : dayOfWeek - 1; + if (StringUtils.equals(variant, DEFAULT)) { - result = new byte[] { bcdType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], - bcdType.encode(calendar.get(Calendar.MONTH) + 1)[0], bcdType.encode(dayOfWeek)[0], - bcdType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); + dayOfWeek = dayOfWeek == 1 ? 7 : dayOfWeek - 1; - } else if (StringUtils.equals(variant, SHORT)) { + result = new byte[] { bcdType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], + bcdType.encode(calendar.get(Calendar.MONTH) + 1)[0], bcdType.encode(dayOfWeek)[0], + bcdType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; - result = new byte[] { bcdType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], - bcdType.encode(calendar.get(Calendar.MONTH) + 1)[0], - bcdType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; + } else if (StringUtils.equals(variant, SHORT)) { - } else if (StringUtils.equals(variant, HEX)) { + result = new byte[] { bcdType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], + bcdType.encode(calendar.get(Calendar.MONTH) + 1)[0], + bcdType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; + + } else if (StringUtils.equals(variant, HEX)) { - int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); - dayOfWeek = dayOfWeek == 1 ? 7 : dayOfWeek - 1; + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); + dayOfWeek = dayOfWeek == 1 ? 7 : dayOfWeek - 1; - result = new byte[] { charType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], - charType.encode(calendar.get(Calendar.MONTH) + 1)[0], charType.encode(dayOfWeek)[0], - charType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; + result = new byte[] { charType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], + charType.encode(calendar.get(Calendar.MONTH) + 1)[0], charType.encode(dayOfWeek)[0], + charType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; - } else if (StringUtils.equals(variant, HEX_SHORT)) { + } else if (StringUtils.equals(variant, HEX_SHORT)) { - result = new byte[] { charType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], - charType.encode(calendar.get(Calendar.MONTH) + 1)[0], - charType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; + result = new byte[] { charType.encode(calendar.get(Calendar.DAY_OF_MONTH))[0], + charType.encode(calendar.get(Calendar.MONTH) + 1)[0], + charType.encode(calendar.get(Calendar.YEAR) % 100)[0] }; - } else if (StringUtils.equals(variant, DAYS)) { + } else if (StringUtils.equals(variant, DAYS)) { - long millis = calendar.getTimeInMillis(); + long millis = calendar.getTimeInMillis(); - calendar.clear(); - calendar.set(1900, 0, 1, 0, 0); - long millis1900 = calendar.getTimeInMillis(); + calendar.clear(); + calendar.set(1900, 0, 1, 0, 0); + long millis1900 = calendar.getTimeInMillis(); - BigDecimal days = new BigDecimal(millis - millis1900); - days = days.divide(BigDecimal.valueOf(86400000), 0, RoundingMode.HALF_UP); + BigDecimal days = new BigDecimal(millis - millis1900); + days = days.divide(BigDecimal.valueOf(86400000), 0, RoundingMode.HALF_UP); - result = wordType.encode(days); - } + result = wordType.encode(days); } + return result; } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java index 4b7bba4..196d7ea 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java @@ -62,6 +62,10 @@ public EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { IEBusType dateType = getDateType(); IEBusType timeType = getTimeType(); + if (dateType == null || timeType == null) { + throw new EBusTypeException("Unable to get all required EBusTyp's type!"); + } + byte[] timeData = null; byte[] dateData = null; @@ -113,6 +117,10 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { IEBusType dateType = getDateType(); IEBusType timeType = getTimeType(); + if (dateType == null || timeType == null) { + throw new EBusTypeException("Unable to get all required EBusTyp's type!"); + } + Calendar calendar = null; byte[] result = new byte[this.getTypeLength()]; @@ -142,7 +150,7 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { } private IEBusType getDateType() { - Map properties = new HashMap(); + Map properties = new HashMap<>(); properties.put(IEBusType.VARIANT, variantDate); return types.getType(EBusTypeDate.TYPE_DATE, properties); } @@ -153,7 +161,7 @@ public String[] getSupportedTypes() { } private IEBusType getTimeType() { - Map properties = new HashMap(); + Map properties = new HashMap<>(); properties.put(IEBusType.VARIANT, variantTime); return types.getType(EBusTypeTime.TYPE_TIME, properties); } @@ -163,6 +171,10 @@ public int getTypeLength() { IEBusType dateType = getDateType(); IEBusType timeType = getTimeType(); + if (dateType == null || timeType == null) { + throw new IllegalStateException("Unable to get all required EBusTyp's type!"); + } + return dateType.getTypeLength() + timeType.getTypeLength(); } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java index 5a70560..0bb12cf 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java @@ -46,13 +46,13 @@ public String[] getSupportedTypes() { } @Override - public Byte decodeInt(byte @Nullable [] data) { - throw new RuntimeException("Not implemented by EBusTypeKWCrc!"); + public Byte decodeInt(byte @Nullable [] data) throws EBusTypeException { + throw new EBusTypeException("Not implemented by EBusTypeKWCrc!"); } @Override - public byte[] encodeInt(@Nullable Object data) { - throw new RuntimeException("Not implemented by EBusTypeKWCrc!"); + public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + throw new EBusTypeException("Not implemented by EBusTypeKWCrc!"); } @Override diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java index dd1447e..73f14cc 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java @@ -90,25 +90,28 @@ public EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { throw new EBusTypeException("Input byte array must have a length of %d bytes!", getTypeLength()); } + IEBusType bcdType = types.getType(EBusTypeBCD.TYPE_BCD); + IEBusType charType = types.getType(EBusTypeChar.TYPE_CHAR); + + if (bcdType == null || charType == null) { + throw new EBusTypeException("Unable to get all required EBusTyp's type!"); + } + if (StringUtils.equals(variant, SHORT)) { - IEBusType bcdType = types.getType(EBusTypeBCD.TYPE_BCD); minute = bcdType.decode(new byte[] { data[0] }); hour = bcdType.decode(new byte[] { data[1] }); } else if (StringUtils.equals(variant, DEFAULT)) { - IEBusType bcdType = types.getType(EBusTypeBCD.TYPE_BCD); second = bcdType.decode(new byte[] { data[0] }); minute = bcdType.decode(new byte[] { data[1] }); hour = bcdType.decode(new byte[] { data[2] }); } else if (StringUtils.equals(variant, HEX)) { - IEBusType charType = types.getType(EBusTypeChar.TYPE_CHAR); second = charType.decode(new byte[] { data[0] }); minute = charType.decode(new byte[] { data[1] }); hour = charType.decode(new byte[] { data[2] }); } else if (StringUtils.equals(variant, HEX_SHORT)) { - IEBusType charType = types.getType(EBusTypeChar.TYPE_CHAR); minute = charType.decode(new byte[] { data[0] }); hour = charType.decode(new byte[] { data[1] }); @@ -117,9 +120,15 @@ public EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { BigDecimal minutesSinceMidnight = null; if (StringUtils.equals(variant, MINUTES_SHORT)) { IEBusType type = types.getType(EBusTypeUnsignedNumber.TYPE_UNUMBER, IEBusType.LENGTH, 1); + if (type == null) { + throw new EBusTypeException("Unable to get required EBusTyp type!"); + } minutesSinceMidnight = type.decode(data); } else { IEBusType type = types.getType(EBusTypeUnsignedNumber.TYPE_UNUMBER, IEBusType.LENGTH, 2); + if (type == null) { + throw new EBusTypeException("Unable to get required EBusTyp type!"); + } minutesSinceMidnight = type.decode(data); } @@ -156,6 +165,10 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { IEBusType wordType = types.getType(EBusTypeWord.TYPE_WORD); IEBusType charType = types.getType(EBusTypeChar.TYPE_CHAR); + if (bcdType == null || wordType == null || charType == null) { + throw new EBusTypeException("Unable to get all required EBusTyp's type!"); + } + Calendar calendar = null; byte[] result = new byte[this.getTypeLength()]; @@ -174,54 +187,53 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { calendar = (Calendar) calendar.clone(); calendar.set(1970, 0, 1); - if (calendar != null) { - if (StringUtils.equals(variant, DEFAULT)) { - result = new byte[] { bcdType.encode(calendar.get(Calendar.SECOND))[0], - bcdType.encode(calendar.get(Calendar.MINUTE))[0], - bcdType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; + if (StringUtils.equals(variant, DEFAULT)) { - } else if (StringUtils.equals(variant, SHORT)) { + result = new byte[] { bcdType.encode(calendar.get(Calendar.SECOND))[0], + bcdType.encode(calendar.get(Calendar.MINUTE))[0], + bcdType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; - result = new byte[] { bcdType.encode(calendar.get(Calendar.MINUTE))[0], - bcdType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; + } else if (StringUtils.equals(variant, SHORT)) { - } else if (StringUtils.equals(variant, HEX)) { + result = new byte[] { bcdType.encode(calendar.get(Calendar.MINUTE))[0], + bcdType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; - result = new byte[] { charType.encode(calendar.get(Calendar.SECOND))[0], - charType.encode(calendar.get(Calendar.MINUTE))[0], - charType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; + } else if (StringUtils.equals(variant, HEX)) { - } else if (StringUtils.equals(variant, HEX_SHORT)) { + result = new byte[] { charType.encode(calendar.get(Calendar.SECOND))[0], + charType.encode(calendar.get(Calendar.MINUTE))[0], + charType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; - result = new byte[] { charType.encode(calendar.get(Calendar.MINUTE))[0], - charType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; + } else if (StringUtils.equals(variant, HEX_SHORT)) { - } else if (StringUtils.equals(variant, MINUTES) || StringUtils.equals(variant, MINUTES_SHORT)) { + result = new byte[] { charType.encode(calendar.get(Calendar.MINUTE))[0], + charType.encode(calendar.get(Calendar.HOUR_OF_DAY))[0] }; - long millis = calendar.getTimeInMillis(); + } else if (StringUtils.equals(variant, MINUTES) || StringUtils.equals(variant, MINUTES_SHORT)) { - calendar.clear(); - calendar.set(1970, 0, 1, 0, 0, 0); - calendar.set(Calendar.MILLISECOND, 0); + long millis = calendar.getTimeInMillis(); - long millisMidnight = calendar.getTimeInMillis(); + calendar.clear(); + calendar.set(1970, 0, 1, 0, 0, 0); + calendar.set(Calendar.MILLISECOND, 0); - BigDecimal minutes = new BigDecimal(millis - millisMidnight); + long millisMidnight = calendar.getTimeInMillis(); - // milliseconds to minutes - minutes = minutes.divide(BigDecimal.valueOf(1000 * 60), 0, RoundingMode.HALF_UP); + BigDecimal minutes = new BigDecimal(millis - millisMidnight); - // xxx - minutes = minutes.divide(minuteMultiplier, 0, RoundingMode.HALF_UP); + // milliseconds to minutes + minutes = minutes.divide(BigDecimal.valueOf(1000L * 60), 0, RoundingMode.HALF_UP); - if (StringUtils.equals(variant, MINUTES_SHORT)) { - result = charType.encode(minutes); - } else { - result = wordType.encode(minutes); - } + // xxx + minutes = minutes.divide(minuteMultiplier, 0, RoundingMode.HALF_UP); + if (StringUtils.equals(variant, MINUTES_SHORT)) { + result = charType.encode(minutes); + } else { + result = wordType.encode(minutes); } + } return result; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java index f31939e..b05ed9d 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java @@ -11,6 +11,8 @@ import java.math.BigDecimal; import java.util.Objects; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -26,7 +28,7 @@ public class EBusTypeBCD extends EBusAbstractType { public static final String TYPE_BCD = "bcd"; - private static String[] supportedTypes = new String[] { TYPE_BCD }; + private static final String[] supportedTypes = new String[] { TYPE_BCD }; private int length = 1; @@ -34,9 +36,11 @@ public EBusTypeBCD() { replaceValue = new byte[] { (byte) 0xFF }; } + // @NonNullByDefault({}) @Override - public String[] getSupportedTypes() { + public @NonNull String[] getSupportedTypes() { return supportedTypes; + // return new String[] { TYPE_BCD }; } @Override diff --git a/src/main/java/de/csdev/ebus/core/EBusVersion.java b/src/main/java/de/csdev/ebus/core/EBusVersion.java index 0aa6382..7033644 100644 --- a/src/main/java/de/csdev/ebus/core/EBusVersion.java +++ b/src/main/java/de/csdev/ebus/core/EBusVersion.java @@ -25,7 +25,7 @@ private static String getAttribute(final Class rootClass, final String name) Manifest manifest = new Manifest(rootClass.getResourceAsStream("/META-INF/MANIFEST.MF")); return manifest.getMainAttributes().getValue(name); } catch (IOException e) { - + // noop } return ""; } diff --git a/src/main/java/de/csdev/ebus/core/IEBusController.java b/src/main/java/de/csdev/ebus/core/IEBusController.java index 6adeda4..fb85db9 100644 --- a/src/main/java/de/csdev/ebus/core/IEBusController.java +++ b/src/main/java/de/csdev/ebus/core/IEBusController.java @@ -9,10 +9,11 @@ package de.csdev.ebus.core; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; +@NonNullByDefault public interface IEBusController { - @NonNull Integer addToSendQueue(final byte @NonNull [] buffer, final int maxAttemps) throws EBusControllerException; /** @@ -20,7 +21,6 @@ public interface IEBusController { * @return * @throws EBusControllerException */ - @NonNull Integer addToSendQueue(final byte @NonNull [] buffer) throws EBusControllerException; /** @@ -28,7 +28,7 @@ public interface IEBusController { * * @param listener */ - void addEBusEventListener(final @NonNull IEBusConnectorEventListener listener); + void addEBusEventListener(final IEBusConnectorEventListener listener); /** * Remove an eBUS listener @@ -36,7 +36,7 @@ public interface IEBusController { * @param listener * @return */ - boolean removeEBusEventListener(final @NonNull IEBusConnectorEventListener listener); + boolean removeEBusEventListener(final IEBusConnectorEventListener listener); boolean isRunning(); diff --git a/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java b/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java index 5e18a64..c1e0303 100644 --- a/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/IEBusConnection.java @@ -10,10 +10,13 @@ import java.io.IOException; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public interface IEBusConnection { /** diff --git a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java index 2f8101a..3af6499 100644 --- a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java +++ b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java @@ -36,7 +36,6 @@ * @author Christian Sowada - Initial contribution * */ -@NonNullByDefault public class EBusDeviceTableService extends EBusConnectorEventListener implements IEBusParserListener, IEBusDeviceTableListener { diff --git a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java index 8fe0013..2486519 100644 --- a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java +++ b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java @@ -10,6 +10,7 @@ import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -26,6 +27,10 @@ private CollectionUtils() { throw new IllegalStateException("Utility class"); } + public static final @NonNull List emptyList() { + return Collections.emptyList(); + } + /** * A null checked variant of map.get * diff --git a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java index baa66e2..944fa85 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java +++ b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java @@ -117,14 +117,14 @@ public static String bruteforceData(byte @Nullable [] data) throws EBusTypeExcep StringBuilder sb = new StringBuilder(); - sb.append(String.format("%-25s | %-10s\n", "Successful received", service.getReceived())); - sb.append(String.format("%-25s | %-10s\n", "Failed received", service.getFailed())); - sb.append(String.format("%-25s | %-10s\n", "Successful/Failed ratio", service.getFailureRatio())); + sb.append(String.format("%-25s | %-10s%n", "Successful received", service.getReceived())); + sb.append(String.format("%-25s | %-10s%n", "Failed received", service.getFailed())); + sb.append(String.format("%-25s | %-10s%n", "Successful/Failed ratio", service.getFailureRatio())); sb.append("\n"); - sb.append(String.format("%-25s | %-10s\n", "Resolved telegrams", service.getResolved())); - sb.append(String.format("%-25s | %-10s\n", "Unresolved telegrams", service.getUnresolved())); - sb.append(String.format("%-25s | %-10s\n", "Resolved/Unresolved ratio", service.getUnresolvedRatio())); + sb.append(String.format("%-25s | %-10s%n", "Resolved telegrams", service.getResolved())); + sb.append(String.format("%-25s | %-10s%n", "Unresolved telegrams", service.getUnresolved())); + sb.append(String.format("%-25s | %-10s%n", "Resolved/Unresolved ratio", service.getUnresolvedRatio())); return sb.toString(); } @@ -149,10 +149,10 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu EBusDevice ownDevice = deviceTable.getOwnDevice(); - sb.append(String.format("%-2s | %-2s | %-14s | %-14s | %-25s | %-2s | %-10s | %-10s | %-20s\n", "MA", "SA", + sb.append(String.format("%-2s | %-2s | %-14s | %-14s | %-25s | %-2s | %-10s | %-10s | %-20s%n", "MA", "SA", "Identifier", "Device", "Manufacture", "ID", "Firmware", "Hardware", "Last Activity")); - sb.append(String.format("%-2s-+-%-2s-+-%-14s-+-%-14s-+-%-20s-+-%-2s-+-%-10s-+-%-10s-+-%-20s\n", + sb.append(String.format("%-2s-+-%-2s-+-%-14s-+-%-14s-+-%-20s-+-%-2s-+-%-10s-+-%-10s-+-%-20s%n", StringUtils.repeat("-", 2), StringUtils.repeat("-", 2), StringUtils.repeat("-", 14), StringUtils.repeat("-", 14), StringUtils.repeat("-", 20), StringUtils.repeat("-", 2), StringUtils.repeat("-", 10), StringUtils.repeat("-", 10), StringUtils.repeat("-", 20))); @@ -168,7 +168,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu String deviceName = isBridge ? "" : mapping.getOrDefault(id, "---"); String manufacture = isBridge ? "eBUS Library" : device.getManufacturerName(); - sb.append(String.format("%-2s | %-2s | %-14s | %-14s | %-25s | %-2s | %-10s | %-10s | %-20s\n", + sb.append(String.format("%-2s | %-2s | %-14s | %-14s | %-25s | %-2s | %-10s | %-10s | %-20s%n", masterAddress, slaveAddress, id, deviceName, manufacture, EBusUtils.toHexDumpString(device.getManufacturer()), device.getSoftwareVersion(), device.getHardwareVersion(), activity)); @@ -225,8 +225,8 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu sb.append("***************************\n"); sb.append("\n"); - sb.append(String.format("Original data : %s\n", EBusUtils.toHexDumpString(data))); - sb.append(String.format("Unescaped data: %s\n", EBusUtils.toHexDumpString(edata))); + sb.append(String.format("Original data : %s%n", EBusUtils.toHexDumpString(data))); + sb.append(String.format("Unescaped data: %s%n", EBusUtils.toHexDumpString(edata))); byte[] command = Arrays.copyOfRange(edata, 2, 4); @@ -312,7 +312,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu sb.append("Resolve the telegram\n"); sb.append("********************\n"); sb.append("\n"); - sb.append(String.format("Found %s command method(s) for this telegram.\n", methods.size())); + sb.append(String.format("Found %s command method(s) for this telegram.%n", methods.size())); sb.append("\n"); for (IEBusCommandMethod method : methods) { @@ -320,7 +320,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu if (method != null) { Map result = EBusCommandUtils.decodeTelegram(method, data); - sb.append(String.format("Values from command '%s' with method '%s' from collection '%s'\n", + sb.append(String.format("Values from command '%s' with method '%s' from collection '%s'%n", method.getParent().getId(), method.getMethod(), method.getParent().getParentCollection().getId())); @@ -331,7 +331,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu value = EBusUtils.toHexDumpString((byte[]) value); } - sb.append(String.format(" %-20s = %s\n", entry.getKey(), + sb.append(String.format(" %-20s = %s%n", entry.getKey(), value != null ? value.toString() : "NULL")); } } diff --git a/src/main/java/de/csdev/ebus/utils/EBusDateTime.java b/src/main/java/de/csdev/ebus/utils/EBusDateTime.java index 41ae3cf..8966ae0 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusDateTime.java +++ b/src/main/java/de/csdev/ebus/utils/EBusDateTime.java @@ -11,11 +11,15 @@ import java.text.SimpleDateFormat; import java.util.Calendar; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusDateTime { private Calendar calendar; @@ -96,7 +100,7 @@ public int hashCode() { } @Override - public boolean equals(Object obj) { + public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } diff --git a/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java b/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java index e5dd835..99c0636 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java +++ b/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java @@ -35,6 +35,7 @@ @NonNullByDefault public class EBusTelegramWriter implements IEBusParserListener { + @NonNullByDefault({}) private final Logger logger = LoggerFactory.getLogger(EBusTelegramWriter.class); private BufferedWriter writerResolved; diff --git a/src/main/java/de/csdev/ebus/utils/EBusUtils.java b/src/main/java/de/csdev/ebus/utils/EBusUtils.java index 7af7ed5..db45306 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusUtils.java +++ b/src/main/java/de/csdev/ebus/utils/EBusUtils.java @@ -12,7 +12,7 @@ import java.util.Objects; import org.apache.commons.lang3.StringUtils; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.core.EBusConsts; @@ -23,6 +23,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusUtils { private EBusUtils() { @@ -30,7 +31,7 @@ private EBusUtils() { } /** calculated crc values */ - protected static final byte CRC_TAB_8_VALUE[] = { (byte) 0x00, (byte) 0x9B, (byte) 0xAD, (byte) 0x36, (byte) 0xC1, + protected static final byte[] CRC_TAB_8_VALUE = { (byte) 0x00, (byte) 0x9B, (byte) 0xAD, (byte) 0x36, (byte) 0xC1, (byte) 0x5A, (byte) 0x6C, (byte) 0xF7, (byte) 0x19, (byte) 0x82, (byte) 0xB4, (byte) 0x2F, (byte) 0xD8, (byte) 0x43, (byte) 0x75, (byte) 0xEE, (byte) 0x32, (byte) 0xA9, (byte) 0x9F, (byte) 0x04, (byte) 0xF3, (byte) 0x68, (byte) 0x5E, (byte) 0xC5, (byte) 0x2B, (byte) 0xB0, (byte) 0x86, (byte) 0x1D, (byte) 0xEA, @@ -235,12 +236,11 @@ public static boolean isValidAddress(final byte address) { } /** - * FIXME: Badly programmed * * @param hexDumpString * @return */ - static public @Nullable Byte toByte(final String hexDumpString) { + public static @Nullable Byte toByte(final String hexDumpString) { if (StringUtils.isEmpty(hexDumpString)) { return null; } @@ -253,7 +253,7 @@ public static boolean isValidAddress(final byte address) { * @param buffer * @return */ - public static byte @NonNull [] toByteArray(@Nullable ByteBuffer buffer) { + public static byte[] toByteArray(@Nullable ByteBuffer buffer) { if (buffer == null) { return new byte[0]; @@ -281,7 +281,7 @@ public static boolean isValidAddress(final byte address) { * @param hexDumpString * @return */ - public static byte @NonNull [] toByteArray(final @Nullable String hexDumpString) throws NumberFormatException { + public static byte[] toByteArray(final @Nullable String hexDumpString) throws NumberFormatException { if (hexDumpString == null || StringUtils.isEmpty(hexDumpString)) { return new byte[0]; } @@ -303,7 +303,7 @@ public static boolean isValidAddress(final byte address) { * @param hexDumpString * @return */ - public static byte @NonNull [] toByteArray2(final @Nullable String hexDumpString) throws NumberFormatException { + public static byte[] toByteArray2(final @Nullable String hexDumpString) throws NumberFormatException { String h = hexDumpString; @@ -326,9 +326,9 @@ public static boolean isValidAddress(final byte address) { return result; } - public static @NonNull String mergeHexDumpStrings(final @Nullable String... args) { + public static String mergeHexDumpStrings(final @Nullable String... args) { - if (args == null) { + if (args.length == 0) { return ""; } @@ -349,7 +349,7 @@ public static boolean isValidAddress(final byte address) { * @param data The source * @return The hex string */ - public static @NonNull String toHexDumpString(final @Nullable Byte data) { + public static String toHexDumpString(final @Nullable Byte data) { if (data == null) { return ""; @@ -365,7 +365,7 @@ public static boolean isValidAddress(final byte address) { * @param data The source * @return The StringBuilder with hex dump */ - public static @NonNull StringBuilder toHexDumpString(final byte @Nullable [] data) { + public static StringBuilder toHexDumpString(final byte @Nullable [] data) { StringBuilder sb = new StringBuilder(); if (data != null && data.length > 0) { for (int i = 0; i < data.length; i++) { @@ -420,7 +420,7 @@ public static String toPrintHexDumpString(final @Nullable Byte data) { if (data != null) { return "0x" + String.format("%02X", (0xFF & data)); } - return null; + return ""; } /** diff --git a/src/main/java/de/csdev/ebus/utils/NumberUtils.java b/src/main/java/de/csdev/ebus/utils/NumberUtils.java index e32c60f..546ab2d 100644 --- a/src/main/java/de/csdev/ebus/utils/NumberUtils.java +++ b/src/main/java/de/csdev/ebus/utils/NumberUtils.java @@ -10,6 +10,7 @@ import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; /** @@ -18,6 +19,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class NumberUtils { private NumberUtils() { From e48359c811e3a3a53c607fc0324f7501205a42f7 Mon Sep 17 00:00:00 2001 From: csowada Date: Thu, 23 Mar 2023 21:18:34 +0100 Subject: [PATCH 06/10] more sonar lint --- .../ebus/command/EBusCommandRegistry.java | 1 + .../csdev/ebus/command/EBusCommandUtils.java | 4 + .../csdev/ebus/command/EBusCommandValue.java | 80 +++++++++---------- .../de/csdev/ebus/command/IEBusValue.java | 1 - .../command/datatypes/EBusAbstractType.java | 16 ++-- .../command/datatypes/EBusTypeRegistry.java | 2 +- .../command/datatypes/ext/EBusTypeBytes.java | 5 +- .../command/datatypes/ext/EBusTypeDate.java | 5 +- .../datatypes/ext/EBusTypeDateTime.java | 9 ++- .../command/datatypes/ext/EBusTypeKWCrc.java | 5 +- .../datatypes/ext/EBusTypeMultiWord.java | 7 +- .../command/datatypes/ext/EBusTypeString.java | 2 + .../command/datatypes/ext/EBusTypeTime.java | 3 + .../datatypes/ext/EBusTypeVersion.java | 4 +- .../datatypes/std/AbstractEBusTypeNumber.java | 17 ++-- .../std/AbstractEBusTypeUnsignedNumber.java | 6 +- .../command/datatypes/std/EBusTypeBCD.java | 8 +- .../command/datatypes/std/EBusTypeBit.java | 17 ++-- .../command/datatypes/std/EBusTypeByte.java | 3 + .../command/datatypes/std/EBusTypeChar.java | 3 + .../command/datatypes/std/EBusTypeData1b.java | 3 + .../command/datatypes/std/EBusTypeData1c.java | 12 ++- .../command/datatypes/std/EBusTypeData2b.java | 9 ++- .../command/datatypes/std/EBusTypeData2c.java | 11 ++- .../command/datatypes/std/EBusTypeFloat.java | 6 +- .../datatypes/std/EBusTypeInteger.java | 3 + .../command/datatypes/std/EBusTypeNumber.java | 3 + .../datatypes/std/EBusTypeUnsignedNumber.java | 3 + .../command/datatypes/std/EBusTypeWord.java | 3 + .../java/de/csdev/ebus/core/EBusConsts.java | 8 +- .../csdev/ebus/core/EBusControllerBase.java | 2 +- .../ebus/core/EBusLowLevelController.java | 4 +- .../ebus/core/EBusReceiveStateMachine.java | 1 + .../connection/AbstractEBusConnection.java | 3 +- .../EBusCaptureProxyConnection.java | 4 +- .../ebus/service/device/EBusDeviceTable.java | 8 +- .../de/csdev/ebus/utils/CollectionUtils.java | 4 +- .../de/csdev/ebus/utils/EBusConsoleUtils.java | 2 + 38 files changed, 186 insertions(+), 101 deletions(-) diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java b/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java index 6df3c75..17a2f03 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandRegistry.java @@ -252,6 +252,7 @@ public EBusTypeRegistry getTypeRegistry() { * @param data * @return */ + @SuppressWarnings("java:S3776") public boolean matchesCommand(@NonNull IEBusCommandMethod command, @NonNull ByteBuffer data) { Byte sourceAddress = ObjectUtils.defaultIfNull(command.getSourceAddress(), Byte.valueOf((byte) 0x00)); diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java b/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java index 413e0d4..9585046 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandUtils.java @@ -272,6 +272,7 @@ public static byte unescapeSymbol(byte reversedByte) { * @return * @throws EBusTypeException */ + @SuppressWarnings("java:S3776") public static @NonNull ByteBuffer composeMasterData(@NonNull IEBusCommandMethod commandMethod, @Nullable Map values) throws EBusTypeException { @@ -376,6 +377,7 @@ public static byte unescapeSymbol(byte reversedByte) { * @throws EBusTypeException * @throws EBusCommandException */ + @SuppressWarnings("java:S3776") public static @NonNull ByteBuffer buildMasterTelegram(@NonNull IEBusCommandMethod commandMethod, @Nullable Byte source, @Nullable Byte target, @Nullable Map values, boolean skipAddressChecks) throws EBusTypeException, EBusCommandException { @@ -489,6 +491,7 @@ public static byte unescapeSymbol(byte reversedByte) { * @return * @throws EBusTypeException */ + @SuppressWarnings("java:S3776") private static int decodeValueList(@Nullable List<@NonNull IEBusValue> values, byte @NonNull [] data, @NonNull HashMap result, int pos) throws EBusTypeException { @@ -567,6 +570,7 @@ private static int decodeValueList(@Nullable List<@NonNull IEBusValue> values, b * @param commandChannel * @return */ + @SuppressWarnings("java:S3776") public static @NonNull ByteBuffer getMasterTelegramMask(@NonNull IEBusCommandMethod commandChannel) { Objects.requireNonNull(commandChannel, "Parameter command is null!"); diff --git a/src/main/java/de/csdev/ebus/command/EBusCommandValue.java b/src/main/java/de/csdev/ebus/command/EBusCommandValue.java index b3fffe5..92d4aa2 100644 --- a/src/main/java/de/csdev/ebus/command/EBusCommandValue.java +++ b/src/main/java/de/csdev/ebus/command/EBusCommandValue.java @@ -34,21 +34,21 @@ public static EBusCommandValue getInstance(IEBusType type, byte[] data) { return value; } - private Object defaultValue; + private @Nullable Object defaultValue; - private BigDecimal factor; + private @Nullable BigDecimal factor; - private String format; + private @Nullable String format; - private String label; + private @Nullable String label; - private Map mapping; + private @Nullable Map mapping; - private BigDecimal max; + private @Nullable BigDecimal max; - private BigDecimal min; + private @Nullable BigDecimal min; - private String name; + private @Nullable String name; private EBusCommandMethod parent; @@ -94,58 +94,58 @@ protected EBusCommandValue createInstance() { } @Override - public Object getDefaultValue() { - return defaultValue; + public @Nullable Object getDefaultValue() { + return this.defaultValue; } @Override - public BigDecimal getFactor() { - return factor; + public @Nullable BigDecimal getFactor() { + return this.factor; } @Override - public String getFormat() { - return format; + public @Nullable String getFormat() { + return this.format; } @Override - public String getLabel() { - return label; + public @Nullable String getLabel() { + return this.label; } @Override - public Map getMapping() { - return mapping; + public @Nullable Map<@NonNull String, @NonNull String> getMapping() { + return this.mapping; } @Override - public BigDecimal getMax() { - return max; + public @Nullable BigDecimal getMax() { + return this.max; } @Override - public BigDecimal getMin() { - return min; + public @Nullable BigDecimal getMin() { + return this.min; } @Override public @Nullable String getName() { - return name; + return this.name; } @Override public @Nullable IEBusCommandMethod getParent() { - return parent; + return this.parent; } @Override - public Map getProperties() { - return CollectionUtils.unmodifiableNotNullMap(properties); + public @Nullable Map<@NonNull String, @NonNull Object> getProperties() { + return CollectionUtils.unmodifiableNotNullMap(this.properties); } @Override - public BigDecimal getStep() { - return step; + public @Nullable BigDecimal getStep() { + return this.step; } @Override @@ -153,35 +153,35 @@ public BigDecimal getStep() { return Objects.requireNonNull(type); } - public void setDefaultValue(Object defaultValue) { + public void setDefaultValue(@Nullable Object defaultValue) { this.defaultValue = defaultValue; } - public void setFactor(BigDecimal factor) { + public void setFactor(@Nullable BigDecimal factor) { this.factor = factor; } - public void setFormat(String format) { + public void setFormat(@Nullable String format) { this.format = format; } - public void setLabel(String label) { + public void setLabel(@Nullable String label) { this.label = label; } - public void setMapping(Map mapping) { + public void setMapping(@Nullable Map mapping) { this.mapping = mapping; } - public void setMax(BigDecimal max) { + public void setMax(@Nullable BigDecimal max) { this.max = max; } - public void setMin(BigDecimal min) { + public void setMin(@Nullable BigDecimal min) { this.min = min; } - public void setName(String name) { + public void setName(@Nullable String name) { this.name = name; } @@ -195,15 +195,15 @@ public void setProperties(Map properties) { } public void setProperty(String key, String value) { - properties = CollectionUtils.newMapIfNull(properties); - properties.put(key, value); + this.properties = CollectionUtils.newMapIfNull(properties); + this.properties.put(key, value); } - public void setStep(BigDecimal step) { + public void setStep(@Nullable BigDecimal step) { this.step = step; } - public void setType(IEBusType type) { + public void setType(@Nullable IEBusType type) { this.type = type; } diff --git a/src/main/java/de/csdev/ebus/command/IEBusValue.java b/src/main/java/de/csdev/ebus/command/IEBusValue.java index 567c256..d597c7c 100644 --- a/src/main/java/de/csdev/ebus/command/IEBusValue.java +++ b/src/main/java/de/csdev/ebus/command/IEBusValue.java @@ -30,7 +30,6 @@ public interface IEBusValue { * * @return */ - public IEBusType getType(); /** diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java index 62fb4fa..1cd5bac 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java @@ -19,6 +19,7 @@ import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.reflect.FieldUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,13 +31,14 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public abstract class EBusAbstractType implements IEBusType { - private static final Logger logger = LoggerFactory.getLogger(EBusAbstractType.class); + private static final Logger logger = LoggerFactory.getLogger(EBusAbstractType.class); - protected Map> otherInstances = new HashMap<>(); + protected Map> otherInstances = new HashMap<>(); - protected byte[] replaceValue = null; + protected byte @Nullable [] replaceValue = null; protected boolean reverseByteOrder = false; @@ -65,12 +67,12 @@ protected byte[] applyByteOrder(byte[] data) { * * @return */ - private EBusAbstractType createNewInstance() { + private @Nullable EBusAbstractType createNewInstance() { try { @SuppressWarnings({ "unchecked"}) EBusAbstractType newInstance = this.getClass().getDeclaredConstructor().newInstance(); - newInstance.types = this.types; + newInstance.setTypesParent(types); return newInstance; } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { @@ -150,7 +152,7 @@ public byte[] encode(@Nullable Object data) throws EBusTypeException { * @return * @throws EBusTypeException */ - public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + public byte @Nullable [] encodeInt(@Nullable Object data) throws EBusTypeException { throw new UnsupportedOperationException("Must be overwritten by superclass!"); } @@ -204,7 +206,7 @@ public IEBusType getInstance(@Nullable Map properties) { * * @return */ - public byte[] getReplaceValue() { + public byte @Nullable [] getReplaceValue() { int length = getTypeLength(); if (replaceValue == null || replaceValue.length == 0) { diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java index 9cd8cb3..7415969 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusTypeRegistry.java @@ -157,7 +157,7 @@ public Set getTypesNames() { * @return * @throws EBusTypeException */ - public byte[] encode(String type, Object data) throws EBusTypeException { + public byte @Nullable [] encode(String type, Object data) throws EBusTypeException { IEBusType eBusType = types.get(type); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java index 784a54d..5a74855 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeBytes.java @@ -11,6 +11,8 @@ import java.util.Map; import java.util.Objects; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -20,6 +22,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeBytes extends EBusAbstractType { public static final String TYPE_BYTES = "bytes"; @@ -56,7 +59,7 @@ public int getTypeLength() { } @Override - public IEBusType getInstance(@Nullable Map properties) { + public @NonNull IEBusType getInstance(@Nullable Map properties) { Objects.requireNonNull(properties); if (properties.containsKey(IEBusType.LENGTH)) { diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java index 47e92b0..8e333c4 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java @@ -15,6 +15,8 @@ import java.util.Objects; import org.apache.commons.lang3.StringUtils; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -29,6 +31,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeDate extends EBusAbstractType { public static final String TYPE_DATE = "date"; @@ -69,7 +72,7 @@ public int getTypeLength() { } @Override - public EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { Objects.requireNonNull(data); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java index 196d7ea..6fc13a7 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java @@ -15,6 +15,8 @@ import java.util.Map; import org.apache.commons.lang3.ArrayUtils; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,6 +30,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeDateTime extends EBusAbstractType { private static final Logger logger = LoggerFactory.getLogger(EBusTypeDateTime.class); @@ -149,18 +152,18 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { return result; } - private IEBusType getDateType() { + private @Nullable IEBusType getDateType() { Map properties = new HashMap<>(); properties.put(IEBusType.VARIANT, variantDate); return types.getType(EBusTypeDate.TYPE_DATE, properties); } @Override - public String[] getSupportedTypes() { + public String @NonNull [] getSupportedTypes() { return supportedTypes; } - private IEBusType getTimeType() { + private @Nullable IEBusType getTimeType() { Map properties = new HashMap<>(); properties.put(IEBusType.VARIANT, variantTime); return types.getType(EBusTypeTime.TYPE_TIME, properties); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java index 0bb12cf..05840f9 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeKWCrc.java @@ -10,6 +10,8 @@ import java.nio.ByteBuffer; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -21,6 +23,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeKWCrc extends EBusAbstractType implements IEBusComplexType { public static final String TYPE_KW_CRC = "kw-crc"; @@ -41,7 +44,7 @@ public int getTypeLength() { } @Override - public String[] getSupportedTypes() { + public String @NonNull [] getSupportedTypes() { return supportedTypes; } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java index 7e64fc8..8c36349 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java @@ -10,6 +10,8 @@ import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -22,6 +24,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeMultiWord extends EBusAbstractType { public static final String TYPE_MWORD = "mword"; @@ -34,7 +37,7 @@ public class EBusTypeMultiWord extends EBusAbstractType { private BigDecimal multiplier = BigDecimal.valueOf(1000); @Override - public String[] getSupportedTypes() { + public String @NonNull [] getSupportedTypes() { return supportedTypes; } @@ -44,7 +47,7 @@ public int getTypeLength() { } @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { byte[] dataNew = new byte[2]; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java index aefd574..33400a8 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeString.java @@ -8,6 +8,7 @@ */ package de.csdev.ebus.command.datatypes.ext; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -16,6 +17,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeString extends EBusAbstractType { public static final String TYPE_STRING = "string"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java index 73f14cc..1470bc2 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java @@ -14,6 +14,8 @@ import java.util.GregorianCalendar; import org.apache.commons.lang3.StringUtils; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -29,6 +31,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeTime extends EBusAbstractType { public static final String TYPE_TIME = "time"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java index 6cdc69d..7ffc4e9 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java @@ -10,6 +10,7 @@ import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -21,6 +22,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeVersion extends EBusAbstractType { public static final String TYPE_VERSION = "version"; @@ -38,7 +40,7 @@ public int getTypeLength() { } @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { if (data == null) { throw new IllegalArgumentException(); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java index 6d12625..b53057c 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeNumber.java @@ -12,27 +12,32 @@ import java.math.BigInteger; import org.apache.commons.lang3.ArrayUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; import de.csdev.ebus.command.datatypes.EBusTypeException; import de.csdev.ebus.utils.NumberUtils; +@NonNullByDefault public abstract class AbstractEBusTypeNumber extends EBusAbstractType { @Override public byte[] getReplaceValue() { int length = getTypeLength(); - if (replaceValue == null || replaceValue.length == 0) { - replaceValue = new byte[length]; - replaceValue[length - 1] = (byte) 0x80; - } + byte[] lReplacevalue = this.replaceValue; - return replaceValue; + if (lReplacevalue == null || lReplacevalue.length == 0) { + lReplacevalue = new byte[length]; + lReplacevalue[length - 1] = (byte) 0x80; + } + + this.replaceValue = lReplacevalue; + return lReplacevalue; } @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { byte[] clone = ArrayUtils.clone(data); ArrayUtils.reverse(clone); return new BigDecimal(new BigInteger(clone)); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java index 76db7b8..f60ba91 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/AbstractEBusTypeUnsignedNumber.java @@ -12,6 +12,7 @@ import java.math.BigInteger; import org.apache.commons.lang3.ArrayUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -22,10 +23,11 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public abstract class AbstractEBusTypeUnsignedNumber extends EBusAbstractType { @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { byte[] clone = ArrayUtils.clone(data); ArrayUtils.reverse(clone); @@ -34,7 +36,7 @@ public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { } @Override - public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + public byte @Nullable [] encodeInt(@Nullable Object data) throws EBusTypeException { BigDecimal b = NumberUtils.toBigDecimal(data == null ? 0 : data); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java index b05ed9d..b5eb9a4 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBCD.java @@ -11,7 +11,6 @@ import java.math.BigDecimal; import java.util.Objects; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -24,6 +23,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeBCD extends EBusAbstractType { public static final String TYPE_BCD = "bcd"; @@ -36,11 +36,9 @@ public EBusTypeBCD() { replaceValue = new byte[] { (byte) 0xFF }; } - // @NonNullByDefault({}) @Override - public @NonNull String[] getSupportedTypes() { + public String[] getSupportedTypes() { return supportedTypes; - // return new String[] { TYPE_BCD }; } @Override @@ -49,7 +47,7 @@ public int getTypeLength() { } @Override - public BigDecimal decodeInt(byte @Nullable [] data) { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) { Objects.requireNonNull(data); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java index 976c869..6eb7558 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java @@ -10,6 +10,8 @@ import java.util.Objects; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusAbstractType; @@ -19,6 +21,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeBit extends EBusAbstractType { public static final String TYPE_BIT = "bit"; @@ -27,19 +30,20 @@ public class EBusTypeBit extends EBusAbstractType { private static String[] supportedTypes = new String[] { TYPE_BIT }; + @SuppressWarnings("java:S1845") private Integer pos = null; public EBusTypeBit() { - + // noop } @Override - public byte[] getReplaceValue() { + public byte @Nullable [] getReplaceValue() { return null; } @Override - public String[] getSupportedTypes() { + public String @NonNull [] getSupportedTypes() { return supportedTypes; } @@ -50,16 +54,13 @@ public int getTypeLength() { @Override public Boolean decodeInt(byte @Nullable [] data) { - Objects.requireNonNull(data); - - Boolean isSet = (data[0] >> pos & 0x1) == 1; - return isSet; + return (data[0] >> pos & 0x1) == 1; } @Override public byte[] encodeInt(@Nullable Object data) { - throw new RuntimeException("Not implemented yet!"); + throw new UnsupportedOperationException("Not implemented yet!"); } @Override diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java index fae831a..23c4430 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeByte.java @@ -8,12 +8,15 @@ */ package de.csdev.ebus.command.datatypes.std; +import org.eclipse.jdt.annotation.NonNullByDefault; + import de.csdev.ebus.utils.EBusUtils; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeByte extends AbstractEBusTypeUnsignedNumber { public static final String TYPE_UCHAR = "uchar"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java index 7ba3858..2df602c 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeChar.java @@ -8,12 +8,15 @@ */ package de.csdev.ebus.command.datatypes.std; +import org.eclipse.jdt.annotation.NonNullByDefault; + import de.csdev.ebus.utils.EBusUtils; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeChar extends AbstractEBusTypeNumber { public static final String TYPE_CHAR = "char"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java index 383f666..81b4598 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1b.java @@ -8,12 +8,15 @@ */ package de.csdev.ebus.command.datatypes.std; +import org.eclipse.jdt.annotation.NonNullByDefault; + import de.csdev.ebus.utils.EBusUtils; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeData1b extends AbstractEBusTypeNumber { public static final String TYPE_DATA1B = "data1b"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java index 2c1da96..148161e 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData1c.java @@ -10,6 +10,7 @@ import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusTypeException; @@ -20,6 +21,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeData1c extends AbstractEBusTypeUnsignedNumber { public static final String TYPE_DATA1C = "data1c"; @@ -37,13 +39,17 @@ public int getTypeLength() { } @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { BigDecimal decodeInt = super.decodeInt(data); - return decodeInt.divide(BigDecimal.valueOf(2)); + + if (decodeInt != null) { + return decodeInt.divide(BigDecimal.valueOf(2)); + } + return null; } @Override - public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + public byte @Nullable [] encodeInt(@Nullable Object data) throws EBusTypeException { BigDecimal b = NumberUtils.toBigDecimal(data); if (b == null) { diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java index 14b645d..a144232 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2b.java @@ -10,6 +10,7 @@ import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusTypeException; @@ -20,6 +21,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeData2b extends AbstractEBusTypeNumber { public static final String TYPE_DATA2B = "data2b"; @@ -37,9 +39,12 @@ public int getTypeLength() { } @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { BigDecimal decodeInt = super.decodeInt(data); - return decodeInt.divide(BigDecimal.valueOf(256)); + if (decodeInt != null) { + return decodeInt.divide(BigDecimal.valueOf(256)); + } + return null; } @Override diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java index c92e7c5..aec5b19 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeData2c.java @@ -10,6 +10,7 @@ import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import de.csdev.ebus.command.datatypes.EBusTypeException; @@ -20,6 +21,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeData2c extends AbstractEBusTypeNumber { public static final String TYPE_DATA2C = "data2c"; @@ -37,15 +39,18 @@ public int getTypeLength() { } @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { BigDecimal decodeInt = super.decodeInt(data); - return decodeInt.divide(BigDecimal.valueOf(16)); + if (decodeInt != null) { + return decodeInt.divide(BigDecimal.valueOf(16)); + } + return null; } @Override public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { BigDecimal b = NumberUtils.toBigDecimal(data); - + if (b == null) { throw new EBusTypeException("Unable to convert input data to number!"); } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java index ec04187..c23ce36 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java @@ -12,6 +12,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,6 +26,7 @@ * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeFloat extends EBusAbstractType { private static final Logger logger = LoggerFactory.getLogger(EBusTypeFloat.class); @@ -49,7 +51,7 @@ public int getTypeLength() { } @Override - public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { + public @Nullable BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { float value = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).getFloat(); if (!Float.isNaN(value)) { return BigDecimal.valueOf(value); @@ -60,7 +62,7 @@ public BigDecimal decodeInt(byte @Nullable [] data) throws EBusTypeException { } @Override - public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + public byte @Nullable [] encodeInt(@Nullable Object data) throws EBusTypeException { BigDecimal b = NumberUtils.toBigDecimal(data == null ? 0 : data); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java index 1605382..b2eac1e 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeInteger.java @@ -8,12 +8,15 @@ */ package de.csdev.ebus.command.datatypes.std; +import org.eclipse.jdt.annotation.NonNullByDefault; + import de.csdev.ebus.utils.EBusUtils; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeInteger extends AbstractEBusTypeNumber { public static final String TYPE_INTEGER = "int"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java index 21531d0..fe6be04 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeNumber.java @@ -8,12 +8,15 @@ */ package de.csdev.ebus.command.datatypes.std; +import org.eclipse.jdt.annotation.NonNullByDefault; + import de.csdev.ebus.utils.EBusUtils; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeNumber extends AbstractEBusTypeNumber { public static final String TYPE_NUMBER = "number"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java index d01fc34..dabba5c 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeUnsignedNumber.java @@ -8,12 +8,15 @@ */ package de.csdev.ebus.command.datatypes.std; +import org.eclipse.jdt.annotation.NonNullByDefault; + import de.csdev.ebus.utils.EBusUtils; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeUnsignedNumber extends AbstractEBusTypeUnsignedNumber { public static final String TYPE_UNUMBER = "unumber"; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java index d48a014..bad1ebe 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeWord.java @@ -8,12 +8,15 @@ */ package de.csdev.ebus.command.datatypes.std; +import org.eclipse.jdt.annotation.NonNullByDefault; + import de.csdev.ebus.utils.EBusUtils; /** * @author Christian Sowada - Initial contribution * */ +@NonNullByDefault public class EBusTypeWord extends AbstractEBusTypeUnsignedNumber { public static final String TYPE_WORD = "word"; diff --git a/src/main/java/de/csdev/ebus/core/EBusConsts.java b/src/main/java/de/csdev/ebus/core/EBusConsts.java index b6b983a..e4efed0 100644 --- a/src/main/java/de/csdev/ebus/core/EBusConsts.java +++ b/src/main/java/de/csdev/ebus/core/EBusConsts.java @@ -8,6 +8,8 @@ */ package de.csdev.ebus.core; +import org.eclipse.jdt.annotation.NonNull; + /** * @author Christian Sowada - Initial contribution * @@ -34,10 +36,12 @@ private EBusConsts() { public static final byte ESCAPE = (byte) 0xA9; /** replacement for an excape symbol */ - public static final byte[] ESCAPE_REPLACEMENT = new byte[] { EBusConsts.ESCAPE, 0x00 }; + @SuppressWarnings("java:S2386") + public static final byte @NonNull [] ESCAPE_REPLACEMENT = new byte[] { EBusConsts.ESCAPE, 0x00 }; /** replacement for an sync symbol */ - public static final byte[] SYN_REPLACEMENT = new byte[] { EBusConsts.ESCAPE, 0x01 }; + @SuppressWarnings("java:S2386") + public static final byte @NonNull [] SYN_REPLACEMENT = new byte[] { EBusConsts.ESCAPE, 0x01 }; /** eBUS standard collection id */ public static final String COLLECTION_STD = "std"; diff --git a/src/main/java/de/csdev/ebus/core/EBusControllerBase.java b/src/main/java/de/csdev/ebus/core/EBusControllerBase.java index b2a24be..eb63054 100644 --- a/src/main/java/de/csdev/ebus/core/EBusControllerBase.java +++ b/src/main/java/de/csdev/ebus/core/EBusControllerBase.java @@ -336,7 +336,7 @@ protected void setConnectionStatus(final @NonNull ConnectionStatus status) { } @Override - public ConnectionStatus getConnectionStatus() { + public @NonNull ConnectionStatus getConnectionStatus() { return this.connectionStatus; } diff --git a/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java b/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java index 3e40633..8a6e471 100644 --- a/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java +++ b/src/main/java/de/csdev/ebus/core/EBusLowLevelController.java @@ -129,7 +129,7 @@ private void reconnect() throws IOException, InterruptedException { logger.warn("Retry to connect to eBUS adapter in {} seconds ...", 5 * reConnectCounter); - Thread.sleep(5000 * reConnectCounter); + Thread.sleep(5000L * reConnectCounter); connection.close(); if (connection.open()) { @@ -162,6 +162,7 @@ private boolean resend() { } @Override + @SuppressWarnings("java:S3776") public void run() { initThreadPool(); @@ -259,6 +260,7 @@ public void run() { * @param secondTry * @throws IOException */ + @SuppressWarnings("java:S3776") private void send(boolean secondTry) throws IOException { if (!isRunning()) { diff --git a/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java b/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java index df22aa0..251436b 100644 --- a/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java +++ b/src/main/java/de/csdev/ebus/core/EBusReceiveStateMachine.java @@ -225,6 +225,7 @@ public String toDumpString() { * @param dataByte The next byte * @throws EBusDataException throws an exception on any telegram error */ + @SuppressWarnings("java:S3776") public void update(final byte dataByte) throws EBusDataException { byte data = dataByte; diff --git a/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java b/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java index 250ecc3..29870d5 100644 --- a/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/AbstractEBusConnection.java @@ -12,6 +12,7 @@ import java.io.InputStream; import java.io.OutputStream; +import org.eclipse.jdt.annotation.NonNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +54,7 @@ public boolean isOpen() throws IOException { } @Override - public int readBytes(final byte[] buffer) throws IOException { + public int readBytes(final byte @NonNull [] buffer) throws IOException { return inputStream.read(buffer); } diff --git a/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java b/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java index e65ec95..17f962c 100644 --- a/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java +++ b/src/main/java/de/csdev/ebus/core/connection/EBusCaptureProxyConnection.java @@ -10,6 +10,8 @@ import java.io.IOException; +import org.eclipse.jdt.annotation.NonNull; + import de.csdev.ebus.utils.EmulatorCapture; /** @@ -54,7 +56,7 @@ public boolean isReceiveBufferEmpty() throws IOException { return proxyConnection.isReceiveBufferEmpty(); } - public int readBytes(final byte[] buffer) throws IOException { + public int readBytes(final byte @NonNull [] buffer) throws IOException { int readBytes = proxyConnection.readBytes(buffer); captureWriter.write(buffer, readBytes); return readBytes; diff --git a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java index 292b3bb..43d7a30 100644 --- a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java +++ b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTable.java @@ -23,7 +23,6 @@ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import org.apache.commons.lang3.ObjectUtils; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.slf4j.Logger; @@ -112,6 +111,7 @@ public String getManufacturerName(final byte vendorCode) { * @param address * @param data */ + @SuppressWarnings("java:S3776") public void updateDevice(final byte address, final Map<@NonNull String, @Nullable Object> data) { boolean newDevice = false; @@ -164,7 +164,7 @@ public void updateDevice(final byte address, final Map<@NonNull String, @Nullabl Object value = data.get("hardware_version"); if (value != null) { BigDecimal obj2 = NumberUtils.toBigDecimal(value); - if (obj2 != null && !ObjectUtils.equals(obj2, device.getHardwareVersion())) { + if (obj2 != null && !Objects.equals(obj2, device.getHardwareVersion())) { device.setHardwareVersion(obj2); updatedDevice = true; } @@ -173,7 +173,7 @@ public void updateDevice(final byte address, final Map<@NonNull String, @Nullabl value = data.get("software_version"); if (value != null) { BigDecimal obj2 = NumberUtils.toBigDecimal(value); - if (obj2 != null && !ObjectUtils.equals(obj2, device.getSoftwareVersion())) { + if (obj2 != null && !Objects.equals(obj2, device.getSoftwareVersion())) { device.setSoftwareVersion(obj2); updatedDevice = true; } @@ -182,7 +182,7 @@ public void updateDevice(final byte address, final Map<@NonNull String, @Nullabl value = data.get("vendor"); if (value != null) { BigDecimal obj2 = NumberUtils.toBigDecimal(value); - if (obj2 != null && !ObjectUtils.equals(obj2.byteValue(), device.getManufacturer())) { + if (obj2 != null && !Objects.equals(obj2.byteValue(), device.getManufacturer())) { int intValue = obj2.intValue(); device.setManufacturer((byte) intValue); updatedDevice = true; diff --git a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java index 2486519..13e22e7 100644 --- a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java +++ b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java @@ -27,8 +27,8 @@ private CollectionUtils() { throw new IllegalStateException("Utility class"); } - public static final @NonNull List emptyList() { - return Collections.emptyList(); + public static final @NonNull List<@Nullable T> emptyList() { + return Collections.emptyList(); } /** diff --git a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java index 944fa85..0a7389f 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java +++ b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java @@ -61,6 +61,7 @@ private EBusConsoleUtils() { * @return * @throws EBusTypeException */ + @SuppressWarnings("java:S3776") public static String bruteforceData(byte @Nullable [] data) throws EBusTypeException { EBusTypeRegistry typeRegistry = new EBusTypeRegistry(); @@ -188,6 +189,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu * @param data * @return */ + @SuppressWarnings("java:S3776") public static @NonNull String analyzeTelegram(@NonNull EBusCommandRegistry registry, byte @NonNull [] data) { Objects.requireNonNull(registry, "registry"); From b4ecc0551bf581206a3cd9a8b48abea5ac718827 Mon Sep 17 00:00:00 2001 From: csowada Date: Sat, 25 Mar 2023 13:24:33 +0100 Subject: [PATCH 07/10] Fix SonarCloud issues --- .../de/csdev/ebus/command/datatypes/EBusAbstractType.java | 2 +- .../java/de/csdev/ebus/command/datatypes/IEBusType.java | 2 +- .../csdev/ebus/command/datatypes/ext/EBusTypeVersion.java | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java index 1cd5bac..adff5ac 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java @@ -172,7 +172,7 @@ protected boolean equalsReplaceValue(byte[] data) { * @see de.csdev.ebus.command.datatypes.IEBusType#getInstance(java.util.Map) */ @Override - public IEBusType getInstance(@Nullable Map properties) { + public @Nullable IEBusType getInstance(@Nullable Map properties) { // use default instance if no properties are set if (properties == null || properties.isEmpty()) { diff --git a/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java b/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java index 367b049..9e98d7a 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/IEBusType.java @@ -74,6 +74,6 @@ public interface IEBusType { * @param properties * @return */ - public IEBusType getInstance(@Nullable Map properties); + public @Nullable IEBusType getInstance(@Nullable Map properties); } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java index 7ffc4e9..b471eb3 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeVersion.java @@ -61,7 +61,7 @@ public int getTypeLength() { } @Override - public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + public byte @Nullable [] encodeInt(@Nullable Object data) throws EBusTypeException { BigDecimal value = NumberUtils.toBigDecimal(data); @@ -75,6 +75,10 @@ public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { byte[] encode1 = types.encode(EBusTypeBCD.TYPE_BCD, values[0]); byte[] encode2 = types.encode(EBusTypeBCD.TYPE_BCD, values[1]); + if ( encode1 == null || encode1.length == 0 || encode2 == null || encode2.length == 0 ) { + return null; + } + return new byte[] { encode1[0], encode2[0] }; } From 761ca20b3d2fc367c6427f3ccc57c32673f558c7 Mon Sep 17 00:00:00 2001 From: csowada Date: Sat, 25 Mar 2023 13:34:43 +0100 Subject: [PATCH 08/10] Update SonarCloud issues and github action --- .github/workflows/codeql-analysis.yml | 4 ++-- .../de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java | 1 - .../de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 8e0ca2b..8b906b8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -65,4 +65,4 @@ jobs: run: mvn -B clean package - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java index 8e333c4..7e17a70 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java @@ -15,7 +15,6 @@ import java.util.Objects; import org.apache.commons.lang3.StringUtils; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java index 1470bc2..16222f9 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java @@ -14,7 +14,6 @@ import java.util.GregorianCalendar; import org.apache.commons.lang3.StringUtils; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; From 7de9076a9b3c1daff0e024f4e9fb196f337dabf0 Mon Sep 17 00:00:00 2001 From: csowada Date: Sat, 25 Mar 2023 16:44:23 +0100 Subject: [PATCH 09/10] Fix some SonarCloud, null topics --- .../command/datatypes/EBusAbstractType.java | 27 ++++++++++------ .../command/datatypes/ext/EBusTypeDate.java | 7 +++- .../datatypes/ext/EBusTypeDateTime.java | 2 +- .../datatypes/ext/EBusTypeMultiWord.java | 2 ++ .../command/datatypes/ext/EBusTypeTime.java | 4 ++- .../command/datatypes/std/EBusTypeBit.java | 3 +- .../command/datatypes/std/EBusTypeFloat.java | 1 + .../csdev/ebus/core/EBusEbusdController.java | 4 ++- .../device/EBusDeviceTableService.java | 1 - .../service/metrics/EBusMetricsService.java | 32 ++++++++++++------- .../de/csdev/ebus/utils/CollectionUtils.java | 4 +-- .../de/csdev/ebus/utils/EBusConsoleUtils.java | 11 ++++--- .../csdev/ebus/utils/EBusTelegramWriter.java | 32 +++++++++++-------- 13 files changed, 82 insertions(+), 48 deletions(-) diff --git a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java index adff5ac..0721fff 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/EBusAbstractType.java @@ -34,6 +34,7 @@ @NonNullByDefault public abstract class EBusAbstractType implements IEBusType { + @SuppressWarnings({"null"}) private static final Logger logger = LoggerFactory.getLogger(EBusAbstractType.class); protected Map> otherInstances = new HashMap<>(); @@ -42,6 +43,7 @@ public abstract class EBusAbstractType implements IEBusType { protected boolean reverseByteOrder = false; + @SuppressWarnings({"null"}) protected EBusTypeRegistry types; /** @@ -50,8 +52,9 @@ public abstract class EBusAbstractType implements IEBusType { * @param data * @return */ - protected byte[] applyByteOrder(byte[] data) { + protected byte @Nullable [] applyByteOrder(byte @Nullable [] data) { + // @SuppressWarnings({}) data = ArrayUtils.clone(data); // reverse the byte order immutable @@ -70,10 +73,13 @@ protected byte[] applyByteOrder(byte[] data) { private @Nullable EBusAbstractType createNewInstance() { try { - @SuppressWarnings({ "unchecked"}) + @SuppressWarnings({ "unchecked" }) EBusAbstractType newInstance = this.getClass().getDeclaredConstructor().newInstance(); - newInstance.setTypesParent(types); - return newInstance; + if (newInstance != null) { + newInstance.setTypesParent(types); + return newInstance; + } + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { logger.error(EBusConsts.LOG_ERR_DEF, e); @@ -162,7 +168,7 @@ public byte[] encode(@Nullable Object data) throws EBusTypeException { * @param data * @return */ - protected boolean equalsReplaceValue(byte[] data) { + protected boolean equalsReplaceValue(byte @Nullable [] data) { return Objects.deepEquals(data, getReplaceValue()); } @@ -209,12 +215,14 @@ protected boolean equalsReplaceValue(byte[] data) { public byte @Nullable [] getReplaceValue() { int length = getTypeLength(); - if (replaceValue == null || replaceValue.length == 0) { - replaceValue = new byte[length]; - Arrays.fill(replaceValue, (byte) 0xFF); + byte[] repValue = this.replaceValue; + if (repValue == null || repValue.length == 0) { + repValue = new byte[length]; + Arrays.fill(repValue, (byte) 0xFF); + this.replaceValue = repValue; } - return replaceValue; + return repValue; } /* @@ -270,6 +278,7 @@ protected void setInstanceProperty(@Nullable EBusAbstractType instance, @Null * @param replaceValue * @throws EBusTypeException */ + @SuppressWarnings("java:S1130") public void setReplaceValue(byte[] replaceValue) throws EBusTypeException { this.replaceValue = applyByteOrder(replaceValue); } diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java index 7e17a70..47debe1 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDate.java @@ -71,6 +71,7 @@ public int getTypeLength() { } @Override + @SuppressWarnings("java:S3776") public @Nullable EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { Objects.requireNonNull(data); @@ -79,6 +80,10 @@ public int getTypeLength() { IEBusType wordType = types.getType(EBusTypeWord.TYPE_WORD); IEBusType charType = types.getType(EBusTypeChar.TYPE_CHAR); + if (bcdType == null || wordType == null || charType == null ) { + throw new EBusTypeException("Unable to get all required EBusTyp's types!"); + } + Calendar calendar = new GregorianCalendar(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); @@ -155,7 +160,7 @@ public int getTypeLength() { } @Override - public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + public byte @Nullable [] encodeInt(@Nullable Object data) throws EBusTypeException { IEBusType bcdType = types.getType(EBusTypeBCD.TYPE_BCD); IEBusType wordType = types.getType(EBusTypeWord.TYPE_WORD); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java index 6fc13a7..6bfebec 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java @@ -66,7 +66,7 @@ public EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { IEBusType timeType = getTimeType(); if (dateType == null || timeType == null) { - throw new EBusTypeException("Unable to get all required EBusTyp's type!"); + throw new EBusTypeException("Unable to get all required EBusTyp's types!"); } byte[] timeData = null; diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java index 8c36349..beaa3e9 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeMultiWord.java @@ -34,6 +34,8 @@ public class EBusTypeMultiWord extends EBusAbstractType { private static String[] supportedTypes = new String[] { TYPE_MWORD }; private int length = 2; + + @SuppressWarnings({"null"}) private BigDecimal multiplier = BigDecimal.valueOf(1000); @Override diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java index 16222f9..6380414 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeTime.java @@ -50,6 +50,7 @@ public class EBusTypeTime extends EBusAbstractType { private String variant = DEFAULT; + @SuppressWarnings({"null"}) private BigDecimal minuteMultiplier = BigDecimal.valueOf(1); @Override @@ -76,6 +77,7 @@ public int getTypeLength() { } @Override + @SuppressWarnings("java:S3776") public EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { if (data == null) { @@ -161,7 +163,7 @@ public EBusDateTime decodeInt(byte @Nullable [] data) throws EBusTypeException { } @Override - public byte[] encodeInt(@Nullable Object data) throws EBusTypeException { + public byte @Nullable [] encodeInt(@Nullable Object data) throws EBusTypeException { IEBusType bcdType = types.getType(EBusTypeBCD.TYPE_BCD); IEBusType wordType = types.getType(EBusTypeWord.TYPE_WORD); diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java index 6eb7558..5d9fb8b 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeBit.java @@ -30,7 +30,8 @@ public class EBusTypeBit extends EBusAbstractType { private static String[] supportedTypes = new String[] { TYPE_BIT }; - @SuppressWarnings("java:S1845") + // will be filled by reflection + @SuppressWarnings({"null", "java:S1845"}) private Integer pos = null; public EBusTypeBit() { diff --git a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java index c23ce36..00e671e 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/std/EBusTypeFloat.java @@ -29,6 +29,7 @@ @NonNullByDefault public class EBusTypeFloat extends EBusAbstractType { + @SuppressWarnings({"null"}) private static final Logger logger = LoggerFactory.getLogger(EBusTypeFloat.class); public static final String TYPE_FLOAT = "float"; diff --git a/src/main/java/de/csdev/ebus/core/EBusEbusdController.java b/src/main/java/de/csdev/ebus/core/EBusEbusdController.java index 6b8ccb0..b1dafdd 100644 --- a/src/main/java/de/csdev/ebus/core/EBusEbusdController.java +++ b/src/main/java/de/csdev/ebus/core/EBusEbusdController.java @@ -128,6 +128,7 @@ public void run() { } } + @SuppressWarnings("java:S3776") private ByteBuffer parseLine(String readLine) throws IOException, InterruptedException, EBusDataException { ByteBuffer b = null; @@ -250,6 +251,7 @@ private void startSenderThread() { } @Override + @SuppressWarnings("java:S3776") public void run() { try { @@ -414,7 +416,7 @@ private void disconnect() { setConnectionStatus(ConnectionStatus.DISCONNECTED); } - private boolean connect() throws UnknownHostException, IOException { + private boolean connect() throws IOException { logger.info("Run connect ..."); socket = new Socket(hostname, port); socket.setSoTimeout(20000); diff --git a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java index 3af6499..3a30077 100644 --- a/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java +++ b/src/main/java/de/csdev/ebus/service/device/EBusDeviceTableService.java @@ -13,7 +13,6 @@ import java.util.Objects; import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java b/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java index 164c5c7..57ca6b8 100644 --- a/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java +++ b/src/main/java/de/csdev/ebus/service/metrics/EBusMetricsService.java @@ -29,23 +29,24 @@ */ @NonNullByDefault public class EBusMetricsService extends EBusConnectorEventListener implements IEBusParserListener { - + @SuppressWarnings({"null"}) private static final BigDecimal HUNDRED = BigDecimal.valueOf(100); - + @SuppressWarnings({"null"}) private BigDecimal resolved = BigDecimal.valueOf(0); - + @SuppressWarnings({"null"}) private BigDecimal unresolved = BigDecimal.valueOf(0); - + @SuppressWarnings({"null"}) private BigDecimal received = BigDecimal.valueOf(0); - + @SuppressWarnings({"null"}) private BigDecimal failed = BigDecimal.valueOf(0); - + @SuppressWarnings({"null"}) private BigDecimal connectionFailed = BigDecimal.valueOf(0); - + @SuppressWarnings({"null"}) private BigDecimal receivedAmount = BigDecimal.valueOf(0); private Map failedMap = new EnumMap<>(EBusError.class); + @SuppressWarnings({"null"}) public void clear() { resolved = BigDecimal.valueOf(0); unresolved = BigDecimal.valueOf(0); @@ -57,26 +58,30 @@ public void clear() { } @Override - public void onTelegramResolved(@NonNull IEBusCommandMethod commandChannel, - @NonNull Map<@NonNull String, @Nullable Object> result, byte @NonNull [] receivedData, + @SuppressWarnings({"null"}) + public void onTelegramResolved(IEBusCommandMethod commandChannel, + Map result, byte @NonNull [] receivedData, @Nullable Integer sendQueueId) { resolved = resolved.add(BigDecimal.ONE); } @Override + @SuppressWarnings({"null"}) public void onTelegramResolveFailed(@Nullable IEBusCommandMethod commandChannel, byte @Nullable [] receivedData, @Nullable Integer sendQueueId, @Nullable String exceptionMessage) { unresolved = unresolved.add(BigDecimal.ONE); } @Override - public void onTelegramReceived(byte @NonNull [] receivedData, @Nullable Integer sendQueueId) { + @SuppressWarnings({"null"}) + public void onTelegramReceived(byte[] receivedData, @Nullable Integer sendQueueId) { received = received.add(BigDecimal.ONE); receivedAmount = receivedAmount.add(BigDecimal.valueOf(receivedData.length)); } @Override - public void onTelegramException(@NonNull EBusDataException exception, @Nullable Integer sendQueueId) { + @SuppressWarnings({"null"}) + public void onTelegramException(EBusDataException exception, @Nullable Integer sendQueueId) { EBusError errorCode = exception.getErrorCode(); @@ -94,7 +99,8 @@ public void onTelegramException(@NonNull EBusDataException exception, @Nullable } @Override - public void onConnectionException(@NonNull Exception e) { + @SuppressWarnings({"null"}) + public void onConnectionException(Exception e) { connectionFailed = connectionFailed.add(BigDecimal.ONE); } @@ -122,6 +128,7 @@ public BigDecimal getConnectionFailed() { return connectionFailed; } + @SuppressWarnings({"null"}) public BigDecimal getFailureRatio() { BigDecimal all = received.add(failed); if (!failed.equals(BigDecimal.ZERO) && !all.equals(BigDecimal.ZERO)) { @@ -133,6 +140,7 @@ public BigDecimal getFailureRatio() { } } + @SuppressWarnings({"null"}) public BigDecimal getUnresolvedRatio() { BigDecimal all = unresolved.add(resolved); if (!unresolved.equals(BigDecimal.ZERO) && !all.equals(BigDecimal.ZERO)) { diff --git a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java index 13e22e7..5ee4972 100644 --- a/src/main/java/de/csdev/ebus/utils/CollectionUtils.java +++ b/src/main/java/de/csdev/ebus/utils/CollectionUtils.java @@ -27,8 +27,8 @@ private CollectionUtils() { throw new IllegalStateException("Utility class"); } - public static final @NonNull List<@Nullable T> emptyList() { - return Collections.emptyList(); + public static final @NonNull List<@NonNull T> emptyList() { + return Objects.requireNonNull(Collections.emptyList()); } /** diff --git a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java index 0a7389f..8d432fa 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java +++ b/src/main/java/de/csdev/ebus/utils/EBusConsoleUtils.java @@ -127,7 +127,7 @@ public static String bruteforceData(byte @Nullable [] data) throws EBusTypeExcep sb.append(String.format("%-25s | %-10s%n", "Unresolved telegrams", service.getUnresolved())); sb.append(String.format("%-25s | %-10s%n", "Resolved/Unresolved ratio", service.getUnresolvedRatio())); - return sb.toString(); + return Objects.requireNonNull(sb.toString()); } /** @@ -140,7 +140,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu StringBuilder sb = new StringBuilder(); - Map mapping = new HashMap(); + Map mapping = new HashMap<>(); for (IEBusCommandCollection collection : collections) { for (String identification : collection.getIdentification()) { @@ -219,7 +219,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu sb.append(StringUtils.repeat("*", len) + "\n"); sb.append("\n"); - return sb.toString(); + return Objects.requireNonNull(sb.toString()); } sb.append("\n"); @@ -346,7 +346,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu logger.error("error!", e); } - return sb.toString(); + return Objects.requireNonNull(sb.toString()); } @@ -361,6 +361,7 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu return "Slave"; } + @SuppressWarnings({"null"}) private static @NonNull String hex(byte[] b) { return EBusUtils.toHexDumpString(b).toString(); @@ -387,6 +388,6 @@ public static String getDeviceTableInformation(@NonNull Collection<@NonNull IEBu sb.append(text); sb.append("\n"); - return sb.toString(); + return Objects.requireNonNull(sb.toString()); } } diff --git a/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java b/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java index 99c0636..bde0071 100644 --- a/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java +++ b/src/main/java/de/csdev/ebus/utils/EBusTelegramWriter.java @@ -12,13 +12,13 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.io.Writer; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; import java.util.Map; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.slf4j.Logger; @@ -38,9 +38,9 @@ public class EBusTelegramWriter implements IEBusParserListener { @NonNullByDefault({}) private final Logger logger = LoggerFactory.getLogger(EBusTelegramWriter.class); - private BufferedWriter writerResolved; + private @Nullable BufferedWriter writerResolved; - private BufferedWriter writerUnresolved; + private @Nullable BufferedWriter writerUnresolved; private File loggingDirectory; @@ -49,8 +49,8 @@ public EBusTelegramWriter(File loggingDirectory) { } @Override - public void onTelegramResolved(@NonNull IEBusCommandMethod commandChannel, - @NonNull Map<@NonNull String, @Nullable Object> result, byte @NonNull [] receivedData, + public void onTelegramResolved(IEBusCommandMethod commandChannel, + Map result, byte[] receivedData, @Nullable Integer sendQueueId) { try { @@ -124,15 +124,17 @@ private BufferedWriter open(final String filename) throws IOException { */ public void close() { try { - if (writerResolved != null) { - writerResolved.flush(); - writerResolved.close(); - writerResolved = null; + Writer w = this.writerResolved; + if (w != null) { + w.flush(); + w.close(); + this.writerResolved = null; } - if (writerUnresolved != null) { - writerUnresolved.flush(); - writerUnresolved.close(); + w = this.writerUnresolved; + if (w != null) { + w.flush(); + w.close(); writerUnresolved = null; } @@ -141,7 +143,7 @@ public void close() { } } - private void write(final BufferedWriter writer, final byte[] receivedData, final @Nullable String comment) throws IOException { + private void write(final @Nullable BufferedWriter writer, final byte[] receivedData, final @Nullable String comment) throws IOException { DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(); @@ -169,6 +171,8 @@ private void write(final BufferedWriter writer, final byte[] receivedData, final sb.append("\n"); - writer.append(sb).flush(); + if (writer != null) { + writer.append(sb).flush(); + } } } From d97aeb5ca2bfe2142e2f9079e824721dbcb305a2 Mon Sep 17 00:00:00 2001 From: csowada Date: Sat, 25 Mar 2023 16:47:57 +0100 Subject: [PATCH 10/10] fix --- .../de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java index 6bfebec..3cb9fff 100644 --- a/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java +++ b/src/main/java/de/csdev/ebus/command/datatypes/ext/EBusTypeDateTime.java @@ -52,7 +52,7 @@ public class EBusTypeDateTime extends EBusAbstractType { private String variantTime = EBusTypeTime.DEFAULT; @Override - protected byte[] applyByteOrder(byte[] data) { + protected byte @Nullable [] applyByteOrder(byte @Nullable [] data) { if (reverseByteOrder) { logger.warn("Parameter 'reverseByteOrder' not supported for EBusTypeDateTime yet!"); }