[infrastructure] add external null-annotations (#8848)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K
2020-10-31 00:29:03 +01:00
committed by GitHub
parent 47d05055db
commit bd664ff0c8
162 changed files with 933 additions and 575 deletions

View File

@@ -422,7 +422,7 @@ public class DynamoDBPersistenceService extends AbstractBufferedPersistenceServi
String tableName = tableNameResolver.fromItem(dynamoItem);
Deque<DynamoDBItem<?>> batch = batchesByTable.computeIfAbsent(tableName, new Function<>() {
@Override
public Deque<DynamoDBItem<?>> apply(String t) {
public Deque<DynamoDBItem<?>> apply(@Nullable String t) {
return new ArrayDeque<>();
}
});

View File

@@ -15,6 +15,7 @@ package org.openhab.persistence.dynamodb.internal;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Iterator;
@@ -53,9 +54,9 @@ import org.openhab.core.types.State;
@NonNullByDefault
public abstract class AbstractTwoItemIntegrationTest extends BaseIntegrationTest {
protected static @Nullable ZonedDateTime beforeStore;
protected static @Nullable ZonedDateTime afterStore1;
protected static @Nullable ZonedDateTime afterStore2;
protected static ZonedDateTime beforeStore = ZonedDateTime.of(2100, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault());
protected static ZonedDateTime afterStore1 = ZonedDateTime.of(1900, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault());
protected static ZonedDateTime afterStore2 = ZonedDateTime.of(1900, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault());
protected abstract String getItemName();

View File

@@ -175,16 +175,19 @@ public class BaseIntegrationTest {
});
Map<String, Object> config = new HashMap<>();
config.put("region", System.getProperty("DYNAMODBTEST_REGION"));
config.put("accessKey", System.getProperty("DYNAMODBTEST_ACCESS"));
config.put("secretKey", System.getProperty("DYNAMODBTEST_SECRET"));
String value = System.getProperty("DYNAMODBTEST_REGION");
config.put("region", value != null ? value : "");
value = System.getProperty("DYNAMODBTEST_ACCESS");
config.put("accessKey", value != null ? value : "");
value = System.getProperty("DYNAMODBTEST_SECRET");
config.put("secretKey", value != null ? value : "");
config.put("tablePrefix", "dynamodb-integration-tests-");
// Disable buffering
config.put("bufferSize", "0");
for (Entry<String, Object> entry : config.entrySet()) {
if (entry.getValue() == null) {
if (((String) entry.getValue()).isEmpty()) {
LOGGER.warn(String.format(
"Expecting %s to have value for integration tests. Integration tests will be skipped",
entry.getKey()));