X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager-facade-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Ffacade%2Fxml%2Fmapping%2Fattributes%2Fresolving%2FArrayAttributeResolvingStrategy.java;h=5daf5a42a941c91a13823082e0fcb7790438a7fa;hp=73b9dd9cbce28dfc9997550b924b3c32bbe20f9d;hb=e331fa568ee0b7a33ec451a104123bcbf7d86e78;hpb=cbcc2b61265e903959f11d44c292771e76b3926e diff --git a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ArrayAttributeResolvingStrategy.java b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ArrayAttributeResolvingStrategy.java index 73b9dd9cbc..5daf5a42a9 100644 --- a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ArrayAttributeResolvingStrategy.java +++ b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ArrayAttributeResolvingStrategy.java @@ -27,14 +27,14 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt private static final Logger LOG = LoggerFactory.getLogger(ArrayAttributeResolvingStrategy.class); - public ArrayAttributeResolvingStrategy(AttributeResolvingStrategy> innerTypeResolved, - ArrayType openType) { + public ArrayAttributeResolvingStrategy(final AttributeResolvingStrategy> innerTypeResolved, + final ArrayType openType) { super(openType); this.innerTypeResolvingStrategy = innerTypeResolved; } @Override - public Optional parseAttribute(String attrName, Object value) throws DocumentedException { + public Optional parseAttribute(final String attrName, final Object value) throws DocumentedException { if (value == null) { return Optional.absent(); } @@ -49,7 +49,7 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt } else { try { innerTypeClass = Class.forName(getOpenType().getElementOpenType().getClassName()); - } catch (ClassNotFoundException e) { + } catch (final ClassNotFoundException e) { throw new IllegalStateException("Unable to locate class for " + getOpenType().getElementOpenType().getClassName(), e); } @@ -80,7 +80,7 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt final ArrayType openType = new ArrayType<>(getOpenType().getDimension(), innerTypeResolvingStrategy.getOpenType()); setOpenType(openType); - } catch (OpenDataException e) { + } catch (final OpenDataException e) { throw new IllegalStateException("An error occurred during restoration of array type " + this + " for attribute " + attrName + " from value " + value, e); } @@ -92,7 +92,7 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt return Optional.of(parsedArray); } - private static String toStringArray(Object array) { + private static String toStringArray(final Object array) { StringBuilder build = new StringBuilder(array.toString()); build.append(" ["); for (int i = 0; i < Array.getLength(array); i++) { @@ -103,10 +103,10 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt return build.toString(); } - private static Class getPrimitiveType(Class innerTypeClass) { + private static Class getPrimitiveType(final Class innerTypeClass) { try { return (Class) innerTypeClass.getField("TYPE").get(null); - } catch (Exception e) { + } catch (final Exception e) { throw new IllegalStateException("Unable to determine primitive type to " + innerTypeClass); } }