BUG-9043: Remove use of CheckedFuture from YANG components
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / repo / SettableSchemaProvider.java
index e2f3ba708dc7e14d2769d8dac0a372565d3a1279..9f48a189d82c326f37f6ec209bb4a871f4c329b0 100644 (file)
@@ -8,12 +8,8 @@
 
 package org.opendaylight.yangtools.yang.parser.repo;
 
-import com.google.common.base.Function;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
-import javax.annotation.Nullable;
-import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource;
@@ -45,14 +41,8 @@ class SettableSchemaProvider<T extends SchemaSourceRepresentation> implements Sc
     }
 
     @Override
-    public CheckedFuture<T, SchemaSourceException> getSource(final SourceIdentifier sourceIdentifier) {
-        return Futures.makeChecked(future, new Function<Exception, SchemaSourceException>() {
-            @Nullable
-            @Override
-            public SchemaSourceException apply(@Nullable final Exception input) {
-                return new SchemaSourceException("Failed", input);
-            }
-        });
+    public ListenableFuture<T> getSource(final SourceIdentifier sourceIdentifier) {
+        return future;
     }
 
     public T getSchemaSourceRepresentation() {