Skip to content

Commit

Permalink
Fixed struct descriptor deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaro committed Jul 30, 2024
1 parent de1e4f8 commit 539aa59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ enum class ComparisonOperator(val value: String) {
when (v1) {
is Value.String,
is Value.Text -> {
(v1.value as String).replace("*", "\\*").replace("%", "*").toRegex().matches(v2.value as String)
(v1.value as String).replace("\\", "\\\\").replace("*", "\\*").replace("%", "*").toRegex().matches(v2.value as String)
}

else -> false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ class ScalarJsonlReader(

private fun queryBoolean(query: SimpleBooleanQuery<*>): Sequence<ScalarDescriptor<*>> =
getAll().filter { descriptor ->
query.comparison.compare(query.value, descriptor.value)
query.comparison.compare(descriptor.value, query.value)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class StructJsonlReader(
val parameters: MutableList<Any?> = mutableListOf(
descriptorId,
retrievableId,
prototype.layout(),
valueMap
valueMap,
this.field
)

prototype.layout().forEach { attribute ->
Expand All @@ -54,7 +54,7 @@ class StructJsonlReader(
}

private fun queryBoolean(query: SimpleBooleanQuery<*>): Sequence<StructDescriptor> = getAll().filter { descriptor ->
query.comparison.compare(query.value, descriptor.values()[query.attributeName!!]!!)
query.comparison.compare(descriptor.values()[query.attributeName!!]!!, query.value)
}


Expand Down

0 comments on commit 539aa59

Please sign in to comment.