Code Review
/
yangtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG-6757: revert fix for BUG-4456
[yangtools.git]
/
yang
/
yang-parser-impl
/
src
/
main
/
java
/
org
/
opendaylight
/
yangtools
/
yang
/
parser
/
stmt
/
rfc6020
/
effective
/
AbstractEffectiveDocumentedNode.java
diff --git
a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveDocumentedNode.java
b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveDocumentedNode.java
index 763b14216238f55b21f27703df9ebae18e9c2cad..ce4eeff53bf1ced17cd67884bedc1f3ec9aa2db3 100644
(file)
--- a/
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveDocumentedNode.java
+++ b/
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveDocumentedNode.java
@@
-1,4
+1,4
@@
-/*
*
+/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@
-7,38
+7,47
@@
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
-import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
-
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
import org.opendaylight.yangtools.yang.model.api.Status;
import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
public abstract class AbstractEffectiveDocumentedNode<A, D extends DeclaredStatement<A>>
public abstract class AbstractEffectiveDocumentedNode<A, D extends DeclaredStatement<A>>
- extends EffectiveStatementBase<A, D> implements DocumentedNode {
+ extends
Declared
EffectiveStatementBase<A, D> implements DocumentedNode {
private final String description;
private final String reference;
private final Status status;
private final String description;
private final String reference;
private final Status status;
- AbstractEffectiveDocumentedNode(final StmtContext<A, D, ?> ctx) {
+ /**
+ * Constructor.
+ *
+ * @param ctx
+ * context of statement.
+ */
+ protected AbstractEffectiveDocumentedNode(final StmtContext<A, D, ?> ctx) {
super(ctx);
super(ctx);
- DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
+
final
DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
if (descStmt != null) {
description = descStmt.argument();
} else {
if (descStmt != null) {
description = descStmt.argument();
} else {
- description =
""
;
+ description =
null
;
}
}
- ReferenceEffectiveStatementImpl refStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
+
final
ReferenceEffectiveStatementImpl refStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
if (refStmt != null) {
reference = refStmt.argument();
} else {
if (refStmt != null) {
reference = refStmt.argument();
} else {
- reference =
""
;
+ reference =
null
;
}
}
- // :TODO
- status = null;
+ final StatusEffectiveStatementImpl statusStmt = firstEffective(StatusEffectiveStatementImpl.class);
+ if (statusStmt != null) {
+ status = statusStmt.argument();
+ } else {
+ status = Status.CURRENT;
+ }
}
@Override
}
@Override
@@
-55,5
+64,4
@@
public abstract class AbstractEffectiveDocumentedNode<A, D extends DeclaredState
public final Status getStatus() {
return status;
}
public final Status getStatus() {
return status;
}
-
}
}