BUG-2159: fix wrong javadocs
[yangtools.git] / yang / yang-binding / src / main / java / org / opendaylight / yangtools / yang / binding / util / BindingReflections.java
index bc7474a9f2cb765796063f07e8c9cd65dc2b5e96..6d6decb8ec74d5bb25fa98e8b727f4306cc9b3dd 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.yangtools.yang.binding.util;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
-
 import com.google.common.base.Optional;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
@@ -17,12 +16,10 @@ import com.google.common.cache.LoadingCache;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSet.Builder;
 import com.google.common.collect.Sets;
-
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -34,7 +31,7 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-
+import org.opendaylight.yangtools.util.ClassLoaderUtils;
 import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
@@ -91,11 +88,9 @@ public class BindingReflections {
      * This method uses first generic argument of
      * implemented {@link ChildOf} interface.
      *
-     * @param augmentation
-     *            {@link Augmentation} subclass for which we want to determine
-     *            augmentation target.
-     * @return Augmentation target - class which augmentation provides
-     *         additional extensions.
+     * @param childClass
+     *            child class for which we want to find the parent class.
+     * @return Parent class, e.g. class of which the childClass is ChildOf.
      */
     public static Class<?> findHierarchicalParent(final Class<? extends ChildOf<?>> childClass) {
         return ClassLoaderUtils.findFirstGenericArgument(childClass, ChildOf.class);
@@ -107,11 +102,9 @@ public class BindingReflections {
      * This method is shorthand which gets DataObject class by invoking
      * {@link DataObject#getImplementedInterface()} and uses {@link #findHierarchicalParent(Class)}.
      *
-     * @param childClass
-     *            {@link Augmentation} subclass for which we want to determine
-     *            augmentation target.
-     * @return Augmentation target - class which augmentation provides
-     *         additional extensions.
+     * @param child
+     *            Child object for which the parent needs to be located.
+     * @return Parent class, or null if a parent is not found.
      */
     public static Class<?> findHierarchicalParent(final DataObject child) {
         if (child instanceof ChildOf) {
@@ -230,9 +223,9 @@ public class BindingReflections {
     }
 
     /**
-     * Returns root package name for suplied package name.
+     * Returns root package name for supplied package name.
      *
-     * @param pkg Package for which find model root package.
+     * @param name Package for which find model root package.
      * @return Package of model root.
      */
     public static String getModelRootPackageName(final String name) {
@@ -407,7 +400,6 @@ public class BindingReflections {
     * @param type YANG Modeled Entity derived from DataContainer
     * @return Iterable of all data children, which have YANG modeled entity
     */
-   @SuppressWarnings("unchecked")
    public static Map<Class<?>,Method> getChildrenClassToMethod(final Class<?> type) {
        checkArgument(type != null, "Target type must not be null");
        checkArgument(DataContainer.class.isAssignableFrom(type), "Supplied type must be derived from DataContainer");
@@ -606,7 +598,7 @@ public class BindingReflections {
      * @return true if and only if classes represents same data.
      */
     @SuppressWarnings({"rawtypes","unchecked"})
-    public static boolean isSubstitutionFor(Class potential, Class target) {
+    public static boolean isSubstitutionFor(final Class potential, final Class target) {
         HashSet<Class> subImplemented = Sets.newHashSet(potential.getInterfaces());
         HashSet<Class> targetImplemented = Sets.newHashSet(target.getInterfaces());
         if(!subImplemented.equals(targetImplemented)) {