X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fcommons%2Fliblldp%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fliblldp%2FEthernetAddress.java;h=fb75532e395caa8712b91203fa4c849913a257fe;hp=b7b72cbffd45aec28c384872d61147149c13f41c;hb=af14e8a5cc7d3654785ffb8cf192eaeea8ba2fae;hpb=4d73514271a9caaa59b7a042d206ba4aad6b3fe0 diff --git a/opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/EthernetAddress.java b/opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/EthernetAddress.java index b7b72cbffd..fb75532e39 100644 --- a/opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/EthernetAddress.java +++ b/opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/EthernetAddress.java @@ -1,4 +1,3 @@ - /* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * @@ -33,10 +32,10 @@ public class EthernetAddress extends DataLinkAddress { public static final String addressName = "Ethernet MAC Address"; public static final int SIZE = 6; - private static final EthernetAddress createWellKnownAddress(byte[] mac) { + private static final EthernetAddress createWellKnownAddress(final byte[] mac) { try { return new EthernetAddress(mac); - } catch (ConstructionException ce) { + } catch (final ConstructionException ce) { return null; } } @@ -53,10 +52,8 @@ public class EthernetAddress extends DataLinkAddress { * * @param macAddress A byte array in big endian format * representing the Ethernet MAC Address - * - * @return The constructed object if valid */ - public EthernetAddress(byte[] macAddress) throws ConstructionException { + public EthernetAddress(final byte[] macAddress) throws ConstructionException { super(addressName); if (macAddress == null) { @@ -75,7 +72,7 @@ public class EthernetAddress extends DataLinkAddress { public EthernetAddress clone() { try { return new EthernetAddress(this.macAddress.clone()); - } catch (ConstructionException ce) { + } catch (final ConstructionException ce) { return null; } } @@ -98,16 +95,20 @@ public class EthernetAddress extends DataLinkAddress { } @Override - public boolean equals(Object obj) { - if (this == obj) + public boolean equals(final Object obj) { + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } EthernetAddress other = (EthernetAddress) obj; - if (!Arrays.equals(macAddress, other.macAddress)) + if (!Arrays.equals(macAddress, other.macAddress)) { return false; + } return true; }