Apply modernizations
[netconf.git] / netconf / yanglib / src / main / java / org / opendaylight / yanglib / impl / YangLibServiceImpl.java
index d856ac7bdb5f62b083602d4a449d8cbbea4a46f6..185f1ea3863bd2cbd6a40af8e90b6d00cbfa9aeb 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yanglib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.io.ByteStreams;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.io.IOException;
@@ -32,12 +32,11 @@ public class YangLibServiceImpl implements YangLibService {
     private final SchemaRepository schemaRepository;
 
     public YangLibServiceImpl(final SchemaRepository schemaRepository) {
-        this.schemaRepository = schemaRepository;
+        this.schemaRepository = requireNonNull(schemaRepository);
     }
 
     @Override
     public String getSchema(final String name, final String revision) {
-        Preconditions.checkNotNull(schemaRepository, "Schema repository is not initialized");
         LOG.debug("Attempting load for schema source {}:{}", name, revision);
         final SourceIdentifier sourceId = RevisionSourceIdentifier.create(name,
             revision.isEmpty() ? null : Revision.of(revision));