From 9472e386a801cd013a04136885174bc7d1c4e083 Mon Sep 17 00:00:00 2001 From: VictorCavichioli Date: Mon, 19 Feb 2024 14:23:13 -0300 Subject: [PATCH] Fix PMD Violations --- application/src/main/resources/ecc.yml | 14 +++++++------- .../ecchronos/core/AbstractCassandraTest.java | 3 ++- .../ecchronos/core/TestCASLockFactory.java | 15 ++++++++++----- .../TestDefaultRepairConfigurationProvider.java | 3 ++- pmd-rules.xml | 8 ++++---- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/application/src/main/resources/ecc.yml b/application/src/main/resources/ecc.yml index 937717cce..aa44a1aa3 100644 --- a/application/src/main/resources/ecc.yml +++ b/application/src/main/resources/ecc.yml @@ -57,14 +57,14 @@ connection: ## remoteRouting: true ## - # # Allow to override consistency level for LWT (lightweight transactions). Possible values are: - # # "DEFAULT" - Use consistency level based on remoteRouting. - # # "SERIAL" - Use SERIAL consistency for LWT regardless of remoteRouting. - # # "LOCAL_SERIAL" - Use LOCAL_SERIAL consistency for LWT regardless of remoteRouting. + ## Allow to override consistency level for LWT (lightweight transactions). Possible values are: + ## "DEFAULT" - Use consistency level based on remoteRouting. + ## "SERIAL" - Use SERIAL consistency for LWT regardless of remoteRouting. + ## "LOCAL_SERIAL" - Use LOCAL_SERIAL consistency for LWT regardless of remoteRouting. ## - # # if you use remoteRouting: false and LOCAL_SERIAL then all locks will be taken locally - # # in DC. I.e There's a risk that multiple nodes in different datacenters will be able to lock the - # # same nodes causing multiple repairs on the same range/node at the same time. + ## if you use remoteRouting: false and LOCAL_SERIAL then all locks will be taken locally + ## in DC. I.e There's a risk that multiple nodes in different datacenters will be able to lock the + ## same nodes causing multiple repairs on the same range/node at the same time. ## consistencySerial: "DEFAULT" jmx: diff --git a/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/AbstractCassandraTest.java b/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/AbstractCassandraTest.java index bf03cce09..6f1cec412 100644 --- a/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/AbstractCassandraTest.java +++ b/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/AbstractCassandraTest.java @@ -79,7 +79,8 @@ public boolean getRemoteRouting() } @Override - public String getSerialConsistency(){ + public String getSerialConsistency() + { return "DEFAULT"; } }; diff --git a/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/TestCASLockFactory.java b/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/TestCASLockFactory.java index 7c919b0de..f1d7fff53 100644 --- a/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/TestCASLockFactory.java +++ b/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/TestCASLockFactory.java @@ -382,7 +382,8 @@ public boolean getRemoteRouting() } @Override - public String getSerialConsistency(){ + public String getSerialConsistency() + { return "DEFAULT"; } }) @@ -393,7 +394,8 @@ public String getSerialConsistency(){ } @Test - public void testRemoteRoutingTrueWithDefaultSerialConsistency() { + public void testRemoteRoutingTrueWithDefaultSerialConsistency() + { myLockFactory = new CASLockFactory.Builder() .withNativeConnectionProvider(getNativeConnectionProvider()) @@ -407,7 +409,8 @@ public void testRemoteRoutingTrueWithDefaultSerialConsistency() { } @Test - public void testRemoteRoutingFalseWithDefaultSerialConsistency() { + public void testRemoteRoutingFalseWithDefaultSerialConsistency() + { Node nodeMock = mock(Node.class); @@ -432,7 +435,8 @@ public void testRemoteRoutingFalseWithDefaultSerialConsistency() { } @Test - public void testLocalSerialConsistency(){ + public void testLocalSerialConsistency() + { NativeConnectionProvider connectionProviderMock = mock(NativeConnectionProvider.class); @@ -456,7 +460,8 @@ public void testLocalSerialConsistency(){ } @Test - public void testSerialConsistency(){ + public void testSerialConsistency() + { NativeConnectionProvider connectionProviderMock = mock(NativeConnectionProvider.class); Node nodeMock = mock(Node.class); diff --git a/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/repair/TestDefaultRepairConfigurationProvider.java b/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/repair/TestDefaultRepairConfigurationProvider.java index 696738508..ab76dd690 100644 --- a/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/repair/TestDefaultRepairConfigurationProvider.java +++ b/core/src/test/java/com/ericsson/bss/cassandra/ecchronos/core/repair/TestDefaultRepairConfigurationProvider.java @@ -103,7 +103,8 @@ public boolean getRemoteRouting() } @Override - public String getSerialConsistency(){ + public String getSerialConsistency() + { return "DEFAULT"; } }; diff --git a/pmd-rules.xml b/pmd-rules.xml index 3e53b6d10..21e2eeab6 100644 --- a/pmd-rules.xml +++ b/pmd-rules.xml @@ -30,10 +30,10 @@ - - - - + + + +