Remove unused exceptions
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / ContextReferenceExtractor.java
index 4653ca399eeab995bd5890cb1a4dd7a41c9075d0..9fa43abecf752aa8772024b1e4eb2c0d83056bc1 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
  *
- * This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * 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.controller.md.sal.binding.impl;
 
 import com.google.common.cache.CacheBuilder;
@@ -19,9 +20,7 @@ import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 abstract class ContextReferenceExtractor {
-
     private static final Logger LOG = LoggerFactory.getLogger(ContextReferenceExtractor.class);
     private static final ContextReferenceExtractor NULL_EXTRACTOR = new ContextReferenceExtractor() {
 
@@ -31,12 +30,11 @@ abstract class ContextReferenceExtractor {
         }
     };
 
-
     private static final LoadingCache<Class<?>, ContextReferenceExtractor> EXTRACTORS = CacheBuilder.newBuilder()
             .weakKeys().build(new CacheLoader<Class<?>, ContextReferenceExtractor>() {
 
                 @Override
-                public ContextReferenceExtractor load(final Class<?> key) throws Exception {
+                public ContextReferenceExtractor load(final Class<?> key) {
                     return create(key);
                 }
             });
@@ -52,15 +50,15 @@ abstract class ContextReferenceExtractor {
      * Extract context-reference (Instance Identifier) from
      * Binding DataObject.
      *
-     * @param obj DataObject from which context reference
-     * should be extracted.
+     * @param obj DataObject from which context reference should be extracted.
      *
-     * @return Instance Identifier representing context reference
-     * or null, if data object does not contain context reference.
+     * @return Instance Identifier representing context reference or null, if data object does not contain
+     *     context reference.
      */
     abstract @Nullable InstanceIdentifier<?> extract(DataObject obj);
 
-    private static @Nonnull ContextReferenceExtractor create(final Class<?> key) {
+    @Nonnull
+    private static ContextReferenceExtractor create(final Class<?> key) {
         final Method contextGetter = getContextGetter(key);
         if (contextGetter == null) {
             return NULL_EXTRACTOR;
@@ -82,10 +80,11 @@ abstract class ContextReferenceExtractor {
         return NULL_EXTRACTOR;
     }
 
-    private static @Nullable Method findGetValueMethod(final Class<?> type, final Class<?> returnType) {
+    @Nullable
+    private static Method findGetValueMethod(final Class<?> type, final Class<?> returnType) {
         try {
             final Method method = type.getMethod(GET_VALUE_NAME);
-            if(returnType.equals(method.getReturnType())) {
+            if (returnType.equals(method.getReturnType())) {
                 return method;
             }
         } catch (final NoSuchMethodException e) {
@@ -102,7 +101,4 @@ abstract class ContextReferenceExtractor {
         }
         return null;
     }
-
-
-
 }