X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager-facade-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Ffacade%2Fxml%2Fmapping%2Fattributes%2Ftoxml%2FSimpleBinaryAttributeWritingStrategy.java;fp=opendaylight%2Fconfig%2Fconfig-manager-facade-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Ffacade%2Fxml%2Fmapping%2Fattributes%2Ftoxml%2FSimpleBinaryAttributeWritingStrategy.java;h=6c75c9f0df38834a321c8f258e5eb68f99c92511;hb=d266f4384d4850af9049d7cddd2bbac8f75ba61e;hp=f56ee73703b663414d9ae806923c292494a46ea6;hpb=b197d75e803beac663033287d769dce62c108490;p=controller.git diff --git a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleBinaryAttributeWritingStrategy.java b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleBinaryAttributeWritingStrategy.java index f56ee73703..6c75c9f0df 100644 --- a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleBinaryAttributeWritingStrategy.java +++ b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/toxml/SimpleBinaryAttributeWritingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2015, 2017 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, @@ -16,10 +16,6 @@ import org.w3c.dom.Document; public class SimpleBinaryAttributeWritingStrategy extends SimpleAttributeWritingStrategy { - /** - * @param document - * @param key - */ public SimpleBinaryAttributeWritingStrategy(final Document document, final String key) { super(document, key); } @@ -31,14 +27,12 @@ public class SimpleBinaryAttributeWritingStrategy extends SimpleAttributeWriting List list = (List) value; byte[] decoded = new byte[list.size()]; - int i = 0; - for (Object bAsStr : list) { - Preconditions.checkArgument(bAsStr instanceof String, "Unexpected inner value for %s, expected string", value); - byte b = Byte.parseByte((String) bAsStr); - decoded[i++] = b; + int index = 0; + for (Object basStr : list) { + Preconditions.checkArgument(basStr instanceof String, "Unexpected inner value for %s, expected string", + value); + decoded[index++] = Byte.parseByte((String) basStr); } - return en.encode(decoded); } - }