Skip to content

Commit

Permalink
fix java 8 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
faustin0 committed Nov 15, 2022
1 parent 8858501 commit c0af3f3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/main/scala/jms4s/jms/JmsMessage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ object JmsMessage {

def properties(msg: Message): Try[Map[String, Any]] =
Try {
val buf = collection.mutable.Map.empty[String, Any]
msg.getPropertyNames.asIterator().forEachRemaining { e =>
val key = e.asInstanceOf[String]
buf += key -> msg.getObjectProperty(key)
val propertyNames = msg.getPropertyNames
val buf = collection.mutable.Map.empty[String, Any]
while (propertyNames.hasMoreElements) {
val propertyName = propertyNames.nextElement.asInstanceOf[String]
buf += propertyName -> msg.getObjectProperty(propertyName)
}
buf.toMap
}
Expand Down

0 comments on commit c0af3f3

Please sign in to comment.