Yuta HIGUCHI

eliminate package dependency cycle

Change-Id: I7c30e5db9f5d17d24d28252b4dc58ce23835b6d8
......@@ -4,8 +4,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Objects;
import org.onlab.onos.net.link.LinkDescription;
import com.google.common.base.MoreObjects;
// TODO Consider renaming.
......@@ -69,16 +67,6 @@ public final class LinkKey {
return new LinkKey(link.src(), link.dst());
}
/**
* Creates a link identifier for the specified link.
*
* @param desc link description
* @return a link identifier
*/
public static LinkKey linkKey(LinkDescription desc) {
return new LinkKey(desc.src(), desc.dst());
}
@Override
public int hashCode() {
return Objects.hash(src(), dst);
......
......@@ -238,7 +238,7 @@ public class GossipLinkStore
final Timestamped<LinkDescription> deltaDesc = new Timestamped<>(linkDescription, newTimestamp);
LinkKey key = linkKey(linkDescription);
LinkKey key = linkKey(linkDescription.src(), linkDescription.dst());
final LinkEvent event;
final Timestamped<LinkDescription> mergedDesc;
synchronized (getLinkDescriptions(key)) {
......@@ -265,7 +265,8 @@ public class GossipLinkStore
ProviderId providerId,
Timestamped<LinkDescription> linkDescription) {
LinkKey key = linkKey(linkDescription.value());
LinkKey key = linkKey(linkDescription.value().src(),
linkDescription.value().dst());
ConcurrentMap<ProviderId, Timestamped<LinkDescription>> descs = getLinkDescriptions(key);
synchronized (descs) {
......
......@@ -151,7 +151,7 @@ public class DistributedLinkStore
@Override
public LinkEvent createOrUpdateLink(ProviderId providerId,
LinkDescription linkDescription) {
LinkKey key = linkKey(linkDescription);
LinkKey key = linkKey(linkDescription.src(), linkDescription.dst());
Optional<DefaultLink> link = links.getUnchecked(key);
if (!link.isPresent()) {
return createLink(providerId, key, linkDescription);
......
......@@ -149,7 +149,7 @@ public class SimpleLinkStore
@Override
public LinkEvent createOrUpdateLink(ProviderId providerId,
LinkDescription linkDescription) {
LinkKey key = linkKey(linkDescription);
LinkKey key = linkKey(linkDescription.src(), linkDescription.dst());
ConcurrentMap<ProviderId, LinkDescription> descs = getLinkDescriptions(key);
synchronized (descs) {
......