Skip to content

Commit 14545be

Browse files
authored
[DE-838] SonarCloud fixes (#566)
* Sonar: exclude GraalVM substitutions * SonarLint * SonarLint fixes
1 parent 5e5e145 commit 14545be

File tree

13 files changed

+16
-24
lines changed

13 files changed

+16
-24
lines changed

core/src/main/java/com/arangodb/internal/InternalArangoSearch.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@
2828
public class InternalArangoSearch extends InternalArangoView {
2929

3030
private static final String PROPERTIES_PATH = "properties";
31-
private final String dbName;
3231

3332
protected InternalArangoSearch(final ArangoExecuteable executeable, final String dbName, final String name) {
3433
super(executeable, dbName, name);
35-
this.dbName = dbName;
3634
}
3735

3836
protected InternalRequest getPropertiesRequest() {

core/src/main/java/com/arangodb/internal/InternalSearchAlias.java

-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
public class InternalSearchAlias extends InternalArangoView {
2626

2727
private static final String PROPERTIES_PATH = "properties";
28-
private final String dbName;
2928

3029
protected InternalSearchAlias(final ArangoExecuteable executeable, final String dbName, final String name) {
3130
super(executeable, dbName, name);
32-
this.dbName = dbName;
3331
}
3432

3533
protected InternalRequest getPropertiesRequest() {

core/src/main/java/com/arangodb/model/AbstractMDIndexOptions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public abstract class AbstractMDIndexOptions<T extends AbstractMDIndexOptions<T>
3939
private Iterable<String> storedValues;
4040

4141

42-
public AbstractMDIndexOptions() {
42+
protected AbstractMDIndexOptions() {
4343
super();
4444
}
4545

core/src/main/java/com/arangodb/util/UnicodeUtils.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package com.arangodb.util;
2222

2323
import java.text.Normalizer;
24+
import java.util.Objects;
2425

2526
/**
2627
* @author Mark Vollmary
@@ -45,6 +46,7 @@ public static String normalize(final String value) {
4546
}
4647

4748
public static boolean isNormalized(final String value) {
48-
return normalize(value).equals(value);
49+
Objects.requireNonNull(value);
50+
return value.equals(normalize(value));
4951
}
5052
}

shaded/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<properties>
1919
<moduleName>com.arangodb.driver</moduleName>
2020
<maven.deploy.skip>false</maven.deploy.skip>
21+
<sonar.exclusions>src/main/java/graal/**/*</sonar.exclusions>
2122
</properties>
2223

2324
<dependencies>

test-functional/src/test/java/com/arangodb/ArangoEdgeCollectionTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
import java.util.Arrays;
3232
import java.util.Collections;
33-
import java.util.Optional;
3433
import java.util.UUID;
3534
import java.util.stream.Stream;
3635

test-functional/src/test/java/com/arangodb/ArangoVertexCollectionTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.arangodb.entity.VertexUpdateEntity;
2626
import com.arangodb.model.*;
2727
import com.arangodb.util.RawJson;
28-
import com.arangodb.util.TestUtils;
2928
import org.junit.jupiter.api.BeforeAll;
3029
import org.junit.jupiter.params.ParameterizedTest;
3130
import org.junit.jupiter.params.provider.Arguments;

test-functional/src/test/java/com/arangodb/ArangoViewTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import com.arangodb.entity.ViewEntity;
2424
import com.arangodb.entity.ViewType;
25-
import com.arangodb.util.TestUtils;
2625
import org.junit.jupiter.api.BeforeAll;
2726
import org.junit.jupiter.params.ParameterizedTest;
2827
import org.junit.jupiter.params.provider.MethodSource;

test-functional/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
import java.util.Collections;
3131
import java.util.UUID;
32-
import java.util.concurrent.CompletableFuture;
3332
import java.util.concurrent.ExecutionException;
3433
import java.util.stream.Stream;
3534

test-functional/src/test/java/com/arangodb/StreamTransactionTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,9 @@ void replaceDocuments(ArangoDatabase db) {
426426
StreamTransactionEntity tx = db.beginStreamTransaction(
427427
new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME));
428428

429-
List<BaseDocument> modifiedDocs = createdDocs.stream().peek(doc -> {
430-
doc.updateAttribute("test", "bar");
431-
}).collect(Collectors.toList());
429+
List<BaseDocument> modifiedDocs = createdDocs.stream()
430+
.peek(doc -> doc.updateAttribute("test", "bar"))
431+
.collect(Collectors.toList());
432432

433433
// replace document from within the tx
434434
collection
@@ -511,9 +511,9 @@ void updateDocuments(ArangoDatabase db) {
511511
StreamTransactionEntity tx = db.beginStreamTransaction(
512512
new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME));
513513

514-
List<BaseDocument> modifiedDocs = createdDocs.stream().peek(doc -> {
515-
doc.updateAttribute("test", "bar");
516-
}).collect(Collectors.toList());
514+
List<BaseDocument> modifiedDocs = createdDocs.stream()
515+
.peek(doc -> doc.updateAttribute("test", "bar"))
516+
.collect(Collectors.toList());
517517

518518
// update documents from within the tx
519519
collection

test-non-functional/src/test/java/arch/ArchUtils.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ArchUtils {
1313

1414
static class JavaTypeExt {
1515
static DescribedPredicate<JavaType> rawTypes(DescribedPredicate<? super JavaClass> predicate) {
16-
return new DescribedPredicate<JavaType>("raw types " + predicate.getDescription()) {
16+
return new DescribedPredicate<>("raw types " + predicate.getDescription()) {
1717
@Override
1818
public boolean test(JavaType t) {
1919
if (t.toErasure().isAnnotatedWith(NoRawTypesInspection.class)) {
@@ -27,7 +27,7 @@ public boolean test(JavaType t) {
2727
}
2828

2929
static class HasReturnTypeExt {
30-
private static final ChainableFunction<HasReturnType, JavaType> GET_RETURN_TYPE = new ChainableFunction<HasReturnType, JavaType>() {
30+
private static final ChainableFunction<HasReturnType, JavaType> GET_RETURN_TYPE = new ChainableFunction<>() {
3131
@Override
3232
public JavaType apply(HasReturnType input) {
3333
return input.getReturnType();
@@ -40,7 +40,7 @@ static DescribedPredicate<HasReturnType> returnType(DescribedPredicate<? super J
4040
}
4141

4242
static class HasTypeExt {
43-
private static final ChainableFunction<HasType, JavaType> GET_TYPE = new ChainableFunction<HasType, JavaType>() {
43+
private static final ChainableFunction<HasType, JavaType> GET_TYPE = new ChainableFunction<>() {
4444
@Override
4545
public JavaType apply(HasType input) {
4646
return input.getType();

test-non-functional/src/test/java/arch/InternalsTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public class InternalsTest {
147147
.should(be(paramPredicate));
148148

149149
private static DescribedPredicate<JavaClass> superclasses(DescribedPredicate<? super JavaClass> predicate) {
150-
return new DescribedPredicate<JavaClass>("superclasses " + predicate.getDescription()) {
150+
return new DescribedPredicate<>("superclasses " + predicate.getDescription()) {
151151
@Override
152152
public boolean test(JavaClass clazz) {
153153
return Stream.of(
@@ -162,7 +162,7 @@ public boolean test(JavaClass clazz) {
162162
}
163163

164164
private static DescribedPredicate<JavaCodeUnit> haveParams(DescribedPredicate<? super JavaParameter> predicate) {
165-
return new DescribedPredicate<JavaCodeUnit>("have params " + predicate.getDescription()) {
165+
return new DescribedPredicate<>("have params " + predicate.getDescription()) {
166166
@Override
167167
public boolean test(JavaCodeUnit method) {
168168
return method.getParameters().stream().allMatch(predicate);

test-non-functional/src/test/java/serde/JacksonSerdeTest.java

-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
import com.arangodb.ContentType;
55
import com.arangodb.Protocol;
66
import com.arangodb.config.ArangoConfigProperties;
7-
import com.arangodb.internal.serde.InternalSerdeProvider;
87
import com.arangodb.serde.jackson.JacksonSerde;
9-
import com.arangodb.serde.jackson.json.JacksonJsonSerdeProvider;
10-
import com.arangodb.serde.jackson.vpack.JacksonVPackSerdeProvider;
118
import com.fasterxml.jackson.databind.JsonNode;
129
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
1310
import com.arangodb.util.RawJson;

0 commit comments

Comments
 (0)