Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W-10547488: Fixed exceptions thrown in Emitters #516

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,27 +279,30 @@ case class VocabularyEmitter(vocabulary: Vocabulary, document: DocumentCreator)
private def vocabularyPropertiesEmitter(ordering: SpecOrdering) = {
var emitters: Seq[EntryEmitter] = Nil

emitters ++= Seq(new EntryEmitter {
override def emit(b: EntryBuilder): Unit = {
MapEntryEmitter("base", vocabulary.base.value()).emit(b)
}

override def position(): Position = ZERO
if (vocabulary.base.nonEmpty) {
emitters ++= Seq(new EntryEmitter {
override def emit(b: EntryBuilder): Unit = {
MapEntryEmitter("base", vocabulary.base.value()).emit(b)
}

})
override def position(): Position = ZERO

emitters ++= Seq(new EntryEmitter {
override def emit(b: EntryBuilder): Unit = MapEntryEmitter("vocabulary", vocabulary.name.value()).emit(b)
})
}

override def position(): Position =
vocabulary.fields
.get(VocabularyModel.Name)
.annotations
.find(classOf[LexicalInformation])
.map(_.range.start)
.getOrElse(ZERO)
})
if (vocabulary.name.nonEmpty) {
emitters ++= Seq(new EntryEmitter {
override def emit(b: EntryBuilder): Unit = MapEntryEmitter("vocabulary", vocabulary.name.value()).emit(b)

override def position(): Position =
vocabulary.fields
.get(VocabularyModel.Name)
.annotations
.find(classOf[LexicalInformation])
.map(_.range.start)
.getOrElse(ZERO)
})
}
if (vocabulary.usage.nonEmpty) {
emitters ++= Seq(new EntryEmitter {
override def emit(b: EntryBuilder): Unit = MapEntryEmitter("usage", vocabulary.usage.value()).emit(b)
Expand Down