According to its general contract, when revision is not found,
SourceIdentifier#getRevision method returns null. Wrap revision in
Optional#fromNullable to avoid possible NPE.
Change-Id: I78f544374f179c9486cc8dd09cbcf1eea379e1e9
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
}
public YangTextSchemaSource getRepresentation() {
- return YangTextSchemaSource.delegateForByteSource(RevisionSourceIdentifier.create(name, Optional.of(revision)),
- ByteSource.wrap(schemaSource));
+ return YangTextSchemaSource.delegateForByteSource(
+ RevisionSourceIdentifier.create(name, Optional.fromNullable(revision)), ByteSource.wrap(schemaSource));
}
}