diff --git a/.classpath b/.classpath
deleted file mode 100644
index 075b839..0000000
--- a/.classpath
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000..9b9378c
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,68 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ master ]
+ schedule:
+ - cron: '15 0 * * 6'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'java' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
+ # Learn more:
+ # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+ - name: Cache Maven packages
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+
+ - name: Set up Java
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+
+ - name: Build
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ run: mvn -B clean package
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index e7d65c0..e295577 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -38,17 +38,27 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11
+ server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
+ server-username: OSSRH_USERNAME # env variable for username in deploy
+ server-password: OSSRH_PASSWORD # env variable for token in deploy
- name: Build and analyze
+ run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-
- - run: mkdir staging && cp target/*.jar staging
+ BUILD_NUMBER: ${{ github.run_id }}-${{ github.run_number }}
- name: Upload Maven build artifact
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v2
with:
name: artifact
- path: staging
\ No newline at end of file
+ path: target/*.jar
+
+ # Upload if develop branch
+ - name: Upload snapshot to OSSRH if development release
+ if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }}
+ run: mvn deploy --batch-mode --update-snapshots -P !sign,!build-extras,deploy-ossrh -Dmaven.test.skip=true -DskipChecks -DskipTest
+ env:
+ OSSRH_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
+ OSSRH_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 100df23..9bacfac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,21 @@
-/target/
-local-upload.bat
+.antlr*
+.classpath
+.idea
+.project
+.DS_Store
+*.iml
+npm-debug.log
+.build.log
+
+.metadata/
bin/
+target/
+src-gen/
+xtend-gen/
+.history/
+
+*/plugin.xml_gen
+**/.settings/org.eclipse.*
+
+.vscode
+.factorypath
\ No newline at end of file
diff --git a/.project b/.project
deleted file mode 100644
index 086bdba..0000000
--- a/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- de.csdev.ebus
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.m2e.core.maven2Builder
-
-
-
-
-
- org.eclipse.m2e.core.maven2Nature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 7934df7..0000000
--- a/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/main/java=UTF-8
-encoding//src/main/java/de/csdev/ebus/core/EBusWorkerThreadFactory.java=UTF-8
-encoding//src/main/resources=UTF-8
-encoding//src/main/resources/manufactures.json=UTF-8
-encoding//src/test/java=UTF-8
-encoding//src/test/resources=UTF-8
-encoding/=UTF-8
diff --git a/.settings/org.eclipse.core.runtime.prefs b/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 5a0ad22..0000000
--- a/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-line.separator=\n
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c809b82..0000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,117 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.APILeak=warning
-org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
-org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
-org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
-org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
-org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index f897a7f..0000000
--- a/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/.settings/org.eclipse.pde.core.prefs b/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index e8ff8be..0000000
--- a/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-pluginProject.equinox=false
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4690391..87f80e8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
## Unreleased
+## [1.1.3] - 2020-12-25
+### Changed
+- Changed many line of code to fix sonarlint/cloud issues
+- Add more ``final`` to parameters
+- Changed to Java 8 syntax like Lambda expressions or Multi-Exceptions
+- Fixed one or two wrong handled Interrupts
+
## [1.1.2] - 2020-12-17
### Added
- Added ``sonarcloud`` to build pipeline
diff --git a/pom.xml b/pom.xml
index 245a774..348e601 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.2
+ 1.1.3
https://github.com/csowada/ebus
bundle
@@ -18,7 +18,7 @@
1.8
8
2020
-
+ ${project.version}
csowada_ebus
csowada
https://sonarcloud.io
@@ -102,7 +102,7 @@
org.apache.felix
maven-bundle-plugin
- 1.4.0
+ 3.0.1
true
@@ -300,7 +300,7 @@
junit
junit
- 4.12
+ 4.13.1
test
diff --git a/sonar-project.properties b/sonar-project.properties
deleted file mode 100644
index 3130950..0000000
--- a/sonar-project.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-sonar.organization=csowada
-sonar.projectKey=csowada_ebus
-
-# relative paths to source directories. More details and properties are described
-# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
-sonar.sources=.
\ No newline at end of file
diff --git a/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java b/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java
index f451f91..c70abcb 100644
--- a/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java
+++ b/src/main/java/de/csdev/ebus/cfg/EBusConfigurationReaderException.java
@@ -18,19 +18,19 @@ public class EBusConfigurationReaderException extends Exception {
private static final long serialVersionUID = 1L;
- public EBusConfigurationReaderException(String message, Throwable cause, Object... args) {
+ public EBusConfigurationReaderException(final String message, final Throwable cause, final Object... args) {
super(String.format(message, args), cause);
}
- public EBusConfigurationReaderException(String message, Object... args) {
+ public EBusConfigurationReaderException(final String message, final Object... args) {
super(MessageFormat.format(message, args));
}
- public EBusConfigurationReaderException(String message) {
+ public EBusConfigurationReaderException(final String message) {
super(message);
}
- public EBusConfigurationReaderException(String message, Throwable cause) {
+ public EBusConfigurationReaderException(final String message, final Throwable cause) {
super(message, cause);
}
diff --git a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java
index c277a1c..1d53d56 100644
--- a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java
+++ b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationProvider.java
@@ -34,7 +34,7 @@ public interface IEBusConfigurationProvider {
* @param configurationId
* @return Returns a configuration label for an id or null if not existent.
*/
- public @Nullable String getConfigurationLabel(String configurationId);
+ public @Nullable String getConfigurationLabel(final String configurationId);
/**
* Returns the input stream for a configuration id or null if not existent.
@@ -42,6 +42,6 @@ public interface IEBusConfigurationProvider {
* @param configurationId
* @return Returns the input stream for a configuration id or null if not existent.
*/
- public @Nullable InputStream getConfigurationStream(String configurationId);
+ public @Nullable InputStream getConfigurationStream(final String configurationId);
}
\ No newline at end of file
diff --git a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java
index 1dab598..56b8159 100644
--- a/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java
+++ b/src/main/java/de/csdev/ebus/cfg/IEBusConfigurationReader.java
@@ -40,21 +40,21 @@ public interface IEBusConfigurationReader {
* @throws EBusConfigurationReaderException
* @throws IOException
*/
- public @Nullable IEBusCommandCollection loadConfigurationCollection(URL url)
+ public @Nullable IEBusCommandCollection loadConfigurationCollection(final URL url)
throws EBusConfigurationReaderException, IOException;
/**
* @param url
* @return
*/
- public List loadConfigurationCollectionBundle(URL url);
+ public List loadConfigurationCollectionBundle(final URL url);
/**
* Sets the eBUS type registry to use
*
* @param ebusTypes
*/
- public void setEBusTypes(EBusTypeRegistry ebusTypes);
+ public void setEBusTypes(final EBusTypeRegistry ebusTypes);
/**
* Clears all internal states
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 9a1655d..4481e77 100644
--- a/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java
+++ b/src/main/java/de/csdev/ebus/cfg/std/EBusConfigurationReader.java
@@ -69,8 +69,8 @@ public class EBusConfigurationReader implements IEBusConfigurationReader {
private @NonNull EBusTypeRegistry registry;
- private @NonNull Map<@NonNull String, @Nullable Collection<@NonNull EBusCommandValue>> templateValueRegistry = new HashMap<@NonNull String, @Nullable Collection<@NonNull EBusCommandValue>>();
- private @NonNull Map<@NonNull String, @Nullable Collection<@NonNull EBusCommandValue>> templateBlockRegistry = new HashMap<@NonNull String, @Nullable Collection<@NonNull EBusCommandValue>>();
+ private @NonNull Map<@NonNull String, @Nullable Collection<@NonNull EBusCommandValue>> templateValueRegistry = new HashMap<>();
+ private @NonNull Map<@NonNull String, @Nullable Collection<@NonNull EBusCommandValue>> templateBlockRegistry = new HashMap<>();
public EBusConfigurationReader() {
try {
@@ -108,8 +108,7 @@ public EBusConfigurationReader() {
Type merchantListType = new TypeToken>() {
}.getType();
- Gson gson = new Gson();
- gson = new GsonBuilder().registerTypeAdapter(merchantListType, new EBusValueJsonDeserializer()).create();
+ Gson gson = new GsonBuilder().registerTypeAdapter(merchantListType, new EBusValueJsonDeserializer()).create();
MessageDigest md = null;
@@ -171,7 +170,7 @@ protected void parseTemplateConfiguration(@NonNull EBusCollectionDTO collection)
List templateValues = templates.getTemplate();
if (templateValues != null) {
- Collection blockList = new ArrayList();
+ Collection blockList = new ArrayList<>();
for (EBusValueDTO value : templateValues) {
if (value != null) {
@@ -211,11 +210,11 @@ protected EBusCommand parseTelegramConfiguration(@NonNull IEBusCommandCollection
Objects.requireNonNull(commandCollection, "commandCollection");
- LinkedHashMap templateMap = new LinkedHashMap();
- ArrayList templateList = new ArrayList();
+ LinkedHashMap templateMap = new LinkedHashMap<>();
+ ArrayList templateList = new ArrayList<>();
// collect available channels
- List methods = new ArrayList();
+ List methods = new ArrayList<>();
if (commandElement.getGet() != null) {
methods.add("get");
}
@@ -357,7 +356,7 @@ protected EBusCommand parseTelegramConfiguration(@NonNull IEBusCommandCollection
Objects.requireNonNull(valueDto, "valueDto");
- Collection<@NonNull EBusCommandValue> result = new ArrayList<@NonNull EBusCommandValue>();
+ Collection<@NonNull EBusCommandValue> result = new ArrayList<>();
String typeStr = valueDto.getType();
String collectionId = null;
@@ -402,7 +401,6 @@ protected EBusCommand parseTelegramConfiguration(@NonNull IEBusCommandCollection
} else if (templateMap != null) {
// return the complete template block from within command block
- // templateCollection = templateMap.values();
templateCollection = new ArrayList<>(templateList);
} else {
@@ -443,7 +441,7 @@ protected EBusCommand parseTelegramConfiguration(@NonNull IEBusCommandCollection
} else if (templateMap != null && templateMap.containsKey(id)) {
// return the complete template block from within command block
- templateCollection = new ArrayList<@NonNull EBusCommandValue>();
+ templateCollection = new ArrayList<>();
templateCollection.add(templateMap.get(id));
} else {
@@ -474,7 +472,7 @@ protected EBusCommand parseTelegramConfiguration(@NonNull IEBusCommandCollection
// convert static content to bytes
byte[] byteArray = EBusUtils.toByteArray(valueDto.getDefault());
- Map properties = new HashMap();
+ Map properties = new HashMap<>();
properties.put("length", byteArray.length);
final IEBusType> typeByte = registry.getType(EBusTypeBytes.TYPE_BYTES, properties);
@@ -571,7 +569,7 @@ public void setEBusTypes(@NonNull EBusTypeRegistry ebusTypes) {
Objects.requireNonNull(url, "url");
- List<@NonNull IEBusCommandCollection> result = new ArrayList<@NonNull IEBusCommandCollection>();
+ List<@NonNull IEBusCommandCollection> result = new ArrayList<>();
Gson gson = new Gson();
Type type = new TypeToken