X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fbuilder%2Fimpl%2FModuleIdentifierImpl.java;h=63608b3e7a71d6d41aa40468fb8e56f623ead4d9;hb=42abb28b99a02f9580f4676ce5c315628e5bcd24;hp=6e825dd666473fe878c46deb8bbc85f41c732517;hpb=f1c55073f8d7631007c01a401346cc83383e5745;p=yangtools.git diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ModuleIdentifierImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ModuleIdentifierImpl.java index 6e825dd666..63608b3e7a 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ModuleIdentifierImpl.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ModuleIdentifierImpl.java @@ -8,9 +8,6 @@ package org.opendaylight.yangtools.yang.parser.builder.impl; import static com.google.common.base.Preconditions.checkNotNull; - -import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil; - import com.google.common.base.Optional; import java.net.URI; import java.util.Date; @@ -21,7 +18,10 @@ import org.opendaylight.yangtools.yang.model.api.ModuleIdentifier; * ModuleIdentifier that can be used for indexing/searching by name. * Name is only non-null attribute. * Equality check on namespace and revision is only triggered if they are non-null + * + * @deprecated Pre-Beryllium implementation, scheduled for removal. */ +@Deprecated public class ModuleIdentifierImpl implements ModuleIdentifier { private final QNameModule qnameModule; private final String name; @@ -56,7 +56,7 @@ public class ModuleIdentifierImpl implements ModuleIdentifier { return "ModuleIdentifierImpl{" + "name='" + name + '\'' + ", namespace=" + getNamespace() + - ", revision=" + getRevision() + + ", revision=" + qnameModule.getFormattedRevision() + '}'; } @@ -65,7 +65,7 @@ public class ModuleIdentifierImpl implements ModuleIdentifier { if (this == o) { return true; } - if (o == null || (!(o instanceof ModuleIdentifier))) { + if (!(o instanceof ModuleIdentifier)) { return false; } @@ -79,29 +79,8 @@ public class ModuleIdentifierImpl implements ModuleIdentifier { if (getNamespace() != null && !getNamespace().equals(that.getNamespace())) { return false; } - - Date defaultRev = SimpleDateFormatUtil.DEFAULT_DATE_REV; - Date defaultImp = SimpleDateFormatUtil.DEFAULT_DATE_IMP; - - // if revision is in import only, spec says that it is undefined which - // revision to take - if (getRevision() == defaultImp ^ that.getRevision() == defaultImp) { - return true; - } - - // default and none revisions taken as equal - if ((defaultRev.equals(getRevision()) && that.getRevision() == null) - || (defaultRev.equals(that.getRevision()) && getRevision() == null)) { - return true; - } - - // else if none of them is default and one null - if (getRevision() == null ^ that.getRevision() == null) { - return false; - } - // only fail if this revision is non-null - if (getRevision() != null && that.getRevision() != null && !getRevision().equals(that.getRevision())) { + if (getRevision() != null && !getRevision().equals(that.getRevision())) { return false; }