From 1f8e4525c4e803e7088372d0082712312fef9c68 Mon Sep 17 00:00:00 2001 From: Stephan Brunner Date: Mon, 26 Apr 2021 11:35:45 +0200 Subject: [PATCH] [MongoDB Persistence] Remove all unnecessary @NonNullByDefault attributes. The given attributes should not be NotNullByDefault, because some may be null, too. Signed-off-by: Stephan Brunner --- .../mongodb/internal/MongoDBPersistenceService.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bundles/org.openhab.persistence.mongodb/src/main/java/org/openhab/persistence/mongodb/internal/MongoDBPersistenceService.java b/bundles/org.openhab.persistence.mongodb/src/main/java/org/openhab/persistence/mongodb/internal/MongoDBPersistenceService.java index 2d13bb319de..1f75e07ab79 100644 --- a/bundles/org.openhab.persistence.mongodb/src/main/java/org/openhab/persistence/mongodb/internal/MongoDBPersistenceService.java +++ b/bundles/org.openhab.persistence.mongodb/src/main/java/org/openhab/persistence/mongodb/internal/MongoDBPersistenceService.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.Set; import org.bson.types.ObjectId; -import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.items.Item; import org.openhab.core.items.ItemNotFoundException; @@ -71,7 +70,6 @@ import com.mongodb.MongoClientURI; * * @author Thorsten Hoeger - Initial contribution */ -@NonNullByDefault @Component(service = { PersistenceService.class, QueryablePersistenceService.class }, configurationPid = "org.openhab.mongodb", configurationPolicy = ConfigurationPolicy.REQUIRE) public class MongoDBPersistenceService implements QueryablePersistenceService { @@ -84,16 +82,16 @@ public class MongoDBPersistenceService implements QueryablePersistenceService { private final Logger logger = LoggerFactory.getLogger(MongoDBPersistenceService.class); - private @NonNullByDefault({}) String url; - private @NonNullByDefault({}) String db; - private @NonNullByDefault({}) String collection; + private String url; + private String db; + private String collection; private boolean collectionPerItem; private boolean initialized = false; protected final ItemRegistry itemRegistry; - private @NonNullByDefault({}) MongoClient cl; + private MongoClient cl; @Activate public MongoDBPersistenceService(final @Reference ItemRegistry itemRegistry) {